POS tagger in SharpNLP
I am using S开发者_如何学JAVAharpNLP for my POS tagging:
EnglishMaximumEntropyPosTagger posTagger =
new EnglishMaximumEntropyPosTagger(mModelPath);
String tagSentence = posTagger.TagSentence(question);
I only have 3 tags. How can I load a set of Penn treebank or some other tagging tree banks to use?
Thanks
:)
Download the model files from http://www.codeplex.com/sharpnlp, and use mModelPath
to point to the models you downloaded.
For POS Tagging, be sure to initialize the PosTagger object not just with the nbin file, but also with the tagdict file.
mPosTagger = new OpenNLP.Tools.PosTagger.EnglishMaximumEntropyPosTagger(mModelPath + "EnglishPOS.nbin", mModelPath + @"\Parser\tagdict");
精彩评论