MCPcopy Create free account
hub / github.com/THUDM/GLM / whitespace_tokenize

Function whitespace_tokenize

data_utils/wordpiece.py:65–71  ·  view source on GitHub ↗

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

(text)

Source from the content-addressed store, hash-verified

63
64
65def 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
74class BertTokenizer(object):

Callers 2

tokenizeMethod · 0.85
tokenizeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected