allenai / allennlp

An open-source NLP research library, built on PyTorch.
http://www.allennlp.org
Apache License 2.0
11.76k stars 2.25k forks source link

[XAI for transformer custom model using AllenNLP] #5519

Closed lengocloi1805 closed 2 years ago

lengocloi1805 commented 2 years ago

I have been solving the NER problem for a Vietnamese dataset with 15 tags in IO format. I have been using the AllenNLP Interpret Toolkit for my model, but I can not configure it completely.

I have used a pre-trained language model "xlm-roberta-base" based-on HuggingFace. I have concatenated 4 last bert layers, and pass through to linear layer. The model architecture you can see in the attachment below. image

What steps do I have to take to integrate this model to AllenNLP Interpret? Could you please help me with this problem?

manhpv8 commented 2 years ago

please help me, i have same problem!

ndtands commented 2 years ago

I also encountered a similar problem. But it's so hard to find the answer.

epwalsh commented 2 years ago

Hi all, have you seen https://guide.allennlp.org/interpret? I hope that helps.

lengocloi1805 commented 2 years ago

Hi all, have you seen https://guide.allennlp.org/interpret? I hope that helps.

Yes I do, but I have no idea about what my archived file (tar.gz) is?. I have downloaded archived file form demo interpret on AllenNLP demo and extract it, but it to challenge for me to understand config.json file to adapt with my model, so I still stuck in here.

github-actions[bot] commented 2 years ago

This issue is being closed due to lack of activity. If you think it still needs to be addressed, please comment on this thread 👇

lengocloi1805 commented 2 years ago

Guide sample found at https://guide.allennlp.org/interpret#3, but I have no idea about archive file (including weight.th, vocabulary....). How I can pass through my predict result to Predictor object, and what format Predictor need to compatibility?

Thanks in advance!

epwalsh commented 2 years ago

The archive file (*.tar.gz) what you get after training / fine-tuning your model with allennlp train. The format your Predictor takes depends on which Predictor you're using and how it's implemented. You may need to implement your own Predictor subclass. Part 1 of the guide may be useful: https://guide.allennlp.org/your-first-model