Software for debugging transformers
Project description
Explainable Transformers
Install by running following command:
pip install explainable-transformers==0.2.0
Usage
from explainable_transformers.text_classification import TextClassificationExplainer
model_path = "cardiffnlp/twitter-roberta-base-sentiment-latest"
explainer = TextClassificationExplainer(model_path=model_path)
inp = ["I like you. I love you."]
shap_values = explainer.get_shap_values(inp)
print(shap_values.base_values)
print(shap_values.values)
Future Scope:
-
Want to give an option to enter either a single example or an entire dataset!
For single example:
- Output is for local
- Text Plot is enough
Entire Dataset: _ Reason: To explain model outputs on a global scale _ Output:
- A plot for global values (Required): Waterfall Plot!
- Download option for shap values of dataset
-
Support for multiple model types and NLP tasks!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for explainable-transformer-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89a5f5a0bc5e923aaf8736746339f9364f83918713847e04ed6ce78d415ba689 |
|
MD5 | 50953cc7db61ce32847bdf084e439868 |
|
BLAKE2b-256 | 3e5621bab989163a3c98d8a3e83d66c9dc2799fb6b225deb7e622a6a92be61e3 |