Arabic/Darija Patient Assistance Chatbot API
# đ„ Arabic/Darija Patient Assistance Chatbot API
Chatbot médical multilingue (Darija / Arabe / Français) exposé via une API REST.
---
## đ Structure du Projet
```
chatbot-medical/
â
âââ data/
â âââ dataset.json â 20 exemples annotĂ©s Darija/Arabe/Français
â
âââ models/
â âââ intent_model.py â DĂ©tection d'intention + gĂ©nĂ©ration de rĂ©ponse
â
âââ api/
â âââ main.py â API FastAPI (endpoints text + voice)
â
âââ utils/
â âââ language_detection.py â DĂ©tection langue (Darija/Arabe/Français)
â âââ entity_extraction.py â Extraction entitĂ©s (mĂ©dicament, symptĂŽme, quantitĂ©)
â âââ speech_to_text.py â Transcription audio avec Whisper
â
âââ tests/
â âââ test_scenarios.py â 12 scĂ©narios de test avec rapport
â
âââ requirements.txt â DĂ©pendances Python
âââ README.md â Ce fichier
```
---
## âïž Installation (Jour 1)
### 1. Cloner / créer le projet
```bash
mkdir chatbot-medical && cd chatbot-medical
```
### 2. Créer un environnement virtuel
```bash
python -m venv venv
source venv/bin/activate # Linux/Mac
venv\Scripts\activate # Windows
```
### 3. Installer les dépendances
```bash
pip install -r requirements.txt
```
> â ïž **Note sur Whisper**: L'installation de `openai-whisper` peut prendre du temps et nĂ©cessite `ffmpeg`.
> Installez ffmpeg:
ffmpeg.org
---
## đ Lancement de l'API (Jour 3)
```bash
cd api
python main.py
```
L'API sera disponible sur: **
http://localhost:8000**
Documentation interactive: **
localhost
---
## đ Endpoints
### `POST /analyze/text` â Analyser du texte
```bash
curl -X POST "
localhost" \
-H "Content-Type: application/json" \
-d '{"text": "bghit dwa dial rassi"}'
```
**Réponse:**
```json
{
"input": "bghit dwa dial rassi",
"language": "darija",
"language_label": "Darija (Marocain)",
"intent": "demande_medicament",
"intent_label": "Demande de médicament",
"co âŠ