fix: Abbildungs-Gegenprobe ohne kopierbares Beispiel, Kennungen vereinheitlicht
- Prompt-Beispiel '1 → 2: 3' durch Schema 'A → B: Wert' ersetzt: eine Lesung hatte nur die Beispielzeile übernommen statt aller fünf Pfeile; alle Datenpunkte verlangt - canonical_figure_id: '1' und 'Abbildung 1' gelten als dieselbe Abbildung – beim Vergleich, in der Pipeline und im Report (Formfehler im zweiten Testlauf) Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
101d55b713
commit
89b61d8c62
1 changed files with 35 additions and 9 deletions
|
|
@ -64,6 +64,16 @@ def split_figures(task: str, basis_dir: Path | str | None = None) -> Tuple[str,
|
|||
return text, figures
|
||||
|
||||
|
||||
def canonical_figure_id(kennung: str) -> str:
|
||||
"""„1“, „Abb. 1“, „Abbildung 1“ → „Abbildung 1“ – beobachtet: eine Lesung schrieb nur „1“."""
|
||||
nummer = re.search(r"\d+", kennung or "")
|
||||
return f"Abbildung {nummer.group(0)}" if nummer else (kennung or "").strip()
|
||||
|
||||
|
||||
def normalize_figure_ids(transcriptions: List[FigureTranscription]) -> List[FigureTranscription]:
|
||||
return [t.model_copy(update={"id": canonical_figure_id(t.id)}) for t in transcriptions]
|
||||
|
||||
|
||||
def image_parts(figures: List[FigureInput]) -> list:
|
||||
"""Nachrichtenteile im OpenAI-Format: je Abbildung ihre Kennung als Text, dann das Bild als Data-URI."""
|
||||
teile = []
|
||||
|
|
|
|||
Loading…
Reference in a new issue