Stanford CoreNLP从命令行将选项传递给注释器

时间:2018-10-19 10:11:26

标签: terminal parameter-passing stanford-nlp

我正在使用以下命令从终端(Ubuntu)使用Stanford CoreNLP:

/path/to/corenlp/corenlp.sh -annotators tokenize,ssplit,pos,lemma,ner,parse -ssplit.eolonly true -file myfile.txt

这可以按预期工作,特别是将值为eolonly的选项true传递给ssplit注释者。

现在,我想使用管道将更复杂的选项传递给parse注释器,以指定输出格式,如针对https://nlp.stanford.edu/software/lex-parser.shtml上的独立解析器所述,使用命令

java -mx200m edu.stanford.nlp.parser.lexparser.LexicalizedParser -retainTMPSubcategories -outputFormat "wordsAndTags,penn,typedDependencies"

我尝试过

corenlp.sh -annotators tokenize,ssplit,pos,lemma,ner,parse -ssplit.eolonly true -parse.flags "-retainTmpSubcategories -outputFormat wordsAndTags,penn,typedDependencies" -file myfile.txt

但是产生了错误

Exception in thread "main" java.lang.IllegalArgumentException: Unknown option: true
at edu.stanford.nlp.parser.lexparser.Options.setOption(Options.java:179)

使用单引号,转义引号,删除破折号,在第一个标志上添加true等各种其他尝试均不起作用。使用管道,从终端传递这些选项的正确语法是什么?

0 个答案:

没有答案
相关问题