Human Coder to Reference Comparison
scripts/human_reliability/compare_references.py compares each validated human coder separately with accepted or reviewable project reference fields. This is not human-human agreement and is never folded into the metrics produced by compute_agreement.py.
Run:
python3 scripts/human_reliability/compare_references.py \
--case <case_id> \
--cohort <cohort_id> \
--cohort-version <version>Outputs are written beside the cohort agreement artifacts:
cases/<case_id>/quality/human-reliability/comparisons/
<cohort_id>-<cohort_version>/
reference-comparison.json
reference-patterns.csv
The command requires complete #81 ingestion, verifies immutable raw registrations and the approved cohort/packet, hashes every reference source, and preserves packet item IDs separately from sentence, lexical-unit, or annotation reference IDs.
Neutral patterns
For each coder pair, item, lexical unit when applicable, and field, the command emits one stable pattern:
| Pattern | Meaning |
|---|---|
both_with_reference |
Both coders share the reference value. |
both_against_reference |
Both coders agree with each other but differ from the reference. |
split_with_reference |
Coders differ and exactly one shares the reference value. |
split_against_both |
Coders differ and neither shares the reference value. |
uncertain_vs_confident |
One coder selects an uncertain identification value or material/unresolved uncertainty while the other records a non-uncertain or none/low value. |
reference_unavailable |
No accepted or reviewable field exists for the comparison. |
These are alignment descriptions, not correctness decisions. Shared coder divergence may expose a stale or underspecified reference; reference alignment may identify a coder disagreement without resolving it. Every substantive split or both-against-reference pattern is marked for later adjudication.
Post-adjudication comparison
The library accepts an optional adjudicated result carrying an adjudication_id, matching cohort identity, and response array. Its comparison appears in a separate adjudicated_comparisons section. It never replaces the original coder comparisons or pre-adjudication agreement. Issues #86 and #87 will define and ingest the authoritative adjudication contract.