MCPcopy Create free account
hub / github.com/SooLab/CGFormer / whitespace_tokenize

Function whitespace_tokenize

bert/tokenization_bert.py:108–114  ·  view source on GitHub ↗

Runs basic whitespace cleaning and splitting on a piece of text.

(text)

Source from the content-addressed store, hash-verified

106
107
108def whitespace_tokenize(text):
109 """Runs basic whitespace cleaning and splitting on a piece of text."""
110 text = text.strip()
111 if not text:
112 return []
113 tokens = text.split()
114 return tokens
115
116
117class BertTokenizer(PreTrainedTokenizer):

Callers 2

tokenizeMethod · 0.85
tokenizeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected