abs_text_attack.attacks package

Submodules

abs_text_attack.attacks.DeepWordBug_en module

class abs_text_attack.attacks.DeepWordBug_en.DeepWordBug(goal_function: GoalFunction, constraints: List[Constraint | PreTransformationConstraint], transformation: Transformation, search_method: SearchMethod, transformation_cache_size=32768, constraint_cache_size=32768)[исходный код]

Базовые классы: Attack

static build(model_wrapper, kwargs={})[исходный код]

abs_text_attack.attacks.PWWS_en module

class abs_text_attack.attacks.PWWS_en.PWWS(goal_function: GoalFunction, constraints: List[Constraint | PreTransformationConstraint], transformation: Transformation, search_method: SearchMethod, transformation_cache_size=32768, constraint_cache_size=32768)[исходный код]

Базовые классы: Attack

static build(model_wrapper, kwargs={})[исходный код]

abs_text_attack.attacks.Pruthi_en module

class abs_text_attack.attacks.Pruthi_en.Pruthi(goal_function: GoalFunction, constraints: List[Constraint | PreTransformationConstraint], transformation: Transformation, search_method: SearchMethod, transformation_cache_size=32768, constraint_cache_size=32768)[исходный код]

Базовые классы: Attack

static build(model_wrapper, kwargs={})[исходный код]

abs_text_attack.attacks.TextBugger_en module

class abs_text_attack.attacks.TextBugger_en.TextBugger(goal_function: GoalFunction, constraints: List[Constraint | PreTransformationConstraint], transformation: Transformation, search_method: SearchMethod, transformation_cache_size=32768, constraint_cache_size=32768)[исходный код]

Базовые классы: Attack

static build(model_wrapper, kwargs={})[исходный код]

abs_text_attack.attacks.TextFooler_en module

class abs_text_attack.attacks.TextFooler_en.TextFooler(goal_function: GoalFunction, constraints: List[Constraint | PreTransformationConstraint], transformation: Transformation, search_method: SearchMethod, transformation_cache_size=32768, constraint_cache_size=32768)[исходный код]

Базовые классы: Attack

Class that builds TextFooler attack type. It is required for us to follow TextAttack paradigm of modular-built Attack, consisting of 1) goal function 2) constraints 3) transformation 4) search method

static build(model_wrapper, kwargs={})[исходный код]

Takes instance of textattack ModelWrapper class. # Параметризация атаки через kwargs была бы лучше, чем жесткое кодирование.

Module contents