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 details)

Uploaded Source

File details

Details for the file explainable-transformer-0.2.0.tar.gz.

File metadata

  • Download URL: explainable-transformer-0.2.0.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.13

File hashes

Hashes for explainable-transformer-0.2.0.tar.gz
Algorithm Hash digest
SHA256 89a5f5a0bc5e923aaf8736746339f9364f83918713847e04ed6ce78d415ba689
MD5 50953cc7db61ce32847bdf084e439868
BLAKE2b-256 3e5621bab989163a3c98d8a3e83d66c9dc2799fb6b225deb7e622a6a92be61e3

See more details on using hashes here.

Supported by

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