Skip to content

Preserve zero-mean confidence intervals in score output - #309

Open
j45856021-dev wants to merge 1 commit into
mjpost:masterfrom
j45856021-dev:fix/zero-mean-confidence-output
Open

j45856021-dev wants to merge 1 commit into
mjpost:masterfrom
j45856021-dev:fix/zero-mean-confidence-output

Conversation

@j45856021-dev

Copy link
Copy Markdown

Fixes #308.

Score.format uses _mean > 0 to decide whether a confidence interval was estimated. Zero is valid too: for example, perfect TER with bootstrap resampling already stores a mean and half-width of 0.0, but loses the confidence text and JSON fields.

Accept zero while retaining the negative unset sentinel. This changes no score or interval calculation. Three focused shared-formatter cases cover zero, positive and uncomputed intervals, including text, score-only and JSON output; the method docstring records the zero-mean behavior. JSON tests supply a signature, so this does not duplicate #306.

Validation

On macOS with Python 3.13.16:

  • Owning native suite: 1 failed, 49 passed before; 50 passed after (python -m pytest -o addopts= test/test_metrics_base.py -q).
  • Normal BLEU, chrF and TER bootstrap reproductions, plus TER CLI JSON/text/score-only checks. Positive-mean and uncomputed API controls are unchanged.
  • mypy sacrebleu scripts test: passes all 44 files. Ruff lint passes on both changed files.
  • Wheel and sdist builds pass; their source bytes match the tested files, and the built wheel's real TER bootstrap path includes the zero interval.

The full dataset-download/CLI shell suite and other platforms were not run locally. ruff format --check reports the same pre-existing missing blank line after the module docstring before and after this change; the new tests are formatted.

Developed and verified by an automated AI assistant; no independent human review has occurred.

Treat zero as an estimated mean while keeping the negative unset sentinel.
Cover zero, positive, and uncomputed intervals in the shared formatter.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Score.format omits computed confidence intervals when the mean is zero

1 participant