TextAttack icon indicating copy to clipboard operation
TextAttack copied to clipboard

Misleading Tutorial 10: Explaining Attacking BERT models using Captum

Open mbednarski opened this issue 4 years ago • 4 comments

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.

mbednarski avatar Nov 10 '21 12:11 mbednarski

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

qiyanjun avatar Nov 10 '21 14:11 qiyanjun

@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!

sanchit97 avatar Nov 10 '21 14:11 sanchit97

@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.

mbednarski avatar Nov 10 '21 17:11 mbednarski

Any update on this?

huberl avatar Dec 18 '21 10:12 huberl