Batch hallucination-rate evaluation and reporting over a dataset - #93
Open
zhenzhudingzhen528-cpu wants to merge 1 commit into
Open
Conversation
adaamko
requested changes
Sep 7, 2026
adaamko
left a comment
Collaborator
There was a problem hiding this comment.
Thanks — this is a careful implementation and it hits the #56 spec. I ran the acceptance command end-to-end against lettucedect-v2-mmbert-base + the taxonomy head on a 10-row file: every count reconciles (overall, per-group denominators, typed category/subcategory counts, confidence bins), the tests are network-free, and the full suite is green on top of current main (201 passed).
One blocker before merge:
- Progress indicator is never visible (
scripts/report_hallucination_rates.py,score_recordslogging at INFO around line 275, andmain()):main()never configures logging, so at the default WARNING level a real run prints nothing while scoring — issue step 3 asks for a progress indicator. Simplest fix:tqdmaround the record loop (already a dependency; seescripts/evaluate_span_model.py), orlogging.basicConfig(level=logging.INFO)inmain(). Adjust thecaplogassertion accordingly.
Non-blocking nits, take or leave:
- CSV errors on a missing
--group-bycolumn while JSONL silently buckets every row under<missing>— I'd make those consistent. _atomic_writeand the NaN/bool/>1 confidence sanitisation guard against values the detectors cannot produce; the script could be a fair bit shorter without them.- The generator-
.throwlambda intest_main_surfaces_detector_configuration_value_erroris hard to read; a smalldefthat raises would do. - Please tick the "no secrets" checkbox in the description (I checked the diff; there are none).
With the progress fix in, this merges and closes #56.
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changed paths:
scripts/report_hallucination_rates.pytests/test_report_hallucination_rates_pytest.pyRelated issue
Closes #56.
Type of change
Testing
python -m pytest tests/test_report_hallucination_rates_pytest.py -q— 23 passedruff format --checkruff checkgit diff --checkChecklist
Rights & sign-off (required)