fix: English TN spurious space after opening punctuation#363
Merged
Conversation
…ation
The verbalizer's INSERT_SPACE was applied uniformly between all
non-punct tokens, causing unwanted spaces after opening quotes and
parens (e.g., `"hello"` → `" hello"`). Split the verbalizer pattern
so classify tokens use INSERT_SPACE for inter-word spacing while
punct tokens use DELETE_SPACE — punct values already carry surrounding
spacing via the tagger's add_weight(accep(" "), -1.0).star.
Add test cases for the reported issue and related patterns.
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.
Fixed pengzhendong/wetext#14
Summary
INSERT_SPACEwas applied uniformly between all non-punct tokens, causing unwanted spaces after opening quotes/parens (e.g.,"hello"→" hello",(hello)→( hello))INSERT_SPACEfor inter-word spacing while punct tokens useDELETE_SPACE— punct values already carry surrounding spacing via the tagger'sadd_weight(accep(" "), -1.0).starFixes wenet-e2e/WeTextProcessing downstream issue: pengzhendong/wetext#14
Test plan
"So, one hundred thousand merit shouldn't be a problem.","hello",(hello)hello, world,He said "hello",a"b",hello "world"