No description, website, or topics provided.
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
sentiment-analysis-repo Content extraction Jan 29, 2019
sentiment-analysis-share Alfresco artifacts Jan 29, 2019
sentiment-analysis Fix to work only with available API as we have removed an API Feb 11, 2019
.gitignore
README.md Correct the sample URL Jan 29, 2019
Resources.md

README.md

SentimentAnalysis

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.

Tasks

  • Project setup.
  • Data preparation.
  • NLP Sentiment Analysis interface.
  • StandfordNLP implementation.
  • OpenNLP implementation.
  • SpringBoot setup to expose Rest-API endpoints
  • Unit test.

Stretch Tasks

  • 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.

Setup

Change into the sentiment-analysis folder and perform the following:

Building The Application

mvn clean install

Running The Application

java -jar target/sentiment-analysis-1.0.0.jar To view the page: http://localhost:8080/

Docker Build

docker build -t SentimentAnalysis .

Running with Docker

docker run SentimentAnalysis To view the page: http://localhost:8080/

REST API

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
    }
}