Repository navigation
Conversation
…er works TextCleaner handles cleaner type "korean_cleaner" (offered by tokenize_text --cleaner and usable as text_cleaner in the training preprocessor), but cleaner.py never imported KoreanCleaner, so the call raised NameError.
This branch has not been deployed
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.
Summary
TextCleanerhandles the cleaner typekorean_cleanerby callingKoreanCleaner.normalize_text, butfunasr/tokenizer/cleaner.pynever importsKoreanCleaner, so the branch raisesNameError.funasr.bin.tokenize_text --cleaner korean_cleaneroffers the option and the training preprocessorTextPreprocessSegDictaccepts it astext_cleaner, so both fail on first use. This adds the missing import from the existingfunasr/tokenizer/korean_cleaner.py.Type of change
Validation
python -m compileall funasr examples testspython -m pytest tests/test_text_cleaner_korean.py -q: 2 failed (NameError: name 'KoreanCleaner' is not defined), 1 passed (unknown cleaner types are still rejected) on current main; 3 passed with the fix.printf 'abc 12\n' | python -m funasr.bin.tokenize_text --token_type char --input - --output - --cleaner korean_cleanerraises theNameErroron main; with the fix it prints에 이 비 씨 일 이.test_char_tokenizer_seg_dictandtest_char_tokenizer_non_linguistic_symbols: 7 passed with the fix.User impact
Korean text normalization (digits and Latin letters spelled out in Hangul) for tokenizer preparation and training works through the documented cleaner option.
Notes for reviewers
tacotronis still a no-op, as before.cleaner.py.import funasralready importsfunasr.tokenizer.korean_cleaner(it only needsre), so the new import adds no module or dependency.