Skip to content

This project focuses on building a sentiment analysis model using Recurrent Neural Networks (RNNs) for classifying movie reviews as either positive or negative

Notifications You must be signed in to change notification settings

MarcLinderGit/Sentiment_RNN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Sentiment Analysis with Recurrent Neural Networks

Introduction

Sentiment analysis, also known as opinion mining, is a natural language processing task that involves determining the sentiment expressed in a piece of text. This project focuses on building a sentiment analysis model using Recurrent Neural Networks (RNNs) for classifying movie reviews as either positive or negative.

Objective

The primary goal of this project is to create a model capable of accurately predicting sentiment in movie reviews. The model is trained on a dataset of labeled movie reviews, learning the nuances of language and context associated with positive and negative sentiments.

Model Architecture

The sentiment analysis model is constructed using an RNN architecture, specifically a Long Short-Term Memory (LSTM) network. LSTMs are well-suited for sequence data, making them effective for capturing dependencies and patterns in textual information over time. The architecture includes an embedding layer for word representation, LSTM layers for sequence modeling, and a fully connected layer with a sigmoid activation for binary classification.

Dataset

The dataset used for training and evaluation consists of movie reviews labeled with sentiment polarity. Each review is preprocessed and tokenized to create a numerical representation that the model can process. The dataset is split into training, validation, and test sets to ensure robust evaluation of the model's performance.

Training Process

The model is trained using a binary cross-entropy loss function and optimized with the Adam optimizer. During training, the model undergoes backpropagation to adjust its parameters based on the calculated loss. To prevent overfitting, dropout layers are incorporated. The training process is monitored through both training and validation loss.

Evaluation

The trained model is evaluated on a separate test set to assess its generalization to unseen data. Performance metrics such as test loss and accuracy are calculated to gauge the effectiveness of the sentiment analysis model.

Inference on New Reviews

The notebook includes a function for making predictions on new reviews. Users can input a movie review, and the model will provide a sentiment prediction, indicating whether the review is likely positive or negative.

About

This project focuses on building a sentiment analysis model using Recurrent Neural Networks (RNNs) for classifying movie reviews as either positive or negative

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages