Nlp 节替换检测到与原始文本的引用

Nlp 节替换检测到与原始文本的引用,nlp,stanford-nlp,Nlp,Stanford Nlp,我正在尝试使用Coref功能。 请告诉我是否有任何内置方法用检测到的相关引用替换原始文本 例如: from stanza.server import CoreNLPClient text = 'XYZ was born in ABC. He is very good at dancing' with CoreNLPClient(annotators=['tokenize','ssplit','pos','lemma','ner', 'parse', 'depparse','coref'],

我正在尝试使用Coref功能。 请告诉我是否有任何
内置方法
用检测到的相关引用替换原始文本

例如:

from stanza.server import CoreNLPClient

text = 'XYZ was born in ABC. He is very good at dancing'

with CoreNLPClient(annotators=['tokenize','ssplit','pos','lemma','ner', 'parse', 'depparse','coref'],
               properties={'annotators': 'coref', 'coref.algorithm' : 'neural'},timeout=30000, memory='16G') as client:

    ann = client.annotate(text)
检测到共同引用后的预期OP
He

IP: XYZ was born in ABC. He is very good at dancing
OP: XYZ was born in ABC. XYZ is very good at dancing