Welcome to the Sentiment Analysis Web Application! This Python-based application leverages machine learning models to analyze and predict the sentiment of text input by users. Whether you're curious about how different texts are perceived or looking to incorporate sentiment analysis into your project, this tool is here to help.
- Model Choice: Select between Logistic Regression and Neural Network models.
- Real-Time Sentiment Prediction: Get instant feedback on whether the sentiment of your text is positive or negative.
- Simple UI: Easy-to-navigate interface for a seamless user experience.
- Backend: Flask
- Machine Learning: Scikit-Learn, NLTK
- Frontend: HTML, CSS
- Data Handling: Joblib for model and vectorizer serialization
To get this project up and running on your local machine:
-
Clone the Repository:
git clone https://github.com/yashshah9/Sentiment-Analysis.git cd Sentiment-Analysis -
Set Up a Virtual Environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install Dependencies:
pip install -r requirements.txt
-
Download Models and Vectorizer:
- Ensure you have the pre-trained models (
model_lr.pkl,model_nn.pkl) and vectorizer (vectorizer.pkl) in the project directory.
- Ensure you have the pre-trained models (
-
Run the Application:
python app.py
-
Open Your Browser:
Go to http://127.0.0.1:5000/ to start using the app.
- Choose a Model: Pick either Logistic Regression or Neural Network from the dropdown menu.
- Enter Text: Type or paste the text you want to analyze.
- Click "Predict": Receive instant sentiment analysis and view the result.
Model Used: Logistic Regression
Sentiment: Positive
Contributions are welcome! To contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature/YourFeature). - Make your changes and commit (
git commit -am 'Add new feature'). - Push the branch (
git push origin feature/YourFeature). - Open a pull request.
Thank you for checking out this project! We hope you find it useful. 🌟