This project demonstrates how to use a Simple Recurrent Neural Network (RNN) to classify IMDb movie reviews as positive or negative.
Sentiment analysis is a common task in natural language processing (NLP) that involves determining the emotional tone behind a text. In this project, we use the IMDb dataset, a collection of movie reviews labeled as positive or negative, to train and evaluate a Simple RNN model.
The dataset is part of the TensorFlow/Keras library and can be directly loaded using: python
from tensorflow.keras.datasets import imdbThe Simple RNN model consists of the following layers:
- Embedding Layer: Converts word indices to dense vectors of fixed size.
- Simple RNN Layer: Processes sequences of embeddings to capture temporal dependencies.
- Dense Layer: Fully connected layer with a single neuron and sigmoid activation for binary classification.
- Python 3.8+
- TensorFlow 2.0+
- NumPy
- Matplotlib (optional, for visualization)
- Clone the repository
git clone <url_of_repository>- Select the kernel and run all the files.
- Run main.py using commond
streamlit run main.py
- Enter the movie review & classify it as positive or negative.