Giter VIP home page Giter VIP logo

template-sentiment-analysis's Introduction

Sentiment Analysis Template

Given a sentence, return a score between 0 and 4, indicating the sentence's sentiment. 0 being very negative, 4 being very positive, 2 being neutral.

The engine uses the stanford CoreNLP library and the Scala binding gangeli/CoreNLP-Scala for parsing.

Versions

v0.1.0

  • initial version

import sample data

$ python data/import_eventserver.py --access_key <your_access_key> --file data/train.tsv

The sample training data comes from https://www.kaggle.com/c/sentiment-analysis-on-movie-reviews. It is a tsv file. Each line contains 4 data, PhraseId, SentenceId, Phrase and Sentiment.

For example,

1	1	bad	1

Step to build, train and deploy the engine

$ pio build && pio train && pio deploy

Query

The query takes a String s. The result contains a Double called sentiment.

normal:

$ curl -H "Content-Type: application/json" \
-d '{
  "s" : "I am happy"
  }' \
http://localhost:8000/queries.json \
-w %{time_connect}:%{time_starttransfer}:%{time_total}

{"sentiment":3.0714285712172384}0.005:0.027:0.027
$ curl -H "Content-Type: application/json" \
-d '{
  "s" : "This movie sucks!"
  }' \
http://localhost:8000/queries.json \
-w %{time_connect}:%{time_starttransfer}:%{time_total}

{"sentiment":0.8000000001798788}0.005:0.031:0.031

template-sentiment-analysis's People

Contributors

whhone avatar cailurus avatar

Watchers

James Cloos avatar Tristan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.