-->

How to use PoS tag as a feature for training data

2019-07-20 02:00发布

问题:

I'm researching how to extract keyphrases from document for my thesis.

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.

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

So I don't know the way to represent PoS tag feature as a number in order to become a input feature for NB classifier.

Please help me to give your advice.

Thanks and regards, Hien Su

回答1:

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

Example:

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

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

and so on.

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