2014-10-26 122 views
1

我是NLP和OpenNLP库的新手,目前我正在玩一些功能,特别是图书馆提取组织名称的功能。如果我用一个简单的字符串,如扩展OpenNLP组织模型的培训

"Bill worked at Microsoft Corp., JP Morgan Chase, Monsanto and General Motors and was amazed at what went on in Congress. " 

我的代码滴出:

Detected name "Bill". Type person with probability of 0.9604452678787172 
Detected name "Microsoft Corp .". Type organization with probability of 0.9976452599132802 
Detected name "JP Morgan Chase". Type organization with probability of 0.9064399433766583 
Detected name "Monsanto". Type organization with probability of 0.7429123227376515 
Detected name "General Motors". Type organization with probability of 0.965472905375375 
Detected name "Congress". Type organization with probability of 0.9940809804351413 

的一切似乎罚款。但是,如果我切换到世界这样的更多的英国视图

"Mark worked at The University of London, HSBC, The Royal Bank of Scotland, Dyson and GlaxoSmithKline." 

我得到

Detected name "Mark". Type person with probability of 0.7496973664676362 
Detected name "London". Type location with probability of 0.6625435519843291 
Detected name "Scotland". Type location with probability of 0.9564118675997605 
Detected name "University of London". Type organization with probability of 0.8516268558212053 
Detected name "Royal Bank". Type organization with probability of 0.8953174632171774 

显然不是那么成功。这是因为组织查找者不了解英国机构或者我不幸运?如果前者有办法让我采用现有模式,并将其知识扩展到英国机构更好?我快速查看了现有组织模型的培训数据,但找不到任何内容。

回答

2

我在快速搜索中也找不到有关培训数据的任何文档,但它可能是根据美国报纸文本(华尔街日报或路透社可能来自MUC或CoNLL数据集)进行培训的,这可以解释为什么它不会对英国实体也是如此。

无法扩展现有模型,但是如果您有注释数据,则可以使用英国实体来训练自己的模型。

+0

其中存在问题。很容易获得所有在公司内部注册的英国公司名单,但可以用来培训该模型吗?我要在这里作出新的判断 – 2014-10-27 13:10:58

+0

不是真的,至少不是OpenNLP。 OpenNLP希望在实体出现在句子上下文中的地方有训练数据。请参阅文档:https://opennlp.apache.org/documentation/1.5.3/manual/opennlp.html#tools.namefind.training – aab 2014-10-29 09:03:42

+0

这几乎是我的想法。非常感谢您的帮助 – 2014-10-29 12:13:53