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

update attackedtext references, need to update tokenization

This commit is contained in:
Jack Morris
2020-06-16 21:56:33 -04:00
parent 9bf213f7fd
commit d25bf44f52
22 changed files with 189 additions and 166 deletions

View File

@@ -217,10 +217,10 @@ class Attack:
yield
for text, ground_truth_output in dataset:
tokenized_text = AttackedText(text, self.goal_function.tokenizer)
attacked_text = AttackedText(text)
self.goal_function.num_queries = 0
goal_function_result, _ = self.goal_function.get_result(
tokenized_text, ground_truth_output
attacked_text, ground_truth_output
)
# We can skip examples for which the goal is already succeeded,
# unless `attack_skippable_examples` is True.