Runs basic whitespace cleaning and splitting on a piece of text.
(text)
| 63 | |
| 64 | |
| 65 | def whitespace_tokenize(text): |
| 66 | """Runs basic whitespace cleaning and splitting on a piece of text.""" |
| 67 | text = text.strip() |
| 68 | if not text: |
| 69 | return [] |
| 70 | tokens = text.split() |
| 71 | return tokens |
| 72 | |
| 73 | |
| 74 | class BertTokenizer(object): |