FAILURE MAP
← Case archive

FA-100286 / Dataset deduplication grouping / Open access

Dataset deduplication: near-duplicate score ignores unmatched token union · case 01

near-duplicate score ignores unmatched token union.

Verified by executionVariant 1 · 6 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The overlap ratio is normalized by the left document size only.

THE FAILURE

The overlap ratio is normalized by the left document size only.

Unsuccessful approach: Using the larger set size as denominator overstates partial overlap compared with union normalization.

Case contract

Return Jaccard similarity of token sets; two empty sets score 1.

Why this case matters

This deterministic toy operation makes one dataset equivalence or representative rule explicit.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(a, b):
    return len(set(a)&set(b))/len(set(a)) if a else (1 if not b else 0)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('balanced overlap',solve(['a','b'],['a','c']),1/3)
check('left containment',solve(['a'],['a','b']),0.5)
check('right containment',solve(['a','b'],['a']),0.5)
check('disjoint',solve(['a'],['b']),0)
check('both empty',solve([],[]),1)
check('duplicates ignored',solve(['a','a','b'],['a','b','b']),1)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
balanced overlap0.50.3333333333333333Failed
left containment1.00.5Failed
right containment0.50.5Passed
disjoint0.00Passed
both empty11Passed
duplicates ignored1.01Passed

SHA-256 / 6e01d4d18fe73cd6146b59cea0999e1e080460c8576e8e3737dff9a60e2724b4

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(a, b):
    return len(set(a)&set(b))/max(len(set(a)),len(set(b))) if set(a) or set(b) else 1
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('balanced overlap',solve(['a','b'],['a','c']),1/3)
check('left containment',solve(['a'],['a','b']),0.5)
check('right containment',solve(['a','b'],['a']),0.5)
check('disjoint',solve(['a'],['b']),0)
check('both empty',solve([],[]),1)
check('duplicates ignored',solve(['a','a','b'],['a','b','b']),1)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
balanced overlap0.50.3333333333333333Failed
left containment0.50.5Passed
right containment0.50.5Passed
disjoint0.00Passed
both empty11Passed
duplicates ignored1.01Passed

SHA-256 / 33cfe76e969bef5ecc835c1a3adb6a1b91cb3ee0c27461c4f6a24087f5a799ee

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 6 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

Inputs are small in-memory fixtures with the stated contract; results do not claim production deduplication quality. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-30T16:48:34.014225+00:00.

Case digest / 8547597cac5038c83fea22381fe19780c4a691dc1a1479303477ad0ca362352d