Spaces:
Sleeping
Sleeping
Commit History
-
feat: complete RAG integration with medical knowledge baseβ
aagahilabs +1: Claude Sonnet 4.6- Add data/medical_knowledge.json: 40 curated clinical documents covering emergency conditions (MI, stroke, sepsis, anaphylaxis), Pakistani endemic diseases (dengue, malaria, typhoid, TB, cholera), and common presentations - Add sentence-transformers to requirements.txt for embedding model - Add _setup_rag() + retrieve_knowledge() using all-MiniLM-L6-v2 and numpy cosine similarity (no ChromaDB β avoids HF Spaces dependency issues) - Update generate_soap_report() to accept retrieved_context parameter and inject RAG passages into the PLAN/ASSESSMENT section of the prompt - Update run_pipeline() to build combined query (English text + symptom names), call retrieve_knowledge(n=3), and pass results to SOAP generator - RAG runs after dataset lookup; falls back gracefully if model unavailable Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>8a2f199 -
Replace sample dataset with full Mendeley 773-disease datasetβ
aagahilabs- Source: data.mendeley.com/datasets/2cxccsxydc/1 - Original: 246,945 rows x 378 columns (multiple patient presentations) - Preprocessed: groupby disease + max() aggregation - Result: 773 diseases x 377 symptoms, 592 KB on disk, 2.27 MB in memory - Symptom names kept as-is (e.g. 'sharp chest pain', 'shortness of breath') β word-overlap matcher handles these better than short names5e2f8a3 -
Add Mendeley disease-symptom dataset lookupβ
aagahilabs- data/diseases_symptoms.csv: 60 diseases x 30 symptoms binary matrix (representative sample β replace with full 773-disease Mendeley dataset from https://data.mendeley.com/datasets/2cxccsxydc/1) - _match_symptom_to_column(): maps free-text LLM symptom names to dataset columns via word-overlap (handles 'severe chest pain' β chest_pain) - lookup_diseases(): scores all diseases by matched symptom count, returns top-5 with match detail (e.g. 'Dengue Fever (3/4 matched)') - Replaces LLM-guessed possible_conditions with dataset-sourced results - Adds dataset_match_detail field for transparency - pandas added to requirements.txteb592d2