【问题标题】:Stanford NLP: Tokenize output on a single line?斯坦福 NLP:在一行上标记输出?
【发布时间】:2015-02-12 03:13:35
【问题描述】:

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

【问题讨论】:

    标签: stanford-nlp


    【解决方案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

    【讨论】:

    • 谢谢乔恩!我注意到输出被标记化了,我想避免这种情况。有什么方法可以跳过斯坦福 NLP 的标记化?
    • 是的——使用空格标记。使用-help 选项运行DocumentPreprocessor 以了解详细信息。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-08-03
    • 1970-01-01
    • 2014-04-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多