QData / TextAttack

TextAttack 🐙 is a Python framework for adversarial attacks, data augmentation, and model training in NLP https://textattack.readthedocs.io/en/master/
https://textattack.readthedocs.io/en/master/
MIT License
2.89k stars 385 forks source link

Misleading Tutorial 10: Explaining Attacking BERT models using Captum #572

Open mbednarski opened 2 years ago

mbednarski commented 2 years ago

I would like to use TextAttack with the BERT model together with Captum. A tutorial covers the topic I am interested in -https://textattack.readthedocs.io/en/latest/2notebook/Example_5_Explain_BERT.html but It looks like broken in a half. It does not use any attributions computed from Captum.

I found another one: https://github.com/P3n9W31/TextAttack/blob/aa736d26b423f0f3d311e02353069899adc1744c/docs/2notebook/Example_5_Explain_BERT.ipynb , which seems to be using an older version of TextAttack.

Anyway, I finally managed to achieve what I wanted by combining those two + browsing source code.

Should the tutorial be updated? I could try to update it and create a merge request, but it will need a review as I am not experienced user of TextAttack.

qiyanjun commented 2 years ago

@mbednarski many thanks for pointing out this. Please help us with a PR!

sanchit97 commented 2 years ago

@mbednarski Do you think there should be an example of visualization of attributions in the tutorial? I understand that it might be required by a lot of users. The code for captum visualize was not in a complete state during writing of this tutorial and we thought users can create their own html viz. It would be great if you can add that. Thanks!

mbednarski commented 2 years ago

@sanchit97 I believe it should be - my colleague and I (as new users) expected that it would be demonstrated. I can update the original article and submit PR for review.

huberl commented 2 years ago

Any update on this?