Skip to main content

Latest PyPI version Documentation Status

A python package for benchmarking interpretability techniques.

from transformers import AutoModelForSequenceClassification, AutoTokenizer
from ferret import Benchmark

model = AutoModelForSequenceClassification.from_pretrained("bert-base-cased")
tokenizer = AutoTokenizer.from_pretrained("bert-base-cased")

bench = Benchmark(model, tokenizer)
explanations = bench.explain("You look stunning!")
bench.show_table(explanations)

Features

ferret builds on top of the transformers library. The library supports explanations using:

  • Gradients

  • Integrated Gradinets

  • Gradient x Input word embeddings

  • SHAP

  • LIME

TODOs

  • Possibility to run on select device (“cpu”, “cuda”)

  • Sample-And-Occlusion explanations

  • Discretized Integrated Gradients: https://arxiv.org/abs/2108.13654

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.1.0 (2022-05-30)

  • First release on PyPI.

Download files

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

Source Distribution

ferret-xai-0.1.0.tar.gz (40.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ferret_xai-0.1.0-py2.py3-none-any.whl (45.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file ferret-xai-0.1.0.tar.gz.

File metadata

  • Download URL: ferret-xai-0.1.0.tar.gz
  • Upload date:
  • Size: 40.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.0

File hashes

Hashes for ferret-xai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e833f351f3c21ea6eb74d16c4381c9a5f0b0ca5d33ea5515af7bc1aaddb8267c
MD5 d46bab9d87fe809439601ca4bdd2ee50
BLAKE2b-256 f36d0c33a2e68163adb6834a0c84f5534626fdb6929aa1cb2498718149918240

See more details on using hashes here.

File details

Details for the file ferret_xai-0.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: ferret_xai-0.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 45.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.0

File hashes

Hashes for ferret_xai-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 cd8e468b37c8a07eb6491ac284a574ac2110942c8652281b3f7246f8bcf5b19c
MD5 b308ed1329156a03b3c680bb02c3a8bf
BLAKE2b-256 d4fe8f283ee2db16b8f35bfe7d4afd59da19fe83f08c28eec1205d5ad0f66965

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 Sentry Error logging StatusPage Status page