# antonious-emad/doctor_recommendation_system architecture

> Architecture diagram of the GitHub repository antonious-emad/doctor_recommendation_system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/antonious-emad/doctor_recommendation_system
- Repository: https://github.com/antonious-emad/doctor_recommendation_system

## Overview

This repository is a notebook-based doctor recommendation system. Its main workflow turns patient symptom descriptions into specialty matches, then uses recommendation algorithms to rank doctors. Separate notebooks cover model fine-tuning, geocoding, contextual bandits, and evaluation. The README documents these capabilities, but most notebook source was not sampled, so the graph reflects documented relationships rather than inferred code-level calls.

Main entry points: [`Notebooks/Thompson_Sampling.ipynb`](https://github.com/antonious-emad/doctor_recommendation_system/blob/main/Notebooks/Thompson_Sampling.ipynb) (Doctor bandits), [`Notebooks/Specialist_Recommender.ipynb`](https://github.com/antonious-emad/doctor_recommendation_system/blob/main/Notebooks/Specialist_Recommender.ipynb) (Specialist recommender), [`Notebooks/FineTune_LLM.ipynb`](https://github.com/antonious-emad/doctor_recommendation_system/blob/main/Notebooks/FineTune_LLM.ipynb) (Fine-tuned LLM), [`Scrapping Codes/spacy_keyword_extraction.py`](https://github.com/antonious-emad/doctor_recommendation_system/blob/main/Scrapping%20Codes/spacy_keyword_extraction.py) (Keyword extraction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_language["Symptom understanding"]
  node_fine_tuned_model["Fine-tuned LLM<br/>[FineTune_LLM.ipynb]"]
  node_keyword_extraction["Keyword extraction"]
end

subgraph group_specialty["Specialty matching"]
  node_specialist_matcher["Specialist recommender"]
  node_specialist_data[("Specialty descriptions")]
end

subgraph group_doctors["Doctor recommendation"]
  node_doctor_bandits["Doctor bandits"]
  node_contextual_bandits["Contextual bandits"]
  node_doctor_data[("Doctor attributes")]
  node_doctor_geo_data[("Geocoded doctors")]
  node_evaluation["Bandit evaluation"]
end

subgraph group_data["Data preparation"]
  node_patient_data[("Patient representations")]
  node_disease_data[("Disease descriptions")]
  node_patient_generation["Patient data generation"]
  node_coordinate_extraction["Coordinate extraction"]
  node_coordinate_update["Doctor data update"]
end

node_patient(("Patient"))

node_patient -->|"provides symptoms"| node_fine_tuned_model
node_fine_tuned_model -->|"generates text for"| node_keyword_extraction
node_keyword_extraction -->|"extracts keywords for"| node_specialist_matcher
node_specialist_matcher -->|"matches descriptions"| node_specialist_data
node_specialist_matcher -->|"recommends specialists"| node_doctor_bandits
node_doctor_bandits -->|"ranks doctors using"| node_doctor_data
node_doctor_bandits -->|"uses distance data"| node_doctor_geo_data
node_contextual_bandits -->|"uses doctor attributes"| node_doctor_data
node_evaluation -->|"evaluates algorithms"| node_doctor_bandits
node_patient_generation -.->|"generates representations"| node_patient_data
node_coordinate_extraction -->|"provides coordinates"| node_coordinate_update
node_coordinate_update -->|"updates doctor data"| node_doctor_geo_data

click node_fine_tuned_model "https://github.com/antonious-emad/doctor_recommendation_system/blob/main/Notebooks/FineTune_LLM.ipynb"
click node_keyword_extraction "https://github.com/antonious-emad/doctor_recommendation_system/blob/main/Scrapping%20Codes/spacy_keyword_extraction.py"
click node_specialist_matcher "https://github.com/antonious-emad/doctor_recommendation_system/blob/main/Notebooks/Specialist_Recommender.ipynb"
click node_specialist_data "https://github.com/antonious-emad/doctor_recommendation_system/blob/main/Datasets/specialist_description.csv"
click node_doctor_bandits "https://github.com/antonious-emad/doctor_recommendation_system/blob/main/Notebooks/Thompson_Sampling.ipynb"
click node_contextual_bandits "https://github.com/antonious-emad/doctor_recommendation_system/blob/main/Notebooks/Contextual_Bandits.ipynb"
click node_doctor_data "https://github.com/antonious-emad/doctor_recommendation_system/blob/main/Datasets/doctors_data_multireward.csv"
click node_doctor_geo_data "https://github.com/antonious-emad/doctor_recommendation_system/blob/main/Datasets/updated_multireward.csv"
click node_evaluation "https://github.com/antonious-emad/doctor_recommendation_system/blob/main/Notebooks/Exp_and_Expl_Algo_Eval_Metrics.ipynb"
click node_patient_data "https://github.com/antonious-emad/doctor_recommendation_system/blob/main/Datasets/patients_representation.csv"
click node_disease_data "https://github.com/antonious-emad/doctor_recommendation_system/blob/main/Datasets/disease_description.csv"
click node_patient_generation "https://github.com/antonious-emad/doctor_recommendation_system/blob/main/Scrapping%20Codes/patients_creation.ipynb"
click node_coordinate_extraction "https://github.com/antonious-emad/doctor_recommendation_system/blob/main/Notebooks/Latitude_Longitude_Extractor.ipynb"
click node_coordinate_update "https://github.com/antonious-emad/doctor_recommendation_system/blob/main/Notebooks/CSV_Updater_For_Latitude_Longitude.ipynb"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_fine_tuned_model,node_keyword_extraction toneBlue
class node_specialist_matcher,node_specialist_data toneAmber
class node_doctor_bandits,node_contextual_bandits,node_doctor_data,node_doctor_geo_data,node_evaluation toneMint
class node_patient_data,node_disease_data,node_patient_generation,node_coordinate_extraction,node_coordinate_update toneRose
class node_patient toneIndigo
```

## Components

### Symptom understanding

- [Fine-tuned LLM](https://github.com/antonious-emad/doctor_recommendation_system/blob/main/Notebooks/FineTune_LLM.ipynb): `Notebooks/FineTune_LLM.ipynb`
- [Keyword extraction](https://github.com/antonious-emad/doctor_recommendation_system/blob/main/Scrapping%20Codes/spacy_keyword_extraction.py): `Scrapping Codes/spacy_keyword_extraction.py`

### Specialty matching

- [Specialist recommender](https://github.com/antonious-emad/doctor_recommendation_system/blob/main/Notebooks/Specialist_Recommender.ipynb): `Notebooks/Specialist_Recommender.ipynb`
- [Specialty descriptions](https://github.com/antonious-emad/doctor_recommendation_system/blob/main/Datasets/specialist_description.csv): `Datasets/specialist_description.csv`

### Doctor recommendation

- [Doctor bandits](https://github.com/antonious-emad/doctor_recommendation_system/blob/main/Notebooks/Thompson_Sampling.ipynb): `Notebooks/Thompson_Sampling.ipynb`
- [Contextual bandits](https://github.com/antonious-emad/doctor_recommendation_system/blob/main/Notebooks/Contextual_Bandits.ipynb): `Notebooks/Contextual_Bandits.ipynb`
- [Doctor attributes](https://github.com/antonious-emad/doctor_recommendation_system/blob/main/Datasets/doctors_data_multireward.csv): `Datasets/doctors_data_multireward.csv`
- [Geocoded doctors](https://github.com/antonious-emad/doctor_recommendation_system/blob/main/Datasets/updated_multireward.csv): `Datasets/updated_multireward.csv`
- [Bandit evaluation](https://github.com/antonious-emad/doctor_recommendation_system/blob/main/Notebooks/Exp_and_Expl_Algo_Eval_Metrics.ipynb): `Notebooks/Exp_and_Expl_Algo_Eval_Metrics.ipynb`

### Data preparation

- [Patient representations](https://github.com/antonious-emad/doctor_recommendation_system/blob/main/Datasets/patients_representation.csv): `Datasets/patients_representation.csv`
- [Disease descriptions](https://github.com/antonious-emad/doctor_recommendation_system/blob/main/Datasets/disease_description.csv): `Datasets/disease_description.csv`
- [Patient data generation](https://github.com/antonious-emad/doctor_recommendation_system/blob/main/Scrapping%20Codes/patients_creation.ipynb): `Scrapping Codes/patients_creation.ipynb`
- [Coordinate extraction](https://github.com/antonious-emad/doctor_recommendation_system/blob/main/Notebooks/Latitude_Longitude_Extractor.ipynb): `Notebooks/Latitude_Longitude_Extractor.ipynb`
- [Doctor data update](https://github.com/antonious-emad/doctor_recommendation_system/blob/main/Notebooks/CSV_Updater_For_Latitude_Longitude.ipynb): `Notebooks/CSV_Updater_For_Latitude_Longitude.ipynb`

### Other components

- **Patient**

## Connections

- Patient → Fine-tuned LLM: provides symptoms (evidence: `README.md`)
- Fine-tuned LLM → Keyword extraction: generates text for (evidence: `README.md`)
- Keyword extraction → Specialist recommender: extracts keywords for (evidence: `README.md`)
- Specialist recommender → Specialty descriptions: matches descriptions (evidence: `README.md`)
- Specialist recommender → Doctor bandits: recommends specialists (evidence: `README.md`)
- Doctor bandits → Doctor attributes: ranks doctors using (evidence: `README.md`)
- Doctor bandits → Geocoded doctors: uses distance data (evidence: `README.md`)
- Contextual bandits → Doctor attributes: uses doctor attributes (evidence: `README.md`)
- Bandit evaluation → Doctor bandits: evaluates algorithms (evidence: `README.md`)
- Patient data generation → Patient representations: generates representations
- Coordinate extraction → Doctor data update: provides coordinates (evidence: `README.md`)
- Doctor data update → Geocoded doctors: updates doctor data (evidence: `README.md`)
