Hi TN Roman: Expanding the numeral support for roman class till 3999 with compositional approach - #463
Conversation
Signed-off-by: Shreyas Pawar <shrpawar@nvidia.com>
Signed-off-by: Shreyas Pawar <shrpawar@nvidia.com>
for more information, see https://pre-commit.ci
|
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. |
folivoramanh
left a comment
There was a problem hiding this comment.
resolve the merge conflict
There was a problem hiding this comment.
how to make sure that this is really roman? for example if only 1 character appeared (V, I, L, D, C, X, M) how to know that it's really roman numerals but not English alphabet (might be codeswitch...?)
There was a problem hiding this comment.
While this is a valid concern, it represents a necessary trade-off. Currently, the grammar relies on adjacency: single characters (I, V, X) are only evaluated as Roman numerals if they are directly adjacent to a Hindi word (with or without a hyphen). If they appear in isolation, they safely fall back to the English alphabet. While this does leave a rare edge case for code-switched English letters (e.g., 'विटामिन C'), trying to fix it will introduce worse regressions. If we restrict length to 2+ characters, we will break valid cases like 'विश्व युद्ध-I' or 'खंड V'. If we use a whitelist of trigger words, we would lose generalization for thousands of valid proper nouns (like satellites or mission names). Considering that Roman numerals overwhelmingly appear adjacent to Hindi words, I think accepting the rare code-switched alphabet character as a limitation is the safest approach here.
Signed-off-by: Shreyas Pawar <shrpawar@nvidia.com>
What does this PR do ?
Expanding the numeral support for roman class till 3999 with compositional approach
Before your PR is "Ready for review"
Pre checks:
git commit -sto sign.pytestor (if your machine does not have GPU)pytest --cpufrom the root folder (given you marked your test cases accordingly@pytest.mark.run_only_on('CPU')).bash tools/text_processing_deployment/export_grammars.sh --MODE=test ...pytestand Sparrowhawk here.__init__.pyfor every folder and subfolder, includingdatafolder which has .TSV files?Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.to all newly added Python files?Copyright 2015 and onwards Google, Inc.. See an example here.try import: ... except: ...) if not already done.PR Type:
If you haven't finished some of the above items you can still open "Draft" PR.