我想知道是否有一种优雅的方法来获得一个实体相对于一个句子的索引。我知道我可以使用ent.start_char和ent.end_char来获取字符串中实体的索引,但这个值是相对于整个字符串的。import spacy
doc = nlp(u"Apple is looking at buying U.K. startupfor ent in doc.ent
我有一个场景,我必须得到这个句子开始和结束的索引。如果我用医生的话。那我就得到了一份情感清单。sent.beg和sent.end打印标记索引,但我想要字符索引。The community is great."nlp.add_pipe(nlp.create_pipe('sentencizer,而不打印字符<e
我想做更多的事情,那就是,在每个块名词短语的末尾分割句子。例如:分块名词短语是(通过在doc.noun_chunks中使用spaCyresources, bad behaviorprotection, of system resources, against bad behavior
这意味着,我需要在每组短语的末尾,例如,在“保护”结尾,在</e