Я настроил проект Maven внутри Eclipse.
Это только класс, пакет src / main / java / App.java com.nlptools.corenlp;
import java.util.List;
import edu.stanford.nlp.pipeline.Annotation;
import edu.stanford.nlp.sentiment.SentimentPipeline;
import edu.stanford.nlp.pipeline.StanfordCoreNLP;
class App
{
public static void main( String[] args )
{
List<Annotation> list = SentimentPipeline.getAnnotations(new StanfordCoreNLP(), null, "foo.txt", false);
for (Annotation item : list) {
System.out.println(item.toString());
}
System.out.println( "Hello World!" );
}
}
Тогда ядобавьте эти зависимости и подождите, пока Gradle загрузит файлы:
<dependency>
<groupId> edu.stanford.nlp </groupId>
<artifactId> stanford-corenlp </artifactId>
<version> 3.9.2</version>
</dependency>
<dependency>
<groupId> edu.stanford.nlp </groupId>
<artifactId> stanford-corenlp </artifactId>
<version> 3.9.2</version>
<classifier> models-english </classifier>
</dependency>
При запуске я получаю эту ошибку:
Couldn't read TokensRegexNER from edu/stanford/nlp/models/kbp/english/gazetteers/regexner_caseless.tab
Я смотрю документацию, но не могу сделатьсмысл этого: https://nlp.stanford.edu/nlp/javadoc/javanlp/edu/stanford/nlp/sentiment/SentimentPipeline.html
Чего мне не хватает?