Skip to content

Releases: QData/TextAttack

v0.3.10

11 Mar 02:09
b2344a3
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.3.9...v0.3.10

v0.3.9

11 Sep 23:06
Compare
Choose a tag to compare

this release mainly is about

  • #747 fixing CSVlogger missing df issue
  • #748 reverting one goal_func change due to the "textattack attack" errors
  • #719 extending textattack into Chinese language

What's Changed

New Contributors

Full Changelog: v0.3.8...v0.3.9

v0.3.8

02 Nov 19:43
Compare
Choose a tag to compare

#689: Add more type annotations and do some code cleanup in AttackedText
notably removed some code that did Chinese word segmentation because it did not properly
support words_from_text, which caused issues with various transformations.

#691: Optimize comparison between two AttackedText objects (thanks @plasmashen!)

#693: Fix bug with writing parameters twice in AttackedText (thanks @89x98!)

#700: Lots of miscellaneous bug fixes and some helper function implementation

#701: Fix bugs with loading TedTalk translation dataset, using T5, seq2sick/text-to-text goal functions

v0.3.7

14 Aug 16:26
f5817fc
Compare
Choose a tag to compare
  • Update dependency: transformers>=4.21.0
  • Update dependency: datasets==2.4.0
  • Update optional dependency: sentence_transformers==2.2.0
  • Update optional dependency: gensim==4.1.2
  • Update optional dependency: tensorflow==2.7.0 (Thanks @VijayKalmath !!!!)
  • Miscellaneous fixes for new packages to update things and remove warning messages
  • Fix logging attack args to W&B #647 (thanks @VijayKalmath)
  • Fix bug with word_swap_masked_lm #649 (thanks @Hanyu-Liu-123)
  • Fix small issues with textattack train #653 (thanks @VijayKalmath)
  • Fix issue with PWWS #654 (thanks @VijayKalmath)
  • Update recipe for FasterGeneticAlgorithm to match paper #656 (thanks @VijayKalmath)
  • Update adversarial dataset generation logic #657 (thanks @VijayKalmath)
  • Update dataset_args to correctly set dataset_split #659 (thanks @VijayKalmath)
  • Add logic for loading SQUAD via HuggingFaceDataset class #660 (thanks @VijayKalmath)
  • Fix ANSI color-printing #662
  • Make GreedyWordSwapWIR and related search methods more query-efficient under the presence of pre-transformation constraints #665 and #674 (thanks @VijayKalmath)
  • Save attack summary table as JSON (thanks @VijayKalmath -- great feature add!!)
  • Fix typo and update numpy #671 and #672 (thanks @JohnGiorgi -- and welcome!)
  • Finish CLARE attack #675 (thanks @Hanyu-Liu-123 and @VijayKalmath)
  • Add repr for better user experience with GoalFunctionResult #676 (thanks @VijayKalmath)
  • Better exception handling in WordSwapChangeNumber ((thanks @dangne -- and welcome!!)
  • Various other typo and bug fixes

Thanks to everyone who contributed to TextAttack this summer, and a special shoutout once more to @VijayKalmath for all the hard work and attention to detail. Glad to see TextAttack so healthy 🙂

v0.3.5

25 May 19:13
6e7fda5
Compare
Choose a tag to compare
  • #644:
    • Ability to specify device via TA_DEVICE env variable
    • New constraint, MaxNumWordsModified
    • Tracks previous AttackedText during attack to allow for reconstruction of chain of modifications
    • ChangeGreedyWordSwapWIR to allow passing of specific unk token
    • Formatting updates to new Black version
    • fix Universal Sentence Encoder from TF breakage
    • fix Flair to new API (thanks @VijayKalmath for the help!)
  • Bump version to 0.3.5
  • #623 Fix quotation bug, thanks @donggrant
  • #613 and others, fix dependencies
  • #609 Only initialize embeddings when needed :) thanks to @duesenfranz
  • #591 fix a bug with CLARE

v0.3.4 New Metric module / Multiple Bug fix / New transformation and Update Augmentation

10 Nov 01:24
49c94fb
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.3.3...v0.3.4

v0.3.3 Multiple Bug fix

03 Aug 02:33
f64df48
Compare
Choose a tag to compare
  1. Merge pull request #508 from QData/example_bug_fix

  2. Merge pull request #505 from QData/s3-model-fix

  3. Merge pull request #503 from QData/multilingual-doc

  4. Merge pull request #502 from QData/Notebook-10-bug-fix

  5. Merge pull request #500 from QData/docstring-rework-missing

  6. Merge pull request #497 from QData/dependabot/pip/docs/tensorflow-2.4.2

  7. Merge pull request #495 from QData/readthedoc-fix

v0.3.2 Bug Fixes

28 Jul 16:37
Compare
Choose a tag to compare

Multiple bug fixes:

  • Merge pull request #473 from cogeid/file-redirection-fix

  • Merge pull request #469 from xinzhel/allennlp_doc

  • Merge pull request #477 from cogeid/Fix-RandomSwap-and-RandomSynonymI…

  • Merge pull request #484 from QData/update-torch-version

  • Merge pull request #490 from QData/scipy-version-plus-two-doc-updates

  • Merge pull request #420 from QData/multilingual

  • Merge pull request #495 from QData/readthedoc-fix

v0.3.0 Updated API and Bug Fixes

25 Jun 12:50
7855b9e
Compare
Choose a tag to compare

New Updated API

We have added two new classes called Attacker and Trainer that can be used to perform adversarial attacks and adversarial training with full logging support and multi-GPU parallelism. This is intended to provide an alternative way of performing attacks and training for custom models and datasets.

Attacker: Running Adversarial Attacks

Below is an example use of Attacker to attack BERT model finetuned on IMDB dataset using TextFooler method. AttackArgs class is used to set the parameters of the attacks, including the number of examples to attack, CSV file to log the results, and the interval at which to save checkpoint.

Screen Shot 2021-06-24 at 8 34 44 PM

More details about Attacker and AttackArgs can be found here.

Trainer: Running Adversarial Training

Previously, TextAttack supported adversarial training in a limited manner. Users could only train models using the CLI command, and not every aspects of training was available for tuning.

Trainer class introduces an easy way to train custom PyTorch/Transformers models on a custom dataset. Below is an example where we finetune BERT on IMDB dataset with an adversarial attack called DeepWordBug.

Screen Shot 2021-06-25 at 9 28 57 PM

Dataset

Previously, datasets passed to TextAttack were simply expected to be an iterable of (input, target) tuples. While this offers flexibility, it prevents users from passing key information about the dataset that TextAttack can use to provide better experience (e.g. label names, label remapping, input column names used for printing).

We instead explicitly define Dataset class that users can use or subclass for their own datasets.

Bug Fixes:

  • #467: Don't check self.target_max_score when it is already known to be None.
  • #417: Fixed bug where in masked_lm transformations only subwords were candidates for top_words.

v0.2.15: CLARE Attack, Custom Word Embedding, and bug fixes!

27 Dec 04:51
Compare
Choose a tag to compare

CLARE Attack (#356, #392)

We have added a new attack proposed by "Contextualized Perturbation for Textual Adversarial Attack" (Li et al., 2020). There's also a corresponding augmenter recipe using CLARE. Thanks to @Hanyu-Liu-123, @cookielee77.

Custom Word Embedding (#333, #399)

We have added support for custom word embedding via AbstractWordEmbedding, WordEmbedding, GensimWordEmbedding fromtextattack.shared. These three classes allow users to use their own custom word embeddings for transformations and constraints that require custom word embeddings. Thanks @tsinggggg and @alexander-zap for contributing!

Bug Fixes and Changes

  • We fixed a bug that caused TextAttack to report fewer number of average queries than what it should be reporting (#350, thanks @ a1noack).
  • Update the dataset split used to evaluate robustness during adversarial training (#361, thanks @Opdoop).
  • Updated default parameters for TextBugger recipe (#373)
  • Fixed an issue with TextBugger by updating the default method used to segment text into words to work with homoglyphs. (#376, thanks @lethaiq!)
  • Updated ModelWrapper to not require get_grad method to be defined. (#381)
  • Fixed an issue with WordSwapMaskedLM that was causing words with lowest probability to be picked first. (#396)