The objective of this project is to perform sentiment analysis on text data. Given a sentence, the project classifies whether the sentence expresses positive or negative sentiment. Sentiment analysis is a natural language processing (NLP) task used to understand the emotional tone of text, making it valuable in various applications such as customer reviews, social media analysis, and more.
🎓 Capstone Project - Data Analytics Program with Azubi Africa
This project is the culmination of a 9-month Data Analytics program with Azubi Africa. It aims to analyze movie reviews and classify them into one of three sentiment categories: positive, negative, or neutral. Leveraging Deep Learning and Natural Language Processing (NLP) techniques, it provides sentiment predictions for movie reviews. A model trained to determine the sentiments is made accessible through Gradio and Streamlit interfaces for user interaction. Additionally, the model is hosted on the Hugging Face Model Hub for broader accessibility and collaboration within the data science community. Deployment is streamlined using Docker for consistent performance across environments
Below is a preview showcasing the app's interface.
👉❗ Gradio App is available for interaction on this url ❗
👉❗ Streamlit App is available for interaction on this url ❗
- Data Collection: Gathered a balanced dataset of movie reviews with sentiment labels.
- EDA: Conducted comprehensive exploratory data analysis to gain insights.
- Data Preprocessing: Leveraged NLP tools to clean and prepare text data for modeling.
- Model Training: Trained various machine learning models for sentiment classification.
- Model Evaluation: Assessed model performance with accuracy, precision, recall, and more.
- Hyperparameter Tuning: Optimized models using grid search and cross-validation.
- App Deployment: Deployed a user-friendly sentiment analysis app on Gradio.
- Docker Containerization: Containerized the app for easy distribution and deployment.
To set up and run the project:
- Clone the repository:
git clone '<https://github.com/Israel-Anaba/Movie_Review_Analysis.git>'
2. Navigate to the project directory:
```bash
cd movie-sentiment-analysis
-
Create a virtual environment (optional but recommended) It's recommended to isolate project dependencies, which helps prevent conflicts with system-wide Python packages.:
python -m venv venv
-
Activate the virtual environment:
- On Windows:
venv\Scripts\activate
- On macOS and Linux:
source venv/bin/activate
- On Windows:
-
Install project dependencies:
pip install -r requirements.txt
-
Explore the Jupyter notebooks for data analysis, model training, and experimentation.
-
Run the Gradio app for real-time sentiment analysis:
python src/app.py
-
Run the Streamlit app for real-time sentiment analysis:
streamlit run src/app_streamlit.py
🚥 NOTE: You can run the notebooks outside the venv
- Launch the Gradio App: Start the Gradio app by running
python app.py. - Analyze Reviews: Input movie reviews to receive real-time sentiment predictions.
- Customize and Experiment: Modify hyperparameters, customize the pipeline, or fine-tune models to suit your needs.
First create a Dockerfile, check documention : Docker Official Documentation - Dockerfile reference
Dockerize the application with the following commands:
# Build the Docker image
docker build -t movie-sentiment-prediction-app .
# Run the Docker container
docker run -p 7860:7860 --name movie-review-sentiment movie-sentiment-prediction-appThe APP was further deployed on huggingface. You can interact with the app via huggingface following the steps below.
- To access the moview review sentiment prediction app, you will need to be signed in to Hugging Face:
- If you don't have a Hugging Face account, you can sign up for free at . Hugging Face.
- After signing in, you can access the app using the link below: 🔔 ❗🤖Movie-Review-Analysis-Gradio❗ 🔔 ❗🤖Movie-Review-Analysis-Streamlit❗
Please note that you need to be signed in to Hugging Face to utilize this service. If you encounter any issues or have questions, feel free to checkout the huggingface documentation Huggingface Documentation for assistance.
This project was developed during the Azubi Africa Data Science Training. Find in the provided link an article covering interesting findings from the project.
| Name | Article |
|---|---|
| Israel Anaba Ayamga | Mastering Sentiment Analysis: A Data Science Project with Azubi Africa |
Contributions are welcome! Feel free to open an issue or submit a pull request.
Here are a few recommended resources to help you gain a solid understanding of the frameworks used in the project:
❗Get to know about Hugging Face
I would like to express my gratitude to the Azubi Africa Data Analyst Program for their support and for offering valuable projects as part of this program. Not forgeting my scrum masters on this program Rachel Appiah-Kubi & Emmanuel Koupoh
This project is open-source and available under the MIT License.
Feel free to reach out to us with any questions or feedback!
📧 Contact: Israel Anaba Ayamga


