Skip to content

armgit / sie

Public Imported from GitHub
0

Open-source inference server and production cluster for all the models your agent needs.

feat(examples): evaluate ordinary named entity tags (#629)

svonava4ecec8ad13c6
diff --git a/examples/ordinary-name-tags/README.md b/examples/ordinary-name-tags/README.md
new file mode 100644
index 000000000..238a95dce
--- /dev/null
+++ b/examples/ordinary-name-tags/README.md
@@ -0,0 +1,91 @@
+# Tag people, organizations and locations in ordinary text
+
+Extract named entities from 24 verbatim paragraphs published in 2026: science,
+software, standards and transport. The task uses the same three labels across
+all four domains, including seven paragraphs with no named entities.
+
+The answer key and seven finite acceptable representations were reviewed before
+model outputs. Repeated mentions count once per typed name; each independent
+source family contributes equally. These paragraphs test a declared engineering
+fit, rather than representing the distribution of all documents.
+
+## Reproduce scores without inference
+
+From this directory, run the offline checks:
+
+```bash
+python3 -m unittest discover -s tests -v
+```
+
+Score a recorded JSONL file, or compare several files against the same answer key:
+
+```bash
+python3 score.py --rows large.jsonl --rows medium.jsonl --rows comparison.jsonl
+```
+
+Each row contains `id`, `model`, `status` (`ok`, `failed` or `unattempted`) and
+the input's `text_sha256`. Successful rows contain `entities` with `text` and
+`type` (or the native `label` field). Native recordings also retain `start`,
+`end` and `score`. Invented comparison names count as false positives rather
+than being discarded. Gold and native spans must be exact source substrings; native offsets are
+Python Unicode character positions, with an exclusive end.
+
+The report shows strict and prospectively accepted tag-set F1, pooled precision
+and recall, entity-bearing F1, exact documents and empty-source false tags.
+Failed and missing planned calls score zero, including empty-source cases.
+Comparisons use a paired bootstrap over source families, never individual
+mentions. An acceptable representation is a complete fixed answer set;
+arbitrary unions or new post-output interpretations are not accepted.
+
+The prospective useful-fit gate requires all 24 calls to succeed, at least 12
+entity-bearing sources, pooled precision of at least 90% and entity-bearing
+mean F1 of at least 80%. Passing that point gate does not establish population
+noninferiority against another model.
+
+## Collect new native recordings
+
+Install the Python SDK from the repository root:
+
+```bash
+python3 -m pip install ./packages/sie_sdk
+```
+
+Use an explicitly configured SIE endpoint serving the selected model. Set
+`SIE_API_KEY` only when that endpoint requires authentication. From this
+directory:
+
+```bash
+python3 record.py --url https://api.superlinked.com \
+ --model gliner-community/gliner_large-v2.5 --output large.jsonl
+python3 record.py --url https://api.superlinked.com \
+ --model gliner-community/gliner_medium-v2.5 --output medium.jsonl
+```
+
+The recipe uses `SIEClient.extract`, plain `person`, `organization`, `location`
+labels and the model profile's fixed threshold: 0.75 for Large, 0.55 for Medium.
+The expected checkpoint revisions are recorded separately from the returned
+model identity; this client does not independently attest the server's loaded
+checkpoint.
+
+Each invocation allows at most 24 physical extraction POSTs and starts no new
+call after its 1,200-second wall budget. Calls run serially, with connect/read
+timeouts capped at 60 seconds and the remaining budget. A request hook prevents
+SDK retries from sending a second POST. The first
+failed call stops further inference and writes every remaining source as
+unattempted. Existing recording files are never overwritten. New inference can
+incur endpoint charges; offline scoring does not.
+
+Recordings allowlist semantic entities and token counters. They exclude API
+keys, authentication headers, request IDs, endpoint addresses and exception
+messages. Costs require a separately pinned rate card and complete metering;
+the scorer does not substitute hardware spend or invent missing prices.
+
+## Source rights and annotation
+
+The bundled passages retain their source URLs, publication dates, content hashes
+and rights in `inputs/cases.jsonl`. See [ATTRIBUTION.md](inputs/ATTRIBUTION.md),
+the [annotation policy](inputs/annotation-policy.md), and the retained
+[license notices](inputs/licenses). USGS and NTSB staff text is U.S. government
+work; NIST permits redistribution of its unmarked text. Go content uses CC BY
+4.0; Rust and Node.js content retain their respective MIT and Apache notices.
+The passages are prose-only extractions, without images or logos.
diff --git a/examples/ordinary-name-tags/inputs/ATTRIBUTION.md b/examples/ordinary-name-tags/inputs/ATTRIBUTION.md
new file mode 100644
index 000000000..bfcafc834
--- /dev/null
+++ b/examples/ordinary-name-tags/inputs/ATTRIBUTION.md
@@ -0,0 +1,149 @@
+# Source attribution
+
+Only complete selected prose passages are included. HTML/Markdown presentation was normalized; source claims and selected paragraph text were not rewritten. Images, logos, personal contact details and uncertain third-party quotations are excluded.
+
+USGS/NTSB staff statements remain official written agency text. Shirley Leung's agency affiliation was additionally checked in the official USGS Water Resources staff directory. No likeness, audio or video is included.
+
+- ordinary-science-01: New Nationwide Tool Helps Answer: Do We Have Enough Water? (2026-04-27).
+ Source: https://www.usgs.gov/news/national-news-release/new-nationwide-tool-helps-answer-do-we-have-enough-water
+ Permission: https://www.usgs.gov/information-policies-and-instructions/copyrights-and-credits
+ License/permission: USGS-US-government-text
+ Publisher attribution: {"credit": "U.S. Geological Survey"}
+
+- ordinary-science-02: Value of U.S. mineral production rose last year, driven by precious metals prices (2026-02-06).
+ Source: https://www.usgs.gov/news/national-news-release/value-us-mineral-production-rose-last-year-driven-precious-metals-prices
+ Permission: https://www.usgs.gov/information-policies-and-instructions/copyrights-and-credits
+ License/permission: USGS-US-government-text
+ Publisher attribution: {"credit": "U.S. Geological Survey"}
+
+- ordinary-science-03: USGS: Lithium in Carolinas Could Replace Imports for a Century or More (2026-06-18).
+ Source: https://www.usgs.gov/news/national-news-release/usgs-lithium-carolinas-could-replace-imports-a-century-or-more
+ Permission: https://www.usgs.gov/information-policies-and-instructions/copyrights-and-credits
+ License/permission: USGS-US-government-text
+ Publisher attribution: {"credit": "U.S. Geological Survey"}
+
+- ordinary-science-04: New research shows prehistoric lake contributed to the birth of the Grand Canyon (2026-04-16).
+ Source: https://www.usgs.gov/news/national-news-release/new-research-shows-prehistoric-lake-contributed-birth-grand-canyon
+ Permission: https://www.usgs.gov/information-policies-and-instructions/copyrights-and-credits
+ License/permission: USGS-US-government-text
+ Publisher attribution: {"credit": "U.S. Geological Survey"}
+
+- ordinary-science-05: New AI Tool Forecasts Drought 90 Days Ahead Nationwide (2026-03-31).
+ Source: https://www.usgs.gov/news/national-news-release/new-ai-tool-forecasts-drought-90-days-ahead-nationwide
+ Permission: https://www.usgs.gov/information-policies-and-instructions/copyrights-and-credits
+ License/permission: USGS-US-government-text
+ Publisher attribution: {"credit": "U.S. Geological Survey"}
+
+- ordinary-science-06: As Wildfires Burn, Rainfall Can Strip Oxygen From Rivers, Killing Fish (2026-05-19).
+ Source: https://www.usgs.gov/news/state-news-release/wildfires-burn-rainfall-can-strip-oxygen-rivers-killing-fish
+ Permission: https://www.usgs.gov/information-policies-and-instructions/copyrights-and-credits
+ License/permission: USGS-US-government-text
+ Publisher attribution: {"credit": "U.S. Geological Survey"}
+
+- ordinary-software-01: Goroutine Leak Profiles (2026-09-02).
+ Source: https://go.dev/blog/goroutine-leak-profiles
+ Permission: https://go.dev/copyright
+ License/permission: CC-BY-4.0
+ Publisher attribution: {"authors": ["Vlad Saioc"], "license_url": "https://creativecommons.org/licenses/by/4.0/", "modification_notice": "Prose extraction and Markdown normalization; code, images, chrome and quoted blocks excluded.", "source_url": "https://go.dev/blog/goroutine-leak-profiles", "title": "Goroutine Leak Profiles"}
+
+- ordinary-software-02: Demoting i686 Windows targets to std-only (2026-10-02).
+ Source: https://blog.rust-lang.org/2026/10/02/demoting-i686-windows-targets-to-std-only/
+ Permission: https://raw.githubusercontent.com/rust-lang/blog.rust-lang.org/c7510dd334a8690c207a08e3e4b6a17a8b675bf2/README.md
+ License/permission: MIT
+ Publisher attribution: {"authors": ["Mateusz Mikuła", "Ralf Jung"], "license_url": "https://raw.githubusercontent.com/rust-lang/blog.rust-lang.org/c7510dd334a8690c207a08e3e4b6a17a8b675bf2/LICENSE-MIT", "modification_notice": "Prose extraction and Markdown normalization; code, images, chrome and quoted blocks excluded.", "source_url": "https://blog.rust-lang.org/2026/10/02/demoting-i686-windows-targets-to-std-only/", "title": "Demoting i686 Windows targets to std-only"}
+
+- ordinary-software-03: docs.rs: building fewer targets by default (2026-04-04).
+ Source: https://blog.rust-lang.org/2026/04/04/docsrs-only-default-targets/
+ Permission: https://raw.githubusercontent.com/rust-lang/blog.rust-lang.org/c7510dd334a8690c207a08e3e4b6a17a8b675bf2/README.md
+ License/permission: MIT
+ Publisher attribution: {"authors": ["Denis Cornehl"], "license_url": "https://raw.githubusercontent.com/rust-lang/blog.rust-lang.org/c7510dd334a8690c207a08e3e4b6a17a8b675bf2/LICENSE-MIT", "modification_notice": "Prose extraction and Markdown normalization; code, images, chrome and quoted blocks excluded.", "source_url": "https://blog.rust-lang.org/2026/04/04/docsrs-only-default-targets/", "title": "docs.rs: building fewer targets by default"}
+
+- ordinary-software-04: New HackerOne Signal Requirement for Vulnerability Reports (2026-02-19).
+ Source: https://nodejs.org/en/blog/announcements/hackerone-signal-requirement
+ Permission: https://raw.githubusercontent.com/nodejs/nodejs.org/e7bbce71483466003758b0d8e7bcfc19ba5fbf2a/LICENSE
+ License/permission: MIT
+ Publisher attribution: {"credit": "Node.js Website WG contributors"}
+
+- ordinary-software-05: Call for Testing: Build Dir Layout v2 (2026-03-13).
+ Source: https://blog.rust-lang.org/2026/03/13/call-for-testing-build-dir-layout-v2/
+ Permission: https://raw.githubusercontent.com/rust-lang/blog.rust-lang.org/c7510dd334a8690c207a08e3e4b6a17a8b675bf2/README.md
+ License/permission: MIT
+ Publisher attribution: {"authors": ["Ed Page"], "license_url": "https://raw.githubusercontent.com/rust-lang/blog.rust-lang.org/c7510dd334a8690c207a08e3e4b6a17a8b675bf2/LICENSE-MIT", "modification_notice": "Prose extraction and Markdown normalization; code, images, chrome and quoted blocks excluded.", "source_url": "https://blog.rust-lang.org/2026/03/13/call-for-testing-build-dir-layout-v2/", "title": "Call for Testing: Build Dir Layout v2"}
+
+- ordinary-software-06: //go:fix inline and the source-level inliner (2026-03-10).
+ Source: https://go.dev/blog/inliner
+ Permission: https://go.dev/copyright
+ License/permission: CC-BY-4.0
+ Publisher attribution: {"authors": ["Alan Donovan"], "license_url": "https://creativecommons.org/licenses/by/4.0/", "modification_notice": "Prose extraction and Markdown normalization; code, images, chrome and quoted blocks excluded.", "source_url": "https://go.dev/blog/inliner", "title": "//go:fix inline and the source-level inliner"}
+
+- ordinary-standards-01: Register Now and Submit Speaker Proposals for the FISSEA Winter Forum (2026-09-24).
+ Source: https://www.nist.gov/news-events/news/2026/09/register-now-and-submit-speaker-proposals-fissea-winter-forum
+ Permission: https://www.nist.gov/copyrights-disclaimers
+ License/permission: NIST-unmarked-text-redistribution-permission
+ Publisher attribution: {"credit": "National Institute of Standards and Technology"}
+
+- ordinary-standards-02: Spotlight: Laser Light Sheet Imaging Shows the Dangers of Airborne Exposure to Allergens (2026-09-18).
+ Source: https://www.nist.gov/news-events/news/2026/09/spotlight-laser-light-sheet-imaging-shows-dangers-airborne-exposure
+ Permission: https://www.nist.gov/copyrights-disclaimers
+ License/permission: NIST-unmarked-text-redistribution-permission
+ Publisher attribution: {"credit": "National Institute of Standards and Technology"}
+
+- ordinary-standards-03: NIST Threshold Call Preview Talks #3 (Virtual) (2026-09-25).
+ Source: https://www.nist.gov/news-events/news/2026/09/nist-threshold-call-preview-talks-3-virtual
+ Permission: https://www.nist.gov/copyrights-disclaimers
+ License/permission: NIST-unmarked-text-redistribution-permission
+ Publisher attribution: {"credit": "National Institute of Standards and Technology"}
+
+- ordinary-standards-04: CAISI’s Assessment of Z.ai’s GLM-5.3 Cyber Capabilities (2026-09-17).
+ Source: https://www.nist.gov/news-events/news/2026/09/caisis-assessment-zais-glm-53-cyber-capabilities
+ Permission: https://www.nist.gov/copyrights-disclaimers
+ License/permission: NIST-unmarked-text-redistribution-permission
+ Publisher attribution: {"credit": "National Institute of Standards and Technology"}
+
+- ordinary-standards-05: OWM Recognizes Proficiency Testing Coordinators of the 2025 RMAPs (2026-10-02).
+ Source: https://www.nist.gov/news-events/news/2026/10/owm-recognizes-proficiency-testing-coordinators-2025-rmaps
+ Permission: https://www.nist.gov/copyrights-disclaimers
+ License/permission: NIST-unmarked-text-redistribution-permission
+ Publisher attribution: {"credit": "National Institute of Standards and Technology"}
+
+- ordinary-standards-06: Validating Spectrum in the CBRS Band: From Models to Measurements (2026-09-23).
+ Source: https://www.nist.gov/news-events/news/2026/09/validating-spectrum-cbrs-band-models-measurements
+ Permission: https://www.nist.gov/copyrights-disclaimers
+ License/permission: NIST-unmarked-text-redistribution-permission
+ Publisher attribution: {"credit": "National Institute of Standards and Technology"}
+
+- ordinary-transport-01: Unrepaired Leaks Led to Natural Gas Pipeline Explosions in Mississippi (2026-03-26).
+ Source: https://www.ntsb.gov/news/press-releases/Pages/NR20260326.aspx
+ Permission: https://www.ntsb.gov/about/Pages/Website-Policies.aspx
+ License/permission: NTSB-US-government-staff-text
+ Publisher attribution: {"credit": "National Transportation Safety Board"}
+
+- ordinary-transport-02: Systemic Failures Led to Midair Collision Over Potomac River in Washington (2026-01-28).
+ Source: https://www.ntsb.gov/news/press-releases/Pages/NR20260127.aspx
+ Permission: https://www.ntsb.gov/about/Pages/Website-Policies.aspx
+ License/permission: NTSB-US-government-staff-text
+ Publisher attribution: {"credit": "National Transportation Safety Board"}
+
+- ordinary-transport-03: NTSB Calls for Alcohol Detection Systems in School Buses and Renews Call for Student Seat Belts (2026-04-23).
+ Source: https://www.ntsb.gov/news/press-releases/Pages/NR20260423.aspx
+ Permission: https://www.ntsb.gov/about/Pages/Website-Policies.aspx
+ License/permission: NTSB-US-government-staff-text
+ Publisher attribution: {"credit": "National Transportation Safety Board"}
+
+- ordinary-transport-04: NTSB Recommends Realistic Training for Smoke-in-Cockpit Emergencies (2026-05-13).
+ Source: https://www.ntsb.gov/news/press-releases/Pages/nr20260513.aspx
+ Permission: https://www.ntsb.gov/about/Pages/Website-Policies.aspx
+ License/permission: NTSB-US-government-staff-text
+ Publisher attribution: {"credit": "National Transportation Safety Board"}
+
+- ordinary-transport-05: NTSB Enhances Civil Aviation Accident Dashboard With Findings Data (2026-05-04).
+ Source: https://www.ntsb.gov/news/press-releases/Pages/NR20260504.aspx
+ Permission: https://www.ntsb.gov/about/Pages/Website-Policies.aspx
+ License/permission: NTSB-US-government-staff-text
+ Publisher attribution: {"credit": "National Transportation Safety Board"}
+
+- ordinary-transport-06: NTSB Recommends FAA Update Runway Condition Assessment Matrix (2026-05-26).
+ Source: https://www.ntsb.gov/news/press-releases/Pages/NR20260526.aspx
+ Permission: https://www.ntsb.gov/about/Pages/Website-Policies.aspx
+ License/permission: NTSB-US-government-staff-text
+ Publisher attribution: {"credit": "National Transportation Safety Board"}
diff --git a/examples/ordinary-name-tags/inputs/acceptable-tag-representations.json b/examples/ordinary-name-tags/inputs/acceptable-tag-representations.json
new file mode 100644
index 000000000..39fa2e182
--- /dev/null
+++ b/examples/ordinary-name-tags/inputs/acceptable-tag-representations.json
@@ -0,0 +1,254 @@
+[
+ {
+ "id": "ordinary-science-02",
+ "reason": "City/jurisdiction combined versus split source-literal representation; neither is a fabricated fact.",
+ "acceptable_tag_sets": [
+ [
+ {
+ "text": "RESTON",
+ "type": "location"
+ },
+ {
+ "text": "U.S.",
+ "type": "location"
+ },
+ {
+ "text": "U.S. Geological Survey",
+ "type": "organization"
+ },
+ {
+ "text": "Va.",
+ "type": "location"
+ }
+ ],
+ [
+ {
+ "text": "RESTON, Va.",
+ "type": "location"
+ },
+ {
+ "text": "U.S.",
+ "type": "location"
+ },
+ {
+ "text": "U.S. Geological Survey",
+ "type": "organization"
+ }
+ ]
+ ]
+ },
+ {
+ "id": "ordinary-transport-01",
+ "reason": "City/jurisdiction combined versus split source-literal representation; neither is a fabricated fact.",
+ "acceptable_tag_sets": [
+ [
+ {
+ "text": "Atmos Energy Corporation",
+ "type": "organization"
+ },
+ {
+ "text": "Jackson",
+ "type": "location"
+ },
+ {
+ "text": "Mississippi",
+ "type": "location"
+ },
+ {
+ "text": "National Transportation Safety Board",
+ "type": "organization"
+ },
+ {
+ "text": "WASHINGTON",
+ "type": "location"
+ }
+ ],
+ [
+ {
+ "text": "Atmos Energy Corporation",
+ "type": "organization"
+ },
+ {
+ "text": "Jackson, Mississippi",
+ "type": "location"
+ },
+ {
+ "text": "National Transportation Safety Board",
+ "type": "organization"
+ },
+ {
+ "text": "WASHINGTON",
+ "type": "location"
+ }
+ ]
+ ]
+ },
+ {
+ "id": "ordinary-transport-03",
+ "reason": "City/jurisdiction combined versus split source-literal representation; neither is a fabricated fact.",
+ "acceptable_tag_sets": [
+ [
+ {
+ "text": "Millstone",
+ "type": "location"
+ },
+ {
+ "text": "National Transportation Safety Board",
+ "type": "organization"
+ },
+ {
+ "text": "WASHINGTON",
+ "type": "location"
+ },
+ {
+ "text": "West Virginia",
+ "type": "location"
+ }
+ ],
+ [
+ {
+ "text": "Millstone, West Virginia",
+ "type": "location"
+ },
+ {
+ "text": "National Transportation Safety Board",
+ "type": "organization"
+ },
+ {
+ "text": "WASHINGTON",
+ "type": "location"
+ }
+ ]
+ ]
+ },
+ {
+ "id": "ordinary-science-06",
+ "reason": "Prospective independent-review scope choice; the geographic-region/manufacturer reading is legitimate, not a fabricated fact.",
+ "acceptable_tag_sets": [
+ [
+ {
+ "text": "Jennifer Curtis",
+ "type": "person"
+ },
+ {
+ "text": "USGS",
+ "type": "organization"
+ }
+ ],
+ [
+ {
+ "text": "Jennifer Curtis",
+ "type": "person"
+ },
+ {
+ "text": "USGS",
+ "type": "organization"
+ },
+ {
+ "text": "West",
+ "type": "location"
+ }
+ ]
+ ]
+ },
+ {
+ "id": "ordinary-transport-04",
+ "reason": "Prospective independent-review scope choice; the geographic-region/manufacturer reading is legitimate, not a fabricated fact.",
+ "acceptable_tag_sets": [
+ [
+ {
+ "text": "Louis Armstrong New Orleans International Airport",
+ "type": "location"
+ },
+ {
+ "text": "NTSB",
+ "type": "organization"
+ },
+ {
+ "text": "Southwest Airlines",
+ "type": "organization"
+ }
+ ],
+ [
+ {
+ "text": "Boeing",
+ "type": "organization"
+ },
+ {
+ "text": "Louis Armstrong New Orleans International Airport",
+ "type": "location"
+ },
+ {
+ "text": "NTSB",
+ "type": "organization"
+ },
+ {
+ "text": "Southwest Airlines",
+ "type": "organization"
+ }
+ ]
+ ]
+ },
+ {
+ "id": "ordinary-software-04",
+ "reason": "HackerOne may refer to company or reporting platform; software/project exclusions stay for Node.js and Slack.",
+ "acceptable_tag_sets": [
+ [
+ {
+ "text": "HackerOne",
+ "type": "organization"
+ },
+ {
+ "text": "OpenJS Foundation",
+ "type": "organization"
+ }
+ ],
+ [
+ {
+ "text": "OpenJS Foundation",
+ "type": "organization"
+ }
+ ]
+ ]
+ },
+ {
+ "id": "ordinary-standards-03",
+ "reason": "The named hosting unit supports organization typing; the generic team descriptor and separately written parenthetical alias are finite boundary conventions. Arbitrary shortening is excluded.",
+ "acceptable_tag_sets": [
+ [
+ {
+ "text": "NIST",
+ "type": "organization"
+ },
+ {
+ "text": "NIST Multi-Party Threshold Cryptography (MPTC) team",
+ "type": "organization"
+ }
+ ],
+ [
+ {
+ "text": "NIST",
+ "type": "organization"
+ },
+ {
+ "text": "NIST Multi-Party Threshold Cryptography (MPTC)",
+ "type": "organization"
+ }
+ ],
+ [
+ {
+ "text": "MPTC",
+ "type": "organization"
+ },
+ {
+ "text": "NIST",
+ "type": "organization"
+ },
+ {
+ "text": "NIST Multi-Party Threshold Cryptography",
+ "type": "organization"
+ }
+ ]
+ ]
+ }
+]
diff --git a/examples/ordinary-name-tags/inputs/annotation-policy.md b/examples/ordinary-name-tags/inputs/annotation-policy.md
new file mode 100644
index 000000000..62180872c
--- /dev/null
+++ b/examples/ordinary-name-tags/inputs/annotation-policy.md
@@ -0,0 +1,23 @@
+# Ordinary-name tag policy, prospective v1
+
+The task is to tag a document with named people, organizations and locations. Gold is AI-agent-prepared and must be independently AI-agent-reviewed before outputs. This is a new ordinary-name engineering fit study. The original custom-type and separate-description results remain unchanged.
+
+Input is the exact selected contiguous paragraph. Do not invent a name or expand an acronym. Preserve source spelling, case, accents and internal punctuation. Annotation positions are Python Unicode character offsets, start inclusive and end exclusive. Every occurrence is annotated; the business metric deduplicates literal `(text,type)` pairs so repeated mentions do not increase document weight.
+
+- `person`: a named human, including a surname alias used as a human reference. Exclude titles, anonymous roles, pronouns and a person's name contained in a facility name when the text refers to the facility.
+- `organization`: a named agency, company, university, committee or organizational unit. Include full qualified body names and separately written aliases. Generic staff and industry names are excluded. Software, languages, products, reports, awards, programs and event titles do not become organizations merely because they have proper names.
+- `location`: a named country, state, city, continent, natural geographic feature or named physical site, including a mine or airport. Exclude unnamed places, generic direction words and names contained inside a longer organization or facility name. A full airport name is one location, without nested city/person tags.
+
+Flat spans do not overlap. A full named organization or site takes precedence over contained names. Honorifics, possessive suffixes and surrounding punctuation are excluded. A parenthetical alias is a separate span when it follows a complete body name; if it is inside one qualified organizational unit, the full unit remains one span. Generic trailing words such as `community` do not extend a body name. A named organization used as a modifier of a separately named program or event may remain an organization mention; an identifier such as ISO/IEC 17043 or an aircraft model is handled as a product/standard rather than a separate organization mention. Boundary/type ambiguities must be reviewed before outputs and described as annotation choices rather than fabricated facts.
+
+Primary display gold splits literal city/state datelines: RESTON plus Va., Jackson plus Mississippi, Millstone plus West Virginia. Each of those three complete source strings may also be returned as a single location under an explicit prospective acceptable representation. Uppercase WASHINGTON is a source-literal capital location and is not expanded to Washington, D.C.
+
+Independent AI review, before outputs, identified four additional finite interpretation choices. `West` in science06 may name the geographic region, so the approved alternative adds that literal location. `Boeing` in transport04 may reference the manufacturer within the aircraft identifier, so the alternative adds that literal organization. `HackerOne` in software04 may name the platform or the company, so the alternative omits that organization while preserving OpenJS Foundation. The qualified MPTC team in standards03 may be one full span including `team`, one span without the generic descriptor, or the complete named body plus its separately written MPTC alias. All three complete alternative tag sets still contain the standalone NIST mention. Arbitrary shortened team names are not accepted. These are scope/boundary choices, not fabricated facts. The complete airport remains one location without nested Louis Armstrong or New Orleans tags.
+
+All seven finite representation records are in `acceptable-tag-representations.json`. Strict display scores remain separately visible. No representation is added or changed after outputs.
+
+Source agencies may qualify attribution/ownership, but no outside facts or surrounding text are supplied to either model. Independent review accepted CAISI organization typing as institutional benchmark attribution and the MPTC hosting team as a named organizational unit; it did not invent expanded names. The same plain labels reach the native model; no hidden separate descriptions are substituted. Luna receives the short shared task policy, but no gold, source IDs, passage-coverage rationale or example answers.
+
+Primary quality is document/source-family-equal typed literal tag-set F1, with the best only among the prospectively fixed complete acceptable tag sets. Empty/empty scores 1; either side alone empty scores 0. All 24 planned sources stay, including failed or unattempted calls as score0. Also report strict display F1, pooled tag precision/recall, entity-bearing mean F1, every empty-source false tag, exact-document correctness and native position/type span diagnostics. Do not market a valid alternate segmentation as a wrong fact.
+
+The engineering useful-fit gate requires pooled emitted-tag precision at least0.90, entity-bearing source-equal F1 at least0.80 and at least12 entity-bearing sources. All24 planned native rows must also have complete known successful evidence; an unknown or unattempted empty case cannot be treated as demonstrated empty-case correctness. This is a point gate on the declared frame, not a population noninferiority conclusion. Any uncertainty uses source family as the paired independent unit. Mention counts are not the sample size. No extra sources, altered gold, thresholds or candidates follow a failed gate.
diff --git a/examples/ordinary-name-tags/inputs/cases.jsonl b/examples/ordinary-name-tags/inputs/cases.jsonl
new file mode 100644
index 000000000..af085f02a
--- /dev/null
+++ b/examples/ordinary-name-tags/inputs/cases.jsonl
@@ -0,0 +1,24 @@
+{"annotation_decision":"Apply the shared ordinary-name policy; no additional per-source exception.","domain":"science","entities":[{"end":24,"start":11,"text":"United States","type":"location"},{"end":182,"start":169,"text":"Shirley Leung","type":"person"}],"id":"ordinary-science-01","labels":["person","organization","location"],"license_or_permission":"USGS-US-government-text","permission_url":"https://www.usgs.gov/information-policies-and-instructions/copyrights-and-credits","publication_date":"2026-04-27","publisher_attribution":{"credit":"U.S. Geological Survey"},"source_body_sha256":"7c84012889b99c3975ef2b187f4cdce0b28222316bfbe84f867d66f6305fcc89","source_candidate_id":"usgs-3a8cc7ff0593","source_end":1142,"source_family_id":"usgs-water-availability-assessment-tool","source_revision":null,"source_start":752,"source_url":"https://www.usgs.gov/news/national-news-release/new-nationwide-tool-helps-answer-do-we-have-enough-water","tags":[{"text":"Shirley Leung","type":"person"},{"text":"United States","type":"location"}],"text":"“While the United States has abundant water nationally, regional imbalances between supply and demand may create water challenges affecting millions of Americans,” said Shirley Leung, lead scientist. “This tool can help decision-makers understand whether challenges may stem from limited natural water supply, high demand, or both. This information is helpful for effective water planning.”","text_sha256":"e6ea430841373a14f82c4b1cfe8342f3aee297d8047c24bd852d35dc12b94a15","title":"New Nationwide Tool Helps Answer: Do We Have Enough Water?","words":54}
+{"annotation_decision":"Survey's possessive suffix is excluded. U.S. inside the longer organization is not a nested location. RESTON/Va. combined dateline is a prospective accepted representation.","domain":"science","entities":[{"end":6,"start":0,"text":"RESTON","type":"location"},{"end":11,"start":8,"text":"Va.","type":"location"},{"end":39,"start":35,"text":"U.S.","type":"location"},{"end":137,"start":115,"text":"U.S. Geological Survey","type":"organization"}],"id":"ordinary-science-02","labels":["person","organization","location"],"license_or_permission":"USGS-US-government-text","permission_url":"https://www.usgs.gov/information-policies-and-instructions/copyrights-and-credits","publication_date":"2026-02-06","publisher_attribution":{"credit":"U.S. Geological Survey"},"source_body_sha256":"bcb8142dffa3ca8e713249e13d76699f003bd0d85f795484f645e4ea8cecb5a7","source_candidate_id":"usgs-c08271c58c26","source_end":394,"source_family_id":"usgs-mineral-commodity-summaries-2026","source_revision":null,"source_start":144,"source_url":"https://www.usgs.gov/news/national-news-release/value-us-mineral-production-rose-last-year-driven-precious-metals-prices","tags":[{"text":"RESTON","type":"location"},{"text":"U.S.","type":"location"},{"text":"U.S. Geological Survey","type":"organization"},{"text":"Va.","type":"location"}],"text":"RESTON, Va. — The overall value of U.S. mineral production rose by 5.6% to \\$112 billion in 2025, according to the U.S. Geological Survey’s annual Mineral Commodity Summaries, driven by changes in the price of precious metals such as gold and silver.","text_sha256":"532518abb1c916381f1ed7ec16463ecd0c0c80c4e779952f91e0db292572c206","title":"Value of U.S. mineral production rose last year, driven by precious metals prices","words":42}
+{"annotation_decision":"Kings Mountain and Hallman-Beam are named physical mine sites in this input. No generic plural mines is appended; North Carolina's possessive suffix is excluded.","domain":"science","entities":[{"end":49,"start":35,"text":"North Carolina","type":"location"},{"end":66,"start":52,"text":"Kings Mountain","type":"location"},{"end":83,"start":71,"text":"Hallman-Beam","type":"location"},{"end":245,"start":232,"text":"South America","type":"location"},{"end":273,"start":264,"text":"Australia","type":"location"}],"id":"ordinary-science-03","labels":["person","organization","location"],"license_or_permission":"USGS-US-government-text","permission_url":"https://www.usgs.gov/information-policies-and-instructions/copyrights-and-credits","publication_date":"2026-06-18","publisher_attribution":{"credit":"U.S. Geological Survey"},"source_body_sha256":"eddfd6db41850136192bbfeaad0de0d787ffd0dee058c7fd7a390ade835b13fc","source_candidate_id":"usgs-1b2c400eb4da","source_end":1362,"source_family_id":"usgs-appalachian-lithium-assessments","source_revision":null,"source_start":1002,"source_url":"https://www.usgs.gov/news/national-news-release/usgs-lithium-carolinas-could-replace-imports-a-century-or-more","tags":[{"text":"Australia","type":"location"},{"text":"Hallman-Beam","type":"location"},{"text":"Kings Mountain","type":"location"},{"text":"North Carolina","type":"location"},{"text":"South America","type":"location"}],"text":"Before the boom in lithium demand, North Carolina’s Kings Mountain and Hallman-Beam mines produced lithium from pegmatites but closed in the 1990s when production shifted to lower-cost sources such as lithium from dried lakebeds in South America and pegmatites in Australia. At the time, lithium was principally used for ceramics, glass and lubricating grease.","text_sha256":"22e7b2ef2fd63cba00fc4f697f4d000540fd05f6d3f437da7c2b3a8bb89503c3","title":"USGS: Lithium in Carolinas Could Replace Imports for a Century or More","words":54}
+{"annotation_decision":"Colorado River is a literal geographic name, including its occurrence before the descriptive suffix -fed. Grand Canyon is a location. Boundary choices are not invented facts.","domain":"science","entities":[{"end":97,"start":83,"text":"Colorado River","type":"location"},{"end":133,"start":124,"text":"Ryan Crow","type":"person"},{"end":139,"start":135,"text":"USGS","type":"organization"},{"end":217,"start":203,"text":"Colorado River","type":"location"},{"end":329,"start":317,"text":"Grand Canyon","type":"location"},{"end":396,"start":382,"text":"Colorado River","type":"location"}],"id":"ordinary-science-04","labels":["person","organization","location"],"license_or_permission":"USGS-US-government-text","permission_url":"https://www.usgs.gov/information-policies-and-instructions/copyrights-and-credits","publication_date":"2026-04-16","publisher_attribution":{"credit":"U.S. Geological Survey"},"source_body_sha256":"234f6ad217248b53d48b5adff7f10b966e6c75e9321bfda29039a8e670341c66","source_candidate_id":"usgs-e35ec8b2fd9a","source_end":1460,"source_family_id":"usgs-bidahochi-grand-canyon-study","source_revision":null,"source_start":1044,"source_url":"https://www.usgs.gov/news/national-news-release/new-research-shows-prehistoric-lake-contributed-birth-grand-canyon","tags":[{"text":"Colorado River","type":"location"},{"text":"Grand Canyon","type":"location"},{"text":"Ryan Crow","type":"person"},{"text":"USGS","type":"organization"}],"text":"“By tracing the mineral grains in these lake deposits, we can see exactly when the Colorado River reached this basin,” said Ryan Crow, USGS geologist and a lead author. “The evidence points clearly to a Colorado River–fed lake that could have spilled westward, establishing the river’s course through what is now the Grand Canyon. It’s a simple but powerful explanation for how the Colorado River system took shape.”","text_sha256":"f1db1023a5bee239910c23935d7006442b15e4795098a03f4f96afa142feb0be","title":"New research shows prehistoric lake contributed to the birth of the Grand Canyon","words":68}
+{"annotation_decision":"Apply the shared ordinary-name policy; no additional per-source exception.","domain":"science","entities":[{"end":9,"start":5,"text":"USGS","type":"organization"},{"end":182,"start":170,"text":"John Hammond","type":"person"},{"end":188,"start":184,"text":"USGS","type":"organization"}],"id":"ordinary-science-05","labels":["person","organization","location"],"license_or_permission":"USGS-US-government-text","permission_url":"https://www.usgs.gov/information-policies-and-instructions/copyrights-and-credits","publication_date":"2026-03-31","publisher_attribution":{"credit":"U.S. Geological Survey"},"source_body_sha256":"4347acff65f762125a267ac29239d496cdc00db1ddff93098dde3d5fae81f25d","source_candidate_id":"usgs-45b67cc6df92","source_end":965,"source_family_id":"usgs-river-droughtcast","source_revision":null,"source_start":725,"source_url":"https://www.usgs.gov/news/national-news-release/new-ai-tool-forecasts-drought-90-days-ahead-nationwide","tags":[{"text":"John Hammond","type":"person"},{"text":"USGS","type":"organization"}],"text":"“The USGS is putting more than a century of streamflow data to work in a completely new way, using machine learning to predict streamflow drought weeks in advance,” said John Hammond, USGS project manager for the drought forecasting system.","text_sha256":"47fe3bee1dc01e1308fdad2d79000eb47090f48835eea40df848dcceb581e009","title":"New AI Tool Forecasts Drought 90 Days Ahead Nationwide","words":39}
+{"annotation_decision":"Primary display excludes West as a regional shorthand; the finite approved alternative includes West:location. Both scope choices are legitimate. USGS and Jennifer Curtis remain literal tags.","domain":"science","entities":[{"end":214,"start":199,"text":"Jennifer Curtis","type":"person"},{"end":220,"start":216,"text":"USGS","type":"organization"}],"id":"ordinary-science-06","labels":["person","organization","location"],"license_or_permission":"USGS-US-government-text","permission_url":"https://www.usgs.gov/information-policies-and-instructions/copyrights-and-credits","publication_date":"2026-05-19","publisher_attribution":{"credit":"U.S. Geological Survey"},"source_body_sha256":"e2f55a60f96fa2dde98b51085a37a60af98532868b0dbdc3214298e65cda1d73","source_candidate_id":"usgs-ef333d9d77ef","source_end":1532,"source_family_id":"usgs-mckinney-klamath-anoxia-study","source_revision":null,"source_start":1080,"source_url":"https://www.usgs.gov/news/state-news-release/wildfires-burn-rainfall-can-strip-oxygen-rivers-killing-fish","tags":[{"text":"Jennifer Curtis","type":"person"},{"text":"USGS","type":"organization"}],"text":"“This research provides resource managers and emergency responders with critical information about how post-fire landscapes can affect water quality in ways we haven't fully understood before,” said Jennifer Curtis, USGS research geologist and lead author of the study. “Understanding these oxygen depletion events helps managers better anticipate and potentially mitigate similar impacts as wildfires become more frequent and intense across the West.”","text_sha256":"92e3e79749b57206bc95b67302fe64637d526be035068580508d1ec2ad223eb1","title":"As Wildfires Burn, Rainfall Can Strip Oxygen From Rivers, Killing Fish","words":62}
+{"annotation_decision":"Apply the shared ordinary-name policy; no additional per-source exception.","domain":"software","entities":[],"id":"ordinary-software-01","labels":["person","organization","location"],"license_or_permission":"CC-BY-4.0","permission_url":"https://go.dev/copyright","publication_date":"2026-09-02","publisher_attribution":{"authors":["Vlad Saioc"],"license_url":"https://creativecommons.org/licenses/by/4.0/","modification_notice":"Prose extraction and Markdown normalization; code, images, chrome and quoted blocks excluded.","source_url":"https://go.dev/blog/goroutine-leak-profiles","title":"Goroutine Leak Profiles"},"source_body_sha256":"047965133e2c31433652a0b40e5da99e18119c269263fc363696c83255cf459e","source_candidate_id":"go-979d992208b0","source_end":352,"source_family_id":"go-1.27-runtime-profiling","source_revision":"32881aa55f0d81413cda4fe43e0236d0cae2b2ec","source_start":0,"source_url":"https://go.dev/blog/goroutine-leak-profiles","tags":[],"text":"Go's concurrency features are powerful and easy to use, but that same ease can sometimes lead even seasoned developers to make mistakes. Fortunately, the Go ecosystem comes equipped with useful tools for debugging, e.g., the race detector, but even existing tools may miss some concurrency bugs, such as the topic of this article, the _goroutine leak_.","text_sha256":"8af5421b4124de068ab6ee23fdd55ee707b92051dbbb35e6c471313ad4d3ead6","title":"Goroutine Leak Profiles","words":56}
+{"annotation_decision":"Apply the shared ordinary-name policy; no additional per-source exception.","domain":"software","entities":[],"id":"ordinary-software-02","labels":["person","organization","location"],"license_or_permission":"MIT","permission_url":"https://raw.githubusercontent.com/rust-lang/blog.rust-lang.org/c7510dd334a8690c207a08e3e4b6a17a8b675bf2/README.md","publication_date":"2026-10-02","publisher_attribution":{"authors":["Mateusz Mikuła","Ralf Jung"],"license_url":"https://raw.githubusercontent.com/rust-lang/blog.rust-lang.org/c7510dd334a8690c207a08e3e4b6a17a8b675bf2/LICENSE-MIT","modification_notice":"Prose extraction and Markdown normalization; code, images, chrome and quoted blocks excluded.","source_url":"https://blog.rust-lang.org/2026/10/02/demoting-i686-windows-targets-to-std-only/","title":"Demoting i686 Windows targets to std-only"},"source_body_sha256":"d00927b6e195478d9c26276eea72c83fe76c33a3d6ab6f70b6c1f03924f235ff","source_candidate_id":"rust-a7e386f76a6b","source_end":482,"source_family_id":"rust-windows-i686-support-policy","source_revision":"c7510dd334a8690c207a08e3e4b6a17a8b675bf2","source_start":286,"source_url":"https://blog.rust-lang.org/2026/10/02/demoting-i686-windows-targets-to-std-only/","tags":[],"text":"Builds of the standard library will continue to be distributed, but host tools such as the compiler will be no longer available. i686-pc-windows-msvc as a Tier 1 target still undergoes CI testing.","text_sha256":"75f9205afd89dd8e8ef1d5e2d96b0031d67ab2cbab79d1fd084031026d10ee81","title":"Demoting i686 Windows targets to std-only","words":32}
+{"annotation_decision":"Apply the shared ordinary-name policy; no additional per-source exception.","domain":"software","entities":[],"id":"ordinary-software-03","labels":["person","organization","location"],"license_or_permission":"MIT","permission_url":"https://raw.githubusercontent.com/rust-lang/blog.rust-lang.org/c7510dd334a8690c207a08e3e4b6a17a8b675bf2/README.md","publication_date":"2026-04-04","publisher_attribution":{"authors":["Denis Cornehl"],"license_url":"https://raw.githubusercontent.com/rust-lang/blog.rust-lang.org/c7510dd334a8690c207a08e3e4b6a17a8b675bf2/LICENSE-MIT","modification_notice":"Prose extraction and Markdown normalization; code, images, chrome and quoted blocks excluded.","source_url":"https://blog.rust-lang.org/2026/04/04/docsrs-only-default-targets/","title":"docs.rs: building fewer targets by default"},"source_body_sha256":"322b6075556df703bd655672833f0c806b9ccb52cbf14f7799546f836918faa9","source_candidate_id":"rust-70be966d36bf","source_end":721,"source_family_id":"docsrs-default-build-target-policy","source_revision":"c7510dd334a8690c207a08e3e4b6a17a8b675bf2","source_start":398,"source_url":"https://blog.rust-lang.org/2026/04/04/docsrs-only-default-targets/","tags":[],"text":"This is the next step in a change we first introduced in 2020, when docs.rs added support for opting into fewer build targets. Most crates do not compile different code for different targets, so building fewer targets by default is a better fit for most releases. It also reduces build times and saves resources on docs.rs.","text_sha256":"dfae848a64a5272902c5b1f6bf428dd9ee0fc68573dd60fac964a52d473e8206","title":"docs.rs: building fewer targets by default","words":56}
+{"annotation_decision":"Primary display tags company HackerOne and body OpenJS Foundation; the finite approved platform interpretation omits HackerOne. Node.js and Slack remain software/project/service references, not organizational tags.","domain":"software","entities":[{"end":96,"start":87,"text":"HackerOne","type":"organization"},{"end":265,"start":248,"text":"OpenJS Foundation","type":"organization"}],"id":"ordinary-software-04","labels":["person","organization","location"],"license_or_permission":"MIT","permission_url":"https://raw.githubusercontent.com/nodejs/nodejs.org/e7bbce71483466003758b0d8e7bcfc19ba5fbf2a/LICENSE","publication_date":"2026-02-19","publisher_attribution":{"credit":"Node.js Website WG contributors"},"source_body_sha256":"0377d0cc02aa1c358f476efbdd1a15d8394a1f4e7c5cfe83640738dbddf9c528","source_candidate_id":"nodejs-f9ea7f0bc348","source_end":272,"source_family_id":"node-security-intake-and-bounty-operation","source_revision":null,"source_start":0,"source_url":"https://nodejs.org/en/blog/announcements/hackerone-signal-requirement","tags":[{"text":"HackerOne","type":"organization"},{"text":"OpenJS Foundation","type":"organization"}],"text":"UPDATE 2026-02-19: New researchers without signal can no longer submit reports through HackerOne. If you are a new researcher and would like to report a potential vulnerability, please reach out to the Node.js security release stewards through the OpenJS Foundation Slack.","text_sha256":"72decf07b6a856473b56cf9aed4861864dec8b0c0b37e6889509fbd22441a4fc","title":"New HackerOne Signal Requirement for Vulnerability Reports","words":41}
+{"annotation_decision":"Apply the shared ordinary-name policy; no additional per-source exception.","domain":"software","entities":[],"id":"ordinary-software-05","labels":["person","organization","location"],"license_or_permission":"MIT","permission_url":"https://raw.githubusercontent.com/rust-lang/blog.rust-lang.org/c7510dd334a8690c207a08e3e4b6a17a8b675bf2/README.md","publication_date":"2026-03-13","publisher_attribution":{"authors":["Ed Page"],"license_url":"https://raw.githubusercontent.com/rust-lang/blog.rust-lang.org/c7510dd334a8690c207a08e3e4b6a17a8b675bf2/LICENSE-MIT","modification_notice":"Prose extraction and Markdown normalization; code, images, chrome and quoted blocks excluded.","source_url":"https://blog.rust-lang.org/2026/03/13/call-for-testing-build-dir-layout-v2/","title":"Call for Testing: Build Dir Layout v2"},"source_body_sha256":"ea1bceb6ce3251303f60abd0d8755b182643f8e480143c07d142d2b5f1577522","source_candidate_id":"rust-d86dac00a93d","source_end":475,"source_family_id":"cargo-build-dir-layout-v2","source_revision":"c7510dd334a8690c207a08e3e4b6a17a8b675bf2","source_start":0,"source_url":"https://blog.rust-lang.org/2026/03/13/call-for-testing-build-dir-layout-v2/","tags":[],"text":"We would welcome people to try and report issues with the nightly-only cargo -Zbuild-dir-new-layout. While the layout of the build dir is internal-only, many projects need to rely on the unspecified details due to missing features within Cargo. While we've performed a crater run, that won't cover everything and we need help identifying tools and process that rely on the details, reporting issues to these projects so they can update to the new layout or support them both.","text_sha256":"157452d1fd351ce28ada21360dd9f18143ea1a4998b8cd3d2aead81808d3f27a","title":"Call for Testing: Build Dir Layout v2","words":78}
+{"annotation_decision":"Apply the shared ordinary-name policy; no additional per-source exception.","domain":"software","entities":[],"id":"ordinary-software-06","labels":["person","organization","location"],"license_or_permission":"CC-BY-4.0","permission_url":"https://go.dev/copyright","publication_date":"2026-03-10","publisher_attribution":{"authors":["Alan Donovan"],"license_url":"https://creativecommons.org/licenses/by/4.0/","modification_notice":"Prose extraction and Markdown normalization; code, images, chrome and quoted blocks excluded.","source_url":"https://go.dev/blog/inliner","title":"//go:fix inline and the source-level inliner"},"source_body_sha256":"0906a1768857aff6184d25db1735ad497de0f78ef81feca86cca6a2fbee5c72a","source_candidate_id":"go-f060b5c1a2cd","source_end":291,"source_family_id":"go-1.26-compiler-and-tooling","source_revision":"32881aa55f0d81413cda4fe43e0236d0cae2b2ec","source_start":15,"source_url":"https://go.dev/blog/inliner","tags":[],"text":"Go 1.26 contains an all-new implementation of the go fix subcommand, designed to help you keep your Go code up-to-date and modern. For an introduction, start by reading our recent post on the topic. In this post, we’ll look at one particular feature, the source-level inliner.","text_sha256":"f5cbd648ad9bef035a4d132732aa79e1766da9d379defda77ce2a6e6e80b0989","title":"//go:fix inline and the source-level inliner","words":46}
+{"annotation_decision":"FISSEA is an organization modifier before event names and an alias outside the full organizational name. Forum titles and generic community are not new organizations.","domain":"standards","entities":[{"end":42,"start":36,"text":"FISSEA","type":"organization"},{"end":122,"start":116,"text":"FISSEA","type":"organization"},{"end":323,"start":285,"text":"Federal Information Security Educators","type":"organization"},{"end":331,"start":325,"text":"FISSEA","type":"organization"}],"id":"ordinary-standards-01","labels":["person","organization","location"],"license_or_permission":"NIST-unmarked-text-redistribution-permission","permission_url":"https://www.nist.gov/copyrights-disclaimers","publication_date":"2026-09-24","publisher_attribution":{"credit":"National Institute of Standards and Technology"},"source_body_sha256":"da065158f09ea4d7777b1f770a470968166ca36665ac11f76a3a673f16b27fd3","source_candidate_id":"nist-ef35bfb0fe19","source_end":360,"source_family_id":"nist-fissea-quarterly-forum","source_revision":null,"source_start":17,"source_url":"https://www.nist.gov/news-events/news/2026/09/register-now-and-submit-speaker-proposals-fissea-winter-forum","tags":[{"text":"FISSEA","type":"organization"},{"text":"Federal Information Security Educators","type":"organization"}],"text":"We are pleased to announce that the FISSEA Winter Forum will take place on February 9, 2027, at 1:00 pm-3:00 pm ET. FISSEA Forums are quarterly events to provide opportunities for programmatic updates, the exchange of best practices, and discussion and engagement among members of the Federal Information Security Educators (FISSEA) community.","text_sha256":"40832aff0fa1197f0223b480d6dae5fc49cc655e2abdbae092ebe1bbd879b153","title":"Register Now and Submit Speaker Proposals for the FISSEA Winter Forum","words":52}
+{"annotation_decision":"Apply the shared ordinary-name policy; no additional per-source exception.","domain":"standards","entities":[],"id":"ordinary-standards-02","labels":["person","organization","location"],"license_or_permission":"NIST-unmarked-text-redistribution-permission","permission_url":"https://www.nist.gov/copyrights-disclaimers","publication_date":"2026-09-18","publisher_attribution":{"credit":"National Institute of Standards and Technology"},"source_body_sha256":"bf012cd65ef1823ca807e833ae21a4a2b6fb08fb507fa40446ee32cb03529a05","source_candidate_id":"nist-1ebcdaaeba24","source_end":372,"source_family_id":"nist-short-spotlight-features","source_revision":null,"source_start":157,"source_url":"https://www.nist.gov/news-events/news/2026/09/spotlight-laser-light-sheet-imaging-shows-dangers-airborne-exposure","tags":[],"text":"This video clip, produced using a technique called laser light sheet imaging, shows how microscopic particles can become airborne — and spread throughout the space you’re in — just from opening or closing a package.","text_sha256":"1939e491d2f1b9ac47832e615ed4bfc1e9aaec08d25b111ffb44a833ee33c950","title":"Spotlight: Laser Light Sheet Imaging Shows the Dangers of Airborne Exposure to Allergens","words":35}
+{"annotation_decision":"The named hosting team is an organizational unit. Three finite approved complete representations cover the full unit with team, without its generic descriptor, or its full body plus separately written MPTC alias; all retain standalone NIST. No arbitrary shortening.","domain":"standards","entities":[{"end":9,"start":5,"text":"NIST","type":"organization"},{"end":169,"start":118,"text":"NIST Multi-Party Threshold Cryptography (MPTC) team","type":"organization"},{"end":235,"start":231,"text":"NIST","type":"organization"}],"id":"ordinary-standards-03","labels":["person","organization","location"],"license_or_permission":"NIST-unmarked-text-redistribution-permission","permission_url":"https://www.nist.gov/copyrights-disclaimers","publication_date":"2026-09-25","publisher_attribution":{"credit":"National Institute of Standards and Technology"},"source_body_sha256":"950f29597c328781f3328fa6b93d477f0be174362273e3e2ba97e42d14667312","source_candidate_id":"nist-d58e0269a766","source_end":251,"source_family_id":"nist-mptc-threshold-call-series","source_revision":null,"source_start":0,"source_url":"https://www.nist.gov/news-events/news/2026/09/nist-threshold-call-preview-talks-3-virtual","tags":[{"text":"NIST","type":"organization"},{"text":"NIST Multi-Party Threshold Cryptography (MPTC) team","type":"organization"}],"text":"Join NIST on September 30 and October 6–7, 2026, for Threshold Call Preview Talks #3 (TCPT3). Hosted virtually by the NIST Multi-Party Threshold Cryptography (MPTC) team, this event highlights upcoming external submissions for the NIST Threshold Call.","text_sha256":"89920424ccfc970a36a501892b72d5b2c7bee67179baabd475683175bd054255","title":"NIST Threshold Call Preview Talks #3 (Virtual)","words":37}
+{"annotation_decision":"Independent review accepts CAISI organization typing as institutional benchmark attribution. U.S. remains a literal location; no expanded CAISI name is invented.","domain":"standards","entities":[{"end":79,"start":75,"text":"U.S.","type":"location"},{"end":142,"start":138,"text":"U.S.","type":"location"},{"end":224,"start":219,"text":"CAISI","type":"organization"}],"id":"ordinary-standards-04","labels":["person","organization","location"],"license_or_permission":"NIST-unmarked-text-redistribution-permission","permission_url":"https://www.nist.gov/copyrights-disclaimers","publication_date":"2026-09-17","publisher_attribution":{"credit":"National Institute of Standards and Technology"},"source_body_sha256":"f44572425aa09f8c3341b10172b48c55afd4b9834e96a39edb1a2490e7c0fa3c","source_candidate_id":"nist-3751e1f90d5d","source_end":573,"source_family_id":"nist-caisi-glm53-assessment","source_revision":null,"source_start":320,"source_url":"https://www.nist.gov/news-events/news/2026/09/caisis-assessment-zais-glm-53-cyber-capabilities","tags":[{"text":"CAISI","type":"organization"},{"text":"U.S.","type":"location"}],"text":"GLM-5.3’s cyber capabilities are significantly lower than those of current U.S. frontier models. GLM-5.3 lags the capability level of the U.S. frontier by about four months in an aggregate measure of performance across CAISI cyber benchmarks (Figure 1).","text_sha256":"c31775707009eafc5d5aa5eca4a3992dda2d99a28153a93e949f0ad37f22fe2d","title":"CAISI’s Assessment of Z.ai’s GLM-5.3 Cyber Capabilities","words":38}
+{"annotation_decision":"Office of Weights and Measures is a separately named body preceding the program; OWM is its separate alias. ISO/IEC 17043 is a standard identifier, SI a measurement system, and PT a service/program acronym, not organizational mentions.","domain":"standards","entities":[{"end":34,"start":4,"text":"Office of Weights and Measures","type":"organization"},{"end":39,"start":36,"text":"OWM","type":"organization"},{"end":323,"start":319,"text":"NIST","type":"organization"},{"end":438,"start":434,"text":"U.S.","type":"location"}],"id":"ordinary-standards-05","labels":["person","organization","location"],"license_or_permission":"NIST-unmarked-text-redistribution-permission","permission_url":"https://www.nist.gov/copyrights-disclaimers","publication_date":"2026-10-02","publisher_attribution":{"credit":"National Institute of Standards and Technology"},"source_body_sha256":"3634a12a4f4d1ae737b9a798afb98292d431b954db8dbbd55add75ed91ec93e3","source_candidate_id":"nist-33c051e53c86","source_end":490,"source_family_id":"nist-owm-rmap-proficiency-recognition","source_revision":null,"source_start":0,"source_url":"https://www.nist.gov/news-events/news/2026/10/owm-recognizes-proficiency-testing-coordinators-2025-rmaps","tags":[{"text":"NIST","type":"organization"},{"text":"OWM","type":"organization"},{"text":"Office of Weights and Measures","type":"organization"},{"text":"U.S.","type":"location"}],"text":"The Office of Weights and Measures (OWM) Laboratory Metrology Program operates an ISO/IEC 17043 compliant Proficiency Testing (PT) services that assesses the effectiveness of the metrology training efforts for the state laboratory participants and the traceability of the state metrology laboratories to the SI through NIST’s measurement services. Participants of the PT program include federal and commercial laboratories across the U.S., in addition to state legal metrology laboratories.","text_sha256":"1538be24cea45911e2879d38fb8b2dbfbdb3727d78789c325d0ed93e2d58dc88","title":"OWM Recognizes Proficiency Testing Coordinators of the 2025 RMAPs","words":68}
+{"annotation_decision":"Apply the shared ordinary-name policy; no additional per-source exception.","domain":"standards","entities":[],"id":"ordinary-standards-06","labels":["person","organization","location"],"license_or_permission":"NIST-unmarked-text-redistribution-permission","permission_url":"https://www.nist.gov/copyrights-disclaimers","publication_date":"2026-09-23","publisher_attribution":{"credit":"National Institute of Standards and Technology"},"source_body_sha256":"e2ed98764c767abb9200bc55ca026b4ab49c8c42df5dc485a7cf20d5da01f063","source_candidate_id":"nist-aafd9e095ffe","source_end":484,"source_family_id":"nist-nasctn-cbrs-sea-measurement-study","source_revision":null,"source_start":0,"source_url":"https://www.nist.gov/news-events/news/2026/09/validating-spectrum-cbrs-band-models-measurements","tags":[],"text":"Wireless devices, from your phone to the internet router at work, need access to slices of radio frequencies to carry signals through the air. These slices are known as spectrum. Spectrum is a finite resource, and as technology advances, demand for it continues to grow, straining the supply of open frequencies. Dynamic spectrum sharing is one answer to this problem and involves allowing different users to share the same frequencies rather than giving each user an exclusive slice.","text_sha256":"8b9a8225d8a446c3887de72d8ca54605e7f4b589c81e73c3c8f776f5ad03bdd5","title":"Validating Spectrum in the CBRS Band: From Models to Measurements","words":78}
+{"annotation_decision":"Jackson/Mississippi combined dateline is a prospective accepted location representation. Names of accident victims or properties are not inferred.","domain":"transport","entities":[{"end":10,"start":0,"text":"WASHINGTON","type":"location"},{"end":96,"start":89,"text":"Jackson","type":"location"},{"end":109,"start":98,"text":"Mississippi","type":"location"},{"end":150,"start":126,"text":"Atmos Energy Corporation","type":"organization"},{"end":266,"start":230,"text":"National Transportation Safety Board","type":"organization"}],"id":"ordinary-transport-01","labels":["person","organization","location"],"license_or_permission":"NTSB-US-government-staff-text","permission_url":"https://www.ntsb.gov/about/Pages/Website-Policies.aspx","publication_date":"2026-03-26","publisher_attribution":{"credit":"National Transportation Safety Board"},"source_body_sha256":"8016d6eadd0a34d75d37405a6f4f75e14c6e03ab0a4ff07c40635cd7fe665dc3","source_candidate_id":"ntsb-0a7cd76a8158","source_end":281,"source_family_id":"ntsb-jackson-mississippi-pipeline-case","source_revision":null,"source_start":0,"source_url":"https://www.ntsb.gov/news/press-releases/Pages/NR20260326.aspx","tags":[{"text":"Atmos Energy Corporation","type":"organization"},{"text":"Jackson","type":"location"},{"text":"Mississippi","type":"location"},{"text":"National Transportation Safety Board","type":"organization"},{"text":"WASHINGTON","type":"location"}],"text":"WASHINGTON (Mar. 26, 2026) — Two natural gas pipeline explosions that destroyed homes in Jackson, Mississippi, happened after Atmos Energy Corporation failed to promptly repair underground gas leaks it had already identified, the National Transportation Safety Board said Thursday.","text_sha256":"c0e5952ab6342a64bcc83c2872f2fb49c33e532bd8a931c2f894a1569213b131","title":"Unrepaired Leaks Led to Natural Gas Pipeline Explosions in Mississippi","words":39}
+{"annotation_decision":"Apply the shared ordinary-name policy; no additional per-source exception.","domain":"transport","entities":[{"end":169,"start":153,"text":"Jennifer Homendy","type":"person"},{"end":193,"start":189,"text":"NTSB","type":"organization"}],"id":"ordinary-transport-02","labels":["person","organization","location"],"license_or_permission":"NTSB-US-government-staff-text","permission_url":"https://www.ntsb.gov/about/Pages/Website-Policies.aspx","publication_date":"2026-01-28","publisher_attribution":{"credit":"National Transportation Safety Board"},"source_body_sha256":"5631f194d8e13eebde1337434692d76d699866e76f9ca7ff213269c7569ecabb","source_candidate_id":"ntsb-0562d40e4a07","source_end":710,"source_family_id":"ntsb-dca-2025-midair-investigation","source_revision":null,"source_start":427,"source_url":"https://www.ntsb.gov/news/press-releases/Pages/NR20260127.aspx","tags":[{"text":"Jennifer Homendy","type":"person"},{"text":"NTSB","type":"organization"}],"text":"“This complex and comprehensive one-year investigation identified serious and long-standing safety gaps in the airspace over our nation’s capital,” said Jennifer Homendy, chairwoman of the NTSB. “Sadly, the conditions for this tragedy were in place long before the night of Jan. 29.”","text_sha256":"e5a3fc3d2c8429824914ffe4e4a73ec0f995d4d76bb1d44c4c0a501db2bac192","title":"Systemic Failures Led to Midair Collision Over Potomac River in Washington","words":42}
+{"annotation_decision":"Millstone/West Virginia combined location is a prospective accepted representation. The driver's unnamed role is not a person.","domain":"transport","entities":[{"end":10,"start":0,"text":"WASHINGTON","type":"location"},{"end":70,"start":34,"text":"National Transportation Safety Board","type":"organization"},{"end":167,"start":158,"text":"Millstone","type":"location"},{"end":182,"start":169,"text":"West Virginia","type":"location"}],"id":"ordinary-transport-03","labels":["person","organization","location"],"license_or_permission":"NTSB-US-government-staff-text","permission_url":"https://www.ntsb.gov/about/Pages/Website-Policies.aspx","publication_date":"2026-04-23","publisher_attribution":{"credit":"National Transportation Safety Board"},"source_body_sha256":"ef1efca13d975bce40930ca11824942af29cec13cd7341e43c08024fc7412ae8","source_candidate_id":"ntsb-498fe7af8dbf","source_end":326,"source_family_id":"ntsb-millstone-school-bus-investigation","source_revision":null,"source_start":0,"source_url":"https://www.ntsb.gov/news/press-releases/Pages/NR20260423.aspx","tags":[{"text":"Millstone","type":"location"},{"text":"National Transportation Safety Board","type":"organization"},{"text":"WASHINGTON","type":"location"},{"text":"West Virginia","type":"location"}],"text":"WASHINGTON (April 23, 2026) – The National Transportation Safety Board said Thursday that a school bus driver’s alcohol impairment caused a rollover crash in Millstone, West Virginia, that seriously injured three students and underscored the need for alcohol detection systems and passenger lap/shoulder belts on school buses.","text_sha256":"2f66e6b240ef5cb24eb0b8e90f5ab7b38ceba4da19da2bd0425398c320b7dc88","title":"NTSB Calls for Alcohol Detection Systems in School Buses and Renews Call for Student Seat Belts","words":47}
+{"annotation_decision":"Complete airport is one physical location without nested human/city tags. Primary display treats Boeing 737-8 as an aircraft identifier; the finite approved alternative also tags the literal manufacturer Boeing:organization.","domain":"transport","entities":[{"end":38,"start":34,"text":"NTSB","type":"organization"},{"end":112,"start":94,"text":"Southwest Airlines","type":"organization"},{"end":208,"start":159,"text":"Louis Armstrong New Orleans International Airport","type":"location"}],"id":"ordinary-transport-04","labels":["person","organization","location"],"license_or_permission":"NTSB-US-government-staff-text","permission_url":"https://www.ntsb.gov/about/Pages/Website-Policies.aspx","publication_date":"2026-05-13","publisher_attribution":{"credit":"National Transportation Safety Board"},"source_body_sha256":"3922d524e7f8385e635a59b6f98173ec4ca8a16ff7a35824d19a4f1357f6d742","source_candidate_id":"ntsb-73064d66107e","source_end":563,"source_family_id":"ntsb-southwest554-cockpit-smoke-study","source_revision":null,"source_start":231,"source_url":"https://www.ntsb.gov/news/press-releases/Pages/nr20260513.aspx","tags":[{"text":"Louis Armstrong New Orleans International Airport","type":"location"},{"text":"NTSB","type":"organization"},{"text":"Southwest Airlines","type":"organization"}],"text":"The recommendations stem from the NTSB’s investigation of a Dec. 20, 2023, incident involving Southwest Airlines flight 554, a Boeing 737-8, on departure from Louis Armstrong New Orleans International Airport. Shortly after takeoff, a bird was ingested into the airplane’s left engine, followed by smoke rapidly filling the cockpit.","text_sha256":"95d88d9a3ecbe1e996e6ca8a4f666db3f412d7c858f44fa8c4480ec92167108a","title":"NTSB Recommends Realistic Training for Smoke-in-Cockpit Emergencies","words":49}
+{"annotation_decision":"The complete NTSB Office of Research and Engineering is one organizational unit, without a nested NTSB tag. The Civil Aviation Accident Dashboard is a data product.","domain":"transport","entities":[{"end":156,"start":144,"text":"Akbar Sultan","type":"person"},{"end":213,"start":174,"text":"NTSB Office of Research and Engineering","type":"organization"}],"id":"ordinary-transport-05","labels":["person","organization","location"],"license_or_permission":"NTSB-US-government-staff-text","permission_url":"https://www.ntsb.gov/about/Pages/Website-Policies.aspx","publication_date":"2026-05-04","publisher_attribution":{"credit":"National Transportation Safety Board"},"source_body_sha256":"a2e49e5346fc304cedc84e04fbf68ef18f7bc88593e97d39d2063a2a40d80a8f","source_candidate_id":"ntsb-6ce4d4e98f54","source_end":973,"source_family_id":"ntsb-civil-aviation-dashboard-update","source_revision":null,"source_start":609,"source_url":"https://www.ntsb.gov/news/press-releases/Pages/NR20260504.aspx","tags":[{"text":"Akbar Sultan","type":"person"},{"text":"NTSB Office of Research and Engineering","type":"organization"}],"text":"“The integration of findings into the Civil Aviation Accident Dashboard gives users a more complete understanding of why accidents occur,” said Akbar Sultan, director of the NTSB Office of Research and Engineering. “This enhancement supports our mission to improve transportation safety by making critical investigative data more accessible and easier to analyze.”","text_sha256":"5ecaa68c593108193f380fc706c7a54d283be842fccd28274c6b2459b2fb8da3","title":"NTSB Enhances Civil Aviation Accident Dashboard With Findings Data","words":52}
+{"annotation_decision":"Apply the shared ordinary-name policy; no additional per-source exception.","domain":"transport","entities":[{"end":10,"start":0,"text":"WASHINGTON","type":"location"},{"end":68,"start":32,"text":"National Transportation Safety Board","type":"organization"}],"id":"ordinary-transport-06","labels":["person","organization","location"],"license_or_permission":"NTSB-US-government-staff-text","permission_url":"https://www.ntsb.gov/about/Pages/Website-Policies.aspx","publication_date":"2026-05-26","publisher_attribution":{"credit":"National Transportation Safety Board"},"source_body_sha256":"672f2b5939ee030a1dbe02323d2c3d87e63a6c94ae0775037ec6c185a0f6897d","source_candidate_id":"ntsb-9e34725200b5","source_end":229,"source_family_id":"ntsb-wet-runway-rcam-study","source_revision":null,"source_start":0,"source_url":"https://www.ntsb.gov/news/press-releases/Pages/NR20260526.aspx","tags":[{"text":"National Transportation Safety Board","type":"organization"},{"text":"WASHINGTON","type":"location"}],"text":"WASHINGTON (May 26, 2026) — The National Transportation Safety Board on Tuesday called for changes in the way runway conditions are assessed during heavy rainfall, saying the current system increases the risk of a runway overrun.","text_sha256":"5f2345b764b7037b5dfc895153e0c4cd407e88e4c29a3be29a964d7d3af35e92","title":"NTSB Recommends FAA Update Runway Condition Assessment Matrix","words":36}
diff --git a/examples/ordinary-name-tags/inputs/licenses/go-content-license-grant.txt b/examples/ordinary-name-tags/inputs/licenses/go-content-license-grant.txt
new file mode 100644
index 000000000..f4818e0e2
--- /dev/null
+++ b/examples/ordinary-name-tags/inputs/licenses/go-content-license-grant.txt
@@ -0,0 +1,8 @@
+Official Go website content permission
+Source: https://go.dev/copyright
+Captured page SHA256: 5f861a1bb90231397c2ec57a5ef607bf4128d488663ddb6477bc2316b22d8539
+
+Except as noted , the contents of this site are licensed under the Creative Commons Attribution 4.0 License , and code is licensed under a BSD license .
+
+Content license: https://creativecommons.org/licenses/by/4.0/
+This excerpt normalizes HTML presentation. Full selected title/author/source credit and modification notice are in ATTRIBUTION.md.
diff --git a/examples/ordinary-name-tags/inputs/licenses/node-MIT.txt b/examples/ordinary-name-tags/inputs/licenses/node-MIT.txt
new file mode 100644
index 000000000..896a53b84
--- /dev/null
+++ b/examples/ordinary-name-tags/inputs/licenses/node-MIT.txt
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright Node.js Website WG contributors. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
diff --git a/examples/ordinary-name-tags/inputs/licenses/rust-APACHE-2.0.txt b/examples/ordinary-name-tags/inputs/licenses/rust-APACHE-2.0.txt
new file mode 100644
index 000000000..d88f6f26c
--- /dev/null
+++ b/examples/ordinary-name-tags/inputs/licenses/rust-APACHE-2.0.txt
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+Copyright 2018 The Rust Programming Language Team
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff --git a/examples/ordinary-name-tags/inputs/licenses/rust-MIT.txt b/examples/ordinary-name-tags/inputs/licenses/rust-MIT.txt
new file mode 100644
index 000000000..31aa79387
--- /dev/null
+++ b/examples/ordinary-name-tags/inputs/licenses/rust-MIT.txt
@@ -0,0 +1,23 @@
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/examples/ordinary-name-tags/inputs/licenses/rust-content-license-README.md b/examples/ordinary-name-tags/inputs/licenses/rust-content-license-README.md
new file mode 100644
index 000000000..bb5a141a2
--- /dev/null
+++ b/examples/ordinary-name-tags/inputs/licenses/rust-content-license-README.md
@@ -0,0 +1,74 @@
+# The Rust blog
+
+[![CI](https://github.com/rust-lang/blog.rust-lang.org/actions/workflows/main.yml/badge.svg)](https://github.com/rust-lang/blog.rust-lang.org/actions/workflows/main.yml)
+
+This is the blog of the Rust Programming Language.
+
+It uses [Zola](https://www.getzola.org/) and is deployed to GitHub Pages via GitHub Actions.
+
+## Installing Zola
+
+You need at least zola v0.22.0 to render the blog.
+
+Compile from source:
+
+```sh
+cargo install --debug --locked --git https://github.com/getzola/zola --rev 29540e9897dbe8aca388b13f7bdf615985f6ca2c
+```
+
+You can also find a list of package managers that provide zola [here](https://www.getzola.org/documentation/getting-started/installation/).
+Prebuilt binaries are available for download [here](https://github.com/getzola/zola/releases/tag/v0.22.1).
+If you use [mise](https://mise.jdx.dev), you can run the pinned version of zola directly with `mise run zola`.
+
+## Building
+
+To serve the site locally, run the following:
+
+```sh
+zola serve --fast --open
+```
+
+The site will be reloaded automatically when you make any changes.
+
+## Contributing
+
+First of all, thank you!
+
+Like everything in Rust, the blog is licensed MIT/Apache 2.0. See the two
+`LICENSE-*` files for more details. We're also governed by the Rust
+Code of Conduct, see `CODE_OF_CONDUCT.md` for more.
+
+### Writing a new blog post
+
+There is an interactive blog post generator that takes care of some boilerplate for you.
+To use it, run:
+
+```
+cargo blog
+```
+
+### Snapshot testing
+
+If you're making changes to how the site is generated, you may want to check the impact your changes have on the output.
+For this purpose, there is a setup to do snapshot testing over the entire output directory.
+
+To run these tests in CI, add the string `RUN_SNAPSHOT_TESTS` to the PR description.
+You can also run these tests locally for a faster feedback cycle:
+
+- Make sure you have [cargo-insta](https://insta.rs/docs/quickstart/) installed.
+
+- Generate the good snapshots to compare against, usually based off the main branch:
+ ```sh
+ cargo insta test -p snapshot --accept --include-ignored
+ ```
+ Consider making a commit with these snapshots, so you can always check the diff of your changes with git:
+ ```sh
+ git add --force crates/snapshot/src/snapshots # snapshots are ignored by default
+ git commit --message "WIP add good snapshots"
+ ```
+ Since we can't merge the snapshots to main, don't forget to drop this commit when opening a pull request.
+
+- Compare the output of the branch you're working on with the good snapshots:
+ ```sh
+ cargo insta test -p snapshot --review --include-ignored
+ ```
diff --git a/examples/ordinary-name-tags/record.py b/examples/ordinary-name-tags/record.py
new file mode 100644
index 000000000..aa3ea3bdb
--- /dev/null
+++ b/examples/ordinary-name-tags/record.py
@@ -0,0 +1,121 @@
+"""Collect one bounded native extraction attempt per frozen paragraph."""
+
+from __future__ import annotations
+
+import argparse
+import json
+import os
+import time
+from pathlib import Path
+from typing import Any
+
+from score import LABELS, MODELS, ROOT, load_frame, tag_set
+
+
+class OneAttempt:
+ """An HTTP request hook that refuses a second POST before it reaches the wire."""
+
+ def __init__(self) -> None:
+ self.posts = 0
+
+ def __call__(self, request: Any) -> None:
+ if request.method == "POST":
+ if self.posts:
+ raise RuntimeError("A second extraction attempt is disabled for this case")
+ self.posts += 1
+
+
+def public_entities(result: dict[str, Any], text: str) -> list[dict[str, Any]]:
+ if result.get("error"):
+ raise ValueError("The extraction item failed")
+ entities = [
+ {key: entity[key] for key in ("text", "label", "start", "end", "score")} for entity in result["entities"]
+ ]
+ tag_set(text, entities, spans=True)
+ return entities
+
+
+def public_usage(result: dict[str, Any]) -> dict[str, int]:
+ """Retain token counters without exporting request IDs or other metadata."""
+ usage = result.get("request", {}).get("usage", {})
+ return {
+ key: usage[key]
+ for key in ("input_tokens", "output_tokens", "cached_input_tokens")
+ if type(usage.get(key)) is int and usage[key] >= 0
+ }
+
+
+def main() -> None:
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument("--url", required=True, help="Explicit endpoint serving the requested model")
+ parser.add_argument("--model", choices=MODELS, required=True)
+ parser.add_argument("--output", type=Path, required=True)
+ parser.add_argument("--cases", type=Path, default=ROOT / "inputs/cases.jsonl")
+ parser.add_argument("--variants", type=Path, default=ROOT / "inputs/acceptable-tag-representations.json")
+ parser.add_argument("--wall-seconds", type=int, default=1200)
+ args = parser.parse_args()
+ if not 1 <= args.wall_seconds <= 3000:
+ parser.error("--wall-seconds must be between 1 and 3000")
+ cases, _ = load_frame(args.cases, args.variants)
+ if len(cases) != 24:
+ parser.error("This recording recipe is limited to the frozen 24-source frame")
+ if args.output.exists():
+ parser.error("Use a new output path; existing recordings are never overwritten")
+
+ # These dependencies are only needed for explicitly requested inference.
+ import httpx
+ from sie_sdk import SIEClient
+
+ settings = MODELS[args.model]
+ deadline = time.monotonic() + args.wall_seconds
+ stopped = False
+ with args.output.open("x", encoding="utf-8") as output:
+ for case in cases:
+ row: dict[str, Any] = {
+ "id": case["id"],
+ "model": args.model,
+ "text_sha256": case["text_sha256"],
+ "expected_checkpoint_revision": settings["checkpoint_revision"],
+ "status": "unattempted",
+ }
+ remaining = deadline - time.monotonic()
+ if not stopped and remaining > 0:
+ fence = OneAttempt()
+ request = {
+ "model": args.model,
+ "items": [{"text": case["text"]}],
+ "params": {"labels": list(LABELS), "options": {"threshold": settings["threshold"]}},
+ }
+ row["request"] = request
+ transport = httpx.Client(base_url=args.url, follow_redirects=False, event_hooks={"request": [fence]})
+ try:
+ with SIEClient(
+ args.url,
+ api_key=os.environ.get("SIE_API_KEY", ""),
+ http_client=transport,
+ timeout_s=min(remaining, 60),
+ ) as client:
+ result = client.extract(
+ args.model,
+ {"text": case["text"]},
+ labels=list(LABELS),
+ options={"threshold": settings["threshold"]},
+ wait_for_capacity=False,
+ max_oom_retries=0,
+ provision_timeout_s=min(remaining, 60),
+ )
+ if result.get("model") != args.model:
+ raise ValueError("The response does not identify the requested model")
+ row.update(status="ok", entities=public_entities(result, case["text"]), usage=public_usage(result))
+ except Exception as error:
+ transport.close()
+ # Exception text can contain headers or infrastructure addresses.
+ row.update(status="failed", error_type=type(error).__name__)
+ stopped = True
+ row["physical_posts"] = fence.posts
+ output.write(json.dumps(row, ensure_ascii=False) + "\n")
+ output.flush()
+
+
+if __name__ == "__main__":
+ main()
diff --git a/examples/ordinary-name-tags/score.py b/examples/ordinary-name-tags/score.py
new file mode 100644
index 000000000..86619f882
--- /dev/null
+++ b/examples/ordinary-name-tags/score.py
@@ -0,0 +1,195 @@
+"""Score typed, source-literal name tags without contacting an inference service."""
+
+from __future__ import annotations
+
+import argparse
+import hashlib
+import json
+import math
+import random
+from pathlib import Path
+from typing import Any
+
+ROOT = Path(__file__).resolve().parent
+LABELS = ("person", "organization", "location")
+MODELS = {
+ "gliner-community/gliner_large-v2.5": {
+ "threshold": 0.75,
+ "checkpoint_revision": "3d6d1760be1c591069f85f207fced9214df8b15f",
+ },
+ "gliner-community/gliner_medium-v2.5": {
+ "threshold": 0.55,
+ "checkpoint_revision": "88c3b98b57ad5e7d66fb209ed61c53f4b1fd05da",
+ },
+}
+Tag = tuple[str, str]
+
+
+def read_jsonl(path: Path) -> list[dict[str, Any]]:
+ return [json.loads(line) for line in path.read_text(encoding="utf-8").splitlines() if line.strip()]
+
+
+def tag_set(
+ text: str, entities: list[dict[str, Any]], *, spans: bool = False, require_literal: bool = True
+) -> set[Tag]:
+ """Validate gold/native literals; retain invented comparison names as false positives."""
+ tags: set[Tag] = set()
+ for entity in entities:
+ name, kind = entity.get("text"), entity.get("type", entity.get("label"))
+ if not isinstance(name, str) or not name or kind not in LABELS or (require_literal and name not in text):
+ raise ValueError("An entity is not a source-literal name with a requested type")
+ if spans:
+ start, end = entity.get("start"), entity.get("end")
+ if type(start) is not int or type(end) is not int or not 0 <= start < end <= len(text):
+ raise ValueError("An entity has invalid Unicode character offsets")
+ if text[start:end] != name:
+ raise ValueError("An entity does not match its Unicode character offsets")
+ confidence = entity.get("score")
+ if (
+ isinstance(confidence, bool)
+ or not isinstance(confidence, (int, float))
+ or not math.isfinite(confidence)
+ or not 0 <= confidence <= 1
+ ):
+ raise ValueError("An entity has an invalid confidence score")
+ tags.add((name, kind))
+ return tags
+
+
+def load_frame(cases_path: Path, variants_path: Path) -> tuple[list[dict[str, Any]], dict[str, list[set[Tag]]]]:
+ cases = read_jsonl(cases_path)
+ ids = [case["id"] for case in cases]
+ families = [case["source_family_id"] for case in cases]
+ if not cases or len(set(ids)) != len(ids) or len(set(families)) != len(families):
+ raise ValueError("The frame must have one distinct case per independent source family")
+ for case in cases:
+ if tuple(case["labels"]) != LABELS:
+ raise ValueError("The frame must use the same three plain labels for every case")
+ digest = hashlib.sha256(case["text"].encode()).hexdigest()
+ if digest != case["text_sha256"]:
+ raise ValueError(f"Input text digest mismatch for {case['id']}")
+ gold = tag_set(case["text"], case["tags"])
+ if tag_set(case["text"], case["entities"]) != gold:
+ raise ValueError("The span and tag answer keys disagree")
+ for entity in case["entities"]:
+ if case["text"][entity["start"] : entity["end"]] != entity["text"]:
+ raise ValueError("An answer-key span does not match its source")
+ by_id = {case["id"]: case for case in cases}
+ variants: dict[str, list[set[Tag]]] = {}
+ for row in json.loads(variants_path.read_text(encoding="utf-8")):
+ case_id = row["id"]
+ if case_id not in by_id or case_id in variants:
+ raise ValueError("An acceptable representation has an unknown or duplicate case")
+ variants[case_id] = [tag_set(by_id[case_id]["text"], tags) for tags in row["acceptable_tag_sets"]]
+ if not variants[case_id] or tag_set(by_id[case_id]["text"], by_id[case_id]["tags"]) not in variants[case_id]:
+ raise ValueError("Acceptable representations must include the unchanged strict answer key")
+ return cases, variants
+
+
+def counts(predicted: set[Tag], gold: set[Tag]) -> tuple[int, int, int]:
+ return len(predicted & gold), len(predicted - gold), len(gold - predicted)
+
+
+def f1(predicted: set[Tag], gold: set[Tag]) -> float:
+ if not predicted and not gold:
+ return 1.0
+ tp, fp, fn = counts(predicted, gold)
+ return 2 * tp / (2 * tp + fp + fn)
+
+
+def evaluate(
+ cases: list[dict[str, Any]], variants: dict[str, list[set[Tag]]], rows: list[dict[str, Any]]
+) -> dict[str, Any]:
+ """Keep failed and missing planned cases in the denominator with quality zero."""
+ known = {case["id"] for case in cases}
+ by_id: dict[str, dict[str, Any]] = {}
+ models: set[str] = set()
+ for row in rows:
+ if row["id"] not in known or row["id"] in by_id:
+ raise ValueError("Recordings contain an unknown or duplicate case")
+ by_id[row["id"]] = row
+ models.add(row["model"])
+ if len(models) != 1:
+ raise ValueError("Each recording file must contain exactly one model")
+ model = next(iter(models))
+ results = []
+ for case in cases:
+ row = by_id.get(case["id"], {"status": "unattempted"})
+ gold = tag_set(case["text"], case["tags"])
+ status = row["status"]
+ predicted: set[Tag] = set()
+ if status == "ok":
+ if row.get("text_sha256") != case["text_sha256"]:
+ raise ValueError("A successful recording is not bound to the same input")
+ predicted = tag_set(case["text"], row["entities"], spans=model in MODELS, require_literal=model in MODELS)
+ elif status not in {"failed", "unattempted"}:
+ raise ValueError("Recordings must declare ok, failed or unattempted status")
+ accepted = max(variants.get(case["id"], [gold]), key=lambda candidate: f1(predicted, candidate))
+ tp, fp, fn = counts(predicted, accepted)
+ results.append(
+ {
+ "id": case["id"],
+ "domain": case["domain"],
+ "status": status,
+ "accepted_f1": f1(predicted, accepted) if status == "ok" else 0.0,
+ "strict_f1": f1(predicted, gold) if status == "ok" else 0.0,
+ "exact": status == "ok" and predicted == accepted,
+ "entity_bearing": bool(gold),
+ "tp": tp,
+ "fp": fp,
+ "fn": fn,
+ "empty_source_false_tags": len(predicted) if not gold else 0,
+ }
+ )
+ tp, fp, fn = (sum(row[key] for row in results) for key in ("tp", "fp", "fn"))
+ positive = [row for row in results if row["entity_bearing"]]
+ precision = tp / (tp + fp) if tp + fp else 0.0
+ positive_f1 = sum(row["accepted_f1"] for row in positive) / len(positive) if positive else 0.0
+ complete = all(row["status"] == "ok" for row in results)
+ return {
+ "model": model,
+ "planned_source_families": len(cases),
+ "successful_calls": sum(row["status"] == "ok" for row in results),
+ "macro_f1": sum(row["accepted_f1"] for row in results) / len(results),
+ "strict_macro_f1": sum(row["strict_f1"] for row in results) / len(results),
+ "entity_bearing_macro_f1": positive_f1,
+ "pooled_precision": precision,
+ "pooled_recall": tp / (tp + fn) if tp + fn else 0.0,
+ "exact_documents": sum(row["exact"] for row in results),
+ "empty_source_false_tags": sum(row["empty_source_false_tags"] for row in results),
+ "useful_fit_gate": complete and len(positive) >= 12 and precision >= 0.9 and positive_f1 >= 0.8,
+ "cases": results,
+ }
+
+
+def paired_difference(left: dict[str, Any], right: dict[str, Any]) -> dict[str, Any]:
+ """Resample paired independent source families, never individual mentions."""
+ diffs = [a["accepted_f1"] - b["accepted_f1"] for a, b in zip(left["cases"], right["cases"], strict=True)]
+ rng = random.Random(20261006)
+ bootstrap = sorted(sum(rng.choices(diffs, k=len(diffs))) / len(diffs) for _ in range(10_000))
+ return {
+ "left": left["model"],
+ "right": right["model"],
+ "mean_f1_difference": sum(diffs) / len(diffs),
+ "paired_source_bootstrap_95_ci": [bootstrap[249], bootstrap[9749]],
+ "resamples": 10_000,
+ "seed": 20261006,
+ }
+
+
+def main() -> None:
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument("--cases", type=Path, default=ROOT / "inputs/cases.jsonl")
+ parser.add_argument("--variants", type=Path, default=ROOT / "inputs/acceptable-tag-representations.json")
+ parser.add_argument(
+ "--rows", type=Path, action="append", required=True, help="One JSONL file per model; repeat to compare"
+ )
+ args = parser.parse_args()
+ cases, variants = load_frame(args.cases, args.variants)
+ reports = [evaluate(cases, variants, read_jsonl(path)) for path in args.rows]
+ comparisons = [paired_difference(reports[0], report) for report in reports[1:]]
+ print(json.dumps({"models": reports, "comparisons": comparisons}, indent=2, ensure_ascii=False))
+
+
+if __name__ == "__main__":
+ main()
diff --git a/examples/ordinary-name-tags/tests/test_scoring.py b/examples/ordinary-name-tags/tests/test_scoring.py
new file mode 100644
index 000000000..d79a36731
--- /dev/null
+++ b/examples/ordinary-name-tags/tests/test_scoring.py
@@ -0,0 +1,104 @@
+"""Offline checks for the scoring and publication contracts."""
+
+from __future__ import annotations
+
+import hashlib
+import sys
+import unittest
+from pathlib import Path
+from types import SimpleNamespace
+
+sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
+
+from record import OneAttempt, public_usage
+from score import LABELS, MODELS, ROOT, evaluate, load_frame, tag_set
+
+
+class ScoringTests(unittest.TestCase):
+ def test_frozen_frame(self) -> None:
+ cases, variants = load_frame(ROOT / "inputs/cases.jsonl", ROOT / "inputs/acceptable-tag-representations.json")
+ self.assertEqual(len(cases), 24)
+ self.assertEqual(len(variants), 7)
+ self.assertEqual(sum(bool(case["tags"]) for case in cases), 17)
+
+ def test_failed_empty_and_missing_calls_score_zero(self) -> None:
+ cases = [
+ {"id": "empty", "domain": "test", "text": "No names.", "tags": []},
+ {"id": "positive", "domain": "test", "text": "Ada spoke.", "tags": [{"text": "Ada", "type": "person"}]},
+ ]
+ report = evaluate(cases, {}, [{"id": "empty", "model": "comparison", "status": "failed"}])
+ self.assertEqual(report["macro_f1"], 0)
+ self.assertEqual(report["successful_calls"], 0)
+ self.assertEqual(report["cases"][1]["fn"], 1)
+ self.assertFalse(report["useful_fit_gate"])
+
+ def test_fixed_complete_variant_not_individual_tag_union(self) -> None:
+ text = "RESTON, Va."
+ digest = hashlib.sha256(text.encode()).hexdigest()
+ strict = [{"text": "RESTON", "type": "location"}, {"text": "Va.", "type": "location"}]
+ combined = {("RESTON, Va.", "location")}
+ cases = [{"id": "city", "domain": "test", "text": text, "tags": strict, "text_sha256": digest}]
+ rows = [
+ {
+ "id": "city",
+ "model": "comparison",
+ "status": "ok",
+ "text_sha256": digest,
+ "entities": [{"text": text, "type": "location"}],
+ }
+ ]
+ report = evaluate(cases, {"city": [tag_set(text, strict), combined]}, rows)
+ self.assertEqual(report["macro_f1"], 1)
+ self.assertEqual(report["strict_macro_f1"], 0)
+ rows[0]["entities"].extend(strict)
+ mixed = evaluate(cases, {"city": [tag_set(text, strict), combined]}, rows)
+ self.assertLess(mixed["macro_f1"], 1)
+
+ def test_unicode_offsets_and_distinct_tags(self) -> None:
+ entity = {"text": "Ada", "label": "person", "start": 2, "end": 5, "score": 0.9}
+ self.assertEqual(tag_set("🐍 Ada Ada", [entity, entity], spans=True), {("Ada", "person")})
+ with self.assertRaises(ValueError):
+ tag_set("🐍 Ada Ada", [{**entity, "start": 3}], spans=True)
+
+ def test_invented_comparison_name_is_a_false_positive(self) -> None:
+ text = "Ada spoke."
+ cases = [
+ {
+ "id": "name",
+ "domain": "test",
+ "text": text,
+ "tags": [{"text": "Ada", "type": "person"}],
+ "text_sha256": hashlib.sha256(text.encode()).hexdigest(),
+ }
+ ]
+ rows = [
+ {
+ "id": "name",
+ "model": "comparison",
+ "status": "ok",
+ "text_sha256": cases[0]["text_sha256"],
+ "entities": [{"text": "Ada Lovelace", "type": "person"}],
+ }
+ ]
+ report = evaluate(cases, {}, rows)
+ self.assertEqual(report["cases"][0]["fp"], 1)
+ self.assertEqual(report["cases"][0]["fn"], 1)
+ self.assertEqual(report["macro_f1"], 0)
+
+ def test_retry_fence_and_usage_allowlist(self) -> None:
+ fence = OneAttempt()
+ request = SimpleNamespace(method="POST")
+ fence(request)
+ with self.assertRaises(RuntimeError):
+ fence(request)
+ self.assertEqual(fence.posts, 1)
+ self.assertEqual(
+ public_usage({"request": {"id": "private", "usage": {"input_tokens": 9, "secret": "private"}}}),
+ {"input_tokens": 9},
+ )
+ self.assertEqual(LABELS, ("person", "organization", "location"))
+ self.assertEqual(len(MODELS), 2)
+
+
+if __name__ == "__main__":
+ unittest.main()