Update regex.py to correctly parse scripts with combining marks#71
Open
ajaykg wants to merge 3 commits intokarpathy:masterfrom
Open
Update regex.py to correctly parse scripts with combining marks#71ajaykg wants to merge 3 commits intokarpathy:masterfrom
ajaykg wants to merge 3 commits intokarpathy:masterfrom
Conversation
Fixing the problem that all tokenizers have with regard to all combining marks like diacritics, Indic Matras (vowels after consonants) Indic Halant, Arabic vowels, Hebrew vowels etc. This was breaking most languages except English and CJKs.
Author
|
This is the utf8 tokenizer that skips the successive utf codepage byte in the word and the chunk to increase the token density.
This was a botched approach. Let's skip.
Author
Author
|
bump. |
|
Dose this merge negatively effect anything? |
Author
|
Should not. Given we are telling the regular expression to not split words between a character and a combining mark after the character. The combining marks in all scripts should by definition not exist independently. Atleast for southasian languages all the vovels following a consonent are combining marks and hence it should significantly improve tokenization that is making it act almost like a character level model. |
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.
Fixing the problem that all tokenizers have with regard to all combining marks like diacritics, Indic Matras (vowels after consonants) Indic Halant, Arabic, Hebrew etc. This was probably breaking most languages except English and CJKs. Verified for Indic languages.