Farm: Bitgleich-Vergleich zaehlt Grund-Marken je Arm (Bibliothek, Flop Tafel / zu lang)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
4ea3ce6923
commit
79b4733659
@@ -33,7 +33,8 @@ 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
|
||||
MARKEN = ('motor FLOP Bibliothek', 'Tafel', 'zu lang') # Zaehlung je Arm (Flop: Tafel / zu lang nur auf FLOP)
|
||||
marke_a, marke_b = collections.Counter(), collections.Counter()
|
||||
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()]
|
||||
@@ -41,7 +42,9 @@ 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'))
|
||||
for m in MARKEN:
|
||||
if m == 'motor FLOP Bibliothek' or s == 'FLOP':
|
||||
marke_a[m] += m in str(x.get('reason')); marke_b[m] += m 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"))
|
||||
@@ -53,7 +56,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), "bibliothek_treffer": {"basis": sum(bib_a.values()), "arm": sum(bib_b.values())}, "stufe1_entscheidung_anders": dict(s1), "davon_zug_oder_groesse": dict(zug),
|
||||
erg = {"anfragen": dict(n), "grund_marken_je_arm": {"basis": dict(marke_a), "arm": dict(marke_b), "hinweis": "Bibliothek alle Strassen; Tafel/zu lang nur FLOP"}, "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}
|
||||
|
||||
Reference in New Issue
Block a user