TextAttack icon indicating copy to clipboard operation
TextAttack copied to clipboard

[Draft] Add adversarial defense benchmark

Open yangheng95 opened this issue 3 years ago • 1 comments

What does this PR do?

Introduce an interface of adversarial defense to benchmark adversarial defense methods.

Summary

The test examples is available in https://github.com/yangheng95/TextAttack/blob/master/examples/reactive_defense/sst2_reactive_defense.py Please contact me and help test if you are interested in this PR. @jxmorris12

This PR is related to https://github.com/QData/TextAttack/issues/687

Additions

  • [1] https://github.com/yangheng95/TextAttack/blob/master/textattack/models/wrappers/pyabsa_model_wrapper.py
  • [2] https://github.com/yangheng95/TextAttack/tree/master/textattack/reactive_defense

Changes

  • [1] Add **kwargs for many functions, see the source code.
  • [2] Modify the search_method()

Deletions

  • Example: Remove unnecessary files under textattack.models...

Checklist

  • [x] The title of your pull request should be a summary of its contribution.
  • [x] Please write detailed description of what parts have been newly added and what parts have been modified. Please also explain why certain changes were made.
  • [x] If your pull request addresses an issue, please mention the issue number in the pull request description to make sure they are linked (and people consulting the issue know you are working on it)
  • [x] To indicate a work in progress please mark it as a draft on Github.
  • [x] Make sure existing tests pass.
  • [x] Add relevant tests. No quality testing = no merge.
  • [x] All public methods must have informative docstrings that work nicely with sphinx. For new modules/files, please add/modify the appropriate .rst file in TextAttack/docs/apidoc.'

yangheng95 avatar Sep 29 '22 15:09 yangheng95

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Hi there, @jxmorris12 Do you have any questions about this PR?

yangheng95 avatar Feb 06 '23 14:02 yangheng95

Hi @jxmorris12, this PR has been tested in my own environment.

yangheng95 avatar Aug 31 '23 01:08 yangheng95

@yangheng95 mind to add some unit tests / also please solve conflicts / and locally run "make test"

qiyanjun avatar Sep 11 '23 15:09 qiyanjun

@yangheng95 do you mind to also add a Jupyter notebook under doc/2notebook to give good examples of your newly added features? Thanks..

qiyanjun avatar Sep 14 '23 13:09 qiyanjun

@yangheng95 do you mind to also add a Jupyter notebook under doc/2notebook to give good examples of your newly added features? Thanks..

Hi, that is ok. And I will push a PR recently, to show some examples and provide detailed documents.

yangheng95 avatar Sep 14 '23 13:09 yangheng95

Closing as it's been over a year. Please feel free to reopen once you've resolved conflicts with the current version of TextAttack and improved the documentation + testing!

jxmorris12 avatar Mar 05 '24 15:03 jxmorris12