在命令行中使用Stanford nndep Parser时,sentenceDelimiter选项不起作用

问题描述 投票:0回答:1

在使用Stanford nndep Parser期间,sentenceDelimiter选项不起作用。

命令是

java -classpath stanford-parsing -mx2000m \
    edu.stanford.nlp.parser.nndep.DependencyParser \
    -model nndep/english_UD.gz \
    -outputFormatOptions includePunctuationDependencies \
    -tagger.model stanford-postags/models/english-left3words-distsim.tagger \
    -textFile srcinput.txt \
    -outFile srcinput.dependence \
    -sentenceDelimiter newline

解析器无法拆分句子。如果-sentenceDelimiter的值为$'\ n',那么如果在linux中运行带有setsid的命令,则该命令可能会失败。

stanford-nlp
1个回答
0
投票

我建议只使用完整的Stanford CoreNLP下载运行管道。

你可以在这里获得完整的包装:https://stanfordnlp.github.io/CoreNLP/

示例命令:

java -Xmx4g edu.stanford.nlp.pipeline.StanfordCoreNLP -annotators tokenize,ssplit,pos,lemma,depparse -ssplit.eolonly -file example.txt
© www.soinside.com 2019 - 2024. All rights reserved.