Umlaut-Normalisierung an drei Stellen + auch articles im QC
Fix fuer ASCII-Umlaute in Headlines/Inhalten (Gespraeche statt Gespraeche). Zwei Quellen des Problems: 1. Quellen wie dpa-AFX, Telegram TASS/RIA liefern Headlines schon ASCII-fiziert 2. LLM-Uebersetzungen drift en gelegentlich zu ae/oe/ue trotz Prompt Aenderungen: - rss_parser.py: nach html_to_text auch normalize_german_umlauts auf title und summary anwenden (sicher, hunspell-Dict ignoriert englische Woerter wie Boeing/Business) - orchestrator.py:1418 Translation-INSERT: headline_de und content_de durch normalize_german_umlauts schicken (LLM-Drift abfangen) - post_refresh_qc.py: neue Funktion normalize_umlaut_articles als Sicher- heitsnetz analog zu normalize_umlaut_fields. Behandelt headline_de und content_de aller Artikel des Incidents; bei language=de zusaetzlich headline und content_original. Wird in run_post_refresh_qc nach normalize_umlaut_fields aufgerufen. Backfill: migrations/migrate_umlauts_2026-05-03.py (im Verwaltungs-Repo)
Dieser Commit ist enthalten in:
@@ -1411,12 +1411,22 @@ class AgentOrchestrator:
|
||||
)
|
||||
|
||||
# Übersetzungen aktualisieren (nur für gültige DB-IDs)
|
||||
# LLM-Drift abfangen: trotz Prompt-Anweisung kommen manchmal
|
||||
# ASCII-Umlaute ("Gespraeche" statt "Gespräche") in der Übersetzung.
|
||||
# Dictionary-basierte Korrektur schreibt nur deutsche Woerter um.
|
||||
from services.post_refresh_qc import normalize_german_umlauts as _norm_de
|
||||
for translation in analysis.get("translations", []):
|
||||
article_id = translation.get("article_id")
|
||||
if isinstance(article_id, int):
|
||||
hd = translation.get("headline_de")
|
||||
cd = translation.get("content_de")
|
||||
if hd:
|
||||
hd, _ = _norm_de(hd)
|
||||
if cd:
|
||||
cd, _ = _norm_de(cd)
|
||||
await db.execute(
|
||||
"UPDATE articles SET headline_de = ?, content_de = ? WHERE id = ? AND incident_id = ?",
|
||||
(translation.get("headline_de"), translation.get("content_de"), article_id, incident_id),
|
||||
(hd, cd, article_id, incident_id),
|
||||
)
|
||||
|
||||
await db.commit()
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren