GithubHelp home page GithubHelp logo

karimkhanp / sentiment-web Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vivekn/sentiment-web

0.0 2.0 0.0 23.88 MB

Web interface to sentiment analyzer.

License: BSD 2-Clause "Simplified" License

Python 56.02% JavaScript 2.77% CSS 0.45% HTML 40.76%

sentiment-web's Introduction

Sentiment

This tool works by examining individual words and short sequences of words (n-grams) and comparing them with a probability model. The probability model is built on a prelabeled test set of IMDb movie reviews. It can also detect negations in phrases, i.e, the phrase "not bad" will be classified as positive despite having two individual words with a negative sentiment. The web service uses a coroutine server based on gevent, so that the trained database can be loaded into shared memory for all requests, which makes it quite scalable and fast. The API is specified here, it supports batch calls so that network latency isn't the main bottleneck.

You can read more about the details of the model in this paper . The code for the training module is also open source and available on Github .

AUTHOR: Vivek Narayanan < [email protected] >

LICENSE: BSD

Setting up the API endpoint

Setting up the server is a fairly straightforward task, here are the steps:

  1. Install pip, the python package manager.
  2. cd to the directory containing the sentiment code and run pip install -r requirements.txt . This will install the dependencies.
  3. Install redis and start the program redis-server. Eg: redis-server --daemonize yes. Redis is used here only for tracking/stats purposes, if you don't want it remove all references to redis in the code.
  4. Finally, create a file called "config.py" and set the parameters as in the example below.
    HOST="http://ec2-54-xxxx.us-west-2.compute.amazonaws.com" 
    PORT=80 
    STATS_KEY="sentiment_stats" 
    RHOST=''
    RPORT=6379 
    RPASS=None

HOST and PORT refer to where you want to host the python server STATS_KEY is the prefix used for the redis entries, RHOST, RPORT are RPASS are the host, port and password of the redis server.

Run the server by executing the command nohup python run.py &

sentiment-web's People

Contributors

vivekn avatar

Watchers

James Cloos avatar Karimkhan 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.