Welcome to the Sentiment Analysis project! This project was developed to demonstrate text processing and classification techniques using machine learning. It aims to classify the sentiment of text data as positive, negative, or neutral.
- Text data preprocessing and cleaning
- Sentiment classification using multiple machine learning models
- Hyperparameter tuning for model optimization
- Ensemble learning for improved accuracy
- Interactive user interface for sentiment prediction
This project demonstrates the following concepts:
- Text Preprocessing: Techniques to clean and prepare text data for analysis.
- Feature Extraction: Transforming text data into numerical features using TF-IDF.
- Model Training and Evaluation: Training multiple machine learning models and evaluating their performance.
- Hyperparameter Tuning: Using GridSearchCV for finding the best model parameters.
- Ensemble Learning: Combining multiple models to improve prediction accuracy.
- Streamlit: Creating an interactive user interface for model predictions.
- TextPreprocessor: Contains methods for cleaning and preprocessing text data, including removing HTML tags, expanding contractions, and lemmatizing words.
- TfidfVectorizer: Converts text data into TF-IDF features for model training.
- NaiveBayesModel: Implements the Multinomial Naive Bayes classifier.
- LogisticRegressionModel: Implements logistic regression with hyperparameter tuning.
- SVMModel: Implements Support Vector Machine with hyperparameter tuning.
- RandomForestModel: Implements Random Forest classifier with hyperparameter tuning.
- EnsembleModel: Combines multiple models using a voting classifier.
To use the Sentiment Analysis system, follow these steps:
- Clone the repository.
- Install the required packages.
- Run the Streamlit application to interact with the system.
- Clone the repository:
git clone https://github.com/Abraam318/sentiment-analysis.git
- Navigate to the project directory:
cd sentiment-analysis
- Run the Streamlit application:
streamlit run app.py
Description: The main interface of the Sentiment Analysis application where users can upload data and select models for sentiment prediction.
Download the dataset used for this project: dataset.csv
We welcome contributions! Please fork the repository and submit a pull request.