MCPcopy
hub / github.com/QData/TextAttack / encode

Method encode

textattack/models/tokenizers/glove_tokenizer.py:150–152  ·  view source on GitHub ↗
(self, text)

Source from the content-addressed store, hash-verified

148 return text_input
149
150 def encode(self, text):
151 text = self._process_text(text)
152 return super().encode(text, add_special_tokens=False).ids
153
154 def batch_encode(self, input_text_list):
155 """The batch equivalent of ``encode``."""

Callers 5

__call__Method · 0.95
calc_pplMethod · 0.45
__init__Method · 0.45
test_command_line_attackFunction · 0.45

Calls 1

_process_textMethod · 0.95

Tested by 1

test_command_line_attackFunction · 0.36