MCPcopy Create free account
hub / github.com/IBM/Project_CodeNet / encode

Function encode

model-experiments/masked-language-model/train.py:128–130  ·  view source on GitHub ↗
(texts)

Source from the content-addressed store, hash-verified

126
127# Encodes the token strings by int vocab indices.
128def encode(texts):
129 encoded_texts = vectorize_layer(texts)
130 return encoded_texts.numpy()
131
132# Randomly replace tokens by the [mask] and keep replaced token as label.
133def get_masked_input_and_labels(encoded_texts):

Callers 1

train.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected