All Projects → MuhammedBuyukkinaci → Tensorflow Sentiment Analysis On Amazon Reviews Data

MuhammedBuyukkinaci / 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.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Tensorflow Sentiment Analysis On Amazon Reviews Data

Rnn Text Classification Tf
Tensorflow Implementation of Recurrent Neural Network (Vanilla, LSTM, GRU) for Text Classification
Stars: ✭ 114 (+235.29%)
Mutual labels:  lstm, text-classification, sentiment-analysis, gru
Sentiment-analysis-amazon-Products-Reviews
NLP with NLTK for Sentiment analysis amazon Products Reviews
Stars: ✭ 37 (+8.82%)
Mutual labels:  sentiment-analysis, text-classification, lstm-neural-networks, sentiment-classification
Context
ConText v4: Neural networks for text categorization
Stars: ✭ 120 (+252.94%)
Mutual labels:  lstm, text-classification, sentiment-analysis, sentiment-classification
sarcasm-detection-for-sentiment-analysis
Sarcasm Detection for Sentiment Analysis
Stars: ✭ 21 (-38.24%)
Mutual labels:  sentiment-analysis, text-classification, lstm
Pytorch Sentiment Analysis
Tutorials on getting started with PyTorch and TorchText for sentiment analysis.
Stars: ✭ 3,209 (+9338.24%)
Mutual labels:  lstm, sentiment-analysis, sentiment-classification
TensorFlow-Multiclass-Image-Classification-using-CNN-s
Balanced Multiclass Image Classification with TensorFlow on Python.
Stars: ✭ 57 (+67.65%)
Mutual labels:  tensorflow-tutorials, tensorflow-experiments, low-level
Dog-or-Cat-TensorflowSharp-Example
An example for TensorflowSharp - classify an image as a dog or cat.
Stars: ✭ 15 (-55.88%)
Mutual labels:  tensorflow-tutorials, tensorflow-experiments, tensorflow-examples
Text tone analyzer
Система, анализирующая тональность текстов и высказываний.
Stars: ✭ 15 (-55.88%)
Mutual labels:  sentiment-analysis, text-classification, sentiment-classification
OCR
Optical character recognition Using Deep Learning
Stars: ✭ 25 (-26.47%)
Mutual labels:  lstm, tensorflow-experiments, lstm-neural-networks
SentimentAnalysis
Sentiment Analysis: Deep Bi-LSTM+attention model
Stars: ✭ 32 (-5.88%)
Mutual labels:  sentiment-analysis, lstm, sentiment-classification
NTUA-slp-nlp
💻Speech and Natural Language Processing (SLP & NLP) Lab Assignments for ECE NTUA
Stars: ✭ 19 (-44.12%)
Mutual labels:  sentiment-analysis, lstm-neural-networks, sentiment-classification
NewsMTSC
Target-dependent sentiment classification in news articles reporting on political events. Includes a high-quality data set of over 11k sentences and a state-of-the-art classification model.
Stars: ✭ 54 (+58.82%)
Mutual labels:  sentiment-analysis, text-classification, sentiment-classification
Multimodal Sentiment Analysis
Attention-based multimodal fusion for sentiment analysis
Stars: ✭ 172 (+405.88%)
Mutual labels:  lstm, sentiment-analysis, sentiment-classification
Pytorch Kaldi
pytorch-kaldi is a project for developing state-of-the-art DNN/RNN hybrid speech recognition systems. The DNN part is managed by pytorch, while feature extraction, label computation, and decoding are performed with the kaldi toolkit.
Stars: ✭ 2,097 (+6067.65%)
Mutual labels:  lstm, lstm-neural-networks, gru
ML2017FALL
Machine Learning (EE 5184) in NTU
Stars: ✭ 66 (+94.12%)
Mutual labels:  sentiment-analysis, text-classification, sentiment-classification
COVID-19-Tweet-Classification-using-Roberta-and-Bert-Simple-Transformers
Rank 1 / 216
Stars: ✭ 24 (-29.41%)
Mutual labels:  sentiment-analysis, text-classification, sentiment-classification
Contextual Utterance Level Multimodal Sentiment Analysis
Context-Dependent Sentiment Analysis in User-Generated Videos
Stars: ✭ 86 (+152.94%)
Mutual labels:  lstm, sentiment-analysis, lstm-neural-networks
Pytorch Rnn Text Classification
Word Embedding + LSTM + FC
Stars: ✭ 112 (+229.41%)
Mutual labels:  lstm, text-classification, gru
Tensorflow-Wide-Deep-Local-Prediction
This project demonstrates how to run and save predictions locally using exported tensorflow estimator model
Stars: ✭ 28 (-17.65%)
Mutual labels:  tensorflow-tutorials, tensorflow-experiments, tensorflow-examples
Gradient-Samples
Samples for TensorFlow binding for .NET by Lost Tech
Stars: ✭ 53 (+55.88%)
Mutual labels:  lstm, tensorflow-tutorials, tensorflow-examples

