cdpierse/transformers-interpret
Model explainability that works seamlessly with 🤗 transformers. Explain your transformers model in just 2 lines of code.
Supports attribution-based explainability for both text and vision transformers through gradient-based methods (Integrated Gradients), generating token-level importance scores. Provides multiple explainer classes tailored to different task types—sequence classification, pairwise classification, question answering, and image classification—with built-in visualization as interactive HTML or static PNG outputs. Integrates directly with Hugging Face transformers' model and tokenizer APIs, supporting any pretrained or fine-tuned model from the ecosystem.
1,413 stars. No commits in the last 6 months.
Stars
1,413
Forks
100
Language
Jupyter Notebook
License
Apache-2.0
Last pushed
Aug 30, 2023
Commits (30d)
0
Get this data via API
curl "https://pt-edge.onrender.com/api/v1/quality/transformers/cdpierse/transformers-interpret"
Open to everyone — 100 requests/day, no key needed. Get a free key for 1,000/day.
Higher-rated alternatives
jessevig/bertviz
BertViz: Visualize Attention in Transformer Models
inseq-team/inseq
Interpretability for sequence generation models 🐛 🔍
EleutherAI/knowledge-neurons
A library for finding knowledge neurons in pretrained transformer models.
hila-chefer/Transformer-MM-Explainability
[ICCV 2021- Oral] Official PyTorch implementation for Generic Attention-model Explainability for...
taufeeque9/codebook-features
Sparse and discrete interpretability tool for neural networks