Last active
February 5, 2020 17:23
-
-
Save Sirsirious/c8ee68b7daef8b93eba76ee64a176be9 to your computer and use it in GitHub Desktop.
Making our DummyTokenizer.
This file contains 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 string | |
class DummyTokenizer: | |
def __init__(self, sentence, token_boundaries=[' ', '-'], | |
punctuations=string.punctuation, delimiter_token='<SPLIT>'): | |
self.tokens = [] | |
self.raw = str(sentence) | |
self._token_boundaries = token_boundaries | |
self._delimiter_token = delimiter_token | |
self._punctuations = punctuations | |
self._index = 0 | |
self._tokenize() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment