斯坦福词性标注器的使用(使用Eclipse)

1、

首先先到https://nlp.stanford.edu/software/tagger.shtml下载斯坦福词性标注器,然后将下载好的文件解压。

2、

打开Eclipse

选择File(文件)

选择Open Projects from File System

选择Directory...

选择解压后斯坦福标注器在文件夹

选择Finish

3、

在Eclipse中进入刚刚导入的Projects中,右键选择任意一个文件然后找到Build Path,选择Configure Build Path

 

4、

在打开的窗口中,先选择Libraries,再从右边的按钮中点击Add Jars...

5、

选择斯坦福标注器项目下的所有jar文件,然后选择OK,最后选择Apply and Close

6、

接下来就是运行项目内的TaggerDemo.java,但是要先设置好传入参数。

所以右键选择然后选择Run As再选择Run Configurations

7、

选择TaggerDemo(x)=Arguments,在Program arguments输入参数,分别是所要用的训练模型以及要词性标注的文本文件(以空格分隔开),例如这里我用项目下的models文件夹的english-bidirectional-distsim.tagger作为模型,然后选择项目下的sample-input.txt作为要词性标注的文本,则传入参数为models/english-bidirectional-distsim.tagger sample-input.txt

8、

最后设置完选择Apply然后Run就大功告成了


                                                                                          最后附上词性标记的含义

来源网站:

http://web.mit.edu/6.863/www/PennTreebankTags.html#Phrase

  1. CC Coordinating conjunction
  2. CD Cardinal number
  3. DT Determiner
  4. EX Existential there
  5. FW Foreign word
  6. IN Preposition or subordinating conjunction
  7. JJ Adjective
  8. JJR Adjective, comparative
  9. JJS Adjective, superlative
  10. LS List item marker
  11. MD Modal
  12. NN Noun, singular or mass
  13. NNS Noun, plural
  14. NNP Proper noun, singular
  15. NNPS Proper noun, plural
  16. PDT Predeterminer
  17. POS Possessive ending
  18. PRP Personal pronoun
  19. PRP$ Possessive pronoun
  20. RB Adverb
  21. RBR Adverb, comparative
  22. RBS Adverb, superlative
  23. RP Particle
  24. SYM Symbol
  25. TO to
  26. UH Interjection
  27. VB Verb, base form
  28. VBD Verb, past tense
  29. VBG Verb, gerund or present participle
  30. VBN Verb, past participle
  31. VBP Verb, non­3rd person singular present
  32. VBZ Verb, 3rd person singular present
  33. WDT Wh­determiner
  34. WP Wh­pronoun
  35. WP$ Possessive wh­pronoun
  36. WRB Wh­adverb

版权声明:本文为博主原创文章,未经博主允许不得转载。https://blog.csdn.net/weixin_42705508/article/details/81186556

猜你喜欢

转载自blog.csdn.net/weixin_42705508/article/details/81186556