- Every station's auto labels reviewed by an analyst (/review-auto-labels), then a cross-review per family across all stations (new skill /cross-review-labels), a finishing pass, and descriptions rewritten in words (no numeric values). - The three never-labeled ranges (WILDSTRUBEL 07/09-01/10, NORDEND 16/08-01/10) labeled and reviewed: 991 auto labels on 11 stations, labeling/controle.py at 0 errors. - Labeling knowledge gathered in labeling/: regles-d-etiquetage.md (new), familles.md (settled boundaries), connaissances/ (notes moved from docs/, links updated), the label map rebuilt from reviewed labels, events and cases; events tied to their stations (PS_DES_COUDRES is JUNGFRAU). The labeler and reviewers read only labeling/. - labels-map reads auto labels and events; decision D-130; living plan points 73-75. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
16 lines
1.4 KiB
Python
16 lines
1.4 KiB
Python
"""Vérifie une réécriture en mots (mots/<STATION>.jsonl) face à labeling/auto/<STATION>.jsonl :
|
|
mêmes lignes, même ordre, mêmes champs ; seule la description change. Puis compte les valeurs chiffrées.
|
|
--remplacer : si tout tient, remplace labeling/auto/<STATION>.jsonl."""
|
|
import json, sys, re, os
|
|
ici = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
# décimales à la virgule (les noms F4.2 et les dates 05.10 ont un point), ou un nombre suivi d'une unité
|
|
pat = re.compile(r'(?<![\w.])\d+,\d+|\b\d+\s*(bruits|px|°|%|MAD|mm|fois)(?!\w)|\b\d+\s+(cibles|mesures) sur\b')
|
|
for st in [a for a in sys.argv[1:] if not a.startswith('--')]:
|
|
a = [json.loads(l) for l in open(f'labeling/auto/{st}.jsonl') if l.strip()]
|
|
b = [json.loads(l) for l in open(f'{ici}/{st}.jsonl') if l.strip()]
|
|
ok = len(a) == len(b) and all({k: v for k, v in x.items() if k != 'description'} == {k: v for k, v in y.items() if k != 'description'} for x, y in zip(a, b))
|
|
reste = [y['debut'] for y in b if pat.search(y['description'])]
|
|
print(st, 'structure', 'OK' if ok else 'DIFFÉRENTE', '|', sum(x['description'] != y['description'] for x, y in zip(a, b)), 'réécrites |', len(reste), 'encore chiffrées', reste[:5])
|
|
if ok and '--remplacer' in sys.argv:
|
|
open(f'labeling/auto/{st}.jsonl', 'w').writelines(json.dumps(y, ensure_ascii=False) + '\n' for y in b); print(st, 'remplacé')
|