Skip to content

Repository files navigation

🚀 Movie_Review_Analysis 👍 👎 ⚖️

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.

Deep Learning NLP Gradio Python 3.11 MIT License Jupyter Notebook Docker Hugging Face Deployment Open Source Love png1

About 📚

🎓 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

Preview 👁️

Below is a preview showcasing the app's interface.

Prev

👉❗ Gradio App is available for interaction on this url

Prev1

👉❗ Streamlit App is available for interaction on this url

Notable Features 🌟

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

Setup 🛠️

To set up and run the project:

  1. 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
  1. 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
  2. Activate the virtual environment:

    • On Windows:
      venv\Scripts\activate
    • On macOS and Linux:
      source venv/bin/activate
  3. Install project dependencies:

    pip install -r requirements.txt
  4. Explore the Jupyter notebooks for data analysis, model training, and experimentation.

  5. Run the Gradio app for real-time sentiment analysis:

    python src/app.py
  6. Run the Streamlit app for real-time sentiment analysis:

   streamlit run src/app_streamlit.py

🚥 NOTE: You can run the notebooks outside the venv

Usage 🚀

  1. Launch the Gradio App: Start the Gradio app by running python app.py.
  2. Analyze Reviews: Input movie reviews to receive real-time sentiment predictions.
  3. Customize and Experiment: Modify hyperparameters, customize the pipeline, or fine-tune models to suit your needs.

Dockerization 📦

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-app

Deployment 🌐

The 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:
  1. If you don't have a Hugging Face account, you can sign up for free at . Hugging Face.
  2. 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.

Author 📖 🧑‍🎓

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

Contributing 🤝

Contributions are welcome! Feel free to open an issue or submit a pull request.

Resources 📚

Here are a few recommended resources to help you gain a solid understanding of the frameworks used in the project:

Get started with Gradio

Get started with Streamlit

Get to know about Hugging Face

More on Docker

Acknowledgement 🥇

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

License 📜

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

About

The project's goal is to analyze text sentiment, determining whether a given sentence conveys a positive or negative sentiment.

Topics

Resources

Stars

Watchers

Forks

Used by

Contributors

Languages