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

Function test_back_translation

tests/test_augment_api.py:128–136  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

126
127
128def test_back_translation():
129 from textattack.augmentation import Augmenter
130 from textattack.transformations.sentence_transformations import BackTranslation
131
132 augmenter = Augmenter(transformation=BackTranslation())
133 s = "What on earth are you doing?"
134 augmented_text_list = augmenter.augment(s)
135 augmented_s = "What the hell are you doing?"
136 assert augmented_s in augmented_text_list
137
138
139def test_back_transcription():

Callers

nothing calls this directly

Calls 3

augmentMethod · 0.95
AugmenterClass · 0.90
BackTranslationClass · 0.90

Tested by

no test coverage detected