Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Symptom NLP Classifier

NLP pipeline for classifying medical symptom descriptions into disease categories. Built as an extension of healthcare analytics work at Ayurnidaan (BITS Pilani incubated startup).

Pipeline

Raw symptom text → Preprocessing → TF-IDF (bigrams) → Classifier → Disease category

Models compared

Model Accuracy F1 (weighted)
Logistic Regression ~0.98 ~0.98
Random Forest ~0.97 ~0.97
Gradient Boosting ~0.96 ~0.96

How to run

pip install numpy scikit-learn matplotlib
python symptom_classifier.py

Usage as API

from symptom_classifier import predict_symptom, build_pipeline

pipeline = build_pipeline('LogisticRegression')
pipeline.fit(X_train, y_train)

result = predict_symptom("fever chills body ache", pipeline)
print(result['predicted'])     # e.g. "flu"
print(result['confidence'])    # e.g. 0.94

Real datasets to plug in

  • MIMIC-III clinical notes (requires credentialing)
  • Symptom-Disease dataset on Kaggle
  • MedQuAD medical Q&A dataset

Skills demonstrated

Python, NLP, TF-IDF, Scikit-learn Pipeline, text classification, prediction API

About

NLP pipeline for classifying medical symptom descriptions using TF-IDF bigrams and scikit-learn classifiers. Achieves 98% accuracy with a callable prediction API.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages