Closed xy1137030414 closed 2 months ago
Actually the root
indicates the index of the word which points to root, whereas rootNode
indicates the position of that node in the node
list (indexed from 0). Since the nodes aren't necessarily sorted by word position,, this index can help you more easily find the root in that list.
i got it!thank you!
this is my coding: f``` rom stanza.server import CoreNLPClient text = " 天河潭位于贵州省贵阳市花溪区石板镇,是以典型喀斯特自然风光为主、历史名人隐士文化为辅的风景名胜区,距贵阳市中心24公里,距花溪13公里,总面积为15平方公里。" with CoreNLPClient( annotators=['tokenize','ssplit','pos','lemma','ner', 'parse', 'depparse','coref'], timeout=30000, memory='6G', properties="chinese", endpoint="http://localhost:9008", outputFormat='json') as client: ann = client.annotate(text) for sentence in ann.sentence: print(sentence.basicDependencies)