Spaces:
Running on Zero
Running on Zero
Cheikh Niang commited on
Deploiement GuindiMa AI (interface Gradio)
Browse files- .gitignore +8 -2
- .streamlit/config.toml +0 -16
- CLAUDE.md +8 -4
- app.py +15 -52
- data/tts_cache/dakar_dem_dikk_15.wav +0 -3
- data/tts_cache/dakar_dem_dikk_16.wav +0 -3
- data/tts_cache/dakar_dem_dikk_502.wav +0 -3
- data/tts_cache/dakar_dem_dikk_503.wav +0 -3
- data/tts_cache/dakar_dem_dikk_504.wav +0 -3
- scripts/lieux_parles.txt +0 -560
- scripts/lieux_prioritaires.txt +0 -43
- src/app/app.py +0 -589
- src/app/check_examples.py +0 -129
- src/asr/test_asr_models.py +0 -228
- src/tts/pregenerer.py +0 -124
- tts_cache_adia.zip +0 -3
.gitignore
CHANGED
|
@@ -1,15 +1,21 @@
|
|
| 1 |
.venv/
|
| 2 |
.env
|
|
|
|
|
|
|
| 3 |
__pycache__/
|
| 4 |
*.pyc
|
| 5 |
body*.json
|
| 6 |
model_checkpoints/
|
| 7 |
models/
|
| 8 |
test_*.wav
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
# Voix de vraies personnes : jamais sur GitHub.
|
| 11 |
data/collecte/
|
| 12 |
data/collecte_brut/
|
| 13 |
-
|
| 14 |
-
upload_space.py
|
| 15 |
test_modeles_nvidia.py
|
|
|
|
| 1 |
.venv/
|
| 2 |
.env
|
| 3 |
+
.env.*
|
| 4 |
+
!.env.example
|
| 5 |
__pycache__/
|
| 6 |
*.pyc
|
| 7 |
body*.json
|
| 8 |
model_checkpoints/
|
| 9 |
models/
|
| 10 |
test_*.wav
|
| 11 |
+
*.zip
|
| 12 |
+
tts_cache_adia/
|
| 13 |
+
data/tts_cache_avant_adia_*/
|
| 14 |
+
.ipynb_checkpoints/
|
| 15 |
|
| 16 |
# Voix de vraies personnes : jamais sur GitHub.
|
| 17 |
data/collecte/
|
| 18 |
data/collecte_brut/
|
| 19 |
+
|
| 20 |
+
upload_space.py
|
| 21 |
test_modeles_nvidia.py
|
.streamlit/config.toml
DELETED
|
@@ -1,16 +0,0 @@
|
|
| 1 |
-
[server]
|
| 2 |
-
fileWatcherType = "none"
|
| 3 |
-
|
| 4 |
-
# Theme clair, vert (#00853F, couleur du Senegal) en couleur principale.
|
| 5 |
-
[theme]
|
| 6 |
-
base = "light"
|
| 7 |
-
primaryColor = "#00853F"
|
| 8 |
-
backgroundColor = "#FFFFFF"
|
| 9 |
-
secondaryBackgroundColor = "#F1F7F3"
|
| 10 |
-
textColor = "#17211C"
|
| 11 |
-
font = "sans-serif"
|
| 12 |
-
headingFont = "sans-serif"
|
| 13 |
-
baseRadius = "0.6rem"
|
| 14 |
-
|
| 15 |
-
[theme.sidebar]
|
| 16 |
-
backgroundColor = "#F1F7F3"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CLAUDE.md
CHANGED
|
@@ -11,8 +11,8 @@ montée, l'arrêt de descente, un éventuel changement, à l'écran et à voix h
|
|
| 11 |
## Règles absolues
|
| 12 |
|
| 13 |
1. **Ne jamais redéployer** (`upload_space.py`) ni pousser (`git push`) sans demande explicite.
|
| 14 |
-
2. **Ne jamais modifier** `data/itineraires_dakar.csv`
|
| 15 |
-
3. **Ne jamais toucher aux audios** de `data/collecte/`
|
| 16 |
4. **Aucun secret** dans le code, les logs ou les messages (`.env` est exclu de Git et du Space).
|
| 17 |
5. **Chaque correction = un test** dans `tests/test_trajets.py`, puis lancer les tests avant de conclure.
|
| 18 |
6. **Mieux vaut ne rien répondre que répondre faux** : en cas de doute sur un lieu, laisser vide plutôt que deviner.
|
|
@@ -57,9 +57,12 @@ Astuce PowerShell : un script Python passé en « here-string » perd les accent
|
|
| 57 |
« Département de X » compte seulement pour Guédiawaye, Pikine, Rufisque.
|
| 58 |
4. **Réponse** (`app.py`)
|
| 59 |
- Cartes HTML (montée, descente, arrêts du trajet, quartier si sûr, lien AFTU).
|
| 60 |
-
- Voix : Adia_TTS (CONCREE), **
|
| 61 |
À l'oral on dit « numero » (pas « ligne ») et « Tata » / « Dem Dikk ».
|
| 62 |
-
Pour régénérer : `scripts/phrases_voix.json` + `
|
|
|
|
|
|
|
|
|
|
| 63 |
|
| 64 |
## Données
|
| 65 |
|
|
@@ -78,6 +81,7 @@ Astuce PowerShell : un script Python passé en « here-string » perd les accent
|
|
| 78 |
- `scripts/nettoyer_transcriptions.py` : orthographe des lieux → colonne `transcription_propre`.
|
| 79 |
- `scripts/transcrire_collecte.py` : transcrit les vocaux avec Whisper, **reprend où il s'est arrêté**.
|
| 80 |
- `scripts/finetune_whisper.py` : fine-tuning de Whisper small (à lancer sur GPU Brev, pas en local).
|
|
|
|
| 81 |
- `upload_space.py` : déploiement vers le Space (**uniquement sur demande**).
|
| 82 |
|
| 83 |
## Style
|
|
|
|
| 11 |
## Règles absolues
|
| 12 |
|
| 13 |
1. **Ne jamais redéployer** (`upload_space.py`) ni pousser (`git push`) sans demande explicite.
|
| 14 |
+
2. **Ne jamais modifier** les CSV de `data/` (`lignes_dakar.csv`, `itineraires_dakar.csv`, `arrets_geo.csv`, `lieux_geo.csv`).
|
| 15 |
+
3. **Ne jamais toucher aux audios** de `data/collecte/`, `data/collecte_brut/`, `data/sources/` et `data/demo_audio/`, ni aux **637 WAV du plan** dans `data/tts_cache/`.
|
| 16 |
4. **Aucun secret** dans le code, les logs ou les messages (`.env` est exclu de Git et du Space).
|
| 17 |
5. **Chaque correction = un test** dans `tests/test_trajets.py`, puis lancer les tests avant de conclure.
|
| 18 |
6. **Mieux vaut ne rien répondre que répondre faux** : en cas de doute sur un lieu, laisser vide plutôt que deviner.
|
|
|
|
| 57 |
« Département de X » compte seulement pour Guédiawaye, Pikine, Rufisque.
|
| 58 |
4. **Réponse** (`app.py`)
|
| 59 |
- Cartes HTML (montée, descente, arrêts du trajet, quartier si sûr, lien AFTU).
|
| 60 |
+
- Voix : Adia_TTS (CONCREE), **637 réponses pré-générées** dans `data/tts_cache/`.
|
| 61 |
À l'oral on dit « numero » (pas « ligne ») et « Tata » / « Dem Dikk ».
|
| 62 |
+
Pour régénérer : `scripts/phrases_voix.json` + `scripts/prononciations_wolof.json`
|
| 63 |
+
+ `notebooks/voix_adia_colab.ipynb` (Colab GPU, 3 prises, meilleure choisie avec Whisper).
|
| 64 |
+
Installation : `scripts/installer_voix_adia.py`. Aucun modèle TTS n'est chargé au runtime :
|
| 65 |
+
un segment absent est sauté, jamais synthétisé en direct.
|
| 66 |
|
| 67 |
## Données
|
| 68 |
|
|
|
|
| 81 |
- `scripts/nettoyer_transcriptions.py` : orthographe des lieux → colonne `transcription_propre`.
|
| 82 |
- `scripts/transcrire_collecte.py` : transcrit les vocaux avec Whisper, **reprend où il s'est arrêté**.
|
| 83 |
- `scripts/finetune_whisper.py` : fine-tuning de Whisper small (à lancer sur GPU Brev, pas en local).
|
| 84 |
+
- `scripts/installer_voix_adia.py` : installe l'archive Adia dans `data/tts_cache/`.
|
| 85 |
- `upload_space.py` : déploiement vers le Space (**uniquement sur demande**).
|
| 86 |
|
| 87 |
## Style
|
app.py
CHANGED
|
@@ -1,12 +1,10 @@
|
|
| 1 |
"""Interface Gradio de GuindiMa AI, pour un Hugging Face Space (ZeroGPU).
|
| 2 |
|
| 3 |
-
Ce fichier ne réimplémente rien : il reprend les modules déjà validés du projet
|
| 4 |
-
|
| 5 |
-
l'application Streamlit : le rendu. Ici on ne gère pas de session, chaque
|
| 6 |
-
exécution de Gradio est indépendante, ce qui simplifie la mise en cache.
|
| 7 |
|
| 8 |
audio -> transcrire() -> extract_intent() -> StopsMatcher.find_line()
|
| 9 |
-
->
|
| 10 |
|
| 11 |
Sur un Space, la seule partie qui demande le GPU est la transcription : le
|
| 12 |
décorateur @spaces.GPU la réserve le temps du calcul puis le libère pour les autres visiteurs.
|
|
@@ -33,7 +31,7 @@ import numpy as np
|
|
| 33 |
|
| 34 |
RACINE = Path(__file__).resolve().parent
|
| 35 |
# Les modules du projet sont importés à plat (asr, intent, matching, tts) : il faut
|
| 36 |
-
# que src/ soit dans le chemin,
|
| 37 |
sys.path.insert(0, str(RACINE / "src"))
|
| 38 |
|
| 39 |
from app.cartes import titre_autre_possibilite # noqa: E402
|
|
@@ -59,13 +57,8 @@ from matching.lieux import AVANT_NUMERO, FAUX_AMIS, joli, sans_accents # noqa:
|
|
| 59 |
from matching.stops_matcher import StopsMatcher # noqa: E402
|
| 60 |
from tts.speak import ( # noqa: E402
|
| 61 |
MAX_POSSIBILITES,
|
| 62 |
-
cache_complet,
|
| 63 |
-
load_tts,
|
| 64 |
nombre_en_wolof,
|
| 65 |
numero_de,
|
| 66 |
-
phrase_correspondances,
|
| 67 |
-
phrase_reponse,
|
| 68 |
-
synthetiser,
|
| 69 |
voix_correspondances_depuis_cache,
|
| 70 |
voix_depuis_cache,
|
| 71 |
)
|
|
@@ -166,18 +159,6 @@ LIBELLE_ASR = "Whisper wolof fine-tuné à Dakar + Kiriku-Wolof-ASR"
|
|
| 166 |
# Voix des réponses pré-générées (voir scripts/phrases_voix.json).
|
| 167 |
LIBELLE_VOIX = "Adia_TTS (CONCREE)"
|
| 168 |
|
| 169 |
-
# Le TTS ne sert qu'en secours, quand le cache disque n'a pas l'audio du résultat.
|
| 170 |
-
# Le charger à la volée évite de téléchargement 578 Mo pour rien sur un Space.
|
| 171 |
-
_TTS = None
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
def _tts():
|
| 175 |
-
global _TTS
|
| 176 |
-
if _TTS is None:
|
| 177 |
-
_TTS = load_tts()
|
| 178 |
-
return _TTS
|
| 179 |
-
|
| 180 |
-
|
| 181 |
# --------------------------------------------------------------------------- #
|
| 182 |
# Clients et objets reconstruits une fois
|
| 183 |
# --------------------------------------------------------------------------- #
|
|
@@ -347,34 +328,21 @@ def _phrase_donne_un_trajet(phrase: str) -> bool:
|
|
| 347 |
def _voix_wolof(lignes: list[dict], correspondances: list[dict] | None = None) -> str | None:
|
| 348 |
"""La réponse lue en wolof, sous forme de chemin de fichier.
|
| 349 |
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
|
| 353 |
"""
|
| 354 |
correspondances = correspondances or []
|
| 355 |
if not lignes and not correspondances:
|
| 356 |
return None
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
if octets is None:
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
# voix qui ne correspond plus au cache Adia.
|
| 366 |
-
print("[voix] aucun segment disponible, réponse laissée sans voix", flush=True)
|
| 367 |
-
return None
|
| 368 |
-
phrase = (
|
| 369 |
-
phrase_reponse(lignes)
|
| 370 |
-
if lignes
|
| 371 |
-
else phrase_correspondances(correspondances)
|
| 372 |
-
)
|
| 373 |
-
try:
|
| 374 |
-
octets = synthetiser(_tts(), phrase)
|
| 375 |
-
except Exception as exc:
|
| 376 |
-
print(f"Voix de synthèse indisponible ({exc}), la réponse reste en texte.")
|
| 377 |
-
return None
|
| 378 |
chemin = DOSSIER_VOIX / f"reponse_{next(_COMPTEUR)}.wav"
|
| 379 |
chemin.write_bytes(octets)
|
| 380 |
return str(chemin)
|
|
@@ -987,7 +955,7 @@ def _pipeline(phrase: str, modele_asr: str, duree_asr: float, compagnie_choix: s
|
|
| 987 |
|
| 988 |
|
| 989 |
def trouver_le_bus(audio: str | None, phrase_ecrite: str, compagnie_choix: str = "") -> tuple:
|
| 990 |
-
"""Le pipeline complet,
|
| 991 |
|
| 992 |
Le micro l'emporte sur le texte : si un enregistrement arrive, on le transcrit
|
| 993 |
(Kiriku sur GPU, whisper CPU en secours, et une seconde chance avec l'autre
|
|
@@ -1031,11 +999,6 @@ def _court(exc: Exception, longueur: int = 160) -> str:
|
|
| 1031 |
return f"{type(exc).__name__} : {exc}"[:longueur]
|
| 1032 |
|
| 1033 |
|
| 1034 |
-
def trouver_le_bus_vocal(audio: str | None) -> tuple:
|
| 1035 |
-
"""Raccourci pour les exemples audio : on part du micro, le texte est vide."""
|
| 1036 |
-
return trouver_le_bus(audio, "", "")
|
| 1037 |
-
|
| 1038 |
-
|
| 1039 |
def trouver_le_bus_texte(phrase: str) -> tuple:
|
| 1040 |
"""Raccourci pour les exemples texte : le micro est vide."""
|
| 1041 |
return trouver_le_bus(None, phrase, "")
|
|
|
|
| 1 |
"""Interface Gradio de GuindiMa AI, pour un Hugging Face Space (ZeroGPU).
|
| 2 |
|
| 3 |
+
Ce fichier ne réimplémente rien : il reprend les modules déjà validés du projet.
|
| 4 |
+
Chaque exécution de Gradio est indépendante, ce qui simplifie la mise en cache.
|
|
|
|
|
|
|
| 5 |
|
| 6 |
audio -> transcrire() -> extract_intent() -> StopsMatcher.find_line()
|
| 7 |
+
-> carte HTML + voix_depuis_cache()
|
| 8 |
|
| 9 |
Sur un Space, la seule partie qui demande le GPU est la transcription : le
|
| 10 |
décorateur @spaces.GPU la réserve le temps du calcul puis le libère pour les autres visiteurs.
|
|
|
|
| 31 |
|
| 32 |
RACINE = Path(__file__).resolve().parent
|
| 33 |
# Les modules du projet sont importés à plat (asr, intent, matching, tts) : il faut
|
| 34 |
+
# que src/ soit dans le chemin, y compris quand app.py est lancé depuis la racine.
|
| 35 |
sys.path.insert(0, str(RACINE / "src"))
|
| 36 |
|
| 37 |
from app.cartes import titre_autre_possibilite # noqa: E402
|
|
|
|
| 57 |
from matching.stops_matcher import StopsMatcher # noqa: E402
|
| 58 |
from tts.speak import ( # noqa: E402
|
| 59 |
MAX_POSSIBILITES,
|
|
|
|
|
|
|
| 60 |
nombre_en_wolof,
|
| 61 |
numero_de,
|
|
|
|
|
|
|
|
|
|
| 62 |
voix_correspondances_depuis_cache,
|
| 63 |
voix_depuis_cache,
|
| 64 |
)
|
|
|
|
| 159 |
# Voix des réponses pré-générées (voir scripts/phrases_voix.json).
|
| 160 |
LIBELLE_VOIX = "Adia_TTS (CONCREE)"
|
| 161 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
# --------------------------------------------------------------------------- #
|
| 163 |
# Clients et objets reconstruits une fois
|
| 164 |
# --------------------------------------------------------------------------- #
|
|
|
|
| 328 |
def _voix_wolof(lignes: list[dict], correspondances: list[dict] | None = None) -> str | None:
|
| 329 |
"""La réponse lue en wolof, sous forme de chemin de fichier.
|
| 330 |
|
| 331 |
+
On assemble uniquement les segments Adia présents dans `data/tts_cache/` :
|
| 332 |
+
aucune synthèse en direct. Si le cache est incomplet, les morceaux présents
|
| 333 |
+
sont joués ; si aucun ne l'est, la réponse reste silencieuse.
|
| 334 |
"""
|
| 335 |
correspondances = correspondances or []
|
| 336 |
if not lignes and not correspondances:
|
| 337 |
return None
|
| 338 |
+
octets = (
|
| 339 |
+
voix_depuis_cache(lignes)
|
| 340 |
+
if lignes
|
| 341 |
+
else voix_correspondances_depuis_cache(correspondances)
|
| 342 |
+
)
|
| 343 |
if octets is None:
|
| 344 |
+
print("[voix] aucun segment disponible, réponse laissée sans voix", flush=True)
|
| 345 |
+
return None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 346 |
chemin = DOSSIER_VOIX / f"reponse_{next(_COMPTEUR)}.wav"
|
| 347 |
chemin.write_bytes(octets)
|
| 348 |
return str(chemin)
|
|
|
|
| 955 |
|
| 956 |
|
| 957 |
def trouver_le_bus(audio: str | None, phrase_ecrite: str, compagnie_choix: str = "") -> tuple:
|
| 958 |
+
"""Le pipeline complet, du micro ou du texte jusqu'à la réponse.
|
| 959 |
|
| 960 |
Le micro l'emporte sur le texte : si un enregistrement arrive, on le transcrit
|
| 961 |
(Kiriku sur GPU, whisper CPU en secours, et une seconde chance avec l'autre
|
|
|
|
| 999 |
return f"{type(exc).__name__} : {exc}"[:longueur]
|
| 1000 |
|
| 1001 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1002 |
def trouver_le_bus_texte(phrase: str) -> tuple:
|
| 1003 |
"""Raccourci pour les exemples texte : le micro est vide."""
|
| 1004 |
return trouver_le_bus(None, phrase, "")
|
data/tts_cache/dakar_dem_dikk_15.wav
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:49fa2bbdfa31ae511027660848c330e6e4587fc567dced757a1ab5fa320d70ae
|
| 3 |
-
size 304998
|
|
|
|
|
|
|
|
|
|
|
|
data/tts_cache/dakar_dem_dikk_16.wav
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:3336b40df0153301919b6ed9a561896b0990c5f0692a3ee2471b48658b9caa8d
|
| 3 |
-
size 309694
|
|
|
|
|
|
|
|
|
|
|
|
data/tts_cache/dakar_dem_dikk_502.wav
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:98ef0c610acabb6be77ea71264c983bcc76aaba1ef547de5d285f4f0b86e267d
|
| 3 |
-
size 259140
|
|
|
|
|
|
|
|
|
|
|
|
data/tts_cache/dakar_dem_dikk_503.wav
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:a13cb225c4f5baec8fe79e5c8e9cc2c9d1e7e8b12732f07a334f9bbe1e42b30a
|
| 3 |
-
size 290784
|
|
|
|
|
|
|
|
|
|
|
|
data/tts_cache/dakar_dem_dikk_504.wav
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:e0ff9372f76bf0100917b5d9fc59df2d688c6f8e7623bb2f6d96b15d516afb93
|
| 3 |
-
size 246850
|
|
|
|
|
|
|
|
|
|
|
|
scripts/lieux_parles.txt
DELETED
|
@@ -1,560 +0,0 @@
|
|
| 1 |
-
2 Voies de Liberté VI -> Deux Voies de Liberté six
|
| 2 |
-
2 Voies Liberté 6 -> Deux Voies Liberté six
|
| 3 |
-
2 Voies Notaire -> Deux Voies Notaire
|
| 4 |
-
30 & 42 -> Trente et quarante-deux
|
| 5 |
-
49 -> Quarante-neuf
|
| 6 |
-
63 -> Soixante-trois
|
| 7 |
-
72 -> Soixante-douze
|
| 8 |
-
AIBD -> AIBD
|
| 9 |
-
Allées Ababacar Sy (Dieuppeul/derklé) -> Allées Ababacar Sy
|
| 10 |
-
Allées Cheikh Sidaty Aïdara (Niaritalli) -> Allées Cheikh Sidaty Aïdara
|
| 11 |
-
Allées Cherif Macky Sall -> Allées Cherif Macky Sall
|
| 12 |
-
Allées Médina ZAC -> Allées Médina ZAC
|
| 13 |
-
Allées Papa Gueye Fall -> Allées Papa Gueye Fall
|
| 14 |
-
Almadies -> Almadies
|
| 15 |
-
Ancienne Piste -> Ancienne Piste
|
| 16 |
-
Ancienne Piste d'Envol -> Ancienne Piste d'Envol
|
| 17 |
-
Apix -> Apix
|
| 18 |
-
Arafat -> Arafat
|
| 19 |
-
Arrêt Chérif (Rufisque) -> Arrêt Chérif
|
| 20 |
-
Auchan Keur Massar -> Auchan Keur Massar
|
| 21 |
-
Auto Route -> Auto Route
|
| 22 |
-
Autoroute -> Autoroute
|
| 23 |
-
Autoroute A Péage -> Autoroute A Péage
|
| 24 |
-
Autoroute Seydina L -> Autoroute Seydina L
|
| 25 |
-
Autoroute Seydina Limamoulaye -> Autoroute Seydina Limamoulaye
|
| 26 |
-
Autoroute Seydinalimamoulaye -> Autoroute Seydinalimamoulaye
|
| 27 |
-
Av Blaise Diagne -> Avenue Blaise Diagne
|
| 28 |
-
Av Bourguiba -> Avenue Bourguiba
|
| 29 |
-
Av Cheikh Ahmadou Bamba (Rue 13 des HLM) -> Avenue Cheikh Ahmadou Bamba
|
| 30 |
-
Av Cheikh Anta Diop -> Avenue Cheikh Anta Diop
|
| 31 |
-
Av Emile Badiane -> Avenue Emile Badiane
|
| 32 |
-
Av Hyacinthe Thiandoum -> Avenue Hyacinthe Thiandoum
|
| 33 |
-
Av Hyacinthe Thiandoum (Grand-Yoff) -> Avenue Hyacinthe Thiandoum
|
| 34 |
-
Av Malick Sy -> Avenue Malick Sy
|
| 35 |
-
Av Oumar Foutiyou Tall (Golf Nord) -> Avenue Oumar Foutiyou Tall
|
| 36 |
-
Av. Cheikh Ahmadou Bamba (Cité Port) -> Avenue Cheikh Ahmadou Bamba
|
| 37 |
-
Av. Emile Badiane -> Avenue Emile Badiane
|
| 38 |
-
Avenue Blaise Diagne -> Avenue Blaise Diagne
|
| 39 |
-
Avenue Bourguiba -> Avenue Bourguiba
|
| 40 |
-
Avenue Cardinal Hyacinthe Thiandoum -> Avenue Cardinal Hyacinthe Thiandoum
|
| 41 |
-
Avenue Cheikh Amadou Bamba (Rue 13 des HLM) -> Avenue Cheikh Amadou Bamba
|
| 42 |
-
Avenue Cheikh Amadou Bamba Mbacke (Rue 13) -> Avenue Cheikh Amadou Bamba Mbacke
|
| 43 |
-
Avenue Cheikh Anta Diop -> Avenue Cheikh Anta Diop
|
| 44 |
-
Avenue Cheikh Antadiop -> Avenue Cheikh Antadiop
|
| 45 |
-
Avenue Emile Badiane -> Avenue Emile Badiane
|
| 46 |
-
Avenue Hyacinthe Thiandom -> Avenue Hyacinthe Thiandom
|
| 47 |
-
Avenue Hyacinthe Thiandoum -> Avenue Hyacinthe Thiandoum
|
| 48 |
-
Avenue Malick Sy -> Avenue Malick Sy
|
| 49 |
-
Avenue Malicksy -> Avenue Malicksy
|
| 50 |
-
Aéroport -> Aéroport
|
| 51 |
-
Aéroport L S Senghor -> Aéroport L S Senghor
|
| 52 |
-
Aéroport LSS -> Aéroport LSS
|
| 53 |
-
Bambilor -> Bambilor
|
| 54 |
-
Banoba -> Banoba
|
| 55 |
-
Bargny -> Bargny
|
| 56 |
-
Bargny (Gare Ferroviaire) -> Bargny
|
| 57 |
-
Baux Maraîchers -> Baux Maraîchers
|
| 58 |
-
Bayakh -> Bayakh
|
| 59 |
-
Baye Laye -> Baye Laye
|
| 60 |
-
Bd Maurice Gueye -> Boulevard Maurice Gueye
|
| 61 |
-
Beaux Maraîchers -> Beaux Maraîchers
|
| 62 |
-
Bene Baraque -> Bene Baraque
|
| 63 |
-
Bld Centenaire de la Commune de Dakar -> Bld Centenaire de la Commune de Dakar
|
| 64 |
-
Bld des Martyrs -> Bld des Martyrs
|
| 65 |
-
Bld du Centenaire de la Commune de Dakar -> Bld du Centenaire de la Commune de Dakar
|
| 66 |
-
Bld Maurice Gueye -> Bld Maurice Gueye
|
| 67 |
-
Boulevard de la Gueule Tapée -> Boulevard de la Gueule Tapée
|
| 68 |
-
Boulevard Dial Diop -> Boulevard Dial Diop
|
| 69 |
-
Boulevard du Centenaire de la Commune de Dakar -> Boulevard du Centenaire de la Commune de Dakar
|
| 70 |
-
Boulevard du Général de Gaulle -> Boulevard du Général de Gaulle
|
| 71 |
-
Boulevard Maurice Gueye -> Boulevard Maurice Gueye
|
| 72 |
-
Boune -> Boune
|
| 73 |
-
Bountou Pikine -> Bountou Pikine
|
| 74 |
-
Bourguiba -> Bourguiba
|
| 75 |
-
Boutikou Diallo -> Boutikou Diallo
|
| 76 |
-
Boutique Diallo (Ouakam) -> Boutique Diallo
|
| 77 |
-
Branche Est Autoroute -> Branche Est Autoroute
|
| 78 |
-
Branche Est-Autoroute -> Branche Est Autoroute
|
| 79 |
-
Bène Tally -> Bène Tally
|
| 80 |
-
Cafeteria -> Cafeteria
|
| 81 |
-
Cambérène -> Cambérène
|
| 82 |
-
Cambérène 2 -> Cambérène deux
|
| 83 |
-
Camp Marchand -> Camp Marchand
|
| 84 |
-
Camp Marchand Rufisque -> Camp Marchand Rufisque
|
| 85 |
-
Canada -> Canada
|
| 86 |
-
Canal 4 -> Canal quatre
|
| 87 |
-
Canal de la Gueule Tapée -> Canal de la Gueule Tapée
|
| 88 |
-
Cap des Biches -> Cap des Biches
|
| 89 |
-
CAPA -> CAPA
|
| 90 |
-
Carrefour HLM Gd Medine/diamalaye -> Carrefour HLM Gd Medine/diamalaye
|
| 91 |
-
Carrefour Serigne Assane -> Carrefour Serigne Assane
|
| 92 |
-
Carrefour Seydou N Tall -> Carrefour Seydou N Tall
|
| 93 |
-
Case Ba -> Case Ba
|
| 94 |
-
Case de Cambérène -> Case de Cambérène
|
| 95 |
-
Case-Ba -> Case Ba
|
| 96 |
-
Caserne Sapeurs Pompiers -> Caserne Sapeurs Pompiers
|
| 97 |
-
Caserne Sapeurs Pompiers Parcelles -> Caserne Sapeurs Pompiers Parcelles
|
| 98 |
-
Castors -> Castors
|
| 99 |
-
Centre Aéré de la BCEAO -> Centre Aéré de la BCEAO
|
| 100 |
-
Centre de Jaxaay -> Centre de Jaxaay
|
| 101 |
-
Centre-Ville -> Centre-Ville
|
| 102 |
-
Cheikh Sidatyaidara (Niarytally) -> Cheikh Sidatyaidara
|
| 103 |
-
Cinéma Parcelles -> Cinéma Parcelles
|
| 104 |
-
Cité Ainoumady -> Cité Ainoumady
|
| 105 |
-
Cité Apix -> Cité Apix
|
| 106 |
-
Cité ASECNA -> Cité ASECNA
|
| 107 |
-
Cité Assurance -> Cité Assurance
|
| 108 |
-
Cité Avion -> Cité Avion
|
| 109 |
-
Cité Baba Guisse -> Cité Baba Guisse
|
| 110 |
-
Cité CAPEC -> Cité CAPEC
|
| 111 |
-
Cité COCEHAS -> Cité COCEHAS
|
| 112 |
-
Cité des Eaux -> Cité des Eaux
|
| 113 |
-
Cité des Enseignants -> Cité des Enseignants
|
| 114 |
-
Cité Enseignants -> Cité Enseignants
|
| 115 |
-
Cité Fadia -> Cité Fadia
|
| 116 |
-
Cité Gendarmerie (Jaxaay) -> Cité Gendarmerie
|
| 117 |
-
Cité Lobatt Fall -> Cité Lobatt Fall
|
| 118 |
-
Cité Lobattfall -> Cité Lobattfall
|
| 119 |
-
Cité Mame Dior -> Cité Mame Dior
|
| 120 |
-
Cité Nations Unies -> Cité Nations Unies
|
| 121 |
-
Cité Nations Unies (Cambérène) -> Cité Nations Unies
|
| 122 |
-
Cité Nations Unies (Derriere Hôpital Dalal Diam) -> Cité Nations Unies
|
| 123 |
-
Cité SAFCO -> Cité SAFCO
|
| 124 |
-
Cité SAGEF -> Cité SAGEF
|
| 125 |
-
Cité Serigne Mansour -> Cité Serigne Mansour
|
| 126 |
-
Cité SOCABEG -> Cité SOCABEG
|
| 127 |
-
Cité SOTRAC -> Cité SOTRAC
|
| 128 |
-
Cité Yacine Diop -> Cité Yacine Diop
|
| 129 |
-
Claudel -> Claudel
|
| 130 |
-
Collège la Liberté -> Collège la Liberté
|
| 131 |
-
Colobane -> Colobane
|
| 132 |
-
Colobane Rufisque -> Colobane Rufisque
|
| 133 |
-
Comico Yeumbeul -> Comico Yeumbeul
|
| 134 |
-
Corniche -> Corniche
|
| 135 |
-
Corniche Fadia -> Corniche Fadia
|
| 136 |
-
Corniche Guédiawaye -> Corniche Guédiawaye
|
| 137 |
-
Croisement 22 -> Croisement vingt-deux
|
| 138 |
-
Croisement Bethio -> Croisement Bethio
|
| 139 |
-
Croisement Cambérène -> Croisement Cambérène
|
| 140 |
-
Croisement Cheikh Bethio -> Croisement Cheikh Bethio
|
| 141 |
-
Croisement Dial Mbaye -> Croisement Dial Mbaye
|
| 142 |
-
Croisement Dior -> Croisement Dior
|
| 143 |
-
Croisement Gadaye -> Croisement Gadaye
|
| 144 |
-
Croisement Grand Mbao -> Croisement Grand Mbao
|
| 145 |
-
Croisement Keur Massar -> Croisement Keur Massar
|
| 146 |
-
Croisement Keurmassar -> Croisement Keurmassar
|
| 147 |
-
Croisement Mame Abdou -> Croisement Mame Abdou
|
| 148 |
-
Croisement Niague (Cité Sicap) -> Croisement Niague
|
| 149 |
-
Croisement Niagues -> Croisement Niagues
|
| 150 |
-
Croisement PAI -> Croisement PAI
|
| 151 |
-
Croisement Tally Diallo -> Croisement Tally Diallo
|
| 152 |
-
Croisement Tivaouane Peulh -> Croisement Tivaouane Peulh
|
| 153 |
-
Croisement Yeumbeul -> Croisement Yeumbeul
|
| 154 |
-
Croisement ZAC Mbao -> Croisement ZAC Mbao
|
| 155 |
-
CTO -> CTO
|
| 156 |
-
Dangou -> Dangou
|
| 157 |
-
Darou Missel -> Darou Missel
|
| 158 |
-
Darou Thioub -> Darou Thioub
|
| 159 |
-
Daroukhane -> Daroukhane
|
| 160 |
-
Daroukhane Keur Serigne Assane -> Daroukhane Keur Serigne Assane
|
| 161 |
-
Derklé -> Derklé
|
| 162 |
-
Deux Voies Notaire -> Deux Voies Notaire
|
| 163 |
-
Dial Mbaay -> Dial Mbaay
|
| 164 |
-
Dial Mbaye -> Dial Mbaye
|
| 165 |
-
Diamaguène -> Diamaguène
|
| 166 |
-
Diamalaye -> Diamalaye
|
| 167 |
-
Diamniadio -> Diamniadio
|
| 168 |
-
Dieuppeul -> Dieuppeul
|
| 169 |
-
Dieuppeul (Sapeurs Pompiers) -> Dieuppeul
|
| 170 |
-
Dior -> Dior
|
| 171 |
-
Dioutyba -> Dioutyba
|
| 172 |
-
Dioutyba (Rufisque) -> Dioutyba
|
| 173 |
-
Dispensaire Nabil Choucair -> Dispensaire Nabil Choucair
|
| 174 |
-
Djiddah Thiaroye Kao -> Djiddah Thiaroye Kao
|
| 175 |
-
Dougar -> Dougar
|
| 176 |
-
Echangeur Cyrnos -> Echangeur Cyrnos
|
| 177 |
-
Echangeur de Hann -> Echangeur de Hann
|
| 178 |
-
Echangeur de la Foire -> Echangeur de la Foire
|
| 179 |
-
Echangeur Hann -> Echangeur Hann
|
| 180 |
-
Echangeur Patte d'Oie -> Echangeur Patte d'Oie
|
| 181 |
-
Echangeur Rufisque-Ouest -> Echangeur Rufisque-Ouest
|
| 182 |
-
Ecobank -> Ecobank
|
| 183 |
-
Entrée Ouakam -> Entrée Ouakam
|
| 184 |
-
Espace HLM Gd Médine (Face Autoroute) -> Espace HLM Gd Médine
|
| 185 |
-
Fadia -> Fadia
|
| 186 |
-
Fass -> Fass
|
| 187 |
-
Fass Mbao -> Fass Mbao
|
| 188 |
-
Fass Mbao (Rail-Ba) -> Fass Mbao
|
| 189 |
-
Fass Rufisque -> Fass Rufisque
|
| 190 |
-
Fassmbao -> Fassmbao
|
| 191 |
-
Foire -> Foire
|
| 192 |
-
Front de Terre -> Front de Terre
|
| 193 |
-
G.dakar -> G.dakar
|
| 194 |
-
Gadaye -> Gadaye
|
| 195 |
-
Gadaye (Guédiawaye) -> Gadaye
|
| 196 |
-
Garage Guédiawaye -> Garage Guédiawaye
|
| 197 |
-
Gare de Colobane -> Gare de Colobane
|
| 198 |
-
Gare de Dakar -> Gare de Dakar
|
| 199 |
-
Gare de Diamniadio -> Gare de Diamniadio
|
| 200 |
-
Gare de Petersen -> Gare de Petersen
|
| 201 |
-
Gare des Baux Maraîchers -> Gare des Baux Maraîchers
|
| 202 |
-
Gare des Parcelles Assainies -> Gare des Parcelles Assainies
|
| 203 |
-
Gare Lat Dior -> Gare Lat Dior
|
| 204 |
-
Gare Lat-Dior -> Gare Lat Dior
|
| 205 |
-
Gare Petersen -> Gare Petersen
|
| 206 |
-
Gare routière de Colobane -> Gare routière de Colobane
|
| 207 |
-
Giratoire de Liberté VI -> Giratoire de Liberté six
|
| 208 |
-
Giratoire Liberté 6 -> Giratoire Liberté six
|
| 209 |
-
Giratoire Liberté VI -> Giratoire Liberté six
|
| 210 |
-
Golf -> Golf
|
| 211 |
-
Golf Fadia -> Golf Fadia
|
| 212 |
-
Gorom 1 -> Gorom un
|
| 213 |
-
Gorom 2 -> Gorom deux
|
| 214 |
-
Grand Dakar -> Grand Dakar
|
| 215 |
-
Grand Mbao -> Grand Mbao
|
| 216 |
-
Grand Yoff -> Grand Yoff
|
| 217 |
-
Grand-Yoff -> Grand Yoff
|
| 218 |
-
Groupement National des Sapeurs-Pompiers -> Groupement National des Sapeurs-Pompiers
|
| 219 |
-
Gueule Tapée -> Gueule Tapée
|
| 220 |
-
Gueule Tapée Claudel -> Gueule Tapée Claudel
|
| 221 |
-
Guédiawaye -> Guédiawaye
|
| 222 |
-
Guédiawaye Cité des Enseignants -> Guédiawaye Cité des Enseignants
|
| 223 |
-
Hamo 6 -> Hamo six
|
| 224 |
-
Hamo III -> Hamo trois
|
| 225 |
-
Hamo IV -> Hamo quatre
|
| 226 |
-
Hamo V/vi -> Hamo cinq/six
|
| 227 |
-
Hamo VI -> Hamo six
|
| 228 |
-
HLM -> HLM
|
| 229 |
-
HLM Grand Yoff -> HLM Grand Yoff
|
| 230 |
-
HLM Guédiawaye -> HLM Guédiawaye
|
| 231 |
-
HLM Rufisque -> HLM Rufisque
|
| 232 |
-
Hydrocarbures -> Hydrocarbures
|
| 233 |
-
Hôpital Abass Ndao -> Hôpital Abass Ndao
|
| 234 |
-
Hôpital Keur Massar -> Hôpital Keur Massar
|
| 235 |
-
Hôpital Principal -> Hôpital Principal
|
| 236 |
-
Hôpital Roi Baudouin -> Hôpital Roi Baudouin
|
| 237 |
-
Hôpital Youssou Mbargane -> Hôpital Youssou Mbargane
|
| 238 |
-
Hôpital Youssou Mbargane Diop -> Hôpital Youssou Mbargane Diop
|
| 239 |
-
Hôtel de Ville -> Hôtel de Ville
|
| 240 |
-
Imprimerie Nationale -> Imprimerie Nationale
|
| 241 |
-
Jaxaay -> Jaxaay
|
| 242 |
-
Jaxaay 1 -> Jaxaay un
|
| 243 |
-
Jaxaay 2 -> Jaxaay deux
|
| 244 |
-
JVC -> JVC
|
| 245 |
-
Keur Daouda Sarr -> Keur Daouda Sarr
|
| 246 |
-
Keur Massar -> Keur Massar
|
| 247 |
-
Keur Massar (Cité MTOA) -> Keur Massar
|
| 248 |
-
Keur Massar (Marché) -> Keur Massar
|
| 249 |
-
Keur Massar Extension -> Keur Massar Extension
|
| 250 |
-
Keur Mbaye Fall -> Keur Mbaye Fall
|
| 251 |
-
Keur Ndiaye Lo -> Keur Ndiaye Lo
|
| 252 |
-
Keur Ngoor (Rond-Point École Mariste) -> Keur Ngoor
|
| 253 |
-
Keurmassar -> Keurmassar
|
| 254 |
-
Keurmbaye Fall -> Keurmbaye Fall
|
| 255 |
-
Khaar -> Khaar
|
| 256 |
-
Khar Yalla -> Khar Yalla
|
| 257 |
-
Kharyalla -> Kharyalla
|
| 258 |
-
Khourounar -> Khourounar
|
| 259 |
-
Kounoune (Cité Cardinal Thiandoum) -> Kounoune
|
| 260 |
-
Kounoune Cité Assurance -> Kounoune Cité Assurance
|
| 261 |
-
Kounoune Ngalam -> Kounoune Ngalam
|
| 262 |
-
Lac Rose -> Lac Rose
|
| 263 |
-
Lat Dior -> Lat Dior
|
| 264 |
-
Les Mamelles (Monument Renaissance) -> Les Mamelles
|
| 265 |
-
Liberté 5 -> Liberté cinq
|
| 266 |
-
Liberté 6 -> Liberté six
|
| 267 |
-
Lobatt Fall -> Lobatt Fall
|
| 268 |
-
Lycée Canada -> Lycée Canada
|
| 269 |
-
Lycée Jaxaay -> Lycée Jaxaay
|
| 270 |
-
Lycée Kennedy -> Lycée Kennedy
|
| 271 |
-
Lycée Limamou Laye -> Lycée Limamou Laye
|
| 272 |
-
Lycée Limamoulaye -> Lycée Limamoulaye
|
| 273 |
-
Maison du Parti -> Maison du Parti
|
| 274 |
-
Malika -> Malika
|
| 275 |
-
Malika (Cité Sonatel) -> Malika
|
| 276 |
-
Malika Cimetière -> Malika Cimetière
|
| 277 |
-
Malika Montagne -> Malika Montagne
|
| 278 |
-
Malika Plage -> Malika Plage
|
| 279 |
-
Malika Terminus -> Malika Terminus
|
| 280 |
-
Mamelles -> Mamelles
|
| 281 |
-
Marché aux Poissons -> Marché aux Poissons
|
| 282 |
-
Marché Boubess -> Marché Boubess
|
| 283 |
-
Marché Cambérène -> Marché Cambérène
|
| 284 |
-
Marché Chavanel -> Marché Chavanel
|
| 285 |
-
Marché Colobane Rufisque -> Marché Colobane Rufisque
|
| 286 |
-
Marché Grand Yoff -> Marché Grand Yoff
|
| 287 |
-
Marché Jeudi -> Marché Jeudi
|
| 288 |
-
Marché Khelcom -> Marché Khelcom
|
| 289 |
-
Marché Mardi -> Marché Mardi
|
| 290 |
-
Marché Ndiarème -> Marché Ndiarème
|
| 291 |
-
Marché Tilène -> Marché Tilène
|
| 292 |
-
Marine Française -> Marine Française
|
| 293 |
-
Maristes -> Maristes
|
| 294 |
-
Maristes (Par Station Titan) -> Maristes
|
| 295 |
-
Mbédou Fass -> Mbédou Fass
|
| 296 |
-
Mermoz -> Mermoz
|
| 297 |
-
Mermoz Rond-Point Cheikh Bethio -> Mermoz Rond-Point Cheikh Bethio
|
| 298 |
-
Monument Serigne Saliou -> Monument Serigne Saliou
|
| 299 |
-
Mosquée Massalikoul Djinane -> Mosquée Massalikoul Djinane
|
| 300 |
-
MTOA -> MTOA
|
| 301 |
-
Médina -> Médina
|
| 302 |
-
Môle 10 -> Môle dix
|
| 303 |
-
Môle 8 -> Môle huit
|
| 304 |
-
Namora -> Namora
|
| 305 |
-
Ndiakhirate -> Ndiakhirate
|
| 306 |
-
Ngor -> Ngor
|
| 307 |
-
Niacourab -> Niacourab
|
| 308 |
-
Niakourab -> Niakourab
|
| 309 |
-
Niary Tally -> Niary Tally
|
| 310 |
-
Nord Foire -> Nord Foire
|
| 311 |
-
Notaire -> Notaire
|
| 312 |
-
Notaire (Guédiawaye) -> Notaire
|
| 313 |
-
Ouakam -> Ouakam
|
| 314 |
-
Ouakam Baye -> Ouakam Baye
|
| 315 |
-
P11 -> P onze
|
| 316 |
-
P11 Keur Massar -> P onze Keur Massar
|
| 317 |
-
PAI -> PAI
|
| 318 |
-
Palais 1 -> Palais un
|
| 319 |
-
Palais 2 -> Palais deux
|
| 320 |
-
Parc Lambaye -> Parc Lambaye
|
| 321 |
-
Parcelles Assainies -> Parcelles Assainies
|
| 322 |
-
Parcelles Dior -> Parcelles Dior
|
| 323 |
-
Parcelles Église -> Parcelles Église
|
| 324 |
-
Passage A Niveau -> Passage A Niveau
|
| 325 |
-
Patte d'Oie -> Patte d'Oie
|
| 326 |
-
Pattesd'oie -> Pattesd'oie
|
| 327 |
-
Penc Mi (Gueule Tapée) -> Penc Mi
|
| 328 |
-
Petersen -> Petersen
|
| 329 |
-
Petit Mbao -> Petit Mbao
|
| 330 |
-
Pharmacie Golf -> Pharmacie Golf
|
| 331 |
-
Pharmicie Abdourahmane -> Pharmicie Abdourahmane
|
| 332 |
-
Pikine Rue 10 -> Pikine Rue dix
|
| 333 |
-
Pikine Texaco -> Pikine Texaco
|
| 334 |
-
Piste d'Envol -> Piste d'Envol
|
| 335 |
-
Place Bakou -> Place Bakou
|
| 336 |
-
Place de l'Indépendance -> Place de l'Indépendance
|
| 337 |
-
Place de l'Obélisque -> Place de l'Obélisque
|
| 338 |
-
Place Leclerc -> Place Leclerc
|
| 339 |
-
Police des Parcelles Assainies -> Police des Parcelles Assainies
|
| 340 |
-
Police Guédiawaye -> Police Guédiawaye
|
| 341 |
-
Police Parcelles -> Police Parcelles
|
| 342 |
-
Police Thiaroye -> Police Thiaroye
|
| 343 |
-
Police Wakhinane -> Police Wakhinane
|
| 344 |
-
Pont Dangou -> Pont Dangou
|
| 345 |
-
Pont de Colobane -> Pont de Colobane
|
| 346 |
-
Pont de l'Émergence -> Pont de l'Émergence
|
| 347 |
-
Pont Hann -> Pont Hann
|
| 348 |
-
Pont Stade LSS -> Pont Stade LSS
|
| 349 |
-
Port (Môle 10 et 8) -> Port
|
| 350 |
-
Port de Dakar -> Port de Dakar
|
| 351 |
-
Poste Courant -> Poste Courant
|
| 352 |
-
Poste de Guédiawaye -> Poste de Guédiawaye
|
| 353 |
-
Poste de Police Thiaroye -> Poste de Police Thiaroye
|
| 354 |
-
Poste Fann -> Poste Fann
|
| 355 |
-
Poste Médina -> Poste Médina
|
| 356 |
-
Poste Médine -> Poste Médine
|
| 357 |
-
Poste Thiaroye -> Poste Thiaroye
|
| 358 |
-
Prolongement Rue 10 -> Prolongement Rue dix
|
| 359 |
-
Préfecture -> Préfecture
|
| 360 |
-
Préfecture Guédiawaye -> Préfecture Guédiawaye
|
| 361 |
-
Péage -> Péage
|
| 362 |
-
Quartier Cheikh Wade -> Quartier Cheikh Wade
|
| 363 |
-
Rd Point Seydou N Tall -> Rd Point Seydou N Tall
|
| 364 |
-
Retour Rue 17 -> Retour Rue dix-sept
|
| 365 |
-
Retour Rue 37 -> Retour Rue trente-sept
|
| 366 |
-
Rocade Fann / Bel Air -> Rocade Fann Bel Air
|
| 367 |
-
Rocade Fann Bel Air -> Rocade Fann Bel Air
|
| 368 |
-
Rocade Fann Bel-Air -> Rocade Fann Bel Air
|
| 369 |
-
Rocade Fannbel-Air -> Rocade Fannbel-Air
|
| 370 |
-
Rond-Point Almadies -> Rond-Point Almadies
|
| 371 |
-
Rond-Point Arafat -> Rond-Point Arafat
|
| 372 |
-
Rond-Point Caisse de Sécurité Sociale -> Rond-Point Caisse de Sécurité Sociale
|
| 373 |
-
Rond-Point Cambérène (Case Bi) -> Rond-Point Cambérène
|
| 374 |
-
Rond-Point Case Bi -> Rond-Point Case Bi
|
| 375 |
-
Rond-Point Cité Pénitence -> Rond-Point Cité Pénitence
|
| 376 |
-
Rond-Point Colobane -> Rond-Point Colobane
|
| 377 |
-
Rond-Point de Cambérène (Casebi) -> Rond-Point de Cambérène
|
| 378 |
-
Rond-Point Dial Mbaay -> Rond-Point Dial Mbaay
|
| 379 |
-
Rond-Point Dioutyba -> Rond-Point Dioutyba
|
| 380 |
-
Rond-Point Djouti Ba Rufisque -> Rond-Point Djouti Ba Rufisque
|
| 381 |
-
Rond-Point Fann -> Rond-Point Fann
|
| 382 |
-
Rond-Point Jet d'Eau -> Rond-Point Jet d'Eau
|
| 383 |
-
Rond-Point Keur Massar -> Rond-Point Keur Massar
|
| 384 |
-
Rond-Point le Virage -> Rond-Point le Virage
|
| 385 |
-
Rond-Point Liberté 6 -> Rond-Point Liberté six
|
| 386 |
-
Rond-Point Malibu -> Rond-Point Malibu
|
| 387 |
-
Rond-Point Môle 8 -> Rond-Point Môle huit
|
| 388 |
-
Rond-Point SCOA -> Rond-Point SCOA
|
| 389 |
-
Rond-Point Seven Up -> Rond-Point Seven Up
|
| 390 |
-
Rond-Point Shell Keur Massar -> Rond-Point Shell Keur Massar
|
| 391 |
-
Rond-Point Station Shell Keur Massar -> Rond-Point Station Shell Keur Massar
|
| 392 |
-
Route de Boune -> Route de Boune
|
| 393 |
-
Route de Front de Terre -> Route de Front de Terre
|
| 394 |
-
Route de Hann -> Route de Hann
|
| 395 |
-
Route de Jaxaay -> Route de Jaxaay
|
| 396 |
-
Route de Jaxxay -> Route de Jaxxay
|
| 397 |
-
Route de l'Aéroport -> Route de l'Aéroport
|
| 398 |
-
Route de l'Hôpital Général de Gd Yoff (Hoggy) -> Route de l'Hôpital Général de Gd Yoff
|
| 399 |
-
Route de l'Église -> Route de l'Église
|
| 400 |
-
Route de Malika -> Route de Malika
|
| 401 |
-
Route de Ngor -> Route de Ngor
|
| 402 |
-
Route de Ouakam -> Route de Ouakam
|
| 403 |
-
Route de Rufisque -> Route de Rufisque
|
| 404 |
-
Route de Sangalkam -> Route de Sangalkam
|
| 405 |
-
Route de Yarakh -> Route de Yarakh
|
| 406 |
-
Route de Yeumbeul -> Route de Yeumbeul
|
| 407 |
-
Route des HLM Rufisque -> Route des HLM Rufisque
|
| 408 |
-
Route des Niayes -> Route des Niayes
|
| 409 |
-
Route des Niayes (Guédiawaye) -> Route des Niayes
|
| 410 |
-
Route des Niayes Prolongée -> Route des Niayes Prolongée
|
| 411 |
-
Route des Niayes Prolongée (Police des P Assainies) -> Route des Niayes Prolongée
|
| 412 |
-
Route du Collège Sacré Cœur -> Route du Collège Sacré Cœur
|
| 413 |
-
Route du Front de Terre -> Route du Front de Terre
|
| 414 |
-
Route du Marché des Parcelles Assainies -> Route du Marché des Parcelles Assainies
|
| 415 |
-
Route du Stade (Taliboubess) -> Route du Stade
|
| 416 |
-
Route du Stade LSS (Taliboubess) -> Route du Stade LSS
|
| 417 |
-
Route HLM Grand Médine -> Route HLM Grand Médine
|
| 418 |
-
Route Nationale -> Route Nationale
|
| 419 |
-
Route Nationale 1 -> Route Nationale un
|
| 420 |
-
Route Nationale N° 1 -> Route Nationale N° un
|
| 421 |
-
Route Nationale N°1 -> Route Nationale N° un
|
| 422 |
-
Route Principale de Grand Yoff (Par Bassin Retention) -> Route Principale de Grand Yoff
|
| 423 |
-
Route Principale de Ouakam (Marché) -> Route Principale de Ouakam
|
| 424 |
-
Route Principale des Parcelles Assainies -> Route Principale des Parcelles Assainies
|
| 425 |
-
Rte Corniche de HLM Gd Médine -> Rte Corniche de HLM Gd Médine
|
| 426 |
-
Rte des Niayes (Police Parcelles) -> Rte des Niayes
|
| 427 |
-
Rte des Niayes Prolongée (Police Parcelles) -> Rte des Niayes Prolongée
|
| 428 |
-
RTS -> RTS
|
| 429 |
-
Rue 1 Pikine Ouest -> Rue un Pikine Ouest
|
| 430 |
-
Rue 10 -> Rue dix
|
| 431 |
-
Rue 10 Grand Dakar -> Rue dix Grand Dakar
|
| 432 |
-
Rue 10 Pikine Ouest (R802) -> Rue dix Pikine Ouest
|
| 433 |
-
Rue 10 Prolongée -> Rue dix Prolongée
|
| 434 |
-
Rue 11 -> Rue onze
|
| 435 |
-
Rue 22 -> Rue vingt-deux
|
| 436 |
-
Rue 25 -> Rue vingt-cinq
|
| 437 |
-
Rue 25 (Retour Par Rue 37) -> Rue vingt-cinq
|
| 438 |
-
Rue 34 -> Rue trente-quatre
|
| 439 |
-
Rue 37 -> Rue trente-sept
|
| 440 |
-
Rue 39 -> Rue trente-neuf
|
| 441 |
-
Rue 39 (Retour Par Rue 17) -> Rue trente-neuf
|
| 442 |
-
Rue 6 -> Rue six
|
| 443 |
-
Rue 9 -> Rue neuf
|
| 444 |
-
Rue 9bis -> Rue neuf bis
|
| 445 |
-
Rue Abebebikila (Rue 11 Prolongée) -> Rue Abebebikila
|
| 446 |
-
Rue Cheik Ahmadou Bamba Prolongée -> Rue Cheik Ahmadou Bamba Prolongée
|
| 447 |
-
Rue Cheikh Wade -> Rue Cheikh Wade
|
| 448 |
-
Rue de la Somme -> Rue de la Somme
|
| 449 |
-
Rue de Reims Prolongée -> Rue de Reims Prolongée
|
| 450 |
-
Rue des Dardanelles -> Rue des Dardanelles
|
| 451 |
-
Rue El Hadj Amadou Malick Gaye (Bopp) -> Rue El Hadj Amadou Malick Gaye
|
| 452 |
-
Rue Mangin -> Rue Mangin
|
| 453 |
-
Rue Marsat (Rue 127) -> Rue Marsat
|
| 454 |
-
Rue P -> Rue P
|
| 455 |
-
Rue Sandiniery -> Rue Sandiniery
|
| 456 |
-
Rue10 Pikine -> Rue dix Pikine
|
| 457 |
-
Rues 754 et 759 -> Rues sept cent cinquante-quatre et sept cent cinquante-neuf
|
| 458 |
-
Rufisque -> Rufisque
|
| 459 |
-
Rufisque Arafat -> Rufisque Arafat
|
| 460 |
-
Rufisque Cité Tacco -> Rufisque Cité Tacco
|
| 461 |
-
Rufisque Gouye Mouride -> Rufisque Gouye Mouride
|
| 462 |
-
Rufisque Nord 73 -> Rufisque Nord soixante-treize
|
| 463 |
-
Rufisque SONADIS -> Rufisque SONADIS
|
| 464 |
-
Sacré Cœur -> Sacré Cœur
|
| 465 |
-
Sacré-Cœur -> Sacré Cœur
|
| 466 |
-
SAFCO -> SAFCO
|
| 467 |
-
SAHM -> Sahm
|
| 468 |
-
Sahm -> Sahm
|
| 469 |
-
Sam Notaire -> Sam Notaire
|
| 470 |
-
Sangalkam -> Sangalkam
|
| 471 |
-
Sapeurs-Pompiers de Gw -> Sapeurs-Pompiers de Gw
|
| 472 |
-
Sapeurs-Pompiers Parcelles -> Sapeurs-Pompiers Parcelles
|
| 473 |
-
SCAT Urbam -> SCAT Urbam
|
| 474 |
-
SCOA -> SCOA
|
| 475 |
-
Score Liberté -> Score Liberté
|
| 476 |
-
SDE Guédiawaye -> SDE Guédiawaye
|
| 477 |
-
SDE Serigne Assane -> SDE Serigne Assane
|
| 478 |
-
SEDIMA -> SEDIMA
|
| 479 |
-
SERAS -> SERAS
|
| 480 |
-
Serigne Assane -> Serigne Assane
|
| 481 |
-
Serigneassane -> Serigneassane
|
| 482 |
-
Service d'Hygiène -> Service d'Hygiène
|
| 483 |
-
SHAM -> SHAM
|
| 484 |
-
Shell SEDIMA -> Shell SEDIMA
|
| 485 |
-
SICAP Mbao -> SICAP Mbao
|
| 486 |
-
Sipres -> Sipres
|
| 487 |
-
SIPS -> SIPS
|
| 488 |
-
Siège Expresso Ouakam -> Siège Expresso Ouakam
|
| 489 |
-
SOCOCIM -> SOCOCIM
|
| 490 |
-
SONADIS -> SONADIS
|
| 491 |
-
SONADIS Rufisque -> SONADIS Rufisque
|
| 492 |
-
Sortie Pikine -> Sortie Pikine
|
| 493 |
-
Sphère ministérielle -> Sphère ministérielle
|
| 494 |
-
Stade Amadou Barry -> Stade Amadou Barry
|
| 495 |
-
Stade de Rufisque -> Stade de Rufisque
|
| 496 |
-
Stade Dembadiop -> Stade Dembadiop
|
| 497 |
-
Stade L.s.s -> Stade L.s.s
|
| 498 |
-
Station Keur Massar -> Station Keur Massar
|
| 499 |
-
Station Keurmassar -> Station Keurmassar
|
| 500 |
-
Station MTOA -> Station MTOA
|
| 501 |
-
Station Toure -> Station Toure
|
| 502 |
-
Station Yeumbeul -> Station Yeumbeul
|
| 503 |
-
Sébikotane -> Sébikotane
|
| 504 |
-
Tableau Ferrailles -> Tableau Ferrailles
|
| 505 |
-
Tally Bou Bess -> Tally Bou Bess
|
| 506 |
-
Tally Boubess -> Tally Boubess
|
| 507 |
-
Tally Boumack -> Tally Boumack
|
| 508 |
-
Tally Diallo -> Tally Diallo
|
| 509 |
-
Tally Icotaf -> Tally Icotaf
|
| 510 |
-
Tally Icotaf Pikine -> Tally Icotaf Pikine
|
| 511 |
-
Tally Icotaf X Rte des Niayes (Pikine) -> Tally Icotaf dix Rte des Niayes
|
| 512 |
-
Tallyboumack -> Tallyboumack
|
| 513 |
-
Tallyicotaf -> Tallyicotaf
|
| 514 |
-
Tawfeex -> Tawfeex
|
| 515 |
-
Technopole -> Technopole
|
| 516 |
-
Tenn Bi -> Tenn Bi
|
| 517 |
-
Thiaroye -> Thiaroye
|
| 518 |
-
Thiawlène -> Thiawlène
|
| 519 |
-
Thiawlène (Rufisque) -> Thiawlène
|
| 520 |
-
Thierno Ndiaye -> Thierno Ndiaye
|
| 521 |
-
Tivaouane Peul -> Tivaouane Peul
|
| 522 |
-
Tivaouane Peulh -> Tivaouane Peulh
|
| 523 |
-
Toubab Dialaw -> Toubab Dialaw
|
| 524 |
-
Tournal Boune -> Tournal Boune
|
| 525 |
-
Tribunal de Pikine -> Tribunal de Pikine
|
| 526 |
-
UCAD -> UCAD
|
| 527 |
-
UCAD (Claudel) -> UCAD
|
| 528 |
-
UE 02 -> UE zéro deux
|
| 529 |
-
Unité 15 -> Unité quinze
|
| 530 |
-
Unité 3 Cinéma -> Unité trois Cinéma
|
| 531 |
-
Unités 5 -> Unités cinq
|
| 532 |
-
Unités de Voisinage : 10 -> Unités de Voisinage : dix
|
| 533 |
-
Université -> Université
|
| 534 |
-
Université Cheikh Anta Diop -> Université Cheikh Anta Diop
|
| 535 |
-
VDN -> VDN
|
| 536 |
-
VDN 3 -> VDN trois
|
| 537 |
-
VDN Prolongée -> VDN Prolongée
|
| 538 |
-
Village de Ngor -> Village de Ngor
|
| 539 |
-
Village de Ouakam -> Village de Ouakam
|
| 540 |
-
Virage Gauche Torino -> Virage Gauche Torino
|
| 541 |
-
Voie de Dégagement Nord (VDN) -> Voie de Dégagement Nord
|
| 542 |
-
Wakhinanenimzatt (Rue 212) -> Wakhinanenimzatt
|
| 543 |
-
Yenne -> Yenne
|
| 544 |
-
Yeumbeul -> Yeumbeul
|
| 545 |
-
Yeumbeul Bene Baraque -> Yeumbeul Bene Baraque
|
| 546 |
-
Yoff -> Yoff
|
| 547 |
-
Yoff Village -> Yoff Village
|
| 548 |
-
Yoff-Village -> Yoff Village
|
| 549 |
-
ZAC 3 Bis Kounoune -> ZAC trois Bis Kounoune
|
| 550 |
-
ZAC Mbao -> ZAC Mbao
|
| 551 |
-
Zone B -> Zone B
|
| 552 |
-
Zone de Captage -> Zone de Captage
|
| 553 |
-
École Dior -> École Dior
|
| 554 |
-
École Japonaise -> École Japonaise
|
| 555 |
-
École Normale -> École Normale
|
| 556 |
-
École Police -> École Police
|
| 557 |
-
Église -> Église
|
| 558 |
-
Église Parcelles -> Église Parcelles
|
| 559 |
-
Église Saint-Joseph -> Église Saint-Joseph
|
| 560 |
-
Étage Madiale -> Étage Madiale
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
scripts/lieux_prioritaires.txt
DELETED
|
@@ -1,43 +0,0 @@
|
|
| 1 |
-
Poste Thiaroye | 24 | Poste Thiaroye
|
| 2 |
-
Bountou Pikine | 17 | Bountou Pikine
|
| 3 |
-
Croisement Cambérène | 17 | Croisement Cambérène
|
| 4 |
-
Route des Niayes | 16 | Route des Niayes, Route des Niayes (Guédiawaye)
|
| 5 |
-
Croisement Keur Massar | 13 | Croisement Keur Massar
|
| 6 |
-
Autoroute | 12 | Autoroute
|
| 7 |
-
Avenue Blaise Diagne | 11 | Av Blaise Diagne, Avenue Blaise Diagne
|
| 8 |
-
Colobane | 11 | Colobane
|
| 9 |
-
Fass Mbao | 10 | Fass Mbao, Fass Mbao (Rail-Ba)
|
| 10 |
-
Case Ba | 9 | Case Ba, Case-Ba
|
| 11 |
-
Keur Massar | 9 | Keur Massar, Keur Massar (Cité MTOA), Keur Massar (Marché)
|
| 12 |
-
UCAD | 9 | UCAD, UCAD (Claudel)
|
| 13 |
-
Avenue Bourguiba | 8 | Av Bourguiba, Avenue Bourguiba
|
| 14 |
-
Diamaguène | 8 | Diamaguène
|
| 15 |
-
Palais un | 8 | Palais 1
|
| 16 |
-
Patte d'Oie | 8 | Patte d'Oie
|
| 17 |
-
Pont de l'Émergence | 8 | Pont de l'Émergence
|
| 18 |
-
Route Nationale un | 8 | Route Nationale 1
|
| 19 |
-
Station Keur Massar | 8 | Station Keur Massar
|
| 20 |
-
Tally Diallo | 8 | Tally Diallo
|
| 21 |
-
Keur Mbaye Fall | 7 | Keur Mbaye Fall
|
| 22 |
-
Liberté cinq | 7 | Liberté 5
|
| 23 |
-
Malika | 7 | Malika, Malika (Cité Sonatel)
|
| 24 |
-
Ouakam | 7 | Ouakam
|
| 25 |
-
Palais deux | 7 | Palais 2
|
| 26 |
-
Petersen | 7 | Petersen
|
| 27 |
-
Police Thiaroye | 7 | Police Thiaroye
|
| 28 |
-
Route Nationale N° un | 7 | Route Nationale N° 1, Route Nationale N°1
|
| 29 |
-
Rufisque | 7 | Rufisque
|
| 30 |
-
Avenue Cheikh Anta Diop | 6 | Av Cheikh Anta Diop, Avenue Cheikh Anta Diop
|
| 31 |
-
Bargny | 6 | Bargny, Bargny (Gare Ferroviaire)
|
| 32 |
-
Echangeur Patte d'Oie | 6 | Echangeur Patte d'Oie
|
| 33 |
-
Lat Dior | 6 | Lat Dior
|
| 34 |
-
Route du Front de Terre | 6 | Route du Front de Terre
|
| 35 |
-
Allées Papa Gueye Fall | 5 | Allées Papa Gueye Fall
|
| 36 |
-
Avenue Emile Badiane | 5 | Av Emile Badiane, Av. Emile Badiane, Avenue Emile Badiane
|
| 37 |
-
Aéroport LSS | 5 | Aéroport LSS
|
| 38 |
-
Branche Est Autoroute | 5 | Branche Est Autoroute, Branche Est-Autoroute
|
| 39 |
-
Castors | 5 | Castors
|
| 40 |
-
Croisement Tivaouane Peulh | 5 | Croisement Tivaouane Peulh
|
| 41 |
-
Gadaye | 5 | Gadaye, Gadaye (Guédiawaye)
|
| 42 |
-
Almadies | 4 | Almadies
|
| 43 |
-
AIBD | 1 | AIBD
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/app/app.py
DELETED
|
@@ -1,589 +0,0 @@
|
|
| 1 |
-
"""Interface Streamlit de l'assistant bus wolof : voix ou texte en wolof -> ligne de bus.
|
| 2 |
-
|
| 3 |
-
Le flux complet enchaîne les briques du pipeline :
|
| 4 |
-
voix -> transcrire() (whisper-small-wolof) -> extract_intent() (LLM) -> StopsMatcher.find_line() (CSV)
|
| 5 |
-
Le mode texte saute simplement la première étape.
|
| 6 |
-
"""
|
| 7 |
-
|
| 8 |
-
from __future__ import annotations
|
| 9 |
-
|
| 10 |
-
import hashlib
|
| 11 |
-
import html
|
| 12 |
-
import sys
|
| 13 |
-
import time
|
| 14 |
-
from pathlib import Path
|
| 15 |
-
|
| 16 |
-
import numpy as np
|
| 17 |
-
import streamlit as st
|
| 18 |
-
|
| 19 |
-
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
|
| 20 |
-
|
| 21 |
-
from asr.transcribe import SAMPLE_RATE, load_audio, load_model, transcrire
|
| 22 |
-
from intent.extract_intent import extract_intent, get_client
|
| 23 |
-
from matching.stops_matcher import StopsMatcher
|
| 24 |
-
from tts.speak import (
|
| 25 |
-
Tts,
|
| 26 |
-
cache_complet,
|
| 27 |
-
load_tts,
|
| 28 |
-
nombre_en_wolof,
|
| 29 |
-
numero_de,
|
| 30 |
-
phrase_reponse,
|
| 31 |
-
synthetiser,
|
| 32 |
-
voix_depuis_cache,
|
| 33 |
-
)
|
| 34 |
-
|
| 35 |
-
# Audios de secours pour la démo : si le micro ou la salle trahit, on rejoue un
|
| 36 |
-
# enregistrement propre qui passe exactement par le même pipeline.
|
| 37 |
-
DEMO_AUDIO_DIR = Path(__file__).resolve().parents[2] / "data" / "demo_audio"
|
| 38 |
-
|
| 39 |
-
EXEMPLES = [
|
| 40 |
-
"ma ngi ci Liberté 5, bëgg naa dem Palais 2",
|
| 41 |
-
"maa ngi Guédiawaye, daldi naa dem Palais 1",
|
| 42 |
-
"ma ngi ci Palais 1, bëgg naa dem Guédiawaye",
|
| 43 |
-
"sant de sante Liberté 5, bëgg bi dem Palais 2",
|
| 44 |
-
]
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
# --------------------------------------------------------------------------- #
|
| 48 |
-
# Apparence. Aucun impact sur la logique : uniquement du CSS et de la mise en
|
| 49 |
-
# page, injectés une fois par run.
|
| 50 |
-
# --------------------------------------------------------------------------- #
|
| 51 |
-
|
| 52 |
-
VERT = "#00853F" # vert du Senegal
|
| 53 |
-
|
| 54 |
-
CSS_APP = f"""
|
| 55 |
-
<style>
|
| 56 |
-
.gd-entete {{
|
| 57 |
-
border-left: 6px solid {VERT};
|
| 58 |
-
padding: 0.2rem 0 0.2rem 1rem;
|
| 59 |
-
margin-bottom: 1.4rem;
|
| 60 |
-
}}
|
| 61 |
-
.gd-entete .gd-titre {{
|
| 62 |
-
font-size: 2.6rem;
|
| 63 |
-
font-weight: 800;
|
| 64 |
-
line-height: 1.1;
|
| 65 |
-
margin: 0;
|
| 66 |
-
}}
|
| 67 |
-
.gd-entete .gd-wolof {{
|
| 68 |
-
color: {VERT};
|
| 69 |
-
font-size: 1.15rem;
|
| 70 |
-
font-weight: 600;
|
| 71 |
-
font-style: italic;
|
| 72 |
-
margin-top: 0.35rem;
|
| 73 |
-
}}
|
| 74 |
-
.gd-entete .gd-fr {{
|
| 75 |
-
color: #55625B;
|
| 76 |
-
font-size: 1.02rem;
|
| 77 |
-
margin-top: 0.1rem;
|
| 78 |
-
}}
|
| 79 |
-
|
| 80 |
-
.gd-carte {{
|
| 81 |
-
border: 1px solid #D6E6DC;
|
| 82 |
-
border-top: 6px solid {VERT};
|
| 83 |
-
border-radius: 0.7rem;
|
| 84 |
-
background: linear-gradient(180deg, #F6FBF8 0%, #FFFFFF 55%);
|
| 85 |
-
padding: 1rem 1.3rem 1.1rem 1.3rem;
|
| 86 |
-
margin: 0.2rem 0 0.6rem 0;
|
| 87 |
-
}}
|
| 88 |
-
.gd-carte .gd-compagnie {{
|
| 89 |
-
color: {VERT};
|
| 90 |
-
font-size: 0.82rem;
|
| 91 |
-
font-weight: 700;
|
| 92 |
-
letter-spacing: 0.14em;
|
| 93 |
-
text-transform: uppercase;
|
| 94 |
-
margin: 0;
|
| 95 |
-
}}
|
| 96 |
-
.gd-carte .gd-numero {{
|
| 97 |
-
color: {VERT};
|
| 98 |
-
font-size: 4.4rem;
|
| 99 |
-
font-weight: 800;
|
| 100 |
-
line-height: 1;
|
| 101 |
-
margin: 0.1rem 0 0.35rem 0;
|
| 102 |
-
}}
|
| 103 |
-
.gd-carte .gd-trajet {{
|
| 104 |
-
color: #17211C;
|
| 105 |
-
font-size: 1.28rem;
|
| 106 |
-
font-weight: 600;
|
| 107 |
-
margin: 0;
|
| 108 |
-
}}
|
| 109 |
-
.gd-carte .gd-categorie {{
|
| 110 |
-
color: #6B7A72;
|
| 111 |
-
font-size: 0.85rem;
|
| 112 |
-
margin-top: 0.3rem;
|
| 113 |
-
}}
|
| 114 |
-
|
| 115 |
-
.gd-pied {{
|
| 116 |
-
color: #8A968F;
|
| 117 |
-
font-size: 0.8rem;
|
| 118 |
-
text-align: center;
|
| 119 |
-
border-top: 1px solid #E3EAE6;
|
| 120 |
-
padding-top: 0.7rem;
|
| 121 |
-
margin-top: 2.2rem;
|
| 122 |
-
}}
|
| 123 |
-
</style>
|
| 124 |
-
"""
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
def afficher_css() -> None:
|
| 128 |
-
"""Injecte la feuille de style (idempotent : meme CSS a chaque run)."""
|
| 129 |
-
st.markdown(CSS_APP, unsafe_allow_html=True)
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
def afficher_entete() -> None:
|
| 133 |
-
"""Titre, puis la promesse en wolof et en francais."""
|
| 134 |
-
st.markdown(
|
| 135 |
-
f"""
|
| 136 |
-
<div class="gd-entete">
|
| 137 |
-
<div class="gd-titre">🚌 GuindiMa AI</div>
|
| 138 |
-
<div class="gd-wolof">Wax ma fu nga jëm, ma won la bus bi</div>
|
| 139 |
-
<div class="gd-fr">Dis-moi où tu vas, je te montre le bus</div>
|
| 140 |
-
</div>
|
| 141 |
-
""",
|
| 142 |
-
unsafe_allow_html=True,
|
| 143 |
-
)
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
def _texte(valeur) -> str:
|
| 147 |
-
"""Échappe une valeur avant de l'injecter en HTML."""
|
| 148 |
-
return html.escape(str(valeur if valeur is not None else ""))
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
def afficher_carte_ligne(match: dict) -> None:
|
| 152 |
-
"""Grande carte : compagnie, numéro de ligne en très gros, trajet en dessous.
|
| 153 |
-
|
| 154 |
-
Le numéro affiché est aussi énoncé en wolof : c'est la version que le
|
| 155 |
-
locuteur pronunciera, ce qui évite de lire un chiffre à l'écran.
|
| 156 |
-
"""
|
| 157 |
-
numero = numero_de(match.get("ligne"))
|
| 158 |
-
# numero_de() renvoie None si le CSV n'a pas de numero : nombre_en_wolof()
|
| 159 |
-
# fait int(n) et leverait TypeError sur None, donc on garde l'affichage nu.
|
| 160 |
-
if numero is None:
|
| 161 |
-
affiche, en_wolof = match.get("ligne", ""), ""
|
| 162 |
-
else:
|
| 163 |
-
affiche, en_wolof = numero, f"ligne {html.escape(nombre_en_wolof(numero))}"
|
| 164 |
-
details = " · ".join(part for part in (_texte(match.get("categorie")), en_wolof) if part)
|
| 165 |
-
st.markdown(
|
| 166 |
-
f"""
|
| 167 |
-
<div class="gd-carte">
|
| 168 |
-
<div class="gd-compagnie">{_texte(match.get('compagnie'))}</div>
|
| 169 |
-
<div class="gd-numero">{_texte(affiche)}</div>
|
| 170 |
-
<div class="gd-trajet">
|
| 171 |
-
{_texte(match.get('depart'))} → {_texte(match.get('arrivee'))}
|
| 172 |
-
</div>
|
| 173 |
-
<div class="gd-categorie">{details}</div>
|
| 174 |
-
</div>
|
| 175 |
-
""",
|
| 176 |
-
unsafe_allow_html=True,
|
| 177 |
-
)
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
def afficher_pied() -> None:
|
| 181 |
-
"""Pied de page discret : d'où viennent les données et les modèles."""
|
| 182 |
-
st.markdown(
|
| 183 |
-
'<div class="gd-pied">Données : Dakar Dem Dikk, Tata AFTU '
|
| 184 |
-
"· IA : Whisper wolof, NVIDIA Build</div>",
|
| 185 |
-
unsafe_allow_html=True,
|
| 186 |
-
)
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
@st.cache_resource
|
| 190 |
-
def get_matcher() -> StopsMatcher:
|
| 191 |
-
return StopsMatcher()
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
@st.cache_resource
|
| 195 |
-
def get_llm_client():
|
| 196 |
-
"""Client HTTP réutilisé entre les requêtes (st.cache_resource le garde en mémoire)."""
|
| 197 |
-
return get_client()
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
@st.cache_resource(show_spinner=False)
|
| 201 |
-
def get_asr_model():
|
| 202 |
-
"""Whisper wolof chargé une seule fois : le recharger à chaque question coûterait ~1 min."""
|
| 203 |
-
return load_model()
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
@st.cache_resource(show_spinner=False)
|
| 207 |
-
def get_tts() -> Tts:
|
| 208 |
-
"""SpeechT5 wolof chargé une seule fois : le recharger coûterait 578 Mo à chaque fois."""
|
| 209 |
-
return load_tts()
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
@st.cache_resource(show_spinner=False)
|
| 213 |
-
def prechauffer_voix_synthetisee() -> None:
|
| 214 |
-
"""Charge le TTS et le teste sur une phrase courte.
|
| 215 |
-
|
| 216 |
-
Le test ne sert qu'à vérifier que toute la chaîne marche (tokenizer, modèle,
|
| 217 |
-
vociseur) : on le paie une fois au démarrage plutôt que de découvrir une
|
| 218 |
-
voix cassée après avoir répondu à l'utilisateur.
|
| 219 |
-
"""
|
| 220 |
-
synthetiser(get_tts(), "Baal ma, gisuma bus bu dem fa.")
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
def dire_la_reponse(lignes: list[dict], origine: str) -> None:
|
| 224 |
-
"""Fait lire le résultat, et le garde en mémoire pour ne pas le regénérer.
|
| 225 |
-
|
| 226 |
-
Deux chemins : les audios déjà sur disque (le cas de la démo, aucun modèle à
|
| 227 |
-
charger), sinon la synthèse en direct. Dans les deux cas le résultat est
|
| 228 |
-
mémorisé par phrase, car Streamlit relit tout le script à chaque clic et la
|
| 229 |
-
synthèse est lente. Volontairement pas décorée de cache_resource : elle a un
|
| 230 |
-
effet d'affichage, elle doit donc être rejouée à chaque rendu.
|
| 231 |
-
"""
|
| 232 |
-
if st.session_state.get("tts_ko"):
|
| 233 |
-
st.caption("Voix de synthèse indisponible, la réponse reste affichée en texte.")
|
| 234 |
-
return
|
| 235 |
-
|
| 236 |
-
phrase = phrase_reponse(lignes)
|
| 237 |
-
deja_vus = st.session_state.setdefault("audio_par_phrase", {})
|
| 238 |
-
|
| 239 |
-
# st.audio n'accepte pas de key (Streamlit 1.64) et, quand autoplay=True,
|
| 240 |
-
# Streamlit dérive son identifiant du contenu audio : les deux onglets, rendus
|
| 241 |
-
# dans le même run, produiraient le même identifiant et lèveraient
|
| 242 |
-
# StreamlitDuplicateElementID. Deux lecteurs identiques qui se déclenchent
|
| 243 |
-
# aussi en même temps produiraient un son parasite, donc on n'en affiche qu'un
|
| 244 |
-
# par phrase et par run.
|
| 245 |
-
if phrase in st.session_state.setdefault("audio_deja_rendu_run", set()):
|
| 246 |
-
return
|
| 247 |
-
st.session_state["audio_deja_rendu_run"].add(phrase)
|
| 248 |
-
|
| 249 |
-
if phrase in deja_vus:
|
| 250 |
-
st.audio(deja_vus[phrase], format="audio/wav", autoplay=True)
|
| 251 |
-
return
|
| 252 |
-
|
| 253 |
-
# Démo : tout est déjà synthétisé, on colle les morceaux sans charger le modèle.
|
| 254 |
-
complet = cache_complet()
|
| 255 |
-
octets = voix_depuis_cache(lignes) if complet else None
|
| 256 |
-
|
| 257 |
-
if octets is None:
|
| 258 |
-
if complet:
|
| 259 |
-
# Segment absent (voir le journal) : pas de repli sur l'ancienne voix.
|
| 260 |
-
st.caption("Voix indisponible : segment audio manquant.")
|
| 261 |
-
return
|
| 262 |
-
try:
|
| 263 |
-
tts = get_tts()
|
| 264 |
-
with st.spinner("Préparation de la voix…"):
|
| 265 |
-
octets = synthetiser(tts, phrase)
|
| 266 |
-
except Exception as exc:
|
| 267 |
-
# On note l'échec : sans cela, chaque clic retenterait le chargement.
|
| 268 |
-
st.session_state["tts_ko"] = True
|
| 269 |
-
st.caption(f"Voix de synthèse indisponible ({exc}), la réponse reste affichée en texte.")
|
| 270 |
-
return
|
| 271 |
-
|
| 272 |
-
deja_vus[phrase] = octets
|
| 273 |
-
st.audio(octets, format="audio/wav", autoplay=True)
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
@st.cache_resource(show_spinner=False)
|
| 277 |
-
def prechauffer_moteur_vocal() -> None:
|
| 278 |
-
"""Charge Whisper au démarrage et le chauffe sur 1 s de silence.
|
| 279 |
-
|
| 280 |
-
Le chargement du modèle dure ~1 min et la première transcription est la plus
|
| 281 |
-
lente : on fait les deux ici pour que l'utilisateur n'attende pas au milieu de
|
| 282 |
-
sa phrase. Le cache_resource évite de refaire ce travail à chaque interaction.
|
| 283 |
-
"""
|
| 284 |
-
transcrire(get_asr_model(), np.zeros(SAMPLE_RATE, dtype=np.float32))
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
def afficher_phrase(phrase: str) -> None:
|
| 288 |
-
"""Étape 1 : rappel de la phrase saisie."""
|
| 289 |
-
with st.container(border=True):
|
| 290 |
-
st.subheader("1 · Phrase")
|
| 291 |
-
st.markdown(f"> {phrase}")
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
def afficher_extraction(phrase: str) -> dict | None:
|
| 295 |
-
"""Étape 2 : extraction départ / arrivée, par LLM ou en repli local."""
|
| 296 |
-
with st.container(border=True):
|
| 297 |
-
# Titre neutre, affiché avant l'attente : on ne sait pas encore si la
|
| 298 |
-
# réponse viendra de l'API ou du filet local.
|
| 299 |
-
st.subheader("2 · Extraction")
|
| 300 |
-
# Streamlit relance tout le script à chaque clic : on garde les réponses
|
| 301 |
-
# déjà obtenues pour ne pas rappeler l'API (et perdre jusqu'à une minute)
|
| 302 |
-
# pour rien, même quand la réponse vient du repli local.
|
| 303 |
-
deja_vus = st.session_state.setdefault("intents_par_phrase", {})
|
| 304 |
-
try:
|
| 305 |
-
if phrase in deja_vus:
|
| 306 |
-
intent = deja_vus[phrase]
|
| 307 |
-
else:
|
| 308 |
-
# Clé API absente ou client cassé : on ne bloque pas, extract_intent
|
| 309 |
-
# basculera tout seul sur l'extraction locale.
|
| 310 |
-
try:
|
| 311 |
-
client = get_llm_client()
|
| 312 |
-
except Exception:
|
| 313 |
-
client = None
|
| 314 |
-
with st.spinner("Analyse de la phrase en cours…"):
|
| 315 |
-
intent = extract_intent(phrase, client=client)
|
| 316 |
-
if not intent.get("erreur"):
|
| 317 |
-
deja_vus[phrase] = intent
|
| 318 |
-
except Exception as exc:
|
| 319 |
-
st.error(f"Extraction impossible : {exc}")
|
| 320 |
-
return None
|
| 321 |
-
if intent.get("erreur"):
|
| 322 |
-
st.error(f"Extraction impossible : {intent['erreur']}")
|
| 323 |
-
return None
|
| 324 |
-
|
| 325 |
-
# Repli local : ce n'est pas une erreur, on le signale en discret pour ne pas
|
| 326 |
-
# inquiéter le jury pendant la démo.
|
| 327 |
-
if intent.get("source") == "local":
|
| 328 |
-
st.caption("Extraction de secours (sans LLM) — l'API était indisponible")
|
| 329 |
-
|
| 330 |
-
st.session_state["dernier_depart"] = intent["depart"]
|
| 331 |
-
st.session_state["dernier_arrivee"] = intent["arrivee"]
|
| 332 |
-
col_depart, col_arrivee = st.columns(2)
|
| 333 |
-
col_depart.metric("Départ", intent["depart"] or "non détecté")
|
| 334 |
-
col_arrivee.metric("Arrivée", intent["arrivee"] or "non détecté")
|
| 335 |
-
return intent
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
def afficher_lignes(matcher: StopsMatcher, depart: str, arrivee: str, origine: str) -> None:
|
| 339 |
-
"""Étape 3 : correspondance avec le CSV des lignes de bus."""
|
| 340 |
-
with st.container(border=True):
|
| 341 |
-
st.subheader("3 · Ligne(s)")
|
| 342 |
-
|
| 343 |
-
if not depart or not arrivee:
|
| 344 |
-
st.warning(
|
| 345 |
-
"Départ ou arrivée non détecté dans la phrase. "
|
| 346 |
-
"Reformulez, ou complétez au clavier dans le mode avancé ci-dessous."
|
| 347 |
-
)
|
| 348 |
-
return
|
| 349 |
-
|
| 350 |
-
result = matcher.find_line(depart, arrivee)
|
| 351 |
-
|
| 352 |
-
if result["found"]:
|
| 353 |
-
st.caption(f"{len(result['lignes'])} ligne(s) trouvée(s) dans le jeu de données.")
|
| 354 |
-
for match in result["lignes"]:
|
| 355 |
-
afficher_carte_ligne(match)
|
| 356 |
-
# Le lecteur audio reste juste sous la carte.
|
| 357 |
-
dire_la_reponse(result["lignes"], origine)
|
| 358 |
-
return
|
| 359 |
-
|
| 360 |
-
depart_valide, arrivee_valide = result["depart_valide"], result["arrivee_valide"]
|
| 361 |
-
if not depart_valide or not arrivee_valide:
|
| 362 |
-
inconnus = [
|
| 363 |
-
f"{label} « {saisi} »"
|
| 364 |
-
for label, valide, saisi in (
|
| 365 |
-
("départ", depart_valide, depart),
|
| 366 |
-
("arrivée", arrivee_valide, arrivee),
|
| 367 |
-
)
|
| 368 |
-
if not valide
|
| 369 |
-
]
|
| 370 |
-
st.warning(
|
| 371 |
-
f"Lieu hors réseau ({', '.join(inconnus)}) : le plus proche est "
|
| 372 |
-
+ " / ".join(
|
| 373 |
-
f"{trouve} ({score:.2f})"
|
| 374 |
-
for trouve, score in (
|
| 375 |
-
(result["depart_matched"], result["depart_score"]),
|
| 376 |
-
(result["arrivee_matched"], result["arrivee_score"]),
|
| 377 |
-
)
|
| 378 |
-
)
|
| 379 |
-
+ f". Correspondances ignorées sous le seuil de similarité."
|
| 380 |
-
)
|
| 381 |
-
else:
|
| 382 |
-
st.warning(
|
| 383 |
-
f"Aucune ligne ne relie {result['depart_matched']} à "
|
| 384 |
-
f"{result['arrivee_matched']} dans le jeu de données."
|
| 385 |
-
)
|
| 386 |
-
|
| 387 |
-
dire_la_reponse(result["lignes"], origine)
|
| 388 |
-
|
| 389 |
-
|
| 390 |
-
def lancer_pipeline(matcher: StopsMatcher, phrase: str, origine: str) -> None:
|
| 391 |
-
"""Phrase -> extraction -> lignes : commun aux modes voix et texte.
|
| 392 |
-
|
| 393 |
-
`origine` identifie l'onglet qui a déclenché le pipeline : les onglets sont
|
| 394 |
-
rendus dans le même run, il faut donc pouvoir distinguer les deux rendus.
|
| 395 |
-
"""
|
| 396 |
-
# Le detail technique (phrase recue, extraction) est replie : le jury voit
|
| 397 |
-
# surtout le resultat. Ouvert par defaut, ca reste demonstrable au besoin.
|
| 398 |
-
with st.expander("Voir le détail (IA)", expanded=True):
|
| 399 |
-
afficher_phrase(phrase)
|
| 400 |
-
intent = afficher_extraction(phrase)
|
| 401 |
-
if intent is not None:
|
| 402 |
-
afficher_lignes(matcher, intent["depart"], intent["arrivee"], origine)
|
| 403 |
-
|
| 404 |
-
|
| 405 |
-
def _lister_audios_demo() -> list[Path]:
|
| 406 |
-
if not DEMO_AUDIO_DIR.exists():
|
| 407 |
-
return []
|
| 408 |
-
return sorted(
|
| 409 |
-
p for p in DEMO_AUDIO_DIR.iterdir() if p.suffix.lower() in {".wav", ".mp3", ".flac", ".ogg"}
|
| 410 |
-
)
|
| 411 |
-
|
| 412 |
-
|
| 413 |
-
def _transcrire_une_fois(audio_bytes: bytes) -> tuple[str, float]:
|
| 414 |
-
"""Transcrit un audio, en mémorisant le résultat par empreinte du fichier.
|
| 415 |
-
|
| 416 |
-
Sans ça, chaque clic dans la page relancerait Whisper sur le même audio.
|
| 417 |
-
Renvoie (texte, durée en secondes) ; la durée vaut 0 si on ressort du cache.
|
| 418 |
-
"""
|
| 419 |
-
empreinte = hashlib.md5(audio_bytes).hexdigest()
|
| 420 |
-
cache = st.session_state.setdefault("transcriptions", {})
|
| 421 |
-
if empreinte in cache:
|
| 422 |
-
return cache[empreinte], 0.0
|
| 423 |
-
|
| 424 |
-
with st.spinner("Chargement du modèle vocal (la première fois seulement)…"):
|
| 425 |
-
modele = get_asr_model()
|
| 426 |
-
debut = time.perf_counter()
|
| 427 |
-
with st.spinner("J'écoute… transcription en wolof"):
|
| 428 |
-
texte = transcrire(modele, load_audio(audio_bytes))
|
| 429 |
-
duree = time.perf_counter() - debut
|
| 430 |
-
cache[empreinte] = texte
|
| 431 |
-
return texte, duree
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
def mode_vocal(matcher: StopsMatcher) -> None:
|
| 435 |
-
"""Flux principal de la démo : on parle en wolof, on obtient la ligne."""
|
| 436 |
-
# st.audio_input est arrivé dans Streamlit 1.39 (d'abord sous le nom « experimental »).
|
| 437 |
-
audio_input = getattr(st, "audio_input", None) or getattr(st, "experimental_audio_input", None)
|
| 438 |
-
if audio_input is None:
|
| 439 |
-
st.error("Enregistrement micro indisponible : mettez Streamlit à jour (pip install -U streamlit).")
|
| 440 |
-
return
|
| 441 |
-
|
| 442 |
-
enregistrement = audio_input("Appuyez, puis dites votre trajet en wolof", key="micro")
|
| 443 |
-
|
| 444 |
-
# On retient la dernière source utilisée (micro ou audio de secours), pour que
|
| 445 |
-
# choisir un audio de démo ne soit pas écrasé par un vieil enregistrement.
|
| 446 |
-
if enregistrement is not None:
|
| 447 |
-
octets = enregistrement.getvalue()
|
| 448 |
-
empreinte = hashlib.md5(octets).hexdigest()
|
| 449 |
-
if st.session_state.get("empreinte_micro") != empreinte:
|
| 450 |
-
st.session_state["empreinte_micro"] = empreinte
|
| 451 |
-
st.session_state["source_audio"] = ("micro", octets)
|
| 452 |
-
|
| 453 |
-
audios_demo = _lister_audios_demo()
|
| 454 |
-
with st.expander("Audios de secours (si le micro ne coopère pas)", expanded=False):
|
| 455 |
-
if audios_demo:
|
| 456 |
-
choix = st.selectbox(
|
| 457 |
-
"Audio pré-enregistré",
|
| 458 |
-
audios_demo,
|
| 459 |
-
format_func=lambda p: p.stem,
|
| 460 |
-
label_visibility="collapsed",
|
| 461 |
-
)
|
| 462 |
-
if st.button("Utiliser cet audio", use_container_width=True):
|
| 463 |
-
st.session_state["source_audio"] = ("demo", choix.read_bytes())
|
| 464 |
-
else:
|
| 465 |
-
st.caption(
|
| 466 |
-
f"Aucun audio dans {DEMO_AUDIO_DIR.name}/. Enregistrez une phrase au micro "
|
| 467 |
-
"puis cliquez sur « Garder comme audio de secours »."
|
| 468 |
-
)
|
| 469 |
-
|
| 470 |
-
source = st.session_state.get("source_audio")
|
| 471 |
-
if source is None:
|
| 472 |
-
return
|
| 473 |
-
|
| 474 |
-
type_source, octets = source
|
| 475 |
-
if type_source == "demo":
|
| 476 |
-
# Pas de key possible sur st.audio, mais sans autoplay Streamlit
|
| 477 |
-
# n'enregistre aucun identifiant : aucun risque de doublon ici.
|
| 478 |
-
st.audio(octets)
|
| 479 |
-
|
| 480 |
-
try:
|
| 481 |
-
phrase, duree = _transcrire_une_fois(octets)
|
| 482 |
-
except Exception as exc:
|
| 483 |
-
st.error(f"Transcription impossible : {exc}")
|
| 484 |
-
return
|
| 485 |
-
|
| 486 |
-
if not phrase:
|
| 487 |
-
st.warning("Je n'ai rien entendu de clair. Rapprochez-vous du micro et réessayez.")
|
| 488 |
-
return
|
| 489 |
-
|
| 490 |
-
if duree:
|
| 491 |
-
st.caption(f"Transcrit en {duree:.1f} s par whisper-small-wolof")
|
| 492 |
-
|
| 493 |
-
# Petit outil de préparation : on transforme une bonne prise en audio de secours.
|
| 494 |
-
if type_source == "micro":
|
| 495 |
-
with st.popover("Garder comme audio de secours"):
|
| 496 |
-
nom = st.text_input("Nom du fichier", value="trajet", key="nom_audio_demo")
|
| 497 |
-
if st.button("Enregistrer", key="sauver_audio_demo"):
|
| 498 |
-
DEMO_AUDIO_DIR.mkdir(parents=True, exist_ok=True)
|
| 499 |
-
cible = DEMO_AUDIO_DIR / f"{nom.strip() or 'trajet'}.wav"
|
| 500 |
-
cible.write_bytes(octets)
|
| 501 |
-
st.success(f"Sauvegardé : data/demo_audio/{cible.name}")
|
| 502 |
-
|
| 503 |
-
lancer_pipeline(matcher, phrase, "voix")
|
| 504 |
-
|
| 505 |
-
|
| 506 |
-
def mode_simple(matcher: StopsMatcher) -> None:
|
| 507 |
-
"""Flux principal : une phrase en wolof."""
|
| 508 |
-
with st.expander("Exemples de phrases", expanded=False):
|
| 509 |
-
exemple = st.selectbox("Phrase d'exemple", EXEMPLES, label_visibility="collapsed")
|
| 510 |
-
if st.button("Charger cet exemple", use_container_width=True):
|
| 511 |
-
st.session_state["phrase"] = exemple
|
| 512 |
-
|
| 513 |
-
phrase = st.text_input(
|
| 514 |
-
"Votre phrase en wolof",
|
| 515 |
-
key="phrase",
|
| 516 |
-
placeholder=EXEMPLES[0],
|
| 517 |
-
)
|
| 518 |
-
|
| 519 |
-
if st.button("Trouver ma ligne", type="primary", use_container_width=True):
|
| 520 |
-
if not phrase.strip():
|
| 521 |
-
st.warning("Saisissez d'abord une phrase en wolof.")
|
| 522 |
-
return
|
| 523 |
-
lancer_pipeline(matcher, phrase, "texte")
|
| 524 |
-
|
| 525 |
-
|
| 526 |
-
def mode_avance(matcher: StopsMatcher) -> None:
|
| 527 |
-
"""Saisie directe départ / arrivée, sans appel au LLM (debug démo)."""
|
| 528 |
-
with st.expander("Mode avancé — saisir départ et arrivée", expanded=False):
|
| 529 |
-
st.caption("Contourne l'extraction LLM : utile pour vérifier le CSV ou le seuil.")
|
| 530 |
-
col_depart, col_arrivee = st.columns(2)
|
| 531 |
-
depart = col_depart.text_input(
|
| 532 |
-
"Départ (quartier)",
|
| 533 |
-
key="avance_depart",
|
| 534 |
-
value=st.session_state.get("dernier_depart", ""),
|
| 535 |
-
)
|
| 536 |
-
arrivee = col_arrivee.text_input(
|
| 537 |
-
"Arrivée (quartier)",
|
| 538 |
-
key="avance_arrivee",
|
| 539 |
-
value=st.session_state.get("dernier_arrivee", ""),
|
| 540 |
-
)
|
| 541 |
-
if st.button("Chercher directement", use_container_width=True):
|
| 542 |
-
if not depart.strip() or not arrivee.strip():
|
| 543 |
-
st.warning("Renseignez le départ et l'arrivée.")
|
| 544 |
-
return
|
| 545 |
-
afficher_lignes(matcher, depart, arrivee, "avance")
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
def main() -> None:
|
| 549 |
-
st.set_page_config(page_title="GuindiMa AI", page_icon="🚌")
|
| 550 |
-
# Le main() est rejoué à chaque run : on repart d'un registre vide, sinon le
|
| 551 |
-
# lecteur audio déjà affiché dans le run précédent bloquerait celui d'aujourd'hui.
|
| 552 |
-
st.session_state["audio_deja_rendu_run"] = set()
|
| 553 |
-
afficher_css()
|
| 554 |
-
afficher_entete()
|
| 555 |
-
|
| 556 |
-
# Le modèle vocal se charge dès le démarrage, avant le premier clic sur le micro :
|
| 557 |
-
# sinon le premier enregistrement attend le chargement en plein milieu de la phrase.
|
| 558 |
-
try:
|
| 559 |
-
with st.spinner("Préparation du modèle vocal…"):
|
| 560 |
-
prechauffer_moteur_vocal()
|
| 561 |
-
except Exception as exc:
|
| 562 |
-
st.warning(
|
| 563 |
-
f"Modèle vocal indisponible ({exc}). "
|
| 564 |
-
"L'onglet « Écrire » reste utilisable."
|
| 565 |
-
)
|
| 566 |
-
|
| 567 |
-
# Si le cache audio est complet, inutile de charger 578 Mo de modèle au
|
| 568 |
-
# démarrage : l'app se contente de coller des fichiers déjà prêts.
|
| 569 |
-
if not cache_complet():
|
| 570 |
-
try:
|
| 571 |
-
with st.spinner("Préparation de la synthèse vocale…"):
|
| 572 |
-
prechauffer_voix_synthetisee()
|
| 573 |
-
except Exception as exc:
|
| 574 |
-
st.caption(
|
| 575 |
-
f"Synthèse vocale indisponible ({exc}), les réponses seront en texte seul."
|
| 576 |
-
)
|
| 577 |
-
|
| 578 |
-
matcher = get_matcher()
|
| 579 |
-
onglet_voix, onglet_texte = st.tabs(["🎙️ Parler", "⌨️ Écrire"])
|
| 580 |
-
with onglet_voix:
|
| 581 |
-
mode_vocal(matcher)
|
| 582 |
-
with onglet_texte:
|
| 583 |
-
mode_simple(matcher)
|
| 584 |
-
mode_avance(matcher)
|
| 585 |
-
afficher_pied()
|
| 586 |
-
|
| 587 |
-
|
| 588 |
-
if __name__ == "__main__":
|
| 589 |
-
main()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/app/check_examples.py
DELETED
|
@@ -1,129 +0,0 @@
|
|
| 1 |
-
"""Vérifie que chaque phrase de EXEMPLES traverse le pipeline complet.
|
| 2 |
-
|
| 3 |
-
phrase en wolof -> extract_intent() (LLM) -> StopsMatcher.find_line() (CSV)
|
| 4 |
-
|
| 5 |
-
La liste est importée depuis app.py : toute modification de EXEMPLES est donc
|
| 6 |
-
contrôlée par ce script. À lancer après chaque changement de EXEMPLES, et avant
|
| 7 |
-
une démo, pour ne pas découvrir devant le jury qu'une phrase ne matche aucune ligne.
|
| 8 |
-
|
| 9 |
-
Usage:
|
| 10 |
-
python -X utf8 -u src/app/check_examples.py
|
| 11 |
-
|
| 12 |
-
Code de sortie : 0 si toutes les phrases donnent found=True, 1 sinon.
|
| 13 |
-
"""
|
| 14 |
-
|
| 15 |
-
from __future__ import annotations
|
| 16 |
-
|
| 17 |
-
import sys
|
| 18 |
-
import time
|
| 19 |
-
from pathlib import Path
|
| 20 |
-
|
| 21 |
-
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
|
| 22 |
-
|
| 23 |
-
from app.app import EXEMPLES
|
| 24 |
-
from intent.extract_intent import extract_intent, get_client
|
| 25 |
-
from matching.stops_matcher import StopsMatcher
|
| 26 |
-
|
| 27 |
-
SEPARATEUR = "=" * 68
|
| 28 |
-
|
| 29 |
-
# L'API NVIDIA limite le débit : enchaîner les phrases sans pause déclenche des
|
| 30 |
-
# 429 qui font échouer la vérification pour une raison étrangère aux phrases.
|
| 31 |
-
PAUSE_ENTRE_PHRASES = 4
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
def verifier_phrase(phrase: str, matcher: StopsMatcher, client) -> dict:
|
| 35 |
-
"""Enchaîne extraction puis correspondance sur une phrase."""
|
| 36 |
-
rapport: dict = {"phrase": phrase, "ok": False, "etape": None, "detail": None}
|
| 37 |
-
|
| 38 |
-
intent = extract_intent(phrase, client=client)
|
| 39 |
-
rapport["intent"] = intent
|
| 40 |
-
if intent.get("erreur"):
|
| 41 |
-
rapport["etape"] = "extraction"
|
| 42 |
-
rapport["detail"] = intent["erreur"]
|
| 43 |
-
return rapport
|
| 44 |
-
|
| 45 |
-
depart, arrivee = intent["depart"], intent["arrivee"]
|
| 46 |
-
rapport["depart"], rapport["arrivee"] = depart, arrivee
|
| 47 |
-
if not depart or not arrivee:
|
| 48 |
-
rapport["etape"] = "extraction"
|
| 49 |
-
rapport["detail"] = f"champ vide (depart={depart!r}, arrivee={arrivee!r})"
|
| 50 |
-
return rapport
|
| 51 |
-
|
| 52 |
-
resultat = matcher.find_line(depart, arrivee)
|
| 53 |
-
rapport["resultat"] = resultat
|
| 54 |
-
rapport["etape"] = "correspondance"
|
| 55 |
-
if not resultat["found"]:
|
| 56 |
-
rapport["detail"] = _raison_echec(resultat)
|
| 57 |
-
return rapport
|
| 58 |
-
|
| 59 |
-
rapport["ok"] = True
|
| 60 |
-
rapport["detail"] = ", ".join(
|
| 61 |
-
f"{match['compagnie']} {match['ligne']} ({match['sens']})"
|
| 62 |
-
for match in resultat["lignes"]
|
| 63 |
-
)
|
| 64 |
-
return rapport
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
def _raison_echec(resultat: dict) -> str:
|
| 68 |
-
if not resultat["depart_valide"] or not resultat["arrivee_valide"]:
|
| 69 |
-
details = []
|
| 70 |
-
if not resultat["depart_valide"]:
|
| 71 |
-
details.append(
|
| 72 |
-
f"départ hors réseau (proche : {resultat['depart_matched']} "
|
| 73 |
-
f"{resultat['depart_score']})"
|
| 74 |
-
)
|
| 75 |
-
if not resultat["arrivee_valide"]:
|
| 76 |
-
details.append(
|
| 77 |
-
f"arrivée hors réseau (proche : {resultat['arrivee_matched']} "
|
| 78 |
-
f"{resultat['arrivee_score']})"
|
| 79 |
-
)
|
| 80 |
-
return " ; ".join(details)
|
| 81 |
-
return (
|
| 82 |
-
f"aucune ligne ne relie {resultat['depart_matched']} à "
|
| 83 |
-
f"{resultat['arrivee_matched']} dans le CSV"
|
| 84 |
-
)
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
def main() -> int:
|
| 88 |
-
print(SEPARATEUR)
|
| 89 |
-
print("Vérification EXEMPLES — pipeline complet (extraction LLM + matcher)")
|
| 90 |
-
print(SEPARATEUR)
|
| 91 |
-
|
| 92 |
-
matcher = StopsMatcher()
|
| 93 |
-
client = get_client()
|
| 94 |
-
rapports = []
|
| 95 |
-
for index, phrase in enumerate(EXEMPLES):
|
| 96 |
-
if index:
|
| 97 |
-
time.sleep(PAUSE_ENTRE_PHRASES)
|
| 98 |
-
print(f"\n[{index + 1}/{len(EXEMPLES)}] analyse en cours…")
|
| 99 |
-
rapports.append(verifier_phrase(phrase, matcher, client))
|
| 100 |
-
|
| 101 |
-
echecs = 0
|
| 102 |
-
for index, rapport in enumerate(rapports, start=1):
|
| 103 |
-
marque = "OK " if rapport["ok"] else "ECHEC"
|
| 104 |
-
print(f"\n[{index}/{len(rapports)}] {marque} {rapport['phrase']}")
|
| 105 |
-
if rapport["etape"] == "extraction" and "intent" in rapport:
|
| 106 |
-
print(f" extraction : depart={rapport['intent']['depart']!r} "
|
| 107 |
-
f"arrivee={rapport['intent']['arrivee']!r}")
|
| 108 |
-
elif "depart" in rapport:
|
| 109 |
-
print(f" extraction : depart={rapport['depart']!r} "
|
| 110 |
-
f"arrivee={rapport['arrivee']!r}")
|
| 111 |
-
print(f" {rapport['etape']:<13}: {rapport['detail']}")
|
| 112 |
-
if not rapport["ok"]:
|
| 113 |
-
echecs += 1
|
| 114 |
-
|
| 115 |
-
print("\n" + SEPARATEUR)
|
| 116 |
-
if echecs:
|
| 117 |
-
print(f"{echecs}/{len(rapports)} phrase(s) en échec :")
|
| 118 |
-
for rapport in rapports:
|
| 119 |
-
if not rapport["ok"]:
|
| 120 |
-
print(f" - {rapport['phrase']} ({rapport['etape']} : {rapport['detail']})")
|
| 121 |
-
print("Corriger EXEMPLES dans src/app/app.py avec un trajet présent dans le CSV.")
|
| 122 |
-
else:
|
| 123 |
-
print(f"{len(rapports)}/{len(rapports)} phrase(s) valides : le pipeline de démo tient.")
|
| 124 |
-
print(SEPARATEUR)
|
| 125 |
-
return 1 if echecs else 0
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
if __name__ == "__main__":
|
| 129 |
-
sys.exit(main())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/asr/test_asr_models.py
DELETED
|
@@ -1,228 +0,0 @@
|
|
| 1 |
-
"""Test ASR wolof (whisper-small) sur le dataset urban-bus-wolof.
|
| 2 |
-
|
| 3 |
-
Usage:
|
| 4 |
-
python src/asr/test_asr_models.py [--samples 3]
|
| 5 |
-
|
| 6 |
-
Modèle testé (inférence seule, en CPU) :
|
| 7 |
-
- M9and2M/whisper-small-wolof
|
| 8 |
-
|
| 9 |
-
SpeechBrain (speechbrain/asr-wav2vec2-dvoice-wolof) est désactivé :
|
| 10 |
-
trop gourmand en RAM (wav2vec2-large) pour cette machine (8 Go).
|
| 11 |
-
"""
|
| 12 |
-
|
| 13 |
-
from __future__ import annotations
|
| 14 |
-
|
| 15 |
-
import argparse
|
| 16 |
-
import os
|
| 17 |
-
import re
|
| 18 |
-
import sys
|
| 19 |
-
import tempfile
|
| 20 |
-
import time
|
| 21 |
-
# --- SpeechBrain désactivé (RAM insuffisante) ---
|
| 22 |
-
# import tempfile
|
| 23 |
-
# MODEL_SPEECHBRAIN = "speechbrain/asr-wav2vec2-dvoice-wolof"
|
| 24 |
-
#
|
| 25 |
-
# def _load_speechbrain():
|
| 26 |
-
# from speechbrain.inference.ASR import EncoderASR
|
| 27 |
-
# from speechbrain.utils.fetching import LocalStrategy
|
| 28 |
-
#
|
| 29 |
-
# return EncoderASR.from_hparams(
|
| 30 |
-
# source=MODEL_SPEECHBRAIN,
|
| 31 |
-
# savedir="pretrained_models/asr-wav2vec2-dvoice-wolof",
|
| 32 |
-
# run_opts={"device": "cpu"},
|
| 33 |
-
# local_strategy=LocalStrategy.COPY,
|
| 34 |
-
# )
|
| 35 |
-
#
|
| 36 |
-
#
|
| 37 |
-
# def _transcribe_speechbrain(model, audio_array, sample_rate):
|
| 38 |
-
# """Transcrit un tableau numpy avec SpeechBrain (batch, puis fichier temporaire)."""
|
| 39 |
-
# import torch
|
| 40 |
-
# import soundfile as sf
|
| 41 |
-
#
|
| 42 |
-
# waveform = torch.tensor(audio_array, dtype=torch.float32).unsqueeze(0)
|
| 43 |
-
# wav_lens = torch.tensor([1.0])
|
| 44 |
-
# try:
|
| 45 |
-
# out = model.transcribe_batch(waveform, wav_lens)
|
| 46 |
-
# except Exception:
|
| 47 |
-
# fd, path = tempfile.mkstemp(suffix=".wav")
|
| 48 |
-
# os.close(fd)
|
| 49 |
-
# try:
|
| 50 |
-
# sf.write(path, audio_array, sample_rate)
|
| 51 |
-
# out = model.transcribe_file(path)
|
| 52 |
-
# finally:
|
| 53 |
-
# try:
|
| 54 |
-
# os.unlink(path)
|
| 55 |
-
# except OSError:
|
| 56 |
-
# pass
|
| 57 |
-
# if isinstance(out, (tuple, list)):
|
| 58 |
-
# out = out[0]
|
| 59 |
-
# if isinstance(out, str):
|
| 60 |
-
# return out
|
| 61 |
-
# return out[0] if out else ""
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
MODEL_WHISPER = "M9and2M/whisper-small-wolof"
|
| 65 |
-
DATASET_NAME = "vonewman/urban-bus-wolof"
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
def _load_whisper():
|
| 69 |
-
from transformers import pipeline
|
| 70 |
-
|
| 71 |
-
return pipeline(
|
| 72 |
-
"automatic-speech-recognition",
|
| 73 |
-
model=MODEL_WHISPER,
|
| 74 |
-
device=-1,
|
| 75 |
-
)
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
def _transcribe_whisper(model, audio_array: list[float], sample_rate: int) -> str:
|
| 79 |
-
prediction = model(
|
| 80 |
-
{"array": audio_array, "sampling_rate": sample_rate},
|
| 81 |
-
generate_kwargs={
|
| 82 |
-
"task": "transcribe",
|
| 83 |
-
"max_new_tokens": 48,
|
| 84 |
-
"num_beams": 1,
|
| 85 |
-
},
|
| 86 |
-
)
|
| 87 |
-
if isinstance(prediction, dict):
|
| 88 |
-
text = prediction.get("text", "")
|
| 89 |
-
else:
|
| 90 |
-
text = str(prediction)
|
| 91 |
-
return re.sub(r"\s+", " ", text).strip()
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
def _probably_error(text: str) -> bool:
|
| 95 |
-
return text.startswith("[ERREUR]")
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
def main() -> int:
|
| 99 |
-
parser = argparse.ArgumentParser(description="Évalue un modèle ASR wolof.")
|
| 100 |
-
parser.add_argument(
|
| 101 |
-
"--samples",
|
| 102 |
-
type=int,
|
| 103 |
-
default=3,
|
| 104 |
-
help="Nombre d'échantillons à tester (1 à 10).",
|
| 105 |
-
)
|
| 106 |
-
args = parser.parse_args()
|
| 107 |
-
n_samples = max(1, min(args.samples, 10))
|
| 108 |
-
|
| 109 |
-
print("=" * 72)
|
| 110 |
-
print("Test ASR wolof — GuindiMa AI")
|
| 111 |
-
print(f"Dataset : {DATASET_NAME} — {n_samples} échantillons, CPU")
|
| 112 |
-
print("=" * 72)
|
| 113 |
-
|
| 114 |
-
try:
|
| 115 |
-
from datasets import load_dataset, Audio
|
| 116 |
-
|
| 117 |
-
dataset = load_dataset(DATASET_NAME, split=f"train[:{n_samples}]")
|
| 118 |
-
dataset = dataset.cast_column("audio", Audio(sampling_rate=16000, decode=False))
|
| 119 |
-
print(f"Dataset chargé ({len(dataset)} échantillons).")
|
| 120 |
-
except Exception as exc:
|
| 121 |
-
print(f"[ERREUR] Impossible de charger le dataset : {exc}")
|
| 122 |
-
return 1
|
| 123 |
-
|
| 124 |
-
# --- Chargement SpeechBrain désactivé : trop gourmand en RAM ---
|
| 125 |
-
# speechbrain_model = None
|
| 126 |
-
# try:
|
| 127 |
-
# print(f"\nChargement de {MODEL_SPEECHBRAIN} …")
|
| 128 |
-
# speechbrain_model = _load_speechbrain()
|
| 129 |
-
# print("Modèle SpeechBrain prêt.")
|
| 130 |
-
# except Exception as exc:
|
| 131 |
-
# print(f"[SKIP] Échec du chargement du modèle SpeechBrain : {exc}")
|
| 132 |
-
|
| 133 |
-
whisper_model = None
|
| 134 |
-
try:
|
| 135 |
-
print(f"\nChargement de {MODEL_WHISPER} …")
|
| 136 |
-
whisper_model = _load_whisper()
|
| 137 |
-
print("Modèle Whisper prêt.")
|
| 138 |
-
except Exception as exc:
|
| 139 |
-
print(f"[SKIP] Échec du chargement du modèle Whisper : {exc}")
|
| 140 |
-
|
| 141 |
-
if whisper_model is None:
|
| 142 |
-
print("\nAucun modèle disponible, test impossible.")
|
| 143 |
-
return 1
|
| 144 |
-
|
| 145 |
-
import numpy as np
|
| 146 |
-
import jiwer
|
| 147 |
-
|
| 148 |
-
results = []
|
| 149 |
-
wer_by_model = {MODEL_WHISPER: []}
|
| 150 |
-
|
| 151 |
-
for i, sample in enumerate(dataset, start=1):
|
| 152 |
-
try:
|
| 153 |
-
import soundfile as sf
|
| 154 |
-
|
| 155 |
-
with tempfile.NamedTemporaryFile(suffix=".mp3", delete=False) as tmp:
|
| 156 |
-
tmp.write(sample["audio"]["bytes"])
|
| 157 |
-
tmp_path = tmp.name
|
| 158 |
-
try:
|
| 159 |
-
audio, sample_rate = sf.read(tmp_path, dtype="float32")
|
| 160 |
-
finally:
|
| 161 |
-
os.unlink(tmp_path)
|
| 162 |
-
audio = np.asarray(audio, dtype=np.float32)
|
| 163 |
-
except Exception as exc:
|
| 164 |
-
print(f"\n[ERREUR] Décodage audio de l'échantillon {i} impossible : {exc}")
|
| 165 |
-
continue
|
| 166 |
-
reference = str(sample["sentence"]).strip()
|
| 167 |
-
|
| 168 |
-
print("\n" + "-" * 72)
|
| 169 |
-
print(f"Échantillon {i}/{n_samples}")
|
| 170 |
-
print(f"Référence : {reference}")
|
| 171 |
-
|
| 172 |
-
row = {"reference": reference}
|
| 173 |
-
|
| 174 |
-
# --- Appel SpeechBrain désactivé ---
|
| 175 |
-
# if speechbrain_model is not None:
|
| 176 |
-
# t0 = time.perf_counter()
|
| 177 |
-
# try:
|
| 178 |
-
# hypothesis = _transcribe_speechbrain(speechbrain_model, audio, sample_rate)
|
| 179 |
-
# except Exception as exc:
|
| 180 |
-
# hypothesis = f"[ERREUR] {exc}"
|
| 181 |
-
# elapsed = time.perf_counter() - t0
|
| 182 |
-
# print(f"\n[{MODEL_SPEECHBRAIN}] ({elapsed:.1f}s)")
|
| 183 |
-
# print(f" Hypothèse : {hypothesis}")
|
| 184 |
-
# if _probably_error(hypothesis):
|
| 185 |
-
# print(" WER : non calculé (erreur d'inférence)")
|
| 186 |
-
# else:
|
| 187 |
-
# wer = jiwer.wer(reference, hypothesis)
|
| 188 |
-
# wer_by_model[MODEL_SPEECHBRAIN].append(wer)
|
| 189 |
-
# row[MODEL_SPEECHBRAIN] = hypothesis
|
| 190 |
-
# print(f" WER : {wer:.3f}")
|
| 191 |
-
|
| 192 |
-
if whisper_model is not None:
|
| 193 |
-
t0 = time.perf_counter()
|
| 194 |
-
try:
|
| 195 |
-
hypothesis = _transcribe_whisper(whisper_model, audio, sample_rate)
|
| 196 |
-
except Exception as exc:
|
| 197 |
-
hypothesis = f"[ERREUR] {exc}"
|
| 198 |
-
elapsed = time.perf_counter() - t0
|
| 199 |
-
print(f"\n[{MODEL_WHISPER}] ({elapsed:.1f}s)")
|
| 200 |
-
print(f" Hypothèse : {hypothesis}")
|
| 201 |
-
if _probably_error(hypothesis):
|
| 202 |
-
print(" WER : non calculé (erreur d'inférence)")
|
| 203 |
-
else:
|
| 204 |
-
wer = jiwer.wer(reference, hypothesis)
|
| 205 |
-
wer_by_model[MODEL_WHISPER].append(wer)
|
| 206 |
-
row[MODEL_WHISPER] = hypothesis
|
| 207 |
-
print(f" WER : {wer:.3f}")
|
| 208 |
-
|
| 209 |
-
results.append(row)
|
| 210 |
-
|
| 211 |
-
print("\n" + "=" * 72)
|
| 212 |
-
print("RÉSUMÉ — WER moyen (plus bas = meilleur)")
|
| 213 |
-
print("=" * 72)
|
| 214 |
-
for model_name, wers in wer_by_model.items():
|
| 215 |
-
if wers:
|
| 216 |
-
mean_wer = sum(wers) / len(wers)
|
| 217 |
-
print(f"{model_name:<45} WER moyen = {mean_wer:.3f} ({len(wers)}/{n_samples} échantillons)")
|
| 218 |
-
else:
|
| 219 |
-
print(f"{model_name:<45} pas de WER calculable")
|
| 220 |
-
|
| 221 |
-
best = min(wer_by_model, key=lambda m: sum(wer_by_model[m]) / len(wer_by_model[m])) if any(wer_by_model[m] for m in wer_by_model) else None
|
| 222 |
-
if best and wer_by_model[best]:
|
| 223 |
-
print(f"\nModèle recommandé sur ce test : {best}")
|
| 224 |
-
return 0
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
if __name__ == "__main__":
|
| 228 |
-
sys.exit(main())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/tts/pregenerer.py
DELETED
|
@@ -1,124 +0,0 @@
|
|
| 1 |
-
"""Prépare une fois pour toutes les audios de la démo.
|
| 2 |
-
|
| 3 |
-
Synthétiser coûte environ 4x le temps réel sur ce portable : le faire en direct
|
| 4 |
-
devant un jury, c'est prendre un risque. Ce script génère donc tous les cas
|
| 5 |
-
possibles — une voix par ligne du jeu de données, plus les phrases de service
|
| 6 |
-
(« walla », « Walla, », « Ci ginnaaw, ») — et l'app se contente ensuite de coller
|
| 7 |
-
les bons morceaux, sans même charger le modèle.
|
| 8 |
-
|
| 9 |
-
python src/tts/pregenerer.py
|
| 10 |
-
|
| 11 |
-
Les fichiers déjà présents sont sautés, on peut donc relancer sans rien casser.
|
| 12 |
-
Une fois le cache complet, il n'est plus nécessaire de garder le TTS en mémoire,
|
| 13 |
-
et l'app ne le charge plus au démarrage.
|
| 14 |
-
"""
|
| 15 |
-
|
| 16 |
-
from __future__ import annotations
|
| 17 |
-
|
| 18 |
-
import sys
|
| 19 |
-
import time
|
| 20 |
-
from pathlib import Path
|
| 21 |
-
|
| 22 |
-
RACINE = Path(__file__).resolve().parents[2]
|
| 23 |
-
CSV_LIGNES = RACINE / "data" / "lignes_dakar.csv"
|
| 24 |
-
|
| 25 |
-
sys.path.insert(0, str(RACINE / "src"))
|
| 26 |
-
|
| 27 |
-
from tts.speak import ( # noqa: E402 (après l'ajout au sys.path)
|
| 28 |
-
AUCUNE_LIGNE,
|
| 29 |
-
CACHE_DIR,
|
| 30 |
-
LIAISON_CORRESPONDANCE,
|
| 31 |
-
MARQUEUR,
|
| 32 |
-
WALLA,
|
| 33 |
-
WALLA_AUTRE,
|
| 34 |
-
load_tts,
|
| 35 |
-
nom_cache_match,
|
| 36 |
-
phrase_reponse,
|
| 37 |
-
synthetiser,
|
| 38 |
-
)
|
| 39 |
-
|
| 40 |
-
# Les phrases de service, absentes du CSV.
|
| 41 |
-
PHRASES_SERVICE = [
|
| 42 |
-
(AUCUNE_LIGNE, "Baal ma, gisuma bus bu dem fa."),
|
| 43 |
-
(WALLA, "walla"),
|
| 44 |
-
(WALLA_AUTRE, "Walla,"),
|
| 45 |
-
(LIAISON_CORRESPONDANCE, "Ci ginnaaw,"),
|
| 46 |
-
]
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
def lignes_du_csv() -> list[tuple[str, str]]:
|
| 50 |
-
"""Tous les couples (compagnie, ligne) du jeu de données, sans doublon.
|
| 51 |
-
|
| 52 |
-
On garde aussi les lignes sans numéro (« TAF TAF ») : elles s'affichent et
|
| 53 |
-
doivent donc s'entendre, avec leur propre audio.
|
| 54 |
-
"""
|
| 55 |
-
import csv
|
| 56 |
-
|
| 57 |
-
couples = set()
|
| 58 |
-
with open(CSV_LIGNES, newline="", encoding="utf-8") as fichier:
|
| 59 |
-
records = list(csv.DictReader(fichier))
|
| 60 |
-
for record in records:
|
| 61 |
-
ligne = str(record.get("ligne", "")).strip()
|
| 62 |
-
if ligne:
|
| 63 |
-
couples.add((str(record.get("compagnie", "")).strip(), ligne))
|
| 64 |
-
return sorted(couples)
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
def cibles() -> list[tuple[str, str]]:
|
| 68 |
-
"""Chaque audio à produire : nom de fichier et phrase à dire, sans doublon."""
|
| 69 |
-
liste = []
|
| 70 |
-
vus = set()
|
| 71 |
-
for compagnie, ligne in lignes_du_csv():
|
| 72 |
-
match = {"compagnie": compagnie, "ligne": ligne}
|
| 73 |
-
nom = nom_cache_match(match)
|
| 74 |
-
if nom in vus:
|
| 75 |
-
continue
|
| 76 |
-
vus.add(nom)
|
| 77 |
-
liste.append((nom, phrase_reponse([match])))
|
| 78 |
-
return liste + [(nom, phrase) for nom, phrase in PHRASES_SERVICE if nom not in vus]
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
def main() -> int:
|
| 82 |
-
CACHE_DIR.mkdir(parents=True, exist_ok=True)
|
| 83 |
-
a_produire = cibles()
|
| 84 |
-
print(f"{len(a_produire)} audios à préparer dans {CACHE_DIR}")
|
| 85 |
-
|
| 86 |
-
modele = None
|
| 87 |
-
debut_global = time.perf_counter()
|
| 88 |
-
produits = 0
|
| 89 |
-
|
| 90 |
-
for nom, phrase in a_produire:
|
| 91 |
-
chemin = CACHE_DIR / nom
|
| 92 |
-
if chemin.is_file():
|
| 93 |
-
print(f" déjà présent {nom}")
|
| 94 |
-
continue
|
| 95 |
-
if modele is None:
|
| 96 |
-
print("Chargement du modèle TTS …")
|
| 97 |
-
modele = load_tts()
|
| 98 |
-
debut = time.perf_counter()
|
| 99 |
-
chemin.write_bytes(synthetiser(modele, phrase))
|
| 100 |
-
produits += 1
|
| 101 |
-
print(f" {nom:26s} {time.perf_counter() - debut:5.1f}s {phrase!r}")
|
| 102 |
-
|
| 103 |
-
total = time.perf_counter() - debut_global
|
| 104 |
-
manquants = [nom for nom, _ in a_produire if not (CACHE_DIR / nom).is_file()]
|
| 105 |
-
|
| 106 |
-
if manquants:
|
| 107 |
-
# Sans marqueur, l'app considère que le cache est incomplet et garde le
|
| 108 |
-
# modèle TTS sous la main, donc on prévient de ce qui a échoué.
|
| 109 |
-
print(f"\n{len(manquants)} audio(s) manquant(s) : {', '.join(manquants)}")
|
| 110 |
-
return 1
|
| 111 |
-
|
| 112 |
-
MARQUEUR.write_text(
|
| 113 |
-
f"{len(a_produire)} audios prêts, préparés en {total:.0f}s le "
|
| 114 |
-
f"{time.strftime('%Y-%m-%d')}\n",
|
| 115 |
-
encoding="utf-8",
|
| 116 |
-
)
|
| 117 |
-
volume = sum((CACHE_DIR / nom).stat().st_size for nom, _ in a_produire)
|
| 118 |
-
print(f"\n{produits} fichier(s) créé(s) en {total:.1f}s")
|
| 119 |
-
print(f"cache complet : {len(a_produire)} audios, {volume / 1024 / 1024:.1f} Mo")
|
| 120 |
-
return 0
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
if __name__ == "__main__":
|
| 124 |
-
sys.exit(main())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tts_cache_adia.zip
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:eb81e01388a8031f04c99618d09823adb66cd5967ea4625e92224a6fd63aa737
|
| 3 |
-
size 33399895
|
|
|
|
|
|
|
|
|
|
|
|