斯坦福NLP:单行标记输出?

时间:2015-02-12 03:13:35

标签: stanford-nlp

我们可以使用命令行工具在Apache OpenNLP的单行上输出tokenizer吗? http://nlp.stanford.edu/software/tokenizer.shtml https://opennlp.apache.org/documentation/1.5.3/manual/opennlp.html#tools.tokenizer

1 个答案:

答案 0 :(得分:1)

您可以通过编程方式或从命令行使用DocumentPreprocessor

从CLI:

$ echo "This is a test. And some more." | java edu.stanford.nlp.process.DocumentPreprocessor 2>/dev/null
This is a test .
And some more .

你可以通过编程方式做同样的事情;见this SO answer