如何从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

使用LSTM在Python中预测未来值

这段代码可以预测指定股票的当前日期之前的值,但不能预测…

如何在gensim的word2vec模型中查找双词组的相似性

我有一个word2vec模型,假设我使用的是googl…

dask_xgboost.predict 可以工作但无法显示 – 数据必须是一维的

我试图使用 XGBoost 创建模型。 看起来我成功地…

ML Tuning – Cross Validation in Spark

我在https://spark.apache.org/…

如何在React JS中使用fetch从REST API获取预测

我正在开发一个应用程序,其中Flask REST AP…

如何分析ML.NET中多类分类预测得分数组?

我在ML.NET中创建了一个多类分类项目。该项目可以对…

发表回复

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