Skip to content

Created cardinal Semiotic class for Kannada TN - #448

Open
richa-2002 wants to merge 37 commits into
NVIDIA:staging/kannada_tn_v1from
richa-2002:feat-kn-cardinal
Open

Created cardinal Semiotic class for Kannada TN#448
richa-2002 wants to merge 37 commits into
NVIDIA:staging/kannada_tn_v1from
richa-2002:feat-kn-cardinal

Conversation

@richa-2002

@richa-2002 richa-2002 commented Jul 7, 2026

Copy link
Copy Markdown

What does this PR do ?

Add a one line overview of what this PR aims to accomplish.

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.
  • Have you added __init__.py for every folder and subfolder, including data folder which has .TSV files?
  • Have you followed codeQL results and removed unused variables and imports (report is at the bottom of the PR in github review box) ?
  • Have you added the correct license header Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. to all newly added 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.
  • Remove import guards (try import: ... except: ...) if not already done.
  • If you added a new language or a new feature please update the NeMo documentation (lives in different repo).
  • Have you added your language support to tools/text_processing_deployment/pynini_export.py.

PR Type:

  • New Feature
  • Bugfix
  • Documentation
  • Test

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

richa-2002 and others added 15 commits June 16, 2026 09:29
Signed-off-by: richa-2002 <richa@nvidia.com>
Signed-off-by: richa-2002 <richa@nvidia.com>
Signed-off-by: richa-2002 <richa@nvidia.com>
Signed-off-by: richa-2002 <richa@nvidia.com>
Signed-off-by: richa-2002 <richa@nvidia.com>
Signed-off-by: richa-2002 <richa@nvidia.com>
Signed-off-by: richa-2002 <richa@nvidia.com>
Signed-off-by: richa-2002 <richa@nvidia.com>
Signed-off-by: richa-2002 <richa@nvidia.com>
Signed-off-by: richa-2002 <richa@nvidia.com>
Signed-off-by: richa-2002 <richa@nvidia.com>
Signed-off-by: richa-2002 <richa@nvidia.com>
Signed-off-by: richa-2002 <richa@nvidia.com>
Signed-off-by: richa-2002 <richa@nvidia.com>
@richa-2002
richa-2002 marked this pull request as ready for review July 7, 2026 10:49
richa-2002 and others added 7 commits July 13, 2026 13:18
Signed-off-by: richa-2002 <richa@nvidia.com>
…iles

Signed-off-by: richa-2002 <richa@nvidia.com>
Signed-off-by: richa-2002 <richa@nvidia.com>
Signed-off-by: richa-2002 <richa@nvidia.com>
Signed-off-by: richa-2002 <richa@nvidia.com>
Signed-off-by: richa-2002 <richa@nvidia.com>
pre-commit-ci Bot and others added 5 commits July 23, 2026 12:24
1
Signed-off-by: richa-2002 <richa@nvidia.com>
3
Signed-off-by: richa-2002 <richa@nvidia.com>
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown

This PR is stale because it has been open for 14 days with no activity. Remove stale label or comment or update or this will be closed in 7 days.

@github-actions github-actions Bot added the Stale label Aug 8, 2026
richa-2002 and others added 2 commits August 10, 2026 13:01
Signed-off-by: richa-2002 <richa@nvidia.com>
@github-actions github-actions Bot removed the Stale label Aug 11, 2026
Comment thread nemo_text_processing/text_normalization/kn/taggers/cardinal.py Outdated
Comment thread nemo_text_processing/text_normalization/kn/taggers/cardinal.py Outdated
Comment thread nemo_text_processing/text_normalization/kn/taggers/cardinal.py Outdated
Comment thread nemo_text_processing/text_normalization/kn/graph_utils.py Outdated
Comment thread nemo_text_processing/text_normalization/normalize.py Outdated
Comment thread nemo_text_processing/text_normalization/run_evaluate.py Outdated
Comment thread tests/nemo_text_processing/kn/test_cardinal.py Outdated
richa-2002 and others added 3 commits August 18, 2026 13:19
Signed-off-by: richa-2002 <richa@nvidia.com>
Signed-off-by: richa-2002 <richa@nvidia.com>
richa-2002 and others added 3 commits August 19, 2026 12:16
Signed-off-by: richa-2002 <richa@nvidia.com>
Signed-off-by: richa-2002 <richa@nvidia.com>
@richa-2002

Copy link
Copy Markdown
Author

Hi @folivoramanh , I have addressed all the changes you suggested.

@folivoramanh
folivoramanh requested a review from mgrafu August 28, 2026 03:44

def __init__(self, deterministic: bool = True):
super().__init__(name="punctuation", kind="classify", deterministic=deterministic)
s = "!#%&\'()*+,-./:;<=>?@^_`{|}~\""

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

does the language need any additional punctuation?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I don’t think any additional punctuation is needed for Kannada, as it follows the same standard punctuation conventions as Hindi.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

and do these symbols cover all Hindi/Kannada punctuation?

Comment thread nemo_text_processing/text_normalization/kn/verbalizers/cardinal.py Outdated
class VerbalizeFinalFst(GraphFst):
"""
Finite state transducer that verbalizes an entire sentence, e.g.
tokens { name: "its" } tokens { time { hours: "twelve" minutes: "thirty" } } tokens { name: "now" } tokens { name: "." } -> its twelve thirty now .

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

let's have all definitions be in the language

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes. I've referred to the Spanish implementation and removed the English example . I didn't replace it with a direct Kannada translation because the resulting sentence would not have natural Kannada wording.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ok, let's instead use a natural Kannada sentence and make sure that the full structure matches what the verbalizer_final output outputs

@@ -0,0 +1,57 @@
4 ಚೌಕೆ~ನಾಲ್ಕು ಚೌಕೆ

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

are all rule categories covered here? at the very least I see negatives missing

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes, I’ve added negative test cases and reviewed the test cases to ensure that the different rule categories are covered.

Comment thread tests/nemo_text_processing/kn/test_sparrowhawk_normalization.sh Outdated
Comment thread Jenkinsfile Outdated
@richa-2002

Copy link
Copy Markdown
Author

Thank you for the review, @mgrafu. I have addressed all the changes you suggested.

Additionally, I removed the unnecessary weights from cardinal.py file from tagger module.

Testing
Cardinal pytest test cases passed.
Sparrowhawk testTNCardinal passed.

@richa-2002
richa-2002 requested a review from mgrafu September 2, 2026 10:06
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.

3 participants