Coder Social home page Coder Social logo

lstm_sentiment's Introduction

LSTM sentiment analysis on the Yelp-dataset

This project does sentiment analysis on the yelp-review dataset. This is done by modeling the star rating and the number of votes for the review being cool, funny and helpful as a function of the written text in the review.

The models evaluated are different combinations of recurrent neural networks, embeddings and convolutional neural networks. All the models are implemented in PyTorch.

Visualization

For visualization of training and other data Visdom is used. This means that you have to start a Visdom server before being able to visualize anything.

python -m visdom.server

Settings

A python script called 'settings.py' contains all the parameters that are meant to be modified for different test. This includes the number of epochs of training that should be performed, the learning rate of the optimizer, the model to be used (defined by a dictionary with the model to be used and the parameters for this model), the dataset to be used, if there should be visualization or not etc. The settings script also takes care of parsing of command line arguments for the other scripts and to see what can be set using these just run for example:

python train.py --help

For a list of supported arguments.

Training a model

When the setting have been set properly training a model should be as easy as

python train.py --data-path PATH_TO_TRAIN_DATA

Evaluating model on new data

To evaluate a trained model on new data start by making sure that the model and dataset type in the settings script are the same as the one you want to evaluate.

Then evaluation should be performed through:

python evaluate.py --load-path PATH_TO_CHECKPOINT_OF_MODEL --data-path PATH_TO_EVAL_DATA

Additional potentially useful resources

Pre-trained word embeddings for PyTorch: https://github.com/iamalbert/pytorch-wordemb

lstm_sentiment's People

Contributors

demborg avatar netrome avatar mllemargauxledieu avatar

Watchers

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