Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: pin nemo-text-process to fix Chinese normalizer error. #7627

Merged
merged 3 commits into from
Oct 11, 2023

Conversation

XuesongYang
Copy link
Collaborator

@XuesongYang XuesongYang commented Oct 4, 2023

What does this PR do ?

Related to bug report,

Chinese normalizer outputted wrong normalized text for the input, '双辽境内除东辽河、西辽河等5条河流', where we expect '双辽境内除东辽河、西辽河等条河流'.

Evidence

  • On the latest version, i.e. nemo-text-processing=0.2.0rc0, it always normalized it as '双辽境内除东辽河、西辽河等5条河流';

  • On the previous version, i.e. nemo-text-processing=0.1.8rc0, it normalized it as expected text, '双辽境内除东辽河、西辽河等五条河流'.

Detailed Log

  • 0.2.0rc0
In [1]: from nemo_text_processing.text_normalization.normalize import Normalizer

In [2]: normalizer = Normalizer(lang='zh', input_case='cased', overwrite_cache=True, cache_dir="./cache_dir")

In [3]: text = '双辽境内除东辽河、西辽河等5条河流'

In [4]: normalizer.normalize(text)
Out[4]: '双辽境内除东辽河、西辽河等5条河流'
  • 0.1.8rc0
Downloading nemo_text_processing-0.1.8rc0-py3-none-any.whl (2.3 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.3/2.3 MB 12.5 MB/s eta 0:00:00
Installing collected packages: nemo-text-processing
  Attempting uninstall: nemo-text-processing
    Found existing installation: nemo-text-processing 0.2.0rc0
    Uninstalling nemo-text-processing-0.2.0rc0:
      Successfully uninstalled nemo-text-processing-0.2.0rc0
Successfully installed nemo-text-processing-0.1.8rc0


In [1]: from nemo_text_processing.text_normalization.normalize import Normalizer

In [2]: normalizer = Normalizer(lang='zh', input_case='cased', overwrite_cache=True, cache_dir="./cache_dir")

In [3]: text = '双辽境内除东辽河、西辽河等5条河流'

In [4]: normalizer.normalize(text)
Out[4]: '双辽境内除东辽河、西辽河等五条河流'

Collection: [Note which collection this PR will affect]

Changelog

  • Add specific line by line info of high level changes in this PR.

Usage

  • You can potentially add a usage example below
# Add a code snippet demonstrating how to use this 

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

PR Type:

  • New Feature
  • Bugfix
  • Documentation

If you haven't finished some of the above items you can still open "Draft" PR.

Who can review?

Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.

Additional Information

  • Related to # (issue)

…er error.

Signed-off-by: Xuesong Yang <1646669+XuesongYang@users.noreply.github.com>
Signed-off-by: Xuesong Yang <1646669+XuesongYang@users.noreply.github.com>
@blisc blisc merged commit 5a81f6a into r1.21.0 Oct 11, 2023
13 checks passed
@blisc blisc deleted the fix-normalizer branch October 11, 2023 16:34
github-actions bot pushed a commit that referenced this pull request Oct 11, 2023
* bugfix: safeguard nemo-text-process==0.1.8rc0 to fix Chinese normalizer error.

Signed-off-by: Xuesong Yang <1646669+XuesongYang@users.noreply.github.com>

* Revert "bugfix: safeguard nemo-text-process==0.1.8rc0 to fix Chinese normalizer error."

This reverts commit 30b6748.

* revert previous solution and pin version.

Signed-off-by: Xuesong Yang <1646669+XuesongYang@users.noreply.github.com>

---------

Signed-off-by: Xuesong Yang <1646669+XuesongYang@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants