Skip to content

Add hi-IN , Ko-KR and pt-BR IPA tokenizer support#15567

Merged
XuesongYang merged 23 commits intoNVIDIA-NeMo:mainfrom
quapham:hi_pt_BR_ipa
Apr 24, 2026
Merged

Add hi-IN , Ko-KR and pt-BR IPA tokenizer support#15567
XuesongYang merged 23 commits intoNVIDIA-NeMo:mainfrom
quapham:hi_pt_BR_ipa

Conversation

@quapham
Copy link
Copy Markdown
Contributor

@quapham quapham commented Mar 31, 2026

Important

The Update branch button must only be pressed in very rare occassions.
An outdated branch is never blocking the merge of a PR.
Please reach out to the automation team before pressing that button.

What does this PR do ?

Extends the IPAG2p tokenizer to support Hindi (hi-IN) with English code-switching , Korean (ko-KR) and Brazilian Portuguese (pt-BR) locale.

Collection: [Note which collection this PR will affect]
tts, common

Changelog

  • Add hi-IN, ko-KR and pt-BR to SUPPORTED_LOCALES in ipa_lexicon.py
  • Add INDIC_CHARS_ALL support to tokenizer_utils.py and IpaG2p (enables Indic script dict parsing)
  • Extend IpaG2p._parse_phoneme_dict() to accept a list of dicts enabling multi-dict code-switching (e.g. Hindi + English)
  • Add pronunciation dict files: hi_prondict-v0.1.dict (hi_IN) and pt_br_prondict-v1.0.dict (pt_BR), ko_prondict-v1.0.dict
  • Add unit tests: test_ipa_tokenizer_hi_in (hi-IN/en code-switching), test_ipa_ko_kr and test_ipa_tokenizer_pt_br

Usage

  • You can potentially add a usage example below
# Add a code snippet demonstrating how to use this 

GitHub Actions CI

The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.

The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".

Before your PR is "Ready for review"

Pre checks:

  • [x ] Make sure you read and followed Contributor guidelines
  • [x ] Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

PR Type:

  • New Feature
  • Bugfix
  • Documentation

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

Who can review?

Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.

Additional Information

  • Related to # (issue)

@quapham quapham changed the title Add hi-IN and pt-BR IPA tokenizer support Add hi-IN , Ko-KR and pt-BR IPA tokenizer support Apr 16, 2026
@blisc blisc added the Run CICD label Apr 16, 2026
@blisc
Copy link
Copy Markdown
Collaborator

blisc commented Apr 16, 2026

Can you fix the linting and sign off issues?

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Extends the NeMo TTS IPA G2P/tokenizer stack to better handle additional scripts/locales (Hindi with English code-switching, Korean, and Brazilian Portuguese) by expanding tokenization character coverage, dictionary parsing, and adding unit tests to validate expected IPA outputs.

Changes:

  • Added unit tests for IPA tokenization in pt-BR, hi-IN (Hindi/English code-switching), and ko-KR.
  • Expanded “any-locale” tokenization character coverage to include Indic and Korean Unicode ranges.
  • Updated IpaG2p dictionary parsing and regex handling to accept Indic/Korean words and merge multiple dictionaries.

Reviewed changes

Copilot reviewed 4 out of 7 changed files in this pull request and generated 3 comments.

File Description
tests/collections/common/tokenizers/text_to_speech/test_tts_tokenizers.py Adds unit tests and small in-test pronunciation dictionaries for pt-BR, hi-IN code-switching, and ko-KR.
nemo/collections/tts/g2p/models/i18n_ipa.py Extends IpaG2p regex + dictionary parsing to support Indic/Korean and multi-dict merging for code-switching.
nemo/collections/common/tokenizers/text_to_speech/tokenizer_utils.py Adds Indic and Korean Unicode ranges and expands any-locale word tokenization regex accordingly.
nemo/collections/common/tokenizers/text_to_speech/ipa_lexicon.py Adds pt-BR and ko-KR to supported locales and extends punctuation sets for hi-IN and ko-KR.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread nemo/collections/tts/g2p/models/i18n_ipa.py
Comment thread nemo/collections/common/tokenizers/text_to_speech/ipa_lexicon.py Outdated
Comment thread nemo/collections/tts/g2p/models/i18n_ipa.py
Comment thread nemo/collections/tts/g2p/models/i18n_ipa.py Outdated
Comment thread nemo/collections/tts/g2p/models/i18n_ipa.py Outdated
Comment thread nemo/collections/tts/g2p/models/i18n_ipa.py Outdated
Comment thread nemo/collections/tts/g2p/models/i18n_ipa.py Outdated
Comment thread nemo/collections/common/tokenizers/text_to_speech/ipa_lexicon.py Outdated
Comment thread nemo/collections/common/tokenizers/text_to_speech/ipa_lexicon.py
Comment thread nemo/collections/tts/g2p/models/i18n_ipa.py Outdated
Comment thread nemo/collections/common/tokenizers/text_to_speech/ipa_lexicon.py
XuesongYang and others added 10 commits April 22, 2026 19:35
…kenizers.py

Signed-off-by: Xuesong Yang <1646669+XuesongYang@users.noreply.github.com>
Signed-off-by: Xuesong Yang <1646669+XuesongYang@users.noreply.github.com>
Signed-off-by: Xuesong Yang <1646669+XuesongYang@users.noreply.github.com>
Signed-off-by: Xuesong Yang <1646669+XuesongYang@users.noreply.github.com>
Signed-off-by: Xuesong Yang <1646669+XuesongYang@users.noreply.github.com>
Signed-off-by: Xuesong Yang <1646669+XuesongYang@users.noreply.github.com>
Signed-off-by: quanpham <youngkwan199@gmail.com>
Signed-off-by: quapham <quapham@users.noreply.github.com>
Signed-off-by: Xuesong Yang <1646669+XuesongYang@users.noreply.github.com>
Signed-off-by: Xuesong Yang <1646669+XuesongYang@users.noreply.github.com>
Signed-off-by: Xuesong Yang <1646669+XuesongYang@users.noreply.github.com>
Signed-off-by: Xuesong Yang <1646669+XuesongYang@users.noreply.github.com>
@XuesongYang XuesongYang dismissed their stale review April 23, 2026 22:26

all are addressed

@XuesongYang XuesongYang enabled auto-merge (squash) April 24, 2026 05:29
@XuesongYang
Copy link
Copy Markdown
Collaborator

@blisc all good now. pls have a look.

@XuesongYang XuesongYang merged commit 52ba833 into NVIDIA-NeMo:main Apr 24, 2026
176 of 180 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants