所以我终于OpenNLP纳入我的项目,我已经成功培训了15,000行的训练数据的我的模型,将其存储,并且可以加载它,当我想用它来识别我的程序中的实体!定制OpenNLP名称查找在训练集识别数据,而不是测试组
,我用它来识别井号标签,所以我的训练数据看起来是这样的:
...
Jim , I know you to be a fighter <START:HASHTAG> #usmarine <END> @ USMC Kira has your strength & amp ; ours @ t1r1u1t1h R love 2 U , Kira & amp ;
What has changed that people from your JAMAT are insulting Hindu GODS and GODDESSES . Calling our Religion names ... .
Ibtihaj represented the United States of America at the Olympics and brought home a medal , elevating the status of
A story point is a metric used in agile project management and development to determine (or estimate) the difficul
I 'm not shy or quiet , I just do n't find your mind appealing in any way shape or form and I 'm not gon na force a conv
<START:HASHTAG> #paradisepapers <END> , Canadian Taxpayers Federation (CTF) & amp ; tax reform `` CTF has not uttered even a single shocked-and-a
...
我发现,如果它传递一个句子并不能直接使用的模型是无法识别的任何主题标签在我的训练集,如:
String paragraph = "Take a shot for #harambe he took one for you!";
它将无法识别在这个例子中包括hashtag,即使我检查,并有我的训练数据内使用#harambe的一个实例。
但是,如果我一个句子直接通过它从训练数据:
String nameParagraph = "Idk whats funnier the #harambe or the fact that Im the only one who will see my page https : t.co/2eWjm6mOon ";
这将能够正确识别它作为一个HASHTAG识别#harambe。
我希望我的模型来识别所有的井号标签,所以我不只是要养活它#harambe主题标签的多个实例,以便它能够识别出单#标签。
对我怎样才能使我的模型正确识别不在训练集合中的新实体的任何建议?提前致谢!
有什么理由,为什么你不能使用正则表达式来识别哈希标签? – jbird
所以我只是用它作为一种“第一次测试”来看看它是否可以接受一些简单的东西,我打算用它来识别正则表达式无法轻松找到的各种实体。 –
您可以制作一个自定义要素生成器来触发每个“#”,但我不知道如何使用这些功能。无论如何,因为一个hashtag遵循一个模式,如果可以的话,我会坚持正则表达式。 – jbird