【问题标题】:How to install correctly Stanford Parser in Ubuntu? (without nltk)如何在 Ubuntu 中正确安装 Stanford Parser? (没有 nltk)
【发布时间】:2019-09-02 17:39:10
【问题描述】:

我正在尝试在 Ubuntu 18.04.3 上安装 Stanford Parser,完全不安装 NLTK 包,但我不确定它是如何安装的以便能够与 Java 或 Python 一起使用。

我已经从官网[Stanford Parser][https://nlp.stanford.edu/software/lex-parser.shtml#Download]下载了完整的包和我需要的语言。 因此,我还安装了 Java JDK 和 Java JRE,但无法检测到 Stanford Parser paks。

我是新手。 :-|

【问题讨论】:

  • 最简单的方法是创建一个maven项目并将stanford-corenlp添加到maven依赖项中。否则,请阅读一些有关 java 类路径的信息,并将 stanford-corenlp 和模型 jar 添加到 IDE 的适当设置中。
  • 我看到有人在谈论它,但他们告诉我不需要安装 Stanford-Corenlp。我只需要 Stanford-Parser 的完整软件包。 :-/

标签: java python ubuntu stanford-nlp linguistics


【解决方案1】:
  1. 下载目录并解压
  2. cd /path/to/stanford-parser-full-2018-10-17
  3. export CLASSPATH=/path/to/stanford-parser-full-2018-10-17/*:
  4. java -Xmx5g edu.stanford.nlp.parser.lexparser.LexicalizedParser -outputFormat "penn,typedDependencies" edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz data/english-onesent.txt

【讨论】:

  • 我已经提出了你的建议,但它给了我以下错误:Error: Could not find or load main class edu.stanford.nlp.parser.lexparser.LexicalizedParser Caused by: java.lang.ClassNotFoundException: edu.stanford.nlp.parser.lexparser.LexicalizedParser 我认为这不是 CLASSPATH 目录。
  • 您是在 Linux 还是 Windows 上运行它?命令行还是 IDE?
  • 您的说明对我来说效果很好,我的问题是我没有为斯坦福解析器位置放置完整的路径。非常感谢。 :-D
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2015-06-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-01-15
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多