OpenNLP-명령 줄 인터페이스

OpenNLP는 명령 줄을 통해 다양한 작업을 수행 할 수있는 명령 줄 인터페이스 (CLI)를 제공합니다. 이 장에서는 OpenNLP 명령 줄 인터페이스를 사용하는 방법을 보여주는 몇 가지 예를 살펴 보겠습니다.

토큰 화

input.txt

Hi. How are you? Welcome to Tutorialspoint. We provide free tutorials on various technologies

통사론

> opennlp TokenizerME path_for_models../en-token.bin <inputfile..> outputfile..

명령

C:\> opennlp TokenizerME C:\OpenNLP_models/en-token.bin <input.txt >output.txt

산출

Loading Tokenizer model ... done (0.207s)  
Average: 214.3 sent/s 
Total: 3 sent 
Runtime: 0.014s

output.txt

Hi . How are you ? Welcome to Tutorialspoint . We provide free tutorials on various technologies

문장 감지

input.txt

Hi. How are you? Welcome to Tutorialspoint. We provide free tutorials on various technologies

통사론

> opennlp SentenceDetector path_for_models../en-token.bin <inputfile..> outputfile..

명령

C:\> opennlp SentenceDetector C:\OpenNLP_models/en-sent.bin <input.txt > output_sendet.txt

산출

Loading Sentence Detector model ... done (0.067s)  

Average: 750.0 sent/s 
Total: 3 sent 
Runtime: 0.004s

Output_sendet.txt

Hi. How are you? 
Welcome to Tutorialspoint. 
We provide free tutorials on various technologies

명명 된 엔티티 인식

input.txt

<START:person> <START:person> Mike <END> <END> is senior programming manager and 
<START:person> Rama <END> is a clerk both are working at Tutorialspoint

통사론

> opennlp TokenNameFinder path_for_models../en-token.bin <inputfile..

명령

C:\>opennlp TokenNameFinder C:\OpenNLP_models\en-ner-person.bin <input_namefinder.txt

산출

Loading Token Name Finder model ... done (0.730s) 
<START:person> <START:person> Mike <END> <END> is senior programming manager and 
<START:person> Rama <END> is a clerk both are working at Tutorialspoint  
Average: 55.6 sent/s 
Total: 1 sent 
Runtime: 0.018s

음성 태깅의 일부

Input.txt

Hi. How are you? Welcome to Tutorialspoint. We provide free tutorials on various technologies

통사론

> opennlp POSTagger path_for_models../en-token.bin <inputfile..

명령

C:\>opennlp POSTagger C:\OpenNLP_models/en-pos-maxent.bin < input.txt

산출

Loading POS Tagger model ... done (1.315s) 
Hi._NNP How_WRB are_VBP you?_JJ Welcome_NNP to_TO Tutorialspoint._NNP We_PRP 
provide_VBP free_JJ tutorials_NNS on_IN various_JJ technologies_NNS  

Average: 66.7 sent/s 
Total: 1 sent 
Runtime: 0.015s