Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions textattack/transformations/composite_transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ def _get_transformations(self, *_):
)

def __call__(self, *args, **kwargs):
new_attacked_texts = set()
new_attacked_texts = []
for transformation in self.transformations:
new_attacked_texts.update(transformation(*args, **kwargs))
return list(new_attacked_texts)
new_attacked_texts.extend(transformation(*args, **kwargs))
seen = set()
return [t for t in new_attacked_texts if not (t in seen or seen.add(t))]

def __repr__(self):
main_str = "CompositeTransformation" + "("
Expand Down