Sentiment Analysis pipeline
Project description
๐ฌ Sentiment Analysis Pipeline
This repository hosts an easy-to-use, ready-made Sentiment Analysis pipeline designed to get you started quickly with classifying text data. Everything you need, from data preprocessing to model training and prediction, is set up and configured.
โจ Features
- End-to-End Pipeline: Go from raw text to sentiment predictions with minimal setup.
- Automated Preprocessing: Includes robust text cleaning:
- Lemmatization
- Stop word removal
- Punctuation handling
- URL/emoji/HTML removal, etc.
- Multiple Text Representation Methods:
- Bag-of-Words (BoW)
- Term Frequency (TF)
- TF-IDF (Term Frequency-Inverse Document Frequency)
- Word Embeddings (Word2Vec - pre-trained Google News 300-dim model)
- Multiple Machine Learning Algorithms:
- Logistic Regression
- Random Forest
- XGBoost
- Hyperparameter Tuning Support:
- All models are compatible with GridSearchCV.
- By default, models run with standard parameters for quick testing.
- Grid search options are built-in and ready to use if needed.
- Modular Design: Each component is cleanly separated into its own module.
- Prediction on New Data: Easily apply your trained model to new, unseen data.
๐ Getting Started
Follow these steps to get your sentiment analysis pipeline up and running:
1. Prerequisites
- Git: For cloning the repository.
- Python 3.8+ (Recommended: Anaconda for environment management)
- Anaconda/Miniconda: Strongly recommended
2. Clone the Repository
git clone https://github.com/AlabhyaMe/Sentimental-Analysis-.git
cd Sentimental-Analysis-
conda create -n sentiment_env python=3.9
conda activate sentiment_env
pip install -r requirements.txt
This project is setup in the follwing pipeline
โโโ Training Data/
โ โโโ train.csv # Your training file
โโโ New Data/
โ โโโ new_texts.csv # Your new prediction file
โโโ MLAlgo/
โ โโโ logistic_regression_model.py
โ โโโ random_forest_model.py
โ โโโ xgboost_model.py
โโโ Vect/
โ โโโ bag_of_words_vectorizer.py
โ โโโ tfidf_vectorizer.py
โ โโโ word_embedding_vectorizer.py
โโโ preprocessing.py # Text cleaning functions
โโโ sentiment_analysis_main.ipynb # Full training + prediction notebook
โโโ sentiment_prediction.ipynb # Quick prediction-only notebook
โโโ requirements.txt
โโโ README.md
3. Prepare Your Data
๐ Training Data
Place your training CSV file in the Training Data/ folder.
- It must contain:
- A column named
Responseโ for the raw input text. - A column named
Sentimentโ for sentiment labels (e.g.,"Positive","Negative","Neutral").
- A column named
๐ New Data for Prediction
Place your new prediction CSV file in the New Data/ folder.
- It must contain:
- A column named
RawTextColumn(or another name you configure in the notebook).
- A column named
๐ Dataset Citation
This project uses publicly available training data from:
Madhav Kumar Choudhary. Sentiment Prediction on Movie Reviews. Kaggle.
https://www.kaggle.com/datasets/madhavkumarchoudhary/sentiment-prediction-on-movie-reviews
Accessed on: 2025- 07-15
If you use this dataset in your own work, please cite the original creator as per Kaggle's Terms of Use.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file quick_sentiments-0.2.0.tar.gz.
File metadata
- Download URL: quick_sentiments-0.2.0.tar.gz
- Upload date:
- Size: 2.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ff50a390936a3de569ee0b92d3b85a22cd33573e27aa47ffa0c266b7d868965
|
|
| MD5 |
ff9185f4f6bb61129997db9bfff1a2da
|
|
| BLAKE2b-256 |
493cfacfc644e09af91f3dce19a27a0df69e8845a7fabd9e77d6a3d3ef4abfa8
|
File details
Details for the file quick_sentiments-0.2.0-py3-none-any.whl.
File metadata
- Download URL: quick_sentiments-0.2.0-py3-none-any.whl
- Upload date:
- Size: 2.6 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2201c8f140bb0d89b98ed1c3cc58f9af0aaf734d3192dbe46e24cc9ee79d8a2c
|
|
| MD5 |
66f52149d8772dccaa6f60cd0f733c28
|
|
| BLAKE2b-256 |
feec36673cd01e258236c86511948f4c25b4401ad370933c120bd94761c240e2
|