开发者

POS tagger in SharpNLP

开发者 https://www.devze.com 2022-12-21 07:10 出处:网络
I am using S开发者_如何学JAVAharpNLP for my POS tagging: EnglishMaximumEntropyPosTagger posTagger =

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");
0

精彩评论

暂无评论...
验证码 换一张
取 消