如何从OpenNLP生成器中提取特征?

我正在使用这个自定义的特征生成器:

    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),                new DictionaryFeatureGenerator("person", dictionary)               });

我只添加了DictionaryFeatureGenerator,并添加了几条记录:

    Dictionary dictionary = new Dictionary();    dictionary.put(new StringList(new String[]{"giovanni"}));    dictionary.put(new StringList(new String[]{"maria"}));    dictionary.put(new StringList(new String[]{"luca"}));

我尝试查看DictionaryFeatureGenerator.java的代码,但没有找到关于如何提取此生成器生成的特征的任何信息。

所以问题是,在我的模型的生成器列表中添加此生成器后,如何提取特征以了解哪些标记与我的字典中的条目匹配?

谢谢!


回答:

机器学习特征并不能保证标记会被标记为命名实体。这就像在标记上放置一个标志,表明该标记出现在字典中,但它仍然需要与其他特征一起进行评估。

你可以使用DictionaryNameFinder来跳过机器学习过程。

Related Posts

L1-L2正则化的不同系数

我想对网络的权重同时应用L1和L2正则化。然而,我找不…

使用scikit-learn的无监督方法将列表分类成不同组别,有没有办法?

我有一系列实例,每个实例都有一份列表,代表它所遵循的不…

f1_score metric in lightgbm

我想使用自定义指标f1_score来训练一个lgb模型…

通过相关系数矩阵进行特征选择

我在测试不同的算法时,如逻辑回归、高斯朴素贝叶斯、随机…

可以将机器学习库用于流式输入和输出吗?

已关闭。此问题需要更加聚焦。目前不接受回答。 想要改进…

在TensorFlow中,queue.dequeue_up_to()方法的用途是什么?

我对这个方法感到非常困惑,特别是当我发现这个令人费解的…

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注