CoolFace
Apppublic

krish5932/Customer-FeedBack-System

sourceHugging Faceupdated 4mo agoView on Hugging Face
0likes
App README

Smart Customer Feedback & Topic Clustering Dashboard

A premium, interactive Natural Language Processing (NLP) dashboard built with Streamlit to analyze customer reviews, classify sentiment, group reviews into unsupervised topic clusters, and evaluate machine learning models.


๐Ÿš€ Key Features

1. Advanced NLP text Preprocessing

  • โ€”Contraction Expansion: Maps contractions (e.g. "don't" $\rightarrow$ "do not", "can't" $\rightarrow$ "cannot") before cleaning.
  • โ€”Negation Preservation: Preserves sentiment-critical negation terms (e.g., "not", "no", "never", "nor") from stopword stripping, ensuring phrases like "not good" are classified correctly.
  • โ€”Lemmatization: Standardizes words to their dictionary forms using NLTK's WordNetLemmatizer.

2. Multi-Model Sentiment Classification

  • โ€”Choose between three popular classifiers from Scikit-Learn:
  • โ€”Logistic Regression (Balanced class weights)
  • โ€”Linear Support Vector Classifier (LinearSVC) (Calibrated for probability estimation)
  • โ€”Multinomial Naive Bayes
  • โ€”Tune hyperparameters (Regularization strength $C$, Smoothing $\alpha$) directly from the sidebar.

3. Model Performance & Diagnostics

  • โ€”Evaluates classifiers on an 80/20 train-test split to report realistic, unbiased out-of-sample accuracy.
  • โ€”Generates a Seaborn Confusion Matrix Heatmap showing true vs. predicted sentiment frequencies.
  • โ€”Renders a detailed Classification Report table outlining Precision, Recall, and F1-score for positive, negative, and neutral classes.

4. Topic Clustering & Silhouette Optimization

  • โ€”Vectorizes feedback using TF-IDF (unigrams & bigrams).
  • โ€”Uses K-Means Clustering to discover hidden topic groups.
  • โ€”Projects the high-dimensional document vectors into a 2D space using PCA (Principal Component Analysis) for spatial visualization.
  • โ€”Cluster Count Optimizer: Runs an on-demand Silhouette Score Analysis for $K \in [2, 8]$ and graphs the score. The peak value suggests the mathematically optimal number of topics for the active dataset.

5. Live NLP Pipeline Tester

  • โ€”Run the entire NLP pipeline interactively.
  • โ€”Input custom reviews and instantly view:
  • โ€”Preprocessed tokens side-by-side with original text.
  • โ€”Sentiment predictions and confidence breakdown.
  • โ€”Topic assignment and keywords.
  • โ€”Visual projection of the entry (marked by a star) in 2D semantic space.

๐Ÿ› ๏ธ Installation & Setup

Prerequisites

  • โ€”Python 3.8 or higher

Steps

  1. 1.Clone the repository:
bash
   git clone https://github.com/krishjuit/Customer-Feedback-System.git
   cd Customer-Feedback-System
  1. 1.Set up a virtual environment (Recommended):
bash
   python -m venv .venv
   # Activate on Windows:
   .venv\Scripts\activate
   # Activate on macOS/Linux:
   source .venv/bin/activate
  1. 1.Install the dependencies:
bash
   pip install -r requirements.txt
  1. 1.Launch the Streamlit app:
bash
   streamlit run app.py

๐Ÿ“ Project Structure

  • โ€”app.py: Streamlit frontend dashboard layout, UI blocks, and plotting logic.
  • โ€”model_utils.py: Text cleaning preprocessing functions, SentimentModel pipelines, and TopicClustering algorithms.
  • โ€”data_generator.py: Generates the default synthetic customer review dataset.
  • โ€”feedback_dataset.csv: The default loaded customer dataset containing 4000+ customer reviews.
  • โ€”requirements.txt: List of dependencies.
  • โ€”.gitignore: List of untracked file patterns to ignore.