singularity
singularity

Reputation: 221

Stanford CoreNLP doesn't exist

I have the following at the start of my code:

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;

The problem is, I get the errors like this below:

Twitter_Project.java:8: error: package edu.stanford.nlp.ling does not exist

import edu.stanford.nlp.ling.CoreAnnotations;

It seems like I didn't place my files in the same folder as I should have, but I don't understand how to rearrange my folder... The only problem is, I don't really understand where to relocate my java files so that I don't return this error anymore.

enter image description here

And this is everything inside the stanford corenlp folder: enter image description here

Please help—this is my first time using stanford corenlp and also using these kinds of integrated programs (if that's the right word), and I'm very confused.

Upvotes: 0

Views: 1600

Answers (2)

alexander nwala
alexander nwala

Reputation: 1

I had much difficulty installing Stanford CoreNLP until I installed it inside a Docker container. Now you can install and run it in two steps:

Pull the image from Dockerhub:

$ docker pull anwala/stanfordcorenlp

To run the CoreNLP server:

$ docker run --rm -d -p 9000:9000 --name stanfordcorenlp anwala/stanfordcorenlp

To use the server via Browser/command-line/custom python script etc: https://ws-dl.blogspot.com/2018/03/2018-03-04-installing-stanford-corenlp.html

Upvotes: 0

StanfordNLPHelp
StanfordNLPHelp

Reputation: 8739

Hi you need to make sure all of the jar files from the distribution are on your CLASSPATH. How you do that will vary depending on if you are running from the command line or in an IDE.

This link explains the idea of CLASSPATH: https://docs.oracle.com/javase/tutorial/essential/environment/paths.html

Upvotes: 1

Related Questions