使用NiuParser进行分词及词性标注

1、下载并解压
http://www.niuparser.com/

2、语法

[USAGE]
         NiuParser-v1.3.0-mt-win.exe    <Action>        <OPTIONS>
[ACTION]
        --WS    :  Word Segmentation.
        --POS   :  Part-Of-Speech Tagging.
        --NER   :  Named Entity Recognition.
        --CHK   :  Chunking (shallow syntactic parsing).
        --CP    :  Constituent Parser.
        --DP    :  Dependency Parser.
        --SRL   :  Semantic Role Label.
[OPITION]
>>   Get Options of Word Segmentation
                 NiuParser-v1.3.0-mt-win.exe    --WS
>>   Get Options of POS Tagging
                 NiuParser-v1.3.0-mt-win.exe    --POS
>>   Get Options of Named Entity Recognition
                 NiuParser-v1.3.0-mt-win.exe    --NER
>>   Get Options of Base Phrase Chunking
                 NiuParser-v1.3.0-mt-win.exe    --CHK
>>   Get Options of Constituent Parser
                 NiuParser-v1.3.0-mt-win.exe    --CP
>>   Get Options of Dependency Parser
                 NiuParser-v1.3.0-mt-win.exe    --DP

3、测试例子
en.txt

Don't ever let somebody tell you you can't do something, not even me. 
You got a dream, you gotta protect it. 
People can’t do something themselves, they wanna tell you you can’t do it. 
If you want something, go get it. 
Period.

zh.txt

别让别人告诉你你成不了才,即使是我也不行。
如果你有梦想的话,就要去捍卫它。
那些一事无成的人想告诉你你也成不了大器。
如果你有理想的话,就要去努力实现。
就这样。

4、执行语句

NiuParser-v1.3.0-mt-win.exe --WS -c niuparser.config -in en.txt -out enws.txt
NiuParser-v1.3.0-mt-win.exe --POS -c niuparser.config -in enws.txt -out enpos.txt

NiuParser-v1.3.0-mt-win.exe --WS -c niuparser.config -in zh.txt -out zhws.txt
NiuParser-v1.3.0-mt-win.exe --POS -c niuparser.config -in zhws.txt -out zhpos.txt

5、测试结果
enpos.txt

Don't/NR ever/NN let/VV somebody/NR tell/NR you/NR you/NR can't/NN d/NN o/VV something/JJ ,/NN not/VV even/NR me./NN 
You/NR go/NN t/NN a/AD dream,/VV you/NR gotta/NR protect/NN it./NN 
People/NR can/NR ’/PU t/NN d/NN o/VV something/JJ t/NN hemselves/NN ,/PU the/DT y/NN wanna/NR tell/NR you/NR you/NR can/NR ’/PU t/NN do/VV it./NN 
If/NR you/NR want/VV something/JJ ,/NN go/NN get/VV it./NN 

zhpos.txt

别/AD 让/VV 别人/NN 告诉/VV 你/PN 你/PN 成/VV 不/AD 了/VV 才/AD ,/PU 即使/CS 是/VC 我/PN 也/AD 不/AD 行/VV 。/PU 
如果/CS 你/PN 有/VE 梦想/NN 的话/SP ,/PU 就/AD 要/VV 去/VV 捍卫/VV 它/PN 。/PU 
那些/DT 一事无成/CD 的/DEG 人/NN 想/VV 告诉/VV 你/PN 你/PN 也/AD 成/VV 不/AD 了/VV 大器/NN 。/PU 
如果/CS 你/PN 有/VE 理想/NN 的话/SP ,/PU 就/AD 要/VV 去/VV 努力/AD 实现/VV 。/PU 

2 thoughts on “使用NiuParser进行分词及词性标注