Repository navigation
Preserve zero-mean confidence intervals in score output - #309
Open
j45856021-dev wants to merge 1 commit into
Open
j45856021-dev wants to merge 1 commit into
j45856021-dev wants to merge 1 commit into
Conversation
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
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.
Fixes #308.
Score.formatuses_mean > 0to 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 of0.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:
python -m pytest -o addopts= test/test_metrics_base.py -q).mypy sacrebleu scripts test: passes all 44 files. Ruff lint passes on both changed files.The full dataset-download/CLI shell suite and other platforms were not run locally.
ruff format --checkreports 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.