Skip to content

Fix source offsets in extracted fragment strings - #1449

Draft
yunyv wants to merge 2 commits into
huggingface:mainfrom
yunyv:fix/fragments-source-offset
Draft

yunyv wants to merge 2 commits into
huggingface:mainfrom
yunyv:fix/fragments-source-offset

Conversation

@yunyv

@yunyv yunyv commented Oct 24, 2026 •

Copy link
Copy Markdown

Summary

Fix Fragments.strings(summary_base=False) to slice source text at the match's source offset rather than its summary offset. For summary cat sat and source The Cat sat on the mat, the source fragment is now Cat sat, not The Cat.

Summary-based output, overlap matching, strict minimum-length filtering, and aggregate coverage/density/compression scores are unchanged. Adds regression coverage for differing offsets, original casing, multiple spans, thresholds, empty/no-overlap inputs, and unchanged metrics.

Validation

  • Identical six package-level regressions: original revision 3 failed / 3 passed; patched revision 6 passed.
  • Six regressions plus existing extractiveness integration: 7 passed.
  • make quality: passed (repository-wide Ruff lint and formatting).
  • pip check and git diff --check: passed.

Broader metric suite: 291 passed, with two NLTK-data-dependent BLEU tests explicitly excluded. BLEU1/4 require punkt_tab, whose download is blocked by this environment's proxy/SSRF safeguards; those safeguards were not disabled. Full GPU/provider CI was not run.

yunyv added 2 commits October 23, 2026 23:28
… in fragment strings

Refactor string generation to improve readability and maintainability.
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.

1 participant