Skip to content

Fix Italian electronic tests for raw and post-processed punctuation - #533

Open
janbernloehr wants to merge 1 commit into
NVIDIA:mainfrom
janbernloehr:fix/italian-electronic-punctuation
Open

janbernloehr wants to merge 1 commit into
NVIDIA:mainfrom
janbernloehr:fix/italian-electronic-punctuation

Conversation

@janbernloehr

Copy link
Copy Markdown

What does this PR do ?

Fix the punctuation mode used by Italian electronic normalization tests and cover optional punctuation cleanup separately.

The electronic fixture is shared with Sparrowhawk and expects raw grammar output, including a space before a final period (punto com .). The Python test enabled punct_post_process, which correctly removes that space (punto com.), causing four failures. Run the shared fixture without punctuation cleanup and add eight explicit cleanup cases covering those four sentences, a URL path, an email address, a social handle, and a URL without sentence punctuation. Existing fixture expectations and production grammars are unchanged.

Before your PR is "Ready for review"

Pre checks:

  • Have you signed your commits? Use git commit -s to sign.
  • Do all unittests finish successfully before sending PR?
    1. pytest or (if your machine does not have GPU) pytest --cpu from the root folder (given you marked your test cases accordingly @pytest.mark.run_only_on('CPU')).
    2. Sparrowhawk tests bash tools/text_processing_deployment/export_grammars.sh --MODE=test ...
  • If you are adding a new feature: Have you added test cases for both pytest and Sparrowhawk here. (Not applicable: test correction.)
  • Have you added __init__.py for every folder and subfolder, including data folder which has .TSV files? (Not applicable: no new folders.)
  • Have you followed codeQL results and removed unused variables and imports (report is at the bottom of the PR in github review box) ? (No PR checks available yet.)
  • Have you added the correct license header Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. to all newly added Python files? (Not applicable: no new Python files.)
  • If you copied nemo_text_processing/text_normalization/en/graph_utils.py your header's second line should be Copyright 2015 and onwards Google, Inc.. See an example here. (Not applicable.)
  • Remove import guards (try import: ... except: ...) if not already done. (Not applicable: no import changes.)
  • If you added a new language or a new feature please update the NeMo documentation (lives in different repo). (Not applicable.)
  • Have you added your language support to tools/text_processing_deployment/pynini_export.py. (Not applicable: Italian TN is already supported.)

Validation:

  • Reproduced all four failures on upstream ddadfb2a38d2bc6b8cc6232c4f915eb60f500688 with Python 3.13.12 / Pynini 2.1.6.post1 and Python 3.14.3 / Pynini 2.1.7: 48 passed, 4 failed on each.
  • After the change, all 60 Italian CPU tests pass on both combinations, using fresh grammar caches.
  • Full CPU suite on Python 3.13.12 / Pynini 2.1.6.post1: 13,545 passed across all 22 test groups, with no failures, errors, or skips. Optional audio-based expansion was disabled; Kinyarwanda ran uncached.
  • Fresh Italian FAR exports pass on both versions. All seven Italian Sparrowhawk shell test functions pass with Pynini 2.1.6.post1 exports; six of seven pass with 2.1.7 exports. The latter reports one unrelated 12:30 mismatch: the shell compares only dodici e trenta minuti, while Sparrowhawk returns the fixture's other valid option, dodici e mezza. A supplemental batch check of all 52 Italian deployment fixtures accepts only their explicitly listed alternatives and passes on both versions, including all 13 electronic cases. The unmodified shell suite's failure keeps the all-tests checkbox unchecked.

PR Type:

  • New Feature
  • Bugfix
  • Documentation
  • Test

If you haven't finished some of the above items you can still open "Draft" PR.

Signed-off-by: Jan Bernloehr <jbernloehr@nvidia.com>
@janbernloehr janbernloehr mentioned this pull request Nov 19, 2026
10 of 14 tasks
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