在spacy中如何在短语匹配器中启用同义(基于向量相似性)和部分匹配选项

时间:2018-06-05 10:26:12

标签: spacy

有没有办法在短语匹配器中启用同义(基于矢量相似性)和部分匹配选项 请考虑以下示例进行部分匹配:

    matcher = PhraseMatcher(nlp.vocab)
    terminology_list = ['Barack Obama', 'Angela Merkel', 'Washington, D.C.']
    patterns = [nlp(text) for text in terminology_list]
    matcher.add('TerminologyList', None, *patterns)
    doc = nlp(u"German Chancellor Angela Merkel and US President Barack"
u"converse in the Oval Office inside the White House in Washington, D.C.")
    matches = matcher(doc) 

0 个答案:

没有答案