查找实体名称时如何使 spaCy 不区分大小写?
有没有我应该添加的代码片段或其他内容,因为这些问题可能会提到不是大写的实体?
def analyseQuestion(question):
doc = nlp(question)
entity=doc.ents
return entity
print(analyseQuestion("what is the best seller of Nicholas Sparks "))
print(analyseQuestion("what is the best seller of nicholas sparks "))
Run Code Online (Sandbox Code Playgroud)
这使
(Nicholas Sparks,)
()
Run Code Online (Sandbox Code Playgroud)