Created
September 29, 2023 10:55
-
-
Save simonespa/398d9d61de4900fd49865f90ee376c1f to your computer and use it in GitHub Desktop.
Tokenizer
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
| import re | |
| vocabulary = set(re.split('\W', text)) | |
| vocabulary.update(set(re.findall('\W', text))) | |
| embeddings = dict.fromkeys(vocabulary, []) | |
| print(f'Vocabulary size: {len(vocabulary)}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment