java - 斯坦福 CoreNLP 不存在

标签 java stanford-nlp file-exists not-exists

我的代码开头有以下内容:

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: error: package edu.stanford.nlp.ling does not exist

import edu.stanford.nlp.ling.CoreAnnotations;

似乎我没有将文件放在应有的文件夹中,但我不明白如何重新排列我的文件夹... 唯一的问题是,我真的不知道在哪里重新定位我的 java 文件,这样我就不会再返回此错误。

enter image description here

这是 stanford corenlp 文件夹中的所有内容: enter image description here

请帮忙——这是我第一次使用 stanford corenlp,也是第一次使用这些类型的集成程序(如果这个词正确的话),我很困惑。

最佳答案

您好,您需要确保发行版中的所有 jar 文件都位于您的 CLASSPATH 中。具体操作方式会有所不同,具体取决于您是从命令行运行还是在 IDE 中运行。

此链接解释了 CLASSPATH 的概念:https://docs.oracle.com/javase/tutorial/essential/environment/paths.html

关于java - 斯坦福 CoreNLP 不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59810832/

相关文章:

java - 如何从其他类或方法中获取 "extract"变量?

PHP file_exists 仅适用于 root :root

python - Winerror 183 当文件已存在时无法创建该文件

java - 无法找到方法“com.google.common.base.Preconditions.checkState”

java - 如何使用一些自定义配置设置属性文件

java - 来自数据库的 Jsf2 primefaces 菜单栏

eclipse - 加载标记器模型时出错(可能缺少模型文件)

java - 解析斯坦福依赖关系

java - 如何初始化stanfordNLP管道一次并使用多次而不需要再次初始化?

eclipse - 如何在 ant 中等待文件可用?