Open
Conversation
8e0c442 to
e9bd355
Compare
halfak
reviewed
Jun 22, 2020
deltas/tokenizers/wikitext_split.py
Outdated
|
|
||
| wikitext_split = RegexTokenizer(LEXICON) | ||
| LEXICON_LATIN = LEXICON.copy() | ||
| LEXICON_LATIN.insert(-2, ('cjk', cjk)) |
Owner
There was a problem hiding this comment.
Why not insert this right after "word"?
Contributor
Author
There was a problem hiding this comment.
I can do that. My thought process was since we won't have lots of cjk in a regular latin-dominant text, we don't need to handle them before the tab_open, tab_close, etc.
halfak
reviewed
Jun 22, 2020
| combined_word = devangari_word + arabic_word + bengali_word + korean_word | ||
|
|
||
| word = r'(?:[^\W\d]|[' + combined_word + r'])' + \ | ||
| cjk_re = r'\u3040-\u30ff' + r'\u4e00-\u9FFF' |
Owner
There was a problem hiding this comment.
Does this still cover the full range?
halfak
reviewed
Jun 22, 2020
|
|
||
| cjk = r'[' + cjk_re + ']' | ||
|
|
||
| word = r'(?:[^\W\d' + cjk_re + r']|[' + combined_word + r'])' + \ |
Owner
There was a problem hiding this comment.
Do we need to explicitly exclude CJK here?
Contributor
Author
There was a problem hiding this comment.
Without doing that, some cjk values get captured as word.
f3489da to
1d59026
Compare
1d59026 to
df6225b
Compare
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.
Created lexicons for cjk and non-cjk texts