1
0
mirror of https://github.com/QData/TextAttack.git synced 2021-10-13 00:05:06 +03:00

merge and format

This commit is contained in:
Jack Morris
2020-07-12 20:40:22 -04:00
20 changed files with 443 additions and 201 deletions

View File

@@ -38,7 +38,7 @@ class Attack:
constraints=[],
transformation=None,
search_method=None,
constraint_cache_size=2 ** 18,
constraint_cache_size=2 ** 20,
):
"""Initialize an attack object.
@@ -150,7 +150,8 @@ class Attack:
self, transformed_texts, current_text, original_text=None
):
"""Filters a list of potential transformed texts based on
``self.constraints`` Checks cache first.
``self.constraints`` Utilizes an LRU cache to attempt to avoid
recomputing common transformations.
Args:
transformed_texts: A list of candidate transformed ``AttackedText`` to filter.