Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

project addition - ML Projects/sentiment_prediction_python_package #178

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vijaytakbhate2002
Copy link

I have added sentiment_prediction_python_package which can be installed with pip command, for more information see below readme.md file


Twitter Sentiment Prediction Python Package

This project focuses on predicting the sentiment of Twitter posts using Natural Language Processing (NLP) techniques. It is an end-to-end machine learning project that includes data preprocessing, model building, hyperparameter tuning, and deployment.


How I built this package

Download code packaging process.pdf

Features

  • ETL Pipeline: Extract, transform, and load (ETL) processes implemented using PySpark and SQL.
  • Text Processing: Cleaned text data using regex, removed special characters, and vectorized text using TF-IDF.
  • Model Building: Implemented Logistic Regression and Multinomial Naive Bayes for sentiment prediction.
  • Hyperparameter Tuning: Optimized models using GridSearchCV.
  • Experiment Tracking: Logged experiments with MLflow for efficient performance comparison.
  • Model Packaging: Prepared reusable model packages using sdist and wheel.
  • Deployment Ready: Plan to host the project on Render for public access.

Installation

  1. Clone the repository:
    git clone https://github.com/vijaytakbhate2002/sentiment_prediction_python_package.git  
  2. Install the package using pip:
    pip install git+https://github.com/vijaytakbhate2002/sentiment_prediction_python_package.git  

Usage

Prediction Example

To predict the sentiment of a Twitter post, you can use the following Python code:

from sentiment_prediction import predict  
predict.predictor("this is a negative tweet")  

This will return:

['Negative']

Sentiment Classes

The prediction function supports four sentiment classes:

  • Positive
  • Negative
  • Neutral
  • Irrelevant

Project Structure

sentiment_prediction_python_package/
│
├── sentiment_prediction/                 # Main package directory
│   ├── config/                           
│   │   └── config.py                     # Configuration file
│   │
│   ├── data_manipulation/                # Model training and prediction scripts
│   │   ├── data_handling.py              # Training pipeline
│   │   ├── data_processing.py            # Prediction pipeline
│   │   └── text_filer.py                 # Text filtering utilities
│   │
│   └── trained_models/                   # Trained models and metadata
│       ├── classifier.pkl                # Classifier model
│       ├── vectorizer.pkl                # Vectorizer model
│       └── encoder.pkl                   # Encoder model
│
├── dist/                                 # Distribution packages (generated)
│
├── build/                                # Build files (generated)
│
├── sentiment_prediction.egg-info/        # Egg-info metadata (generated)
│
├── .gitignore                            # Excluded files and folders
├── MANIFEST.in                           # Configuration file with paths and constants
├── README.md                             # Project documentation
├── requirements.txt                      # Project dependencies
└── setup.py                              # Package metadata and configuration

Contribution

Feel free to submit issues or pull requests. Contributions are welcome!


License

This project is licensed under the MIT License.


Author

Vijay Dipak Takbhate


GitHub Repository: Twitter Sentiment Prediction Python Package


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant