An intelligent chatbot that combines TF-IDF, SBERT embeddings, machine learning classification and collaborative filtering to deliver accurate, intent-aware medical responses.
Every message goes through a 5-step intelligent pipeline before a response is returned.
Raw text is lowercased, punctuation removed, and stopwords filtered.
TF-IDF (5K features) + SBERT sentence embeddings are concatenated into one vector.
Best ML classifier (LR / SVM / RF) predicts the intent category with confidence score.
Content-based cosine similarity + collaborative filtering scores are blended (α=0.6).
Top-ranked response is cleaned, follow-up chips generated, and returned to the UI.
HealthBot-CRS is built on a modular ML pipeline with 6 key components.
ChatDoctor dataset cleaned, entities extracted, intent labels assigned.
01_data_loading.pyTF-IDF matrix + SBERT all-MiniLM-L6-v2 embeddings generated.
02_feature_engineering.pyKMeans on SBERT embeddings groups users into behavioural clusters.
03_clustering.py5 classifiers trained; best F1 model auto-selected at runtime.
04_classification.pySVD / NMF / KNN collaborative filtering for personalised ranking.
05_recommender.pyFlask REST API loads all models and serves responses in real time.
08_chatbot.pyHealthBot-CRS goes beyond simple keyword matching.
Combines semantic similarity (SBERT cosine) with collaborative filtering scores for more relevant responses than TF-IDF alone.
Every response shows a real-time confidence bar so users can judge reliability at a glance.
Intent-aware follow-up question suggestions appear after every response, just like ChatGPT.
Chest pain, stroke and emergency keywords are immediately routed to the emergency intent.
At startup, all 5 classifier models are evaluated and the best F1 model is chosen automatically.
Dataset boilerplate and sign-off phrases are stripped so responses sound natural and professional.
HealthBot-CRS recognises 7 intent categories covering the most common health query types.
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.