Skip to content

Commit 9bca70a

Browse files
committed
Fixing all the feedbacks
Haven't fixed the graph@leading zero part
1 parent fa304a2 commit 9bca70a

File tree

9 files changed

+7
-33
lines changed

9 files changed

+7
-33
lines changed

nemo_text_processing/inverse_text_normalization/ko/data/numbers/zero.tsv

Lines changed: 0 additions & 1 deletion
This file was deleted.

nemo_text_processing/inverse_text_normalization/ko/graph_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
1+
# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
22
# Copyright 2015 and onwards Google, Inc.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");

nemo_text_processing/inverse_text_normalization/ko/taggers/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,3 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
15-
from nemo_text_processing.inverse_text_normalization.ko.taggers.tokenize_and_classify import ClassifyFst
16-
from nemo_text_processing.inverse_text_normalization.ko.verbalizers.verbalize import VerbalizeFst
17-
from nemo_text_processing.inverse_text_normalization.ko.verbalizers.verbalize_final import VerbalizeFinalFst

nemo_text_processing/inverse_text_normalization/ko/taggers/cardinal.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,9 @@ class CardinalFst(GraphFst):
3131
def __init__(self):
3232
super().__init__(name="cardinal", kind="classify")
3333

34-
graph_zero = pynini.string_file(get_abs_path("data/numbers/zero.tsv"))
35-
graph_digit = pynini.string_file(get_abs_path("data/numbers/digit.tsv"))
3634
graph_zero = pynini.cross("영", "0")
35+
graph_digit = pynini.string_file(get_abs_path("data/numbers/digit.tsv"))
3736

38-
graph_negative = pynini.cross("마이너스", "-")
39-
graph_negative += delete_space
40-
4137
ten = pynutil.delete("십")
4238
ten_alt = pynini.cross("십", "1")
4339
### Responsible for second digit of two digit number. ex) 20's 2
@@ -47,7 +43,7 @@ def __init__(self):
4743

4844
hundred = pynutil.delete("백")
4945
hundred_alt = pynini.cross("백", "1")
50-
graph_hundred_component = pynini.union(((graph_digit + hundred) | hundred_alt), pynutil.insert("0"))
46+
graph_hundred_component = pynini.union(((graph_digit + hundred | hundred_alt)), pynutil.insert("0"))
5147
graph_hundred_component += graph_ten_component
5248

5349
thousand = pynutil.delete("천")

nemo_text_processing/inverse_text_normalization/ko/taggers/tokenize_and_classify.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
from nemo_text_processing.inverse_text_normalization.ko.graph_utils import (
2525
INPUT_LOWER_CASED,
2626
GraphFst,
27-
delete_extra_space,
28-
delete_space,
2927
generator_main,
3028
)
3129

nemo_text_processing/inverse_text_normalization/ko/verbalizers/__init__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,4 @@
1010
# distributed under the License is distributed on an "AS IS" BASIS,
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
13-
# limitations under the License.
14-
15-
from nemo_text_processing.inverse_text_normalization.ko.taggers.tokenize_and_classify import ClassifyFst
16-
from nemo_text_processing.inverse_text_normalization.ko.verbalizers.verbalize import VerbalizeFst
17-
from nemo_text_processing.inverse_text_normalization.ko.verbalizers.verbalize_final import VerbalizeFinalFst
13+
# limitations under the License.

nemo_text_processing/inverse_text_normalization/ko/verbalizers/verbalize_final.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
from pynini.lib import pynutil
2020

2121
from nemo_text_processing.inverse_text_normalization.ko.verbalizers.verbalize import VerbalizeFst
22-
from nemo_text_processing.inverse_text_normalization.ko.verbalizers.word import WordFst
2322
from nemo_text_processing.inverse_text_normalization.ko.graph_utils import GraphFst, generator_main, delete_space
2423

2524

nemo_text_processing/inverse_text_normalization/ko/verbalizers/word.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
17-
import pynini
1816
from pynini.lib import pynutil
1917

20-
from nemo_text_processing.inverse_text_normalization.ko.graph_utils import NEMO_NOT_QUOTE, GraphFst, delete_space
18+
from nemo_text_processing.inverse_text_normalization.ko.graph_utils import NEMO_NOT_QUOTE, GraphFst
2119

2220

2321

tests/nemo_text_processing/ko/test_cardinal.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
1+
# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -16,10 +16,8 @@
1616
from parameterized import parameterized
1717

1818
from nemo_text_processing.inverse_text_normalization.inverse_normalize import InverseNormalizer
19-
from nemo_text_processing.text_normalization.normalize import Normalizer
20-
from nemo_text_processing.text_normalization.normalize_with_audio import NormalizerWithAudio
2119

22-
from ..utils import CACHE_DIR, RUN_AUDIO_BASED_TESTS, parse_test_case_file
20+
from ..utils import CACHE_DIR, parse_test_case_file
2321

2422

2523
class TestCardinal:
@@ -31,9 +29,3 @@ class TestCardinal:
3129
def test_denorm(self, test_input, expected):
3230
pred = self.inverse_normalizer_ko.inverse_normalize(test_input, verbose=False)
3331
assert pred == expected
34-
35-
normalizer_with_audio_ko = (
36-
NormalizerWithAudio(lang='ko', cache_dir=CACHE_DIR, overwrite_cache=False)
37-
if RUN_AUDIO_BASED_TESTS
38-
else None
39-
)

0 commit comments

Comments
 (0)