Logo Lanfrica

SalmaneSossey/darija-health-nlp

Domaine:

natural language processinghealthcare

Type de record:

software
Créateur:
Sal
Hôte:
NLP-based medical triage system for Moroccan patient messages in Darija, Arabic, and French using FastAPI and Streamlit. # Darija Health NLP Moroccan Medical Triage System using NLP, FastAPI, Streamlit, Docker, and Colab. This project studies whether NLP models can classify Moroccan patient messages written in Darija, Arabic script, French, or mixed language into relevant medical specialties and urgency levels. ## Medical disclaimer This project is for academic and educational purposes only. It does not provide medical diagnosis, treatment, or emergency medical advice. Users should consult qualified healthcare professionals for medical concerns. ## Problem statement Moroccan patients often describe symptoms in Moroccan Darija, Latin-script Arabizi, Arabic script, French, or a mixture of these. Standard medical NLP pipelines are usually not designed for this linguistic setting. This project builds a practical V1 pipeline for orientation: specialty classification, rule-based urgency detection, multilingual symptom extraction, and safe recommendations. ## Features - Dataset inspection and EDA for MedQA-MA. - Light Darija/Arabic/French text normalization. - Unified processed schema: `id,text,language,specialty,urgency,symptoms,source`. - TF-IDF baselines with Logistic Regression and Linear SVM. - Dictionary-based symptom extraction. - Rule-based urgency orientation. - FastAPI backend and Streamlit frontend. - Optional native Rust inference engine (PyO3) for the classical SVM, with transparent joblib fallback. - Docker Compose for local deployment. ## Architecture ```text data/raw/medqa_ma -> EDA -> data/processed -> TF-IDF classifier (joblib) | -> export_svm_to_rust.py | -> models/svm_weights.json | -> rust_inference (PyO3, cdylib) -> FastAPI /predict (Transformer -> Rust SVM -> joblib) -> Streamlit UI ``` Reusable data, feature, and model code lives in `src/`. The native Rust inference engine lives in `rust_inference/` (compiled as a Python extension via PyO3). Application code lives in `backend/` and `frontend/`. Generated data, models, and artifacts are ignored …