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

Function test_charwap_augmenter

tests/test_augment_api.py:40–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38
39
40def test_charwap_augmenter():
41 from textattack.augmentation import CharSwapAugmenter
42
43 augmenter = CharSwapAugmenter(
44 pct_words_to_swap=0.01, transformations_per_example=64
45 )
46 s = "To be or not to be"
47 augmented_text_list = augmenter.augment(s)
48 augmented_s = "T be or not to be"
49 assert augmented_s in augmented_text_list
50
51
52def test_easydata_augmenter():

Callers

nothing calls this directly

Calls 2

CharSwapAugmenterClass · 0.90
augmentMethod · 0.45

Tested by

no test coverage detected