【问题标题】:Speed up annotation time in CoreNLP sentiment加快 CoreNLP 情绪中的注释时间
【发布时间】:2018-03-27 12:43:08
【问题描述】:

在我的数据集中,我有 100,000 个文本文件,我正在尝试使用 CoreNLP 处理它们。期望的结果是 100,000 个完成的文本文件结果,其中将每个句子分类为具有正面、负面或中性情绪。 为了从一个文本文件到另一个文本文件,我使用 CoreNLP jar 文件,该文件在下面的命令行中使用。

 java -cp "*" -mx5g edu.stanford.nlp.sentiment.SentimentPipeline -fileList list.txt

这需要很长时间,因为我无法让模型获取文件列表中的每个文件,但它会将单个路径行作为模型的输入。

我还尝试在此链接中实现一些其他方法,但我无法从这些方法中获得所需的结果。 https://stanfordnlp.github.io/CoreNLP/cmdline.html#classpath

有没有更好更快的方法来做到这一点并加快进程?

【问题讨论】:

    标签: java command-line nlp stanford-nlp sentiment-analysis


    【解决方案1】:

    试试这个命令:

    java -Xmx14g edu.stanford.nlp.pipeline.StanfordCoreNLP -annotators tokenize,ssplit,pos,lemma,parse,sentiment -parse.model edu/stanford/nlp/models/srparser/englishSR.ser.gz -outputFormat text -filelist list.txt 
    

    它将使用更快的 shift-reduce 解析器。这将遍历list.txt 中的每个文件(每行1 个文件)并对其进行处理。

    【讨论】:

    • 如何通过 CoreNLP API 做到这一点?这是对管道中parse 阶段的配置吗?
    • 更改 parse.model
    猜你喜欢
    • 2016-04-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-11
    • 1970-01-01
    相关资源
    最近更新 更多