【发布时间】:2016-09-17 00:02:11
【问题描述】:
我有一些文件要提供给 coreNLP 的情绪标记器。我已经将文件分解成单独的句子,因此希望每个文件返回一个标签。如何让java命令返回一个标签。
命令如下java -cp "*" -mx5g edu.stanford.nlp.sentiment.SentimentPipeline -stdin,输出如下:
Annotation pipeline timing information:
TokenizerAnnotator: 0.0 sec.
WordsToSentencesAnnotator: 0.0 sec.
TOTAL: 0.0 sec. for 8 tokens at 296.3 tokens/sec.
Pipeline setup: 0.0 sec.
Total time for StanfordCoreNLP pipeline: 8.7 sec.
C:\stanford-corenlp-full-2015-04-20>java -cp "*" -mx5g edu.stanford.nlp.sentiment.SentimentPipeline -stdin
Adding annotator tokenize
TokenizerAnnotator: No tokenizer type provided. Defaulting to PTBTokenizer.
Adding annotator ssplit
Adding annotator parse
Loading parser from serialized file edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz ... done [0.4 sec].
Adding annotator sentiment
Reading in text from stdin.
Please enter one sentence per line.
Processing will end when EOF is reached.
Computer is fun. Not too fun.
Positive
Neutral
如何通过删除标点符号使输出成为类似于我在下面所做的单个标记:
Computer is fun Not too fun.
Positive
似乎我应该能够轻松地做到这一点,因为有-ssplit.isOneSentence,据我了解,情绪标记器使用ssplit,但我不知道如何修改我的命令来合并它(我已阅读@ 987654321@).
【问题讨论】:
标签: java stanford-nlp