Sentiment analysis is the process of obtaining some assessment of text such as a favorable or unfavorable review of a book. We will demonstrate how this type of analysis can be performed using the Stanford API. Specifically, we will use a model trained for movie reviews.
Performing sentiment analysis on reviews
Getting ready
To prepare, we need to do the following:
- Create a new Maven project
- Add the following dependencies to the project's POM file:
<!-- https://mvnrepository.com/artifact/edu.stanford.nlp/stanford-corenlp -->
<dependency>
<groupId>edu.stanford.nlp</groupId>
<artifactId>stanford-corenlp</artifactId>
<version>3.9.2</version>
</dependency>
<...