斯坦福词性标注器的使用(使用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
- CC Coordinating conjunction
- CD Cardinal number
- DT Determiner
- EX Existential there
- FW Foreign word
- IN Preposition or subordinating conjunction
- JJ Adjective
- JJR Adjective, comparative
- JJS Adjective, superlative
- LS List item marker
- MD Modal
- NN Noun, singular or mass
- NNS Noun, plural
- NNP Proper noun, singular
- NNPS Proper noun, plural
- PDT Predeterminer
- POS Possessive ending
- PRP Personal pronoun
- PRP$ Possessive pronoun
- RB Adverb
- RBR Adverb, comparative
- RBS Adverb, superlative
- RP Particle
- SYM Symbol
- TO to
- UH Interjection
- VB Verb, base form
- VBD Verb, past tense
- VBG Verb, gerund or present participle
- VBN Verb, past participle
- VBP Verb, non3rd person singular present
- VBZ Verb, 3rd person singular present
- WDT Whdeterminer
- WP Whpronoun
- WP$ Possessive whpronoun
- WRB Whadverb
版权声明:本文为博主原创文章,未经博主允许不得转载。https://blog.****.net/weixin_42705508/article/details/81186556