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 xai-embeddings

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.2.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.2-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xaiembeddings-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 d4e91adbb1a1eba09dd818ec96ec2a369545e07e3caade7e657b3c4935ee4730
MD5 bd2af627d970e13dddd89c4c66cb21b0
BLAKE2b-256 5c9c2d67fe5d85e0c9ff01b7cf87165abfc23f136fe48898d37f93ac5da10d0b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xaiembeddings-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e33c86b7cea903e7af8903c91bf48193ffd93a775dd82980a2d5d10e2639a850
MD5 45be6631725a3b17b62c6db6a3c76e6c
BLAKE2b-256 129a0c6b42df246f2207cbf70576ac09430444ff37d87e2862758a739b78247c

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