Research Prototype  |  AI-Powered Medical Q&A

Clinical Response
System for Health Queries

An intelligent chatbot that combines TF-IDF, SBERT embeddings, machine learning classification and collaborative filtering to deliver accurate, intent-aware medical responses.

100K+
Training Samples
7
Intent Categories
5
ML Classifiers
96%
Top Confidence
Pipeline

How HealthBot-CRS Works

Every message goes through a 5-step intelligent pipeline before a response is returned.

1

Input Cleaning

Raw text is lowercased, punctuation removed, and stopwords filtered.

→
2

Feature Encoding

TF-IDF (5K features) + SBERT sentence embeddings are concatenated into one vector.

→
3

Intent Classification

Best ML classifier (LR / SVM / RF) predicts the intent category with confidence score.

→
4

Hybrid Retrieval

Content-based cosine similarity + collaborative filtering scores are blended (α=0.6).

→
5

Response Return

Top-ranked response is cleaned, follow-up chips generated, and returned to the UI.

Architecture

System Components

HealthBot-CRS is built on a modular ML pipeline with 6 key components.

🧹

Data Preprocessing

ChatDoctor dataset cleaned, entities extracted, intent labels assigned.

01_data_loading.py
🧮

Feature Engineering

TF-IDF matrix + SBERT all-MiniLM-L6-v2 embeddings generated.

02_feature_engineering.py
🧩

Clustering

KMeans on SBERT embeddings groups users into behavioural clusters.

03_clustering.py
🎯

Classification

5 classifiers trained; best F1 model auto-selected at runtime.

04_classification.py
🔄

Recommender

SVD / NMF / KNN collaborative filtering for personalised ranking.

05_recommender.py
🤖

Chatbot API

Flask REST API loads all models and serves responses in real time.

08_chatbot.py
Features

What Makes It Smart

HealthBot-CRS goes beyond simple keyword matching.

🧠

Hybrid Retrieval

Combines semantic similarity (SBERT cosine) with collaborative filtering scores for more relevant responses than TF-IDF alone.

📊

Confidence Scoring

Every response shows a real-time confidence bar so users can judge reliability at a glance.

💬

Follow-up Chips

Intent-aware follow-up question suggestions appear after every response, just like ChatGPT.

⚠️

Emergency Detection

Chest pain, stroke and emergency keywords are immediately routed to the emergency intent.

🔁

Auto Model Selection

At startup, all 5 classifier models are evaluated and the best F1 model is chosen automatically.

🧼

Response Cleaning

Dataset boilerplate and sign-off phrases are stripped so responses sound natural and professional.

Intent Categories

What You Can Ask

HealthBot-CRS recognises 7 intent categories covering the most common health query types.

🚨 Emergency
🤒 Symptom Inquiry
💊 Medication
🧘 Mental Health
🥦 Lifestyle
🔬 Diagnostics
💬 General Inquiry
Start Chatting ➤
⚠️

Research Prototype Disclaimer

HealthBot-CRS is an academic research prototype developed as part of a data science project. It is NOT a substitute for professional medical advice, diagnosis, or treatment. Always consult a qualified healthcare professional for any medical concerns.