Skip to content

fix(verifif): support Unicode keyword phrases in Italian and German - #5014

Merged
qiaochuz-nv merged 2 commits into
NVIDIA-NeMo:mainfrom
mikemikimike:fix/verifif-unicode-keywords-4511
Oct 27, 2026
Merged

qiaochuz-nv merged 2 commits into
NVIDIA-NeMo:mainfrom
mikemikimike:fix/verifif-unicode-keywords-4511

Conversation

@mikemikimike

Copy link
Copy Markdown
Contributor

Fixes #4511

Issue: #4511

Summary

  • Match Italian multiword keyword frequency and forbidden-word phrases as complete Unicode-aware phrases.
  • Accept accented Unicode letters in German keyword validation while preserving the existing internal apostrophe and hyphen rules.
  • Add dispatcher regression coverage for phrase matching, elision, accented German phrases, hyphenated keywords, and invalid leading hyphens.

Tests

  • python -m pytest resources_servers/verifif/tests/test_validator_keywords.py -q
  • python -m pre_commit run --all-files
  • gym dev test (Windows collection is blocked by existing POSIX-only resource and fcntl imports.)

@copy-pr-bot

copy-pr-bot Bot commented Oct 23, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@nemo-automation-bot nemo-automation-bot Bot added the community-request Issue reported or requested by someone from the community label Oct 23, 2026
@svcnvidia-nemo-ci svcnvidia-nemo-ci added area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers bug Something isn't working needs-review PR is ready for code review and waiting on a reviewer labels Oct 23, 2026
@cmunley1

Copy link
Copy Markdown
Contributor

/review

@svcnvidia-nemo-ci svcnvidia-nemo-ci added the waiting-on-maintainers Waiting on maintainers to respond label Oct 26, 2026
@qiaochuz-nv
qiaochuz-nv requested a review from yaoyu-33 October 26, 2026 20:34
@qiaochuz-nv

Copy link
Copy Markdown
Contributor

Thanks for picking this up! It fixes NVBug 6790399 / #4511, and it reproduces on our side. I checked it with direct validate_instruction calls (no model or HTTP) on the three shipped-example inputs from the bug, plus controls.

Before: main @ 882073970

BAD IT freq phrase       expected=True  got=(False, "Expected at least 1 of 'testo segnaposto di contatto', found 0.")
OK  IT freq ctrl         expected=True  got=(True, 'No error')            # single-word keyword "contatto"
BAD IT forbid phrase     expected=False got=(True, 'No error')            # forbidden "limitato a"
BAD DE forbid accented   expected=True  got=(False, "Validation error: Invalid token 'beschränkt'. Keywords may only contain letters or numbers; apostrophes or hyphens are permitted only inside a word.")
OK  DE ascii ctrl        expected=True  got=(True, 'No error')
mismatches: 3

After: this PR @ 9df0d88a6

OK  IT freq phrase       expected=True  got=(True, 'No error')
OK  IT freq ctrl         expected=True  got=(True, 'No error')
OK  IT forbid phrase     expected=False got=(False, "Forbidden words found: ['limitato a']")
OK  DE forbid accented   expected=True  got=(True, 'No error')
OK  DE forbid accented hit expected=False got=(False, "Forbidden words found: ['beschränkt auf']")
OK  DE ascii ctrl        expected=True  got=(True, 'No error')
mismatches: 0
  • Rebased onto current main (882073970), it applies cleanly and pytest resources_servers/verifif/tests → 49 passed.
  • The new test_validator_keywords.py run against main's validators gives 4 failed / 3 passed, so the tests do catch the bug.
  • Not covered here: our QA e2e verifif case. We'll rerun it on main after merge.

@yaoyu-33 for review.

@cmunley1

Copy link
Copy Markdown
Contributor

/ok to test 9df0d88

@svcnvidia-nemo-ci svcnvidia-nemo-ci removed the waiting-on-maintainers Waiting on maintainers to respond label Oct 27, 2026
@qiaochuz-nv
qiaochuz-nv enabled auto-merge October 27, 2026 16:53
@mikemikimike

Copy link
Copy Markdown
Contributor Author

The earlier non-blocking Harness conformance failure on commit 9df0d88 appears unrelated to this PR. The Kilocode probe reported 2 of 7 scenarios unavailable, with the first failure involving retention of a terminal model error. A separate run on main also reported 2 of 7 Kilocode scenarios unavailable, with a similar model-error retention failure. This PR changes VerifIF keyword validation and its tests, not the harness. The underlying cause of the probe failure has not been established. The PR head has since changed, and its current check summary shows no failures.

@qiaochuz-nv

Copy link
Copy Markdown
Contributor

/ok to test 42ac719

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/40565014473

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/40567106257

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/40571850344

Merged via the queue into NVIDIA-NeMo:main with commit e77c3e0 Oct 27, 2026
53 of 56 checks passed

This branch was previously deployed

1 inactive deployment
public — 42ac719e Deployed Oct 27, 2026 by copy-pr-bot[bot] via release / finalize / notify #7660
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers bug Something isn't working community-request Issue reported or requested by someone from the community needs-review PR is ready for code review and waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[NVBug 6790399] Fix VerifIF Italian multiword and German accented keyword matching

4 participants