如何通过朴素贝叶斯分类器将PoS标签用作训练数据的功能? [英] How to use PoS tag as a feature for training data by Naive Bayes classifier?

查看:102
本文介绍了如何通过朴素贝叶斯分类器将PoS标签用作训练数据的功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究如何从文档中提取关键词短语.

在我的研究中,我使用了朴素贝叶斯分类器机器学习来创建候选术语特征的训练模型.其中的一项功能是 PoS标签,我认为该功能对于指定术语是否为关键短语非常重要.

In my research, I used Naive Bayes classifier machine learning for creating a training model of the candidate term features. One of features is PoS tag, I think this feature is important for specifying a term is keyphrase or not.

但是朴素贝叶斯(NB)分类器的输入是数字,而PoS标签是字符串.

But the input of Naive Bayes (NB) classifier is numbers and the PoS tag is a string.

所以我不知道将PoS标签功能表示为数字以便成为NB分类器的输入功能的方法.

请帮助我提供您的建议.

Please help me to give your advice.

感谢和问候, 苏贤

推荐答案

您可以将POS标签视为一个单词.然后,您可以使用POS unigram,bigram或trigram作为功能.

You can treat POS tag as a word. Then you can use POS unigram, bigram or trigram as feature.

示例:

他们/PRP拒绝/VBP到/TO许可证/VB美国/PRB到/要获得/VB/DT拒绝/NN许可证/NN.

They/PRP refuse/VBP to/TO permit/VB us/PRB to/TO obtain/VB the/DT refuse/NN permit/NN.

如果您将POS卦作为特征.您可以构建具有以下功能的向量.

If you take POS trigrams as features. You can construct a vector with following features.

Feature          Value
(PRP,VBP,TO)      1
(VBP,TO,VB)       1 
(TO,VB,PRB)       1

以此类推.

您还可以将tf-idf值用于POS功能.

You can also use the tf-idf value for POS features.

这篇关于如何通过朴素贝叶斯分类器将PoS标签用作训练数据的功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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