【问题标题】:Unable to Start Stanford CoreNLP server with Shift-Reduce Parser无法使用 Shift-Reduce Parser 启动 Stanford CoreNLP 服务器
【发布时间】:2018-08-01 17:44:36
【问题描述】:

我已经在本地设置了 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"

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

【问题讨论】:

    标签: stanford-nlp


    【解决方案1】:

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

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

    你可以在这里找到英文模型的jar:

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

    【讨论】:

      猜你喜欢
      • 2016-04-19
      • 1970-01-01
      • 2013-10-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多