claimcheck-eval / scripts /build_cases.py
NagaYu's picture
ClaimCheck v1.1.0: rule pack, policy presets and 158-case bilingual evaluation set
6549139 verified
Raw History Blame Contribute Delete
23.7 kB
# -*- coding: utf-8 -*-
"""Source of truth for the ClaimCheck evaluation dataset.
Every case is (context, answer, focus_value, expected_status). `expected_status`
is the label a careful human reviewer would assign. The build script then runs
each case through ClaimCheck and records what the tool ACTUALLY returns, so the
published dataset carries both columns and an `agrees` flag.
Rows where the tool disagrees with the human label are not bugs to be hidden -
they are the known-limitation rows, and they are the most useful part of the set.
"""
C = []
def case(lang, ctype, category, context, answer, focus, expected, why):
C.append(dict(language=lang, claim_type=ctype, category=category, context=context,
answer=answer, focus_value=focus, expected_status=expected, rationale=why))
# ---------------------------------------------------------------- NUMERIC
case("en", "NUMERIC", "grounded",
"Acme Corp reported revenue of 12,000 million yen for fiscal 2024, with operating profit of 1,800 million yen.",
"Acme Corp reported revenue of 12,000 million yen for fiscal 2024.",
"12,000", "supported", "The figure appears literally in the context.")
case("ja", "NUMERIC", "grounded",
"架空商事の2024年度売上高は12,000百万円、営業利益は1,800百万円でした。",
"架空商事の売上高は12,000百万円です。",
"12,000", "supported", "桁区切りを正規化した上で文脈に literal に存在する。")
case("ja", "NUMERIC", "grounded",
"問い合わせ件数は約1,200件に達した。",
"問い合わせ件数は1200件でした。",
"1200件", "supported", "「約」は数値トークンの外側、カンマは正規化されるので一致する。")
case("en", "NUMERIC", "grounded",
"The service handled approximately 1,200 requests per second at peak.",
"At peak the service handled 1200 requests per second.",
"1200", "supported", "Thousands separator and the hedge 'approximately' are both normalised away.")
case("ja", "NUMERIC", "grounded",
"当期の最終損益は▲1,200百万円の赤字となった。",
"最終損益は▲1,200百万円でした。",
"▲1,200", "supported", "▲ は日本の会計表記の負号として正規化され、-1200 として一致する。")
case("en", "NUMERIC", "grounded",
"Total addressable market is estimated at 3.5B USD.",
"The total addressable market is 3.5B USD.",
"3.5B", "supported", "The B magnitude suffix expands to 3.5e9 on both sides.")
case("ja", "NUMERIC", "grounded",
"登録ユーザー数は1.2万人を突破した。",
"登録ユーザー数は1.2万人です。",
"1.2万人", "supported", "万 は 1e4 に展開され、両側とも 12000 になる。")
case("en", "NUMERIC", "grounded",
"The sensor operates at 2.4e3 Hz under nominal load.",
"The sensor operates at 2.4e3 Hz.",
"2.4e3", "supported", "Exponent notation is parsed on both sides.")
case("en", "NUMERIC", "derived",
"Acme reported revenue of 12,000 million and operating profit of 1,800 million for fiscal 2024.",
"That gives an operating margin of 15%.",
"15%", "derived", "1,800 / 12,000 * 100 = 15; the formula is returned as evidence.")
case("ja", "NUMERIC", "derived",
"2024年度の売上高は12,000百万円、営業利益は1,800百万円でした。",
"したがって営業利益率は15%です。",
"15%", "derived", "1,800 / 12,000 * 100 = 15 で導出できる。")
case("en", "NUMERIC", "derived",
"Revenue was 100 million and total costs were 40 million.",
"Profit therefore came to 60 million.",
"60", "derived", "100 - 40 = 60 is a two-term derivation.")
case("ja", "NUMERIC", "derived",
"従業員数は前年度3,200人、今年度3,400人でした。",
"増加数は200人です。",
"200人", "derived", "3,400 - 3,200 = 200 の差分導出。")
case("en", "NUMERIC", "derived",
"Headcount grew from 3,200 to 3,400 over the year.",
"That is a growth rate of 6.25%.",
"6.25%", "derived", "(3,400 - 3,200) / 3,200 * 100 = 6.25 is an indexed change rate.")
case("en", "NUMERIC", "derived",
"The unit price is 250 USD and the order covers 40 units.",
"The order total is 10,000 USD.",
"10,000", "derived", "250 * 40 = 10,000 is a two-term product.")
case("en", "NUMERIC", "contradicted",
"Headcount at the end of the prior year was 3,200.",
"Headcount at the end of the prior year was 3,250.",
"3,250", "contradicted", "The context holds 3,200, a 1.5% relative difference, inside the near-miss window.")
case("ja", "NUMERIC", "contradicted",
"前年度の従業員数は3,200人でした。",
"前年度の従業員数は3,250人でした。",
"3,250人", "contradicted", "文脈の 3,200人 と近接するが不一致。")
case("en", "NUMERIC", "contradicted",
"The fine imposed was 340,000 USD.",
"The fine imposed was 3,400,000 USD.",
"3,400,000", "contradicted", "Exactly one order of magnitude off the context value.")
case("ja", "NUMERIC", "contradicted",
"罰金は340,000ドルであった。",
"罰金は3,400,000ドルであった。",
"3,400,000", "contradicted", "文脈値のちょうど10倍。桁違いとして検出される。")
case("en", "NUMERIC", "contradicted",
"Net income for the quarter was 1,500 million yen.",
"Net income for the quarter was -1,500 million yen.",
"-1,500", "contradicted", "Same magnitude, opposite sign.")
case("en", "NUMERIC", "hallucinated",
"Acme reported revenue of 12,000 million and operating profit of 1,800 million.",
"The churn rate reached 7.2% this quarter.",
"7.2%", "unsupported", "Nothing in the context relates to churn and no context value is near 7.2.")
case("ja", "NUMERIC", "hallucinated",
"2024年度の売上高は12,000百万円、営業利益は1,800百万円でした。",
"なお解約率は7.2%に達しています。",
"7.2%", "unsupported", "解約率に関する記述は文脈に一切存在しない。")
case("en", "NUMERIC", "hallucinated",
"The report covers three regional offices.",
"The company operates 847 retail locations worldwide.",
"847", "unsupported", "A fabricated specific with no counterpart in the context.")
case("en", "NUMERIC", "known_false_positive",
"Annual recurring revenue reached 1,200 thousand USD.",
"Annual recurring revenue reached roughly 1,250 thousand USD.",
"1,250", "contradicted", "A human would accept 1,250 as a rounded restatement, but 4% off is inside the default near-miss window. Raise numeric_tolerance rather than lowering contradiction_rel.")
case("ja", "NUMERIC", "known_false_positive",
"売上高は12,345百万円でした。",
"売上高はおよそ12,000百万円規模でした。",
"12,000", "contradicted", "人間は丸めた言い換えとして許容するが、相対差 2.8% は近接不一致の窓に入る。")
case("en", "NUMERIC", "known_false_positive",
"The context lists the values 2, 3 and 6 in an unrelated table.",
"The combined figure is 6.",
"6", "supported", "Literally present, but also coincidentally derivable as 2*3. Coincidental derivation is why the formula is always shown as evidence.")
case("en", "NUMERIC", "edge_case",
"The margin improved to 3.5% this year.",
"The margin improved by 3.5 points this year.",
"3.5", "supported", "Value matches but the unit meaning differs (percent vs percentage points). Semantic unit errors are invisible to this tool.")
case("en", "NUMERIC", "edge_case",
"Steps: prepare the environment, then run the migration.",
"1. Prepare the environment\n2. Run the migration",
"2", "not_extracted", "List markers at a line start are excluded from extraction, so no NUMERIC claim is produced for this token at all.")
case("en", "NUMERIC", "edge_case",
"The team has four members and two open roles.",
"The team has 5 members.",
"5", "unsupported", "Bare integers 0-10 with no unit are never marked contradicted: they sit near everything and produced only noise.")
# ---------------------------------------------------------------- DATE
case("en", "DATE", "grounded",
"Product X shipped on 2024-03-15 following a six-month delay.",
"Product X shipped on 2024-03-15.",
"2024-03-15", "supported", "Identical ISO date.")
case("ja", "DATE", "grounded",
"新製品Xは2024年3月15日に発売されました。",
"新製品Xは2024年3月15日に発売されています。",
"2024年3月15日", "supported", "和暦表記でない年月日をISOに正規化して一致。")
case("ja", "DATE", "grounded",
"契約の発効日は令和6年1月5日である。",
"契約は2024-01-05に発効しました。",
"2024-01-05", "supported", "令和6年 は 2024 に正規化されるため一致する。")
case("en", "DATE", "grounded",
"The amendment takes effect on January 5, 2024.",
"The amendment takes effect on 5 January 2024.",
"5 January 2024", "supported", "Month-day-year and day-month-year both normalise to 2024-01-05.")
case("en", "DATE", "grounded",
"The filing deadline is 2024/3/1 for all applicants.",
"The filing deadline is 2024-03-01.",
"2024-03-01", "supported", "Separator differences are absorbed by normalisation.")
case("ja", "DATE", "grounded",
"平成31年4月30日をもって制度は終了した。",
"制度は1989年ではなく2019-04-30に終了しました。",
"2019-04-30", "supported", "平成31年 は 2019 に正規化される。")
case("en", "DATE", "approximate",
"The incident occurred in January 2024.",
"The incident occurred on 2024-01-15.",
"2024-01-15", "approximate", "The answer is finer-grained than the source: the model added a day the context never stated.")
case("ja", "DATE", "approximate",
"障害は2024年1月に発生した。",
"障害は2024年1月15日に発生しました。",
"2024年1月15日", "approximate", "文脈より詳細な日付。モデルが粒度を補完した可能性がある。")
case("en", "DATE", "contradicted",
"The board approved the merger on 2024-03-15.",
"The board approved the merger on 2024-03-18.",
"2024-03-18", "contradicted", "Same year and month, different day.")
case("ja", "DATE", "contradicted",
"取締役会は2024年3月15日に承認した。",
"取締役会は2024年5月15日に承認しました。",
"2024年5月15日", "contradicted", "年は一致するが月が異なる。")
case("en", "DATE", "hallucinated",
"The policy document describes the escalation procedure in detail.",
"The policy was ratified on 2019-11-04.",
"2019-11-04", "unsupported", "The context contains no date at all.")
case("ja", "DATE", "hallucinated",
"本規程はエスカレーション手順を定めるものである。",
"本規程は2019年11月4日に制定されました。",
"2019年11月4日", "unsupported", "文脈に日付が存在しない。")
case("en", "DATE", "known_false_positive",
"Revenue for FY2024 reached a record high.",
"Revenue for 2024 reached a record high.",
"2024", "supported", "FY2024 and calendar 2024 are treated as the same year. Depending on the company's fiscal calendar they are not the same period.")
case("ja", "DATE", "known_false_positive",
"2024年度の業績は過去最高となった。",
"2024年の業績は過去最高となりました。",
"2024年", "supported", "年度と暦年を同一視する。開始月が異なる企業では誤り。")
case("en", "DATE", "edge_case",
"The audit was completed on 2024-03-15.",
"The audit was completed last year.",
"last year", "not_extracted", "Relative dates are counted but never become claims: they cannot be resolved without knowing the generation date.")
case("ja", "DATE", "edge_case",
"監査は2024年3月15日に完了した。",
"監査は昨年完了しました。",
"昨年", "not_extracted", "相対表現は claim にならない。counts.relative_date_mentions に計上されるのみ。")
# ---------------------------------------------------------------- QUOTE
case("en", "QUOTE", "grounded",
'The report: revenue grew by twelve percent in 2024 across all segments.',
'The report states that "revenue grew by twelve percent in 2024"',
"revenue grew by twelve percent in 2024", "supported",
"The quoted span is an exact normalised substring of the context.")
case("ja", "QUOTE", "grounded",
"報告書: 当社は2024年に新製品を投入する。",
"報告書には「当社は2024年に新製品を投入する」と記載されています。",
"当社は2024年に新製品を投入する", "supported", "正規化後の完全一致。")
case("ja", "QUOTE", "paraphrase",
"報告書: 当社は2024年に新製品を投入する。",
"報告書には「2024年に新製品を投入します」と記載されています。",
"2024年に新製品を投入します", "approximate",
"敬体への言い換え。意味は保たれているが引用としては不正確なので approximate。")
case("en", "QUOTE", "paraphrase",
"The memo: all contractors must complete the security training before access is granted.",
'The memo says that "all contractors must complete security training before access is granted"',
"all contractors must complete security training before access is granted", "approximate",
"One word dropped; high similarity but not an exact quote.")
case("en", "QUOTE", "contradicted",
"The report: revenue grew by twelve percent in 2024.",
'The report states that "revenue declined by twelve percent last year"',
"revenue declined by twelve percent last year", "contradicted",
"A passage this similar exists but says the opposite: grew versus declined.")
case("ja", "QUOTE", "known_false_negative",
"議事録: 提案は全会一致で承認された。",
"議事録には「提案は全会一致で否決された」と記載されています。",
"提案は全会一致で否決された", "approximate",
"承認 -> 否決 は1文字の違いで類似度0.92となり approximate に落ちる。文字類似度では日本語の意味反転を検出できない。本ツールの最も重要な限界。")
case("en", "QUOTE", "hallucinated",
"The report: revenue grew by twelve percent in 2024.",
'The report states that "the moon is made of cheese entirely"',
"the moon is made of cheese entirely", "unsupported",
"No similar passage exists anywhere in the context.")
case("ja", "QUOTE", "hallucinated",
"報告書: 当社は2024年に新製品を投入する。",
"報告書には「火星に支社を設立する」と記載されています。",
"火星に支社を設立する", "unsupported", "類似する記述が文脈に存在しない。")
case("en", "QUOTE", "known_false_positive",
"The guidance: employees should submit expenses within thirty days of travel.",
'The guidance states that "staff must file expenses within 30 days of travelling"',
"staff must file expenses within 30 days of travelling", "contradicted",
"A faithful meaning-preserving paraphrase that rewrites most words. Similarity falls below the approximate threshold, so a correct answer is penalised.")
case("ja", "QUOTE", "known_false_positive",
"規程: 従業員は出張後30日以内に経費を精算しなければならない。",
"規程には「社員は出張から1か月以内に経費精算を行う必要がある」と記載されています。",
"社員は出張から1か月以内に経費精算を行う必要がある", "unsupported",
"意味は同じだが語をほぼ入れ替えた言い換え。類似度が閾値に届かず偽陽性になる。")
# ---------------------------------------------------------------- ENTITY
case("en", "ENTITY", "grounded",
"The contract renews automatically under Article 12 unless terminated.",
"The contract renews automatically under Article 12.",
"Article 12", "supported", "The identifier appears verbatim.")
case("ja", "ENTITY", "grounded",
"契約は第12条に基づき自動更新される。",
"契約は第12条に基づき自動更新されます。",
"第12条", "supported", "条番号が文脈に literal に存在する。")
case("en", "ENTITY", "contradicted",
"The contract renews automatically under Article 12.",
"The contract renews automatically under Article 15.",
"Article 15", "contradicted",
"Identifiers are exact-or-wrong: a one-digit-off article number is the dangerous fabrication, not an approximation.")
case("ja", "ENTITY", "contradicted",
"契約は第12条に基づき自動更新される。",
"契約は第13条に基づき自動更新されます。",
"第13条", "contradicted", "1桁違いの条番号。識別子は一致か誤りかしかない。")
case("en", "ENTITY", "contradicted",
"The approved hardware for this deployment is model XR-400.",
"The approved hardware for this deployment is model XR-500.",
"XR-500", "contradicted", "A model number one digit off the one in the source.")
case("en", "ENTITY", "hallucinated",
"The vendor assessment covered pricing, support and roadmap.",
"The assessment was carried out by Meridian Analytics Group.",
"Meridian Analytics Group", "unsupported", "A fabricated organisation name absent from the context.")
case("ja", "ENTITY", "grounded",
"当社は ISO 9001 認証を取得しています。",
"当社は ISO 9001 に準拠しています。",
"ISO 9001", "supported", "規格番号が完全一致。")
case("en", "ENTITY", "known_false_positive",
"The pipeline uses a gradient boosting classifier trained on historical tickets.",
"The pipeline applies Machine Learning to historical tickets.",
"Machine Learning", "unsupported",
"A generic noun phrase, not a hallucinated fact. ENTITY is the noisiest check and should be disabled first.")
case("en", "ENTITY", "known_false_positive",
"Guidance was issued by the World Health Organization in March.",
"Guidance was issued by the WHO in March.",
"WHO", "not_extracted",
"'who' is on the stopword list, so no ENTITY claim is created. The suppression list already prevents this false positive - acronym expansion is still unhandled, but it costs a miss rather than a false alarm.")
case("en", "ENTITY", "known_false_positive",
"The facility is certified to ISO 9001.",
"The facility is certified to ISO 9001:2015.",
"ISO 9001:2015", "contradicted",
"A legitimate standard-version variant is treated as a near-miss identifier. The cost of catching one-digit-off fabrications.")
# ---------------------------------------------------------------- URL
case("en", "URL", "grounded",
"Full results are published at https://example.com/ir/2024 for download.",
"Full results are at https://example.com/ir/2024",
"https://example.com/ir/2024", "supported", "The URL matches exactly after normalisation.")
case("ja", "URL", "grounded",
"IR資料は https://example.com/ir/2024 に掲載しています。",
"詳細は https://example.com/ir/2024 をご覧ください。",
"https://example.com/ir/2024", "supported", "URL が完全一致。")
case("en", "URL", "contradicted",
"Full results are published at https://example.com/ir/2024",
"Full results are at https://example.com/ir/2025",
"https://example.com/ir/2025", "contradicted",
"The host appears in the context but this exact path does not: the classic fabricated citation.")
case("ja", "URL", "contradicted",
"IR資料は https://example.com/ir/2024 に掲載しています。",
"詳細は https://example.com/ir/2025 をご覧ください。",
"https://example.com/ir/2025", "contradicted", "ホストは一致、パスが捏造されている。")
case("en", "URL", "hallucinated",
"Full results are published at https://example.com/ir/2024",
"See also https://totally-invented-source.org/report for background.",
"https://totally-invented-source.org/report", "unsupported",
"An entirely invented domain with no counterpart in the context.")
case("en", "URL", "approximate",
"Documentation lives at https://example.com/docs/v2/getting-started",
"Documentation lives at https://example.com/docs/v2",
"https://example.com/docs/v2", "approximate",
"A path prefix of a context URL: related, but not the cited page.")
case("en", "URL", "known_false_positive",
"Full results are published at https://example.com/ir/2024",
"Full results are at https://example.com/ir/2024?utm_source=newsletter",
"https://example.com/ir/2024?utm_source=newsletter", "approximate",
"A tracking parameter makes an otherwise identical link fail exact matching.")
# ---------------------------------------------------------------- COVERAGE / ADVERSARIAL
case("en", "NUMERIC", "coverage",
"Acme reported revenue of 12,000 million for fiscal 2024.",
"Please contact the relevant department for further details. We appreciate your understanding.",
"", "not_extracted",
"Zero claims extracted, so coverage is 0.0. grounding_score is meaningless here: this is the case that proves why coverage must always be read alongside it.")
case("ja", "NUMERIC", "coverage",
"2024年度の売上高は12,000百万円でした。",
"詳細は担当部署にお問い合わせください。ご検討のほどよろしくお願いいたします。",
"", "not_extracted",
"抽出できる主張がゼロなので coverage は 0.0。grounding_score だけを見ると「検証済み」と誤読される典型例。")
case("en", "NUMERIC", "adversarial",
"Acme reported revenue of 12,000 million and operating profit of 1,800 million for fiscal 2024.",
"Acme reported revenue of 12,000 million for fiscal 2024. The company also opened 34 new offices that year.",
"34", "unsupported",
"One well-grounded sentence carrying a fabricated specific alongside it: the mixed answer is the realistic failure mode.")
case("ja", "NUMERIC", "adversarial",
"2024年度の売上高は12,000百万円、営業利益は1,800百万円でした。",
"2024年度の売上高は12,000百万円でした。また同年に34拠点を新設しました。",
"34拠点", "unsupported", "正しい文と捏造された具体値が同居する、実運用で最もよくある形。")
case("en", "NUMERIC", "adversarial",
"The survey covered 1,200 respondents across four countries.",
"The survey, which reached 1,200 respondents, found that 68% favoured the proposal.",
"68%", "unsupported",
"A fabricated figure buried inside an otherwise faithful restatement.")
case("ja", "NUMERIC", "adversarial",
"調査は4カ国の1,200名を対象に実施された。",
"1,200名を対象とした調査の結果、68%が提案に賛成しました。",
"68%", "unsupported", "忠実な言い換えの中に捏造値が埋め込まれている。")
case("en", "DATE", "adversarial",
"The outage began at 03:00 UTC and was resolved within two hours.",
"The outage began recently and was resolved quickly.",
"recently", "not_extracted",
"An answer that is vague where the context was specific: nothing to verify, and coverage drops accordingly.")