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

Function test_embedding_augmenter

tests/test_augment_api.py:9–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7
8
9def test_embedding_augmenter():
10 from textattack.augmentation import EmbeddingAugmenter
11
12 augmenter = EmbeddingAugmenter(
13 pct_words_to_swap=0.01, transformations_per_example=64
14 )
15 s = "There is nothing either good or bad, but thinking makes it so."
16 augmented_text_list = augmenter.augment(s)
17 augmented_s = (
18 "There is nothing either good or unfavourable, but thinking makes it so."
19 )
20 assert augmented_s in augmented_text_list
21
22
23def test_checklist_augmenter():

Callers

nothing calls this directly

Calls 2

EmbeddingAugmenterClass · 0.90
augmentMethod · 0.45

Tested by

no test coverage detected