Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions nemo_text_processing/text_normalization/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ def __init__(

if post_process:
self.post_processor = PostProcessingFst(cache_dir=cache_dir, overwrite_cache=overwrite_cache)

elif lang == 'it':
from nemo_text_processing.text_normalization.it.taggers.tokenize_and_classify import ClassifyFst
from nemo_text_processing.text_normalization.it.verbalizers.verbalize_final import VerbalizeFinalFst
Expand All @@ -191,6 +192,13 @@ def __init__(
elif lang == 'ko':
from nemo_text_processing.text_normalization.ko.taggers.tokenize_and_classify import ClassifyFst
from nemo_text_processing.text_normalization.ko.verbalizers.verbalize_final import VerbalizeFinalFst
elif lang == 'te':
from nemo_text_processing.text_normalization.te.taggers.tokenize_and_classify import ClassifyFst
from nemo_text_processing.text_normalization.te.verbalizers.post_processing import PostProcessingFst
from nemo_text_processing.text_normalization.te.verbalizers.verbalize_final import VerbalizeFinalFst

if post_process:
self.post_processor = PostProcessingFst(cache_dir=cache_dir, overwrite_cache=overwrite_cache)
else:
raise NotImplementedError(f"Language {lang} has not been supported yet.")

Expand Down Expand Up @@ -391,7 +399,11 @@ def normalize(
return text
output = SPACE_DUP.sub(' ', output[1:])

if self.lang in ["en", "hi", "vi"] and hasattr(self, 'post_processor') and self.post_processor is not None:
if (
self.lang in ["en", "hi", "te", "vi"]
and hasattr(self, 'post_processor')
and self.post_processor is not None
):
output = self.post_process(output)

if punct_post_process:
Expand Down Expand Up @@ -737,7 +749,7 @@ def parse_args():
parser.add_argument(
"--language",
help="language",
choices=["en", "de", "es", "fr", "hu", "sv", "zh", "ar", "it", "hy", "ja", "hi", "ko", "vi", "pt"],
choices=["en", "de", "es", "fr", "hu", "sv", "zh", "ar", "it", "hy", "ja", "hi", "te", "ko", "vi", "pt"],
default="en",
type=str,
)
Expand Down
6 changes: 5 additions & 1 deletion nemo_text_processing/text_normalization/run_evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def parse_args():
parser.add_argument(
"--lang",
help="language",
choices=['ar', 'de', 'en', 'es', 'fr', 'hu', 'it', 'ru', 'sv', 'zh', 'hy', 'hi', 'ko', 'vi', 'pt'],
choices=['ar', 'de', 'en', 'es', 'fr', 'hu', 'it', 'ru', 'sv', 'zh', 'hy', 'hi', 'te', 'ko', 'vi', 'pt'],
default="en",
type=str,
)
Expand Down Expand Up @@ -67,6 +67,10 @@ def parse_args():
to_lower = args.input_case == "lower_cased"
training_data = load_files([file_path], to_lower=to_lower)

# print("Loading training data: " + file_path)
# to_lower = True if args.input_case == "lower_cased" else False
# training_data = load_files([file_path], to_lower=to_lower)

if args.filter:
training_data = filter_loaded_data(training_data)

Expand Down
13 changes: 13 additions & 0 deletions nemo_text_processing/text_normalization/te/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (c) 2026, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (c) 2026, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
18 changes: 18 additions & 0 deletions nemo_text_processing/text_normalization/te/data/numbers/digit.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
1 ఒకటి
2 రెండు
3 మూడు
4 నాలుగు
5 ఐదు
6 ఆరు
7 ఏడు
8 ఎనిమిది
9 తొమ్మిది
౧ ఒకటి
౨ రెండు
౩ మూడు
౪ నాలుగు
౫ ఐదు
౬ ఆరు
౭ ఏడు
౮ ఎనిమిది
౯ తొమ్మిది
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
౧౦ పది
౧౧ పదకొండు
౧౨ పన్నెండు
౧౩ పదమూడు
౧౪ పద్నాలుగు
౧౫ పదిహేను
౧౬ పదహారు
౧౭ పదిహేడు
౧౮ పధ్ధెనిమిది
౧౯ పంతొమ్మిది
౨౦ ఇరవై
౨౧ ఇరవై ఒకటి
౨౨ ఇరవై రెండు
౨౩ ఇరవై మూడు
౨౪ ఇరవై నాలుగు
౨౫ ఇరవై ఐదు
౨౬ ఇరవై ఆరు
౨౭ ఇరవై ఏడు
౨౮ ఇరవై ఎనిమిది
౨౯ ఇరవై తొమ్మిది
౩౦ ముప్పై
౩౧ ముప్పై ఒకటి
౩౨ ముప్పై రెండు
౩౩ ముప్పై మూడు
౩౪ ముప్పై నాలుగు
౩౫ ముప్పై ఐదు
౩౬ ముప్పై ఆరు
౩౭ ముప్పై ఏడు
౩౮ ముప్పై ఎనిమిది
౩౯ ముప్పై తొమ్మిది
౪౦ నలభై
౪౧ నలభై ఒకటి
౪౨ నలభై రెండు
౪౩ నలభై మూడు
౪౪ నలభై నాలుగు
౪౫ నలభై ఐదు
౪౬ నలభై ఆరు
౪౭ నలభై ఏడు
౪౮ నలభై ఎనిమిది
౪౯ నలభై తొమ్మిది
౫౦ యాభై
౫౧ యాభై ఒకటి
౫౨ యాభై రెండు
౫౩ యాభై మూడు
౫౪ యాభై నాలుగు
౫౫ యాభై ఐదు
౫౬ యాభై ఆరు
౫౭ యాభై ఏడు
౫౮ యాభై ఎనిమిది
౫౯ యాభై తొమ్మిది
౬౦ అరవై
౬౧ అరవై ఒకటి
౬౨ అరవై రెండు
౬౩ అరవై మూడు
౬౪ అరవై నాలుగు
౬౫ అరవై ఐదు
౬౬ అరవై ఆరు
౬౭ అరవై ఏడు
౬౮ అరవై ఎనిమిది
౬౯ అరవై తొమ్మిది
౭౦ డెబ్బై
౭౧ డెబ్బై ఒకటి
౭౨ డెబ్బై రెండు
౭౩ డెబ్బై మూడు
౭౪ డెబ్బై నాలుగు
౭౫ డెబ్బై ఐదు
౭౬ డెబ్బై ఆరు
౭౭ డెబ్బై ఏడు
౭౮ డెబ్బై ఎనిమిది
౭౯ డెబ్బై తొమ్మిది
౮౦ ఎనభై
౮౧ ఎనభై ఒకటి
౮౨ ఎనభై రెండు
౮౩ ఎనభై మూడు
౮౪ ఎనభై నాలుగు
౮౫ ఎనభై ఐదు
౮౬ ఎనభై ఆరు
౮౭ ఎనభై ఏడు
౮౮ ఎనభై ఎనిమిది
౮౯ ఎనభై తొమ్మిది
౯౦ తొంభై
౯౧ తొంభై ఒకటి
౯౨ తొంభై రెండు
౯౩ తొంభై మూడు
౯౪ తొంభై నాలుగు
౯౫ తొంభై ఐదు
౯౬ తొంభై ఆరు
౯౭ తొంభై ఏడు
౯౮ తొంభై ఎనిమిది
౯౯ తొంభై తొమ్మిది
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
10 పది
11 పదకొండు
12 పన్నెండు
13 పదమూడు
14 పద్నాలుగు
15 పదిహేను
16 పదహారు
17 పదిహేడు
18 పధ్ధెనిమిది
19 పంతొమ్మిది
20 ఇరవై
21 ఇరవై ఒకటి
22 ఇరవై రెండు
23 ఇరవై మూడు
24 ఇరవై నాలుగు
25 ఇరవై ఐదు
26 ఇరవై ఆరు
27 ఇరవై ఏడు
28 ఇరవై ఎనిమిది
29 ఇరవై తొమ్మిది
30 ముప్పై
31 ముప్పై ఒకటి
32 ముప్పై రెండు
33 ముప్పై మూడు
34 ముప్పై నాలుగు
35 ముప్పై ఐదు
36 ముప్పై ఆరు
37 ముప్పై ఏడు
38 ముప్పై ఎనిమిది
39 ముప్పై తొమ్మిది
40 నలభై
41 నలభై ఒకటి
42 నలభై రెండు
43 నలభై మూడు
44 నలభై నాలుగు
45 నలభై ఐదు
46 నలభై ఆరు
47 నలభై ఏడు
48 నలభై ఎనిమిది
49 నలభై తొమ్మిది
50 యాభై
51 యాభై ఒకటి
52 యాభై రెండు
53 యాభై మూడు
54 యాభై నాలుగు
55 యాభై ఐదు
56 యాభై ఆరు
57 యాభై ఏడు
58 యాభై ఎనిమిది
59 యాభై తొమ్మిది
60 అరవై
61 అరవై ఒకటి
62 అరవై రెండు
63 అరవై మూడు
64 అరవై నాలుగు
65 అరవై ఐదు
66 అరవై ఆరు
67 అరవై ఏడు
68 అరవై ఎనిమిది
69 అరవై తొమ్మిది
70 డెబ్బై
71 డెబ్బై ఒకటి
72 డెబ్బై రెండు
73 డెబ్బై మూడు
74 డెబ్బై నాలుగు
75 డెబ్బై ఐదు
76 డెబ్బై ఆరు
77 డెబ్బై ఏడు
78 డెబ్బై ఎనిమిది
79 డెబ్బై తొమ్మిది
80 ఎనభై
81 ఎనభై ఒకటి
82 ఎనభై రెండు
83 ఎనభై మూడు
84 ఎనభై నాలుగు
85 ఎనభై ఐదు
86 ఎనభై ఆరు
87 ఎనభై ఏడు
88 ఎనభై ఎనిమిది
89 ఎనభై తొమ్మిది
90 తొంభై
91 తొంభై ఒకటి
92 తొంభై రెండు
93 తొంభై మూడు
94 తొంభై నాలుగు
95 తొంభై ఐదు
96 తొంభై ఆరు
97 తొంభై ఏడు
98 తొంభై ఎనిమిది
99 తొంభై తొమ్మిది
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
21 ఇరవై ఒక
31 ముప్పై ఒక
41 నలభై ఒక
51 యాభై ఒక
61 అరవై ఒక
71 డెబ్బై ఒక
81 ఎనభై ఒక
91 తొంభై ఒక
౨౧ ఇరవై ఒక
౩౧ ముప్పై ఒక
౪౧ నలభై ఒక
౫౧ యాభై ఒక
౬౧ అరవై ఒక
౭౧ డెబ్బై ఒక
౮౧ ఎనభై ఒక
౯౧ తొంభై ఒక
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0 సున్నా
౦ సున్నా
Loading