MCPcopy Create free account
hub / github.com/Topdu/OpenOCR / full_mask

Method full_mask

openrec/preprocess/mdiff_label_encode.py:63–67  ·  view source on GitHub ↗
(self, text)

Source from the content-addressed store, hash-verified

61 return noisy_batch, masked_indices
62
63 def full_mask(self, text):
64 noisy_batch = [self.dict[self.MASK]] * (self.max_text_len + 1)
65 masked_indices = [True] * len(text) + [False] * (self.max_text_len +
66 1 - len(text))
67 return noisy_batch, masked_indices
68
69 def left_to_right_mask(self, text):
70 rand_split = random.randint(1, len(text) - 1)

Callers 1

forward_processMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected