我正在使用以下命令从终端(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
等各种其他尝试均不起作用。使用管道,从终端传递这些选项的正确语法是什么?