TensorFlow-Sentiment-Analysis-on-Amazon-Reviews-Data

Implementing different RNN(GRU & LSTM) models on a subset of Amazon Reviews data.

Requirements

pip3 install -r requirements.txt

Pre-trained Word Embeddings

I used 100-Dimensional GloVe Word Embeddings for this project.

You can download it from here.

After downloading, glove.6B.100d.txt must be in where .py files are.

Default Version

If you have GPU, use 02_CUDNN_GRU.py or 06_CUDNN_LSTM.py as default .

If you don't have, use 04_CPU_Optimized_GRU.py or 08_CPU_Optimized_LSTM.py as default.

Training

python3 01_Baseline_GPU.py

python3 02_CUDNN_GRU.py

python3 03_CUDNN_GRU_bidirectional.py

python3 04_CPU_Optimized_GRU.py

python3 05_Baseline_LSTM.py

python3 06_CUDNN_LSTM.py

python3 07_CUDNN_LSTM_bidirectional.py

python3 08_CPU_Optimized_LSTM.py

python3 09_CONV1D_CUDNNGRU.py

python3 10_CONV2D.py

python3 11_Attention_GRU.py

python3 12_Attention_CUDNNGRU.py

python3 13_Attention_CUDNNGRU_bidirectional.py

Dataset

Dataset used in this project is a subset of Amazon Reviews.

Train dataset has 150k rows.

Test dataset has 30k rows.

Output classes are positive and negative (Binary Classification).

The models were trained on train dataset and validated on test dataset.

Models

01_Baseline_GRU.py --> Base GRU implementation.

02_CUDNN_GRU.py --> GPU optimized CUDNNGRU implementation.

03_CUDNN_GRU_bidirectional.py --> GPU optimized CUDNNGRU bidirectional implementation.

04_CPU_Optimized_GRU.py --> CPU optimized GRU implementation.

05_Baseline_LSTM.py --> Base LSTM implementation.

06_CUDNN_LSTM.py --> GPU optimized CUDNNLSTM implementation.

07_CUDNN_LSTM_bidirectional.py --> GPU optimized CUDNNLSTM bidirectional implementation.

08_CPU_Optimized_LSTM.py --> CPU optimized LSTM implementation.

09_CONV1D_CUDNNGRU.py --> CONV1D BEFORE CUDNNGRU implementation

10_CONV2D.py ---> CONV2D implementation before fully connected layers.

11_Attention_GRU.py ---> Attention Layer including GRU implementation

12_Attention_CUDNNGRU.py ---> Attention Layer including CUDNNGRU implementation

13_Attention_CUDNNGRU_bidirectional.py ---> Attention Layer including Bidirectional CUDNNGRU implementation

Early Stopping

I defined a customized function to check if loss is decreasing on test data.

If it isn't decreasing for a time period, the model stops to train.

#Defining a function for early stopping
def early_stopping_check(x):
    if np.mean(x[-20:]) <= np.mean(x[-80:]):
        return True
    else:
        return False

Results

results

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