-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Tarushi V <[email protected]>
- Loading branch information
1 parent
34e1087
commit f4d88c4
Showing
11 changed files
with
122 additions
and
9 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
nemo_text_processing/inverse_text_normalization/hi/data/whitelist/whitelist.tsv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
१/४ पाव | ||
१/२ आधा | ||
३/४ पौन | ||
१:३० डेढ़ बजे | ||
२:३० ढाई बजे | ||
१.५ डेढ़ | ||
२.५ ढाई | ||
कु. कुमारी | ||
स्मि. श्रीमती | ||
श्री. श्री | ||
श्री. श्रीमान | ||
मा. मास्टर | ||
डॉ. डॉक्टर |
3 changes: 0 additions & 3 deletions
3
nemo_text_processing/inverse_text_normalization/hi/data/whitelist/whitelist_fraction.tsv
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
nemo_text_processing/inverse_text_normalization/hi/data/whitelist/whitelist_time.tsv
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
tests/nemo_text_processing/hi/data_inverse_text_normalization/test_cases_whitelist.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
डेढ़ बजे~१:३० | ||
ढाई बजे~२:३० | ||
मास्टर निखिल तनिष~मा. निखिल तनिष | ||
पाव~१/४ | ||
श्रीमती ज्योत्सना~स्मि. ज्योत्सना | ||
डॉक्टर~डॉ. | ||
आधा कप चाय~१/२ कप चाय | ||
श्रीमान भारत कुमार~श्री. भारत कुमार | ||
डॉक्टर प्रशांत~डॉ. प्रशांत | ||
डेढ़~१.५ | ||
कुमारी~कु. | ||
ढाई~२.५ |
15 changes: 15 additions & 0 deletions
15
tests/nemo_text_processing/hi/data_inverse_text_normalization/test_cases_word.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
नींद~नींद | ||
याहू!~याहू! | ||
-~- | ||
आआआ~आआआ | ||
आकाशगंगा~आकाशगंगा | ||
लटरपटर~लटरपटर | ||
कच्चा-पक्का~कच्चा-पक्का | ||
गुब्बारा~गुब्बारा | ||
चिट्ठी~चिट्ठी | ||
ढूंढना~ढूंढना | ||
लोहे का!~लोहे का! | ||
टाटा~टाटा | ||
~ | ||
झ~झ | ||
संगीत~संगीत |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Copyright (c) 2024, 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. | ||
|
||
|
||
import pytest | ||
from parameterized import parameterized | ||
|
||
from nemo_text_processing.inverse_text_normalization.inverse_normalize import InverseNormalizer | ||
from nemo_text_processing.text_normalization.normalize_with_audio import NormalizerWithAudio | ||
|
||
from ..utils import CACHE_DIR, RUN_AUDIO_BASED_TESTS, parse_test_case_file | ||
|
||
|
||
class TestWhiteList: | ||
inverse_normalizer = InverseNormalizer(lang='hi', cache_dir=CACHE_DIR, overwrite_cache=False) | ||
|
||
@parameterized.expand(parse_test_case_file('hi/data_inverse_text_normalization/test_cases_whitelist.txt')) | ||
@pytest.mark.run_only_on('CPU') | ||
@pytest.mark.unit | ||
def test_denorm(self, test_input, expected): | ||
pred = self.inverse_normalizer.inverse_normalize(test_input, verbose=False) | ||
assert pred == expected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Copyright (c) 2024, 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. | ||
|
||
|
||
import pytest | ||
from parameterized import parameterized | ||
|
||
from nemo_text_processing.inverse_text_normalization.inverse_normalize import InverseNormalizer | ||
from nemo_text_processing.text_normalization.normalize_with_audio import NormalizerWithAudio | ||
|
||
from ..utils import CACHE_DIR, RUN_AUDIO_BASED_TESTS, parse_test_case_file | ||
|
||
|
||
class TestWord: | ||
inverse_normalizer = InverseNormalizer(lang='hi', cache_dir=CACHE_DIR, overwrite_cache=False) | ||
|
||
@parameterized.expand(parse_test_case_file('hi/data_inverse_text_normalization/test_cases_word.txt')) | ||
@pytest.mark.run_only_on('CPU') | ||
@pytest.mark.unit | ||
def test_denorm(self, test_input, expected): | ||
pred = self.inverse_normalizer.inverse_normalize(test_input, verbose=False) | ||
assert pred == expected |