Giter Site home page Giter Site logo

maulberto3 / movie-review-sentiment-analysis-lstm-pytorch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lukysummer/movie-review-sentiment-analysis-lstm-pytorch

0.0 0.0 0.0 11.57 MB

Classifying movie reviews as positive or negative using Word2Vec Embeddings & LSTM network

Python 100.00%

movie-review-sentiment-analysis-lstm-pytorch's Introduction

Sentiment Analysis of Movie Reviews w/ Word2Vec & LSTM (PyTorch)

This is my implementation of Sentiment Analysis using Long-Short Term Memory (LSTM) Network. The code performs:

  1. Loading and pre-processing raw reviews & labels data
  2. Building a deep neural network including Word2Vec embeddings and LSTM layers
  3. Test the performance of the model in classifying a random review as postive or negative.

Main Components of the Network

I. Word2Vec Embedding - used to reduce dimensionality, as there are tens of thousands of words in the entire vocabulary of all reviews. Each of those words are represented as vectors in 400-dimension space.

II. LSTM Layers - used to look at the review texts as the sequence of inputs, rather than individual, in order to take advantage of the bigger context of the text.

Repository

This repository contains:

  • sentiment_analysis_LSTM.py : Complete code for implementing the sentiment analysis of movie reviews using LSTM network
  • data folder : includes reviews.txt (contains all reivews) & labels.txt (contains all corresponding labels)

List of Hyperparameters Used:

  • Batch Size = 50
  • Sequence Length for Movie Reviews = 200
  • Embedding Dimension = 400
  • Number of hidden nodes in LSTM = 256
  • Number of LSTM Layers = 2
  • Learning Rate = 0.001
  • Gradient Clip Maximum Threshold= 5
  • Number of Epochs = 4

Sources

I referenced the following sources for building & debugging the final model :

movie-review-sentiment-analysis-lstm-pytorch's People

Contributors

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