首页 > 解决方案 > 斯坦福 CoreNLP 使用文件列表时如何跳过失败?

问题描述

我正在使用带有 filelist 参数的 stanfordCoreNLP。该程序似乎在 filelist.lst 中的某些文件处失败,并且 cmd 停止并退出。如何跳过失败继续完成对其余文件的分析?

java -mx3g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLP -props Props.properties

我已经在属性文件中添加了 continueOnAnnotateError 标志,但是在遇到坏文件时它仍然失败。

Props.properties 文件如下所示:

annotators = tokenize, ssplit, pos, parse, sentiment
outputFormat = JSON 
outputDirectory = ./output_2020
timeout = 500000
output.includeText = False
parse.model = edu/stanford/nlp/models/srparser/englishSR.ser.gz
continueOnAnnotateError = True
filelist = ./flist253.lst

这是我使用 continueOnAnnotateError=True 得到的错误:

在此处输入图像描述

标签: nlpstanford-nlp

解决方案


你应该使用-continueOnAnnotateError


推荐阅读