我尝试在Python中使用Spacy构建和解释一个句子的解析树的结果。 我也使用了以下代码:
from spacy.en import English
nlp=English()
example = "The angry bear chased the frightened little squirrel"
parsedEx = nlp(unicode(example))
for token in parsedEx:
print("Head:", token.head, " Left:",token.left_edge, " Right:",token.right_edge ," Relationship:",token.dep_)
代码给出了以下内容结果。可以有人告诉我怎么解释?提前谢谢!在
^{pr2}$
可以通过列出依赖树的边来解释依赖树,如下所示:
上述代码的结果如下所示:
^{pr2}$相关问题 更多 >
编程相关推荐