OpenNLP Namefinder API中的自定义功能生成 [英] Custom Feature Generation in OpenNLP Namefinder API

查看:105
本文介绍了OpenNLP Namefinder API中的自定义功能生成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将OpenNLP的自定义功能生成用于命名查找器API.

I am trying to use the Custom Feature generation of OpenNLP for Named Finder API.

http://opennlp.apache.org/documentation/1.5. 3/manual/opennlp.html

我仔细阅读了文档,但无法理解如何指定不同的功能.

I went through the documentation but I was not able to understand how to specify the different features.

它只是说:

AdaptiveFeatureGenerator featureGenerator = new CachedFeatureGenerator(
     new AdaptiveFeatureGenerator[]{
       new WindowFeatureGenerator(new TokenFeatureGenerator(), 2, 2),
       new WindowFeatureGenerator(new TokenClassFeatureGenerator(true), 2, 2),
       new OutcomePriorFeatureGenerator(),
       new PreviousMapFeatureGenerator(),
       new BigramNameFeatureGenerator(),
       new SentenceFeatureGenerator(true, false)
       });

但是您实际上如何使用这些不同的特征生成器来创建自己的自定义特征.有人可以张贴示例代码来定义这些特征生成器,以及如何将其用于自定义特征生成.谢谢您的期待.

But how do you actually use each of these different feature generators to create my own custom features. Can somebody post a sample code defining these feature generators and how do we use it for custom feature generation. Thanks in anticipation.

推荐答案

我也没有找到任何文档,但是对于大多数功能生成器,

I did not find any documentation either, but for most feature generators the code is quite self explanatory. Here are some links to the source repository:

  • TokenFeatureGenerator
  • TokenClassFeatureGenerator
  • OutcomePriorFeatureGenerator
  • PreviousMapFeatureGenerator
  • SentenceFeatureGenerator
  • BigramNameFeatureGenerator
  • WindowFeatureGenerator
  • CachedFeatureGenerator

此外,文档您指的是所引用的特征生成器与默认特征生成器相似.但是,

Furthermore, the documentation you refer to states that the quoted feature generator is similar to the default feature generator. However, the source code shows that it is actually identical to the default feature generator.

这篇关于OpenNLP Namefinder API中的自定义功能生成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