Repository navigation
Conversation
"3rd-party" was normalized to "three rd-party" and "21st-century" to "twenty one st-century": the serial tagger split the ordinal suffix off as a letter group and read the digits as a cardinal. Add a serial path for an ordinal followed by hyphenated words, reusing the ordinal tagger and verbalizer as the address grammar in measure.py does, so "3rd-party" -> "third-party" and "19th-century" -> "nineteenth-century". Signed-off-by: Udaya Tejas <udayatejas2004@gmail.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do ?
Fixes English TN of ordinals inside hyphenated compounds. Today the serial tagger splits the ordinal suffix off as letters and reads the digits as a cardinal:
3rd-partythree rd-partythird-partya 21st-century novela twenty one st-century novela twenty first-century novel19th-century artnineteen th-century artnineteenth-century artthe 2nd-largest citythe two nd-largest citythe second-largest cityThe fix adds a path to
SerialFstfor an ordinal followed by one or more-wordgroups. It composes the existing ordinal tagger with the ordinal verbalizer, the same patternen/taggers/measure.pyuses for addresses, and gives itMIN_NEG_WEIGHTso it is preferred over the letter split.I added 5 cases to
test_cases_serial.txt. All 5 fail onmainand pass with this change.Before your PR is "Ready for review"
Pre checks:
git commit -sto sign.pytest tests/nemo_text_processing/en --cpupasses (1620 passed, 0 failed).test_serial.pyalso passes with--run_audio_based.test_cases_serial.txt, which the Sparrowhawk test script also reads.pytestand Sparrowhawk here. (Added toen/data_text_normalization/test_cases_serial.txt.)__init__.pyfor every folder and subfolder, includingdatafolder which has .TSV files? (N/A: no new folders)try import: ... except: ...) if not already done.PR Type: