Skip to main content

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:

    1. A plot for global values (Required): Waterfall Plot!
    2. Download option for shap values of dataset
  • Support for multiple model types and NLP tasks!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

explainable-transformer-0.2.0.tar.gz (12.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page