无法使用Shift-Reduce解析器启动Stanford CoreNLP服务器

时间:2018-08-01 17:44:36

标签: stanford-nlp

我在本地安装了coreNLP服务器,可以使用以下命令启动:

java -mx5g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer  -timeout 100000 

但是使用以下警告消息设置了默认选区解析器:

  

警告:找不到edu / stanford / nlp / models / srparser / englishSR.ser.gz

     

使用:edu / stanford / nlp / models / lexparser / englishPCFG.ser.gz代替

我下载了shift reduce解析器,提取了jar文件,并将 edu 文件夹粘贴到了项目目录中。

要仔细检查,我手动遍历edu / stanford / nlp / models / lexparser以确保 englishSR.ser.gz 存在。

还创建了 .properties 文件,并在再次启动服务器时使用了-serverProperties选项。

StanfordCoreNLP.properties 文件包含:

parser.model = edu/stanford/nlp/models/srparser/englishSR.ser.gz
  • 运行服务器的命令现在为:
java -mx5g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -timeout 100000 -serverProperties "StanfordCoreNLP.properties"

没有运气,我仍然收到同样的警告。 如果需要更多说明,请发表评论。

1 个答案:

答案 0 :(得分:2)

您应该将完整的英语模型jar放在运行此命令的目录中。

-cp "*"表示要查看该目录中的所有jar。

您可以在此处找到英文型号的罐子:

https://stanfordnlp.github.io/CoreNLP/download.html