in augmentation/filtering.py [0:0]
def augment(self, text: str, *args, **kwargs):
augmented = self.augmenter.augment(text, *args, **kwargs)
if isinstance(augmented, str):
augmented = [augmented]
filter_fn = lambda variant: self.metric_acceptor(
self.metric_fn(text, variant)
)
return list(filter(filter_fn, augmented))