PROJECT 02 — NLP / CLASSIFICATION

Sentiment Analysis

Natural language processing pipeline converting noisy tweet streams into feature vectors using TF-IDF and Logistic Regression.

VIEW SOURCE ON GITHUB ↗
JUNE 2025
PYTHON · SCIKIT-LEARN · NLTK · TF-IDF
KAGGLE TWITTER DATASET
~70% TEST ACCURACY

01. Executive Overview

Social media content on Twitter is unstructured, contains heavy slang, contractions, and noisy punctuation. The goal of this project was to build a clean preprocessing and feature engineering pipeline to accurately categorize tweets into Positive, Neutral, or Negative sentiment buckets using Logistic Regression.

02. Model Performance & Precision Matrix

The model achieved ~70% test accuracy across the three sentiment class labels. Below is the multi-class classification precision breakdown:

Class Wise Precision Breakdown (%)
[REAL PROJECT DATA REQUIRED] Evaluated metric ~70% accuracy per source specification.

03. Preprocessing & Feature Pipeline

The NLP pipeline executes the following stages:

  1. Regex cleaning (removing URLs, @user handles, hashtags, and special characters)
  2. Lowercasing & stop-word removal using NLTK
  3. POS tagging & WordNet lemmatization
  4. TF-IDF vectorization ($N$-gram range $(1, 2)$, max features $5,000$)

04. Interactive Deployment

A lightweight Streamlit application enables live inference — allowing users to enter custom text strings or tweets and instantly view predicted sentiment class probabilities.