Repository navigation
fix(eval): compute novel F1 token overlap - #856
Merged
Merged
Conversation
External contribution policy✅ This PR now complies with the external contribution policy. |
Contributor
Author
|
Hi @dosco, when convenient, could you please review the novel F1 overlap and empty-input fix? The 53 focused tests pass, and the required PR-linked AxIR backlog entry is included. Thank you. |
Merged
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.
What kind of change does this PR introduce?
Bug fix for the exported novel F1 evaluation metric.
What is the current behavior?
AxEvalUtil.novelF1ScoreOptimizedleaves token overlap hardcoded to zero. Ordinary partial/identical/disjoint inputs produceNaNF1; recall is zero orNaNwhen the filtered truth is empty. For example,albatross narwhalversusalbatross cobaltgivesNaN/0 instead of F1/recall 0.5.Fixes Implement the exported novel F1 evaluation metric #805.
What is the new behavior (if this is a feature change)?
Count multiset overlap after the existing stopword/history filtering and return finite F1 or recall. Repeated tokens contribute at most the minimum occurrence count. Two empty filtered inputs score 1 and a single empty input scores 0, matching the sibling F1 helper's empty-input convention. Empty normalized tokens are excluded, and local maps also handle tokens such as
constructorsafely.Shared normalization, token counting, exact match and ordinary F1 helpers are unchanged.
AxIR portable behavior check:
This changes portable
axgenbehavior in exactlysrc/ax/dsp/eval.tsandsrc/ax/dsp/eval.test.ts. New open backlog entryaxir-2026-10-18-novel-f1-token-overlap-and-finite-empty-input-scoresis bound to this PR (fix(eval): compute novel F1 token overlap #856) and lists those exact two paths. Only the requiredir/axir-backlog.jsonand rendereddocs/AXIR_BACKLOG.mdexception accompany the handwritten TypeScript. Existing entries/exemptions are unchanged; no AxIR or generated-language changes are included.npm run axir:backlog:validatepassed. Hosted checks remain to be verified.Other information:
Regression uses the original public
AxEvalUtilexport. Before the fix: 16 failed, 1 passed. Final local validation (Node 26.10.0):npm run test:unit --workspace=@ax-llm/ax -- dsp/eval.test.ts dsp/util.test.ts dsp/generate.metrics.test.ts --maxWorkers=2: 53 passed, 0 skipped.npm run test:type-check --workspace=@ax-llm/ax: passed.npm exec -- biome check src/ax/dsp/eval.ts src/ax/dsp/eval.test.ts: passed; actual pre-commit hook passed too.Paid-provider and generated-language suites were not run; this metric is synchronous and needs no model or API key.
AI assistance was used for investigation, implementation and validation. The original-package reproduction, regression results and cumulative diff were checked before submission.