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

Method augment_many

textattack/augmentation/augmenter.py:198–209  ·  view source on GitHub ↗

Returns all possible augmentations of a list of strings according to ``self.transformation``. Args: text_list (list(string)): a list of strings for data augmentation Returns a list(string) of augmented texts. :param show_progress: show process during augm

(self, text_list, show_progress=False)

Source from the content-addressed store, hash-verified

196 return perturbed_texts
197
198 def augment_many(self, text_list, show_progress=False):
199 """Returns all possible augmentations of a list of strings according to
200 ``self.transformation``.
201
202 Args:
203 text_list (list(string)): a list of strings for data augmentation
204 Returns a list(string) of augmented texts.
205 :param show_progress: show process during augmentation
206 """
207 if show_progress:
208 text_list = tqdm.tqdm(text_list, desc="Augmenting data...")
209 return [self.augment(text) for text in text_list]
210
211 def augment_text_with_ids(self, text_list, id_list, show_progress=True):
212 """Supplements a list of text with more text data.

Callers

nothing calls this directly

Calls 1

augmentMethod · 0.95

Tested by

no test coverage detected