This project was created as part of Alfresco #DevCon2019 and aims to create a micro service that is able to analyise the sentiment of a content. As part of this project we will compare the different NLP frameworks and try to improve on the accuracy of the prediction.
- Project setup.
- Data preparation.
- NLP Sentiment Analysis interface.
- StandfordNLP implementation.
- OpenNLP implementation.
- SpringBoot setup to expose Rest-API endpoints
- Unit test.
- Integrate the service into Alfresco, create a rule that invokes the Sentiment Analysis API.
- Integrate with APS to perform a process based on the Sentiment result.
Change into the sentiment-analysis folder and perform the following:
mvn clean install
java -jar target/sentiment-analysis-1.0.0.jar
To view the page: http://localhost:8080/
docker build -t SentimentAnalysis .
docker run SentimentAnalysis
To view the page: http://localhost:8080/
Get Sentiment Analysis ranking by sentence
Request
$ curl -X POST \
http://localhost:8080/analyze/v1/text \
-H 'Content-Type: text/plain' \
-d Text coming from Alfresco Content
Response
{
"ranking": {
"positive": 3,
"negative": 4,
"neutral": 3
}
}