Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何向 SpaCy 添加新的引理。例如,新的单复数名词。
示例:Kirana = 单数 Kiranas = 复数
我想将它添加到 SpaCy,以便当句子包含“Kiranas”时,Kirana 将显示为其引理。
只需将单词“kirana”添加到 Spacy 安装文件夹内的 _nouns.py 文件中:(spacy/en/lemmatizer/_nouns.py)。将单词添加到文件时,不应更改文件内的文本格式。由于已经定义了词形还原规则,这应该可以按您的预期工作。