- About the Project
- Features
- Technologies Used
- Directory Structure
- Getting Started
- Usage
- License
- Contact
This is a Sentiment Analysis Web Application that allows users to analyze the sentiment of text inputs (e.g., tweets). The app uses a machine learning model built with scikit-learn
to classify text as positive or negative. Users can interact with the model via a modern, minimalistic frontend designed for simplicity and ease of use.
This application can be deployed locally or using Docker, and it's set up to be easily accessible through Docker Hub for streamlined deployment.
--view live at:- https://sentiment-analysis-uyeg.onrender.com/
- Sentiment Analysis: Classify input text into positive, negative, or neutral sentiment.
- User-Friendly Interface: Clean, modern UI built with HTML and CSS for intuitive usage.
- Containerized Deployment: Easily deploy the application via Docker with minimal configuration.
- Pre-trained Model: Model pre-trained with sklearn and saved using Joblib for quick loading and inference.
- Python 3.10
- Flask - Web Framework
- scikit-learn - Machine Learning Library
- Joblib - For saving and loading ML models
- Docker - Containerization for easy deployment
- HTML & CSS - Frontend design
sentiment-analysis
│app
├── app.py # Main Flask application
├── requirements.txt # Python dependencies
├── Dockerfile # Docker configuration file
│
├── templates/
│ └── index.html # Frontend HTML file
│
└── static/
├── css/
│ └── style.css # Styling for the frontend
-
Clone the repository:
git clone https://github.com/Aafimalek/sentiment-analysis.git cd sentiment-analysis
-
Set up a virtual environment (optional but recommended):
python3 -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
To run the application locally without Docker:
-
Make sure all dependencies are installed.
-
Start the Flask app:
python app.py
-
Open your browser and go to http://localhost:8080 to view the application.
-
Make sure Docker is installed on your machine.
-
Build the Docker image:
docker build -t aafimalek2032/sentiment-analysis .
Run the container using:
docker run -p 8080:8080 aafimalek2032/sentiment-analysis
Now, the application should be accessible at http://localhost:8080.
-
Log in to Docker Hub:
docker login
-
Tag and push the image:
docker tag aafimalek2032/sentiment-analysis aafimalek2032/sentiment-analysis:latest docker push aafimalek2032/sentiment-analysis:latest
Now, your image is available on Docker Hub at aafimalek2032/sentiment-analysis
.
- Enter the text you want to analyze in the input field.
- Click Analyze to get the sentiment classification.
- The result will show whether the sentiment is Positive or Negative.
Distributed under the MIT License. See LICENSE
for more information.