Spaces:
Running on Zero
Running on Zero
Download scripts/inspecter_dataset.py from Myz0/CV-Matching: direct link, hf CLI and curl.
- Browser
- Download file 1.65 kB
-
https://huggingface.co/spaces/Myz0/CV-Matching/resolve/main/scripts/inspecter_dataset.py
- Command line
-
hf download hf://spaces/Myz0/CV-Matching/scripts/inspecter_dataset.py
-
curl -L -o inspecter_dataset.py https://huggingface.co/spaces/Myz0/CV-Matching/resolve/main/scripts/inspecter_dataset.py
1.65 kB
| """Affiche la structure réelle du dataset opt-nc/odata-avps, sans rien modifier. | |
| Lancer depuis la racine du projet : python -m scripts.inspecter_dataset | |
| """ | |
| from collections import Counter | |
| from datetime import date | |
| from huggingface_hub import list_repo_files | |
| from app import config | |
| from app.avp_store import CHAMPS_ATTENDUS, CHAMPS_PREREQUIS, est_ouvert, extraire, lire_avps | |
| print("=== Fichiers du dataset ===") | |
| print("\n".join(f for f in list_repo_files(config.DATASET_REPO, repo_type="dataset") | |
| if not f.startswith("data/20"))) # l'archive data/AAAA/MM/ est masquée | |
| avps = lire_avps() | |
| ouverts = [a for a in avps if est_ouvert(a)] | |
| print(f"\n=== {len(avps)} AVP, dont {len(ouverts)} ouverts au {date.today()} ===") | |
| for a in sorted(avps, key=lambda a: str(a.get("validThrough"))): | |
| print(f" {str(a.get('id_avp')):18s} {str(a.get('validThrough'))[:10]:10s} " | |
| f"{'ouvert' if est_ouvert(a) else 'clos '} {a.get('title') or a.get('name')}") | |
| print("\n=== Nombre d'attendus notés par AVP ===") | |
| nb = [len(extraire(a, CHAMPS_ATTENDUS)) for a in avps] | |
| print(f" min {min(nb, default=0)} · moyenne {sum(nb) / max(len(nb), 1):.0f} · max {max(nb, default=0)}") | |
| print("\n=== Compétences les plus fréquentes (texte identique) ===") | |
| compte = Counter(t for a in avps for t, _ in extraire(a, CHAMPS_ATTENDUS)) | |
| for texte, n in compte.most_common(10): | |
| print(f" {n:3d} AVP {texte}") | |
| print("\n=== Prérequis rencontrés (jamais notés) ===") | |
| for texte, n in Counter(t for a in avps for t, _ in extraire(a, CHAMPS_PREREQUIS)).most_common(10): | |
| print(f" {n:3d} AVP {texte}") | |