Captum: Could Captum be used for sequence tagging problems?

Created on 6 May 2020  路  8Comments  路  Source: pytorch/captum

Hi,

I'm currently working on a sequence tagging problem, and I'm interested in investigating what tokens in the sequence are relevant for each step's predicting.

All 8 comments

Hi @heytitle , you should be able to use captum for sequence tagging. We don't have a tutorial on that but I'd recommend to start from IG and attribute predicted output at each step to the input embeddings. Here is an older example on translation. https://github.com/pytorch/captum/blob/4378c1c7ae733a56fa781881faa3cf59b8829b6b/tutorials/seq2seq_interpret.ipynb

@NarineK Thanks for the reply!

Just out of my curiosity, what don't we have that tutorial on the website?

It was long time ago. I didn't get time to review it. Seq2seq models can also be more computationally expensive but we can definitely think of adding a tutorial. Do you have any recommendations on seq2seq models in PyTorch that would be good to have a tutorial on?

I'll take a look and let you know if I come up with something. The problem that I'm currently working is about word segmentation for Thai language. It's quite specific and might not be a good example to illustrate Captum's features.

@NarineK : I used your tutorial to create one for seq2seq model (i.e NER) here . Could you please review it ?

Hi @LopezGG, great tutorial,

We also find that the last few layers of the target word "Rob" also has a strong positive influence.

Actually last few layers (starting with 1 up to layer 4) are quite cold, think You wanted to point out to layers 5-7.

@lipka-clazzpl : Thanks for your feedback. I believe the lighter color refers to positive feedback (0.8-1.0) based on the scale here. Am I missing something
image

@LopezGG correct, lighter color=more positive feedback, thought You wanted to explain attribution for word "Rob" solely with all the layers, my misinterpretation, You clearly explain "Rob" with "win", ",", "in" and "surprise" at lowest layers.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

elboyran picture elboyran  路  5Comments

eburling picture eburling  路  3Comments

rmcavoy picture rmcavoy  路  4Comments

asalimih picture asalimih  路  5Comments

hchong-ml picture hchong-ml  路  3Comments