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

Method strip

textattack/models/wrappers/model_wrapper.py:47–50  ·  view source on GitHub ↗
(s, chars)

Source from the content-addressed store, hash-verified

45 # TODO: Find a better way to identify prefixes. These depend on the model, so cannot be resolved in ModelWrapper.
46
47 def strip(s, chars):
48 for c in chars:
49 s = s.replace(c, "")
50 return s
51
52 tokens = [[strip(t, strip_chars) for t in x] for x in tokens]
53

Callers 15

_write_readmeMethod · 0.80
__init__Method · 0.80
_get_transformationsMethod · 0.80
back_transcribeMethod · 0.80
_get_transformationsMethod · 0.80
__init__Method · 0.80
_get_transformationsMethod · 0.80
test_command_line_evalFunction · 0.80
test_loggerFunction · 0.80
update_testFunction · 0.80
test_command_line_listFunction · 0.80

Calls

no outgoing calls

Tested by 7

test_command_line_evalFunction · 0.64
test_loggerFunction · 0.64
update_testFunction · 0.64
test_command_line_listFunction · 0.64
test_train_tinyFunction · 0.64
test_command_line_attackFunction · 0.64