All Projects → charlesashby → CharLSTM

charlesashby / CharLSTM

Licence: MIT license
Bidirectional Character LSTM for Sentiment Analysis - Tensorflow Implementation

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to CharLSTM

Contextual Utterance Level Multimodal Sentiment Analysis
Context-Dependent Sentiment Analysis in User-Generated Videos
Stars: ✭ 86 (+75.51%)
Mutual labels:  sentiment-analysis, lstm
Amazon Product Recommender System
Sentiment analysis on Amazon Review Dataset available at http://snap.stanford.edu/data/web-Amazon.html
Stars: ✭ 158 (+222.45%)
Mutual labels:  sentiment-analysis, lstm
Stock Market Prediction Web App Using Machine Learning And Sentiment Analysis
Stock Market Prediction Web App based on Machine Learning and Sentiment Analysis of Tweets (API keys included in code). The front end of the Web App is based on Flask and Wordpress. The App forecasts stock prices of the next seven days for any given stock under NASDAQ or NSE as input by the user. Predictions are made using three algorithms: ARIMA, LSTM, Linear Regression. The Web App combines the predicted prices of the next seven days with the sentiment analysis of tweets to give recommendation whether the price is going to rise or fall
Stars: ✭ 101 (+106.12%)
Mutual labels:  sentiment-analysis, lstm
SentimentAnalysis
Sentiment Analysis: Deep Bi-LSTM+attention model
Stars: ✭ 32 (-34.69%)
Mutual labels:  sentiment-analysis, lstm
LSTM-sentiment-analysis
LSTM sentiment analysis. Please look at my another repo for SVM and Naive algorithem
Stars: ✭ 19 (-61.22%)
Mutual labels:  sentiment-analysis, lstm
Sentiment Analysis Nltk Ml Lstm
Sentiment Analysis on the First Republic Party debate in 2016 based on Python,NLTK and ML.
Stars: ✭ 61 (+24.49%)
Mutual labels:  sentiment-analysis, lstm
Context
ConText v4: Neural networks for text categorization
Stars: ✭ 120 (+144.9%)
Mutual labels:  sentiment-analysis, lstm
Tensorflow Sentiment Analysis On Amazon Reviews Data
Implementing different RNN models (LSTM,GRU) & Convolution models (Conv1D, Conv2D) on a subset of Amazon Reviews data with TensorFlow on Python 3. A sentiment analysis project.
Stars: ✭ 34 (-30.61%)
Mutual labels:  sentiment-analysis, lstm
Pytorch Sentiment Analysis
Tutorials on getting started with PyTorch and TorchText for sentiment analysis.
Stars: ✭ 3,209 (+6448.98%)
Mutual labels:  sentiment-analysis, lstm
Datastories Semeval2017 Task4
Deep-learning model presented in "DataStories at SemEval-2017 Task 4: Deep LSTM with Attention for Message-level and Topic-based Sentiment Analysis".
Stars: ✭ 184 (+275.51%)
Mutual labels:  sentiment-analysis, lstm
Text Classification Keras
📚 Text classification library with Keras
Stars: ✭ 53 (+8.16%)
Mutual labels:  sentiment-analysis, lstm
fsauor2018
基于LSTM网络与自注意力机制对中文评论进行细粒度情感分析
Stars: ✭ 36 (-26.53%)
Mutual labels:  sentiment-analysis, lstm
Twitter Sentiment Analysis
Sentiment analysis on tweets using Naive Bayes, SVM, CNN, LSTM, etc.
Stars: ✭ 978 (+1895.92%)
Mutual labels:  sentiment-analysis, lstm
Dialogue Understanding
This repository contains PyTorch implementation for the baseline models from the paper Utterance-level Dialogue Understanding: An Empirical Study
Stars: ✭ 77 (+57.14%)
Mutual labels:  sentiment-analysis, lstm
Neural Networks
All about Neural Networks!
Stars: ✭ 34 (-30.61%)
Mutual labels:  sentiment-analysis, lstm
Rnn Text Classification Tf
Tensorflow Implementation of Recurrent Neural Network (Vanilla, LSTM, GRU) for Text Classification
Stars: ✭ 114 (+132.65%)
Mutual labels:  sentiment-analysis, lstm
Getting Things Done With Pytorch
Jupyter Notebook tutorials on solving real-world problems with Machine Learning & Deep Learning using PyTorch. Topics: Face detection with Detectron 2, Time Series anomaly detection with LSTM Autoencoders, Object Detection with YOLO v5, Build your first Neural Network, Time Series forecasting for Coronavirus daily cases, Sentiment Analysis with BERT.
Stars: ✭ 738 (+1406.12%)
Mutual labels:  sentiment-analysis, lstm
Lstm Sentiment Analysis
Sentiment Analysis with LSTMs in Tensorflow
Stars: ✭ 886 (+1708.16%)
Mutual labels:  sentiment-analysis, lstm
Multimodal Sentiment Analysis
Attention-based multimodal fusion for sentiment analysis
Stars: ✭ 172 (+251.02%)
Mutual labels:  sentiment-analysis, lstm
sarcasm-detection-for-sentiment-analysis
Sarcasm Detection for Sentiment Analysis
Stars: ✭ 21 (-57.14%)
Mutual labels:  sentiment-analysis, lstm

Bidirectional Character LSTM for Sentiment Analysis

Requirements

  • Python 2.7
  • NLTK (punkt)
  • Tensorflow GPU/CPU version 1.1.0 (NOTE: This code has only been tested to work on this version of Tensorflow!!)

Setup

  • Download the datasets in CharLSTM/datasets
  • Download the Tokenize module of NLTK using nltk.download()
  • Change the PATH variable in data_utils.py and in the model files
  • Install the requirements
cd CharLSTM

# Create virtual environment
virtualenv --python==/path/to/python2.7 venv

# Activate venv
source venv/bin/activate

# Install requirements
pip install -r requirements.txt
  • Train the model you want with python main.py <MODEL_NAME> --train

Using a Pretrained Model

This repository provides a pretrained model for the unidirectional LSTM you can test your own sentences using:

python main.py lstm --sentences 'sentence 1' 'sentence 2' 'etc...'

Model

Results

Both models were trained for more or less 80000 iterations (~ 5 epochs) and achieved similar accuracy on a test set of 80000 tweets.

# (LSTM) Valid loss: 23.50035 -- Valid Accuracy: 0.83613
# (Bidirectional LSTM) Valid loss: 24.41145 -- Valid Accuracy: 0.82714
# Some examples...
# "cant believe i still have to write an essay..", yielded (pos/neg): 0.03065/0.96935, pred: neg
#
# "Why are you concerned with people leaking information youve declassified?" , yielded (pos/neg):
#  0.04639/0.95361, pred: neg
# 
# "Virus is going in reverse now, god my guts hurt", yielded (pos/neg): 0.09748/0.90252, pred: neg
# However, it still has problem with sarcasm:
# "his bravery?  Haha, you have to be kidding.", yielded (pos/neg): 0.73277/0.26723, pred: pos

You can read the tutorial here.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].