cdpierse / cdpierse/transformers-interpret
Text attribution fails for XLM-Roberta models
- Dominant language
- Jupyter Notebook
- Stars
- 1.4k
- Forks
- 99
- PR merge metrics
- No merged PRs in 30d
Description
### Issue:
I was testing the package on huggingface "xlm-roberta-base" model and it failed with the following error.
`IndexError: index out of range in self`
--------------------------------------------------------------------------------------------------------
### Here's how to reproduce the error:
```
from transformers import AutoTokenizer, AutoModelForSequenceClassification
from transformers_interpret import SequenceClassificationExplainer
tokenizer = AutoTokenizer.from_pretrained("xlm-roberta-base")
model = AutoModelForSequenceClassification.from_pretrained(
"xlm-roberta-base"
)
multiclass_explainer = SequenceClassificationExplainer(model=model, tokenizer=tokenizer)
word_attributions = multiclass_explainer(text="hello world")
```
Contributor guide
Assessment
This issue has not been assessed yet.