Farm: Bitgleich-Vergleich weist Bibliothekstreffer je Arm aus

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Marc Mintel
2026-12-05 21:49:56 +01:00
co-authored by Claude Opus 5.5
parent cdd070321c
commit 4ea3ce6923
+3 -1
View File
@@ -33,6 +33,7 @@ st = [json.loads(z)["street"] for z in open(EIN, encoding="utf-8")]
def vergleiche(A, B, ERG):
n, s1, s2, zug = collections.Counter(), collections.Counter(), collections.Counter(), collections.Counter()
feld2, rundung, max_rel, bsp = collections.Counter(), 0, 0.0, []
bib_a, bib_b = collections.Counter(), collections.Counter() # Antworten mit Grund 'motor FLOP Bibliothek' je Arm
for t in range(N):
ka = json.load(open(os.path.join(A, f"teil{t}.jsonl.kopf.json")))
a = [json.loads(z) for z in open(os.path.join(A, f"teil{t}.jsonl"), encoding="utf-8") if z.strip()]
@@ -40,6 +41,7 @@ def vergleiche(A, B, ERG):
assert len(a) == len(b) == ka["anzahl"], (t, len(a), len(b), ka["anzahl"])
for j, (x, y) in enumerate(zip(a, b)):
i = ka["idx"][j]; s = st[i]; n[s] += 1
bib_a[s] += 'motor FLOP Bibliothek' in str(x.get('reason')); bib_b[s] += 'motor FLOP Bibliothek' in str(y.get('reason'))
e = [k for k in ENTSCHEIDUNG if text(x.get(k)) != text(y.get(k))]
if e:
s1[s] += 1; zug[s] += (x.get("action"), x.get("size")) != (y.get("action"), y.get("size"))
@@ -51,7 +53,7 @@ def vergleiche(A, B, ERG):
s2[s] += 1
for p in set(f["funde"]): feld2[p] += 1
if len(bsp) < 40: bsp.append({"stufe": 2, "zeile": i, "strasse": s, "felder": sorted(set(f["funde"]))[:10]})
erg = {"anfragen": dict(n), "stufe1_entscheidung_anders": dict(s1), "davon_zug_oder_groesse": dict(zug),
erg = {"anfragen": dict(n), "bibliothek_treffer": {"basis": sum(bib_a.values()), "arm": sum(bib_b.values())}, "stufe1_entscheidung_anders": dict(s1), "davon_zug_oder_groesse": dict(zug),
"stufe2_felder_anders": dict(s2), "stufe2_felder": dict(feld2.most_common(30)),
"rundung_unter_1e-9": {"felder": rundung, "groesste_relative_abweichung": max_rel},
"bitgleich_entscheidung": sum(s1.values()) == 0, "bitgleich_bis_auf_rundung": sum(s1.values()) + sum(s2.values()) == 0, "beispiele": bsp}