edu.stanford.nlp.sentiment.SentimentCoreAnnotations Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of stanford-corenlp Show documentation
Show all versions of stanford-corenlp Show documentation
Stanford CoreNLP provides a set of natural language analysis tools which can take raw English language text input and give the base forms of words, their parts of speech, whether they are names of companies, people, etc., normalize dates, times, and numeric quantities, mark up the structure of sentences in terms of phrases and word dependencies, and indicate which noun phrases refer to the same entities. It provides the foundational building blocks for higher level text understanding applications.
package edu.stanford.nlp.sentiment;
import edu.stanford.nlp.ling.CoreAnnotation;
import edu.stanford.nlp.trees.Tree;
/**
* Annotations specific to the Sentiment project. In case there are
* other projects that use the same RNN machinery, including the RNN
* core annotations, this lets a sentence have a tree attached where
* that tree specifically has the sentiment annotations.
*
* @author John Bauer
*/
public class SentimentCoreAnnotations {
/**
* A tree which contains the annotations used for the Sentiment
* task. After forwardPropagate has been called, the Tree will have
* prediction, etc. attached to it.
*/
public static class SentimentAnnotatedTree implements CoreAnnotation {
@Override
public Class getType() {
return Tree.class;
}
}
/**
* The final label given for a sentence. Set by the
* SentimentAnnotator and used by various forms of text output.
*/
public static class SentimentClass implements CoreAnnotation {
@Override
public Class getType() {
return String.class;
}
}
}