我的应用程序是一个使用 Spark 的 java maven 项目。这是我的 pom 中添加 stanford coreNLP 依赖项的部分:
<dependency>
<groupId>edu.stanford.nlp</groupId>
<artifactId>stanford-corenlp</artifactId>
<version>3.6.0</version>
</dependency>
<dependency>
<groupId>edu.stanford.nlp</groupId>
<artifactId>stanford-corenlp</artifactId>
<version>3.6.0</version>
<classifier>models</classifier>
</dependency>
我收到以下错误:
java.lang.NoClassDefFoundError: edu/stanford/nlp/pipeline/StanfordCoreNLP
还有其他依赖项,例如 Spark,并且 dataproc 可以很好地提取它们。现在我添加了 coreNLP,它在我的笔记本电脑上运行良好,但在 google dataproc 中失败了。