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

Reformatting-try2

This commit is contained in:
Hanyu Liu
2020-07-10 21:49:20 -04:00
parent 974061c0aa
commit 4f8b227ef9
59 changed files with 156 additions and 93 deletions

View File

@@ -1,5 +1,5 @@
from collections import deque
import os
# import os
import lru
import numpy as np
@@ -117,10 +117,10 @@ class Attack:
self, transformed_texts, current_text, original_text=None
):
"""Filters a list of potential transformaed texts based on
``self.constraints``\.
``self.constraints``
Args:
transformed_texts: A list of candidate transformed ``AttackedText``\s to filter.
transformed_texts: A list of candidate transformed ``AttackedText`` to filter.
current_text: The current ``AttackedText`` on which the transformation was applied.
original_text: The original ``AttackedText`` from which the attack started.
"""
@@ -149,10 +149,10 @@ 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`` Checks cache first.
Args:
transformed_texts: A list of candidate transformed ``AttackedText``\s to filter.
transformed_texts: A list of candidate transformed ``AttackedText`` to filter.
current_text: The current ``AttackedText`` on which the transformation was applied.
original_text: The original ``AttackedText`` from which the attack started.
"""