A Streamlit web app for analyzing movie reviews and classifying them as positive or negative using a pre-trained RNN model built with TensorFlow and Keras on the IMDb dataset.
This project allows users to input any movie review text and receive a real-time sentiment prediction.
It uses a simple Recurrent Neural Network (RNN) trained on the IMDb movie review dataset.
The web interface is built with Streamlit for a fast, clean, and easy user experience.
- Text Input: Users can input any movie review.
- Sentiment Prediction: Classifies the review as Positive or Negative.
- Prediction Score: Shows the model's confidence score for the prediction.
- Real-time Analysis: Quick response via a lightweight Streamlit interface.
- Python
- TensorFlow / Keras
- Streamlit
- IMDb Dataset (Keras built-in)
- The app loads a pre-trained RNN model (
simple_rnn_imdb.h5). - User input is preprocessed by:
- Tokenizing words based on IMDb's word index.
- Padding the sequence to a fixed length (500).
- The processed text is passed to the model for sentiment prediction.
- Displays whether the review is Positive or Negative along with the confidence score.
-
Clone this repository:
git clone https://github.com/your-username/review-analysis-system.git cd review-analysis-system -
Install the required packages:
pip install tensorflow streamlit
-
Make sure you have the pre-trained model file:
simple_rnn_imdb.h5should be present in the project folder.
-
Run the Streamlit app:
streamlit run app.py
-
Open the app in your browser at:
http://localhost:8501
βββ app.py # Main Streamlit application
βββ simple_rnn_imdb.h5 # Pre-trained RNN model
βββ README.md # Project documentation- Add live review scraping (e.g., from Rotten Tomatoes or IMDb).
- Improve preprocessing with punctuation removal and stopword filtering.
- Deploy online using platforms like Streamlit Cloud or AWS.
Pull requests are welcome!
If you find any bugs or want to add features, feel free to open an issue or submit a pull request.
This project is open source under the MIT License.
If you like this project, please β star the repo β it really helps!