【问题标题】:How to train OpenNLP model to extract multi set words如何训练 OpenNLP 模型提取多组词
【发布时间】:2017-12-01 15:33:13
【问题描述】:
我是 Open NLP 的新手 - 使用 NER 进行实体提取,我已经在 Open NLP NER 中训练和评估了实体提取模型,当我输入带有一个单词的实体的输入文本时效果很好例如:“我想购买吉百利”
但它不适用于多字场景,例如:“我想要一台 Apple MacBook”
如何训练模型选择多词
PS:我知道我需要做一些与 NLP 中提供的 BiGrams 相关的事情,但是如何使用 OpenNLP 做呢?
【问题讨论】:
标签:
machine-learning
nlp
opennlp
named-entity-recognition
【解决方案1】:
您需要提供涵盖多词跨度的训练数据。来自OpenNLP documentation 的示例:
<START:person> Pierre Vinken <END> , 61 years old , will join the board as a nonexecutive director Nov. 29 . Mr . <START:person> Vinken <END> is chairman of Elsevier N.V. , the Dutch publishing group .
除了上述格式,IO/BIO/etc tags也很常见。
在您的示例中,Apple MacBook 可以是 Product Name 类型的一个实体,但也可以是两个,Apple 为 Company Name,MacBook 为 Product Name。其工作原理完全取决于您的训练数据。
您可以手动或使用brat 直观地创建此类数据。