How yashmgp69420/domain-aware-sentiment-analysis-for-healthcare-e-consultations works
This repository provides a healthcare e-consultation sentiment and urgency analysis product, with an interactive Streamlit dashboard as its main user entry point. The dashboard accepts consultation text or audio and can present sentiment, clinical urgency, and token-level SHAP explanations; the README also documents batch CSV triage and model benchmarking. The internal workflow detects language, translates to English, then runs urgency and sentiment analysis. Training and dataset preparation form a separate model-development branch. Source excerpts are partial, so unsampled subsystem links are included only where README or SOURCE INDEX evidence supports them.
Main entry points: dashboard.py Clinical dashboard · pipeline.py Inference coordinator · prepare_data.py Dataset preparation · predict.py Sentiment prediction
Components 21
Clinical experience
- Clinical dashboard
app/dashboard.py - UI translations
app/i18n.py
Clinical inference
- Speech transcription
src/healthcare_sentiment/multilingual/speech.py - Inference coordinator
src/healthcare_sentiment/pipeline.py - Language detection
src/healthcare_sentiment/multilingual/detect.py - Clinical translation
src/healthcare_sentiment/multilingual/translate.py - Urgency triage
src/healthcare_sentiment/urgency/detector.py - Sentiment prediction
src/healthcare_sentiment/models/predict.py
Model development
- BioBERT model
src/healthcare_sentiment/models/biobert.py - Pipeline configuration
src/healthcare_sentiment/config.py - Model training
src/healthcare_sentiment/models/trainer.py
Data preparation
- Dataset preparation
scripts/prepare_data.py - Dataset loading
src/healthcare_sentiment/data/loaders.py - Text preprocessing
src/healthcare_sentiment/data/preprocessing.py - Dataset splits
src/healthcare_sentiment/data/splits.py
Explanation and evaluation
- Token explanations
src/healthcare_sentiment/explainability/shap_explainer.py - Model evaluation
src/healthcare_sentiment/models/evaluate.py - Model benchmarks
src/healthcare_sentiment/models/benchmark.py
Other components
- Clinician or patient
- Speech recognition service
- Translation service
Connections 20
- Clinician or patient → Clinical dashboard: submits consultation
README.md - Clinical dashboard → UI translations: renders language UI
app/dashboard.py - Clinical dashboard → Speech transcription: transcribes audio
app/dashboard.py - Clinical dashboard → Inference coordinator: requests analysis
app/dashboard.py - Inference coordinator → Language detection: detects language
src/healthcare_sentiment/pipeline.py - Inference coordinator → Clinical translation: translates text
src/healthcare_sentiment/pipeline.py - Inference coordinator → Urgency triage: scores urgency
src/healthcare_sentiment/pipeline.py - Inference coordinator → Sentiment prediction: predicts sentiment
src/healthcare_sentiment/pipeline.py - Clinical dashboard → Token explanations: generates highlights
app/dashboard.py - Token explanations → Sentiment prediction: uses predictions
src/healthcare_sentiment/explainability/shap_explainer.py - Sentiment prediction → BioBERT model: loads checkpoint model
src/healthcare_sentiment/models/predict.py - Dataset preparation → Pipeline configuration: loads settings
scripts/prepare_data.py - Dataset preparation → Dataset loading: loads datasets
scripts/prepare_data.py - Dataset preparation → Text preprocessing: cleans records
scripts/prepare_data.py - Dataset preparation → Dataset splits: creates splits
scripts/prepare_data.py - Model training → Pipeline configuration: uses training settings
src/healthcare_sentiment/models/trainer.py - Model training → BioBERT model: fine-tunes model
src/healthcare_sentiment/models/trainer.py - Model evaluation → Model benchmarks: compares models
- Speech transcription → Speech recognition service: requests transcription
- Clinical translation → Translation service: may use service