📅  最后修改于: 2020-11-23 03:58:31             🧑  作者: Mango
OpenNLP提供了命令行界面(CLI),可通过命令行执行不同的操作。在本章中,我们将通过一些示例来说明如何使用OpenNLP命令行界面。
Hi. How are you? Welcome to Tutorialspoint. We provide free tutorials on various technologies
> opennlp TokenizerME path_for_models../en-token.bin outputfile..
C:\> opennlp TokenizerME C:\OpenNLP_models/en-token.bin output.txt
Loading Tokenizer model ... done (0.207s)
Average: 214.3 sent/s
Total: 3 sent
Runtime: 0.014s
Hi . How are you ? Welcome to Tutorialspoint . We provide free tutorials on various technologies
Hi. How are you? Welcome to Tutorialspoint. We provide free tutorials on various technologies
> opennlp SentenceDetector path_for_models../en-token.bin outputfile..
C:\> opennlp SentenceDetector C:\OpenNLP_models/en-sent.bin output_sendet.txt
Loading Sentence Detector model ... done (0.067s)
Average: 750.0 sent/s
Total: 3 sent
Runtime: 0.004s
Hi. How are you?
Welcome to Tutorialspoint.
We provide free tutorials on various technologies
Mike is senior programming manager and
Rama is a clerk both are working at Tutorialspoint
> opennlp TokenNameFinder path_for_models../en-token.bin
C:\>opennlp TokenNameFinder C:\OpenNLP_models\en-ner-person.bin
Loading Token Name Finder model ... done (0.730s)
Mike is senior programming manager and
Rama is a clerk both are working at Tutorialspoint
Average: 55.6 sent/s
Total: 1 sent
Runtime: 0.018s
Hi. How are you? Welcome to Tutorialspoint. We provide free tutorials on various technologies
> opennlp POSTagger path_for_models../en-token.bin
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