Skip to main content

Sentiment Analysis pipeline

Project description

PyPI Version PyPI Downloads

Quick Sentiments

Updates

The package is now live!

!pip install quick-sentiments

Alternatively, you can clone the git and install it locally. (Not recommended, please try the pip install)

git clone https://github.com/AlabhyaMe/quick_sentiments.git

Then run the command in the command prompt or notebook where git is cloned. Make sure you are in the main directory - quick_sentiments

pip install .\dist\quick_sentiments-0.4.3-py3-none-any.whl # please note, sometimes I might not have updated the version number to the  latest

This Python package is designed to streamline natural language processing (NLP) for sentiment analysis. It achieves this by combining various vectorization techniques with machine learning models. The package automates the often complex and time-consuming vectorization process, allowing users to skip the manual coding typically required for this step. Additionally, users can easily select their preferred machine learning models to conduct sentiment analysis.

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)
    • Glove Embedding (25,50,100 and 200)
    • Hugging Face (The module is optional but user have to download the required dependencies themself)
  • Multiple Machine Learning Algorithms:
    • Logistic Regression
    • Random Forest
    • XGBoost
    • Naive Bayesian
    • Neural Network
    • Naive Bayes
    • Tensorflow Models
  • Hyperparameter Tuning Support:
    • All models are compatible with GridSearchCV. Tensorflow has it's own tuning
    • 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.

3. INSTRUCTIONS AND DEMO

To help users get started with this package, I have documented comprehensive instructions and a demo workbook. Please begin by reviewing quick_sentiments.pdf for an introduction to the library's capabilities.

Afterward, proceed to the Demo workbook, which contains ready-to-use examples. Please ensure that your file names and column labels are accurately set before proceeding with the instructions within the workbook. As an alternative, you may directly execute the Python script, provided your files and labels are correctly configured.

Training Data

Place your training CSV file in the demo/training_data folder.

  • It must contain:
    • A column for the raw input text.
    • A column for sentiments

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

📚 Dataset Citation

The demo 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quick_sentiments-0.6.4.tar.gz (2.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

quick_sentiments-0.6.4-py3-none-any.whl (2.6 MB view details)

Uploaded Python 3

File details

Details for the file quick_sentiments-0.6.4.tar.gz.

File metadata

  • Download URL: quick_sentiments-0.6.4.tar.gz
  • Upload date:
  • Size: 2.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for quick_sentiments-0.6.4.tar.gz
Algorithm Hash digest
SHA256 aeb926cab6e4c15389c3f1fef41659f8d8ccd0ad283b3b0ed4c49f7e531d229a
MD5 b1573b4e20a58f1ce33ea8f57dff56df
BLAKE2b-256 9aa3b9bca8e3d5d6a18e290e491022dada93a820843d9d4fd6be4460ef8d8a2f

See more details on using hashes here.

File details

Details for the file quick_sentiments-0.6.4-py3-none-any.whl.

File metadata

File hashes

Hashes for quick_sentiments-0.6.4-py3-none-any.whl
Algorithm Hash digest
SHA256 146d4eb5173af1aa30c649f19fec28dd47c05a550060701eb7d05121d3655ea7
MD5 d2b7bbbc9d0f13d4bccb23ee83a542e8
BLAKE2b-256 7c6be7b7c65b1a14b8c16d8f07b96f0e4e9e5665e2cbb58af81d66c5a8f93fe5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page