[英]Stanford CoreNLP doesn't exist
我的代碼開頭有以下內容:
import twitter4j.*; import java.util.List; import java.util.Properties; import java.io.*; import java.util.*; import edu.stanford.nlp.ling.CoreAnnotations; import edu.stanford.nlp.neural.rnn.RNNCoreAnnotations; import edu.stanford.nlp.pipeline.Annotation; import edu.stanford.nlp.pipeline.StanfordCoreNLP; import edu.stanford.nlp.sentiment.SentimentCoreAnnotations; import edu.stanford.nlp.trees.Tree; import edu.stanford.nlp.util.CoreMap;
問題是,我收到如下錯誤:
Twitter_Project.java:8: 錯誤:包 edu.stanford.nlp.ling 不存在
導入 edu.stanford.nlp.ling.CoreAnnotations;
好像我沒有把我的文件放在我應該有的同一個文件夾中,但我不明白如何重新排列我的文件夾......唯一的問題是,我真的不知道在哪里重新定位我的 java 文件以便我不再返回此錯誤。
這是 stanford corenlp 文件夾中的所有內容:
請幫助 - 這是我第一次使用 stanford corenlp 並且還使用這些類型的集成程序(如果這是正確的詞),我很困惑。
您好,您需要確保發行版中的所有 jar 文件都在您的 CLASSPATH 中。 您如何執行此操作將取決於您是從命令行還是在 IDE 中運行。
這個鏈接解釋了 CLASSPATH 的想法: https : //docs.oracle.com/javase/tutorial/essential/environment/paths.html
在我將其安裝在 Docker 容器中之前,我在安裝斯坦福 CoreNLP 時遇到了很多困難。 現在您可以分兩步安裝和運行它:
從 Dockerhub 拉取鏡像:
$ docker pull anwala/stanfordcorenlp
運行 CoreNLP 服務器:
$ docker run --rm -d -p 9000:9000 --name stanfordcorenlp anwala/stanfordcorenlp
通過瀏覽器/命令行/自定義python 腳本等使用服務器: https : //ws-dl.blogspot.com/2018/03/2018-03-04-installing-stanford-corenlp.html
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.