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

Function test_checklist_augmenter

tests/test_augment_api.py:23–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21
22
23def test_checklist_augmenter():
24 from textattack.augmentation import CheckListAugmenter
25
26 augmenter = CheckListAugmenter(
27 pct_words_to_swap=0.01, transformations_per_example=64
28 )
29 s = "I'll be happy to assist you."
30 augmented_text_list = augmenter.augment(s)
31 augmented_s = "I will be happy to assist you."
32 assert augmented_s in augmented_text_list
33
34 s = "I will be happy to assist you."
35 augmented_text_list = augmenter.augment(s)
36 augmented_s = "I'll be happy to assist you."
37 assert augmented_s in augmented_text_list
38
39
40def test_charwap_augmenter():

Callers

nothing calls this directly

Calls 2

CheckListAugmenterClass · 0.90
augmentMethod · 0.45

Tested by

no test coverage detected