Skip to main content

A Python package for explainable AI embeddings analysis with perturbation-based methods.

Project description

XAI Embeddings

A Python package for explainable AI (XAI) embeddings analysis, using perturbation based explanation methods for transformer-based models. Explanations show how tokens influence position of each other.

Installation

pip install xaiembeddings

Requirements for POS-PFI

  • Spacy Model: path to spacy model e.g.: en_core_web_trf
  • Part-of-speech Dictionary: dictionary with list of words for permutations.

Available Explainers

  • AttentionExplainer: Uses attention weights to explain token importance
  • LOOExplainer: Leave-one-out analysis
  • POSPermutationExplainer: Part-of-speech based permutation analysis
  • SubsetExplainer: Subset-based explanation generation

Models

  • BERTModel: BERT bert-base-uncased with embedding extraction
  • Model: Abstract base class for custom model implementations

Examples:

Sample usage was provided in examples.ipynb

License

This project is licensed under the MIT License.

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

xaiembeddings-0.1.3.tar.gz (2.0 MB view details)

Uploaded Source

Built Distribution

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

xaiembeddings-0.1.3-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file xaiembeddings-0.1.3.tar.gz.

File metadata

  • Download URL: xaiembeddings-0.1.3.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for xaiembeddings-0.1.3.tar.gz
Algorithm Hash digest
SHA256 94da35befea4c14e6753d12d2d36b234a78864cde000c8857918e5cedd984df6
MD5 e9087829ffb8a6915dffdb7647f96c05
BLAKE2b-256 df455ada0c505a96fcd554988dfd19f576a35fd51ec26e0875bd5647fff4a0d5

See more details on using hashes here.

File details

Details for the file xaiembeddings-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: xaiembeddings-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for xaiembeddings-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8d036a1ccf06a8955c8518c8522afbc895cec16df46aecd12374a38721e317fa
MD5 cb4bd65009de029b822a139c5447f3db
BLAKE2b-256 4f1785e39b4fa441c65ee4e8598b52f206470bf34a6f843a5206d84adc62d2df

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