Initial support for automatic fixing of additional and wrong label

This commit is contained in:
2026-03-15 22:28:15 +01:00
parent 5f1613b8c1
commit f43c296e8a
11 changed files with 292 additions and 61 deletions
+3 -6
View File
@@ -5,8 +5,7 @@ import ezodf
import re
from pathlib import Path
def natural_key(text):
return [int(c) if c.isdigit() else c.lower() for c in re.split(r'(\d+)', str(text))]
from utils import natural_key, read_all_labels
# Configuration
ODS_PATH = "/home/sebastien/Rust/gestion_classe/Staging/current_eval.ods"
@@ -19,10 +18,8 @@ def main():
else:
work_dir = os.path.abspath(sys.argv[1])
all_labels = sorted(list(filter(None,
(Path(work_dir) / "labels")
.read_text().splitlines())),
key = natural_key)
all_labels = read_all_labels(Path(work_dir))
a_rendre_path = os.path.join(work_dir, TARGET_DIR_NAME)
if not os.path.isdir(a_rendre_path):