TextAttack
TextAttack copied to clipboard
Could TextAttack only attack substring of input.
I would like to employ TextAttack for further research. does TextAttack support setting attack range of input text?
Yes, definitely. You can implement a PreTransformationConstraint that filters out transformations to the words that you don't want to alter. Here's an example, which we used to prevent modifying the premise (or hypothesis) in SNLI: https://github.com/QData/TextAttack/blob/master/textattack/constraints/pre_transformation/input_column_modification.py#L11