Metadata-Version: 2.4
Name: nlp-shap
Version: 0.1.3
Summary: Multimodal explainability tool for NLP based on Shapley value.
Keywords: explainability,llms,multimodal,nlp,shapley-value,xai
Author: Paweł Pozorski
Author-email: Paweł Pozorski <pozorski.paul@gmail.com>
License-Expression: Apache-2.0
License-File: LICENSE
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Dist: logging518>=1.0.0,<2.0.0
Requires-Dist: numpy>=2.0.0,<3.0.0
Requires-Dist: pydantic>=2.11.0,<3.0.0
Requires-Dist: pyyaml>=6.0.2,<7.0.0
Maintainer: Paweł Pozorski
Maintainer-email: Paweł Pozorski <pozorski.paul@gmail.com>
Requires-Python: >=3.12, <3.13
Project-URL: Homepage, https://github.com/Pawlo77/nlp-shap
Project-URL: Documentation, https://pawlo77.github.io/nlp-shap/
Project-URL: Repository, https://github.com/Pawlo77/nlp-shap
Project-URL: Issues, https://github.com/Pawlo77/nlp-shap/issues
Description-Content-Type: text/markdown

<div align="center">
  <h1>📦 nlp-shap</h1>
  <p><strong>Multimodal explainability for NLP and multimodal models based on Shapley-style cooperative game theory.</strong></p>
  <p>
    <a href="https://pypi.org/project/nlp-shap/"><img src="https://img.shields.io/pypi/v/nlp-shap.svg" alt="PyPI"></a>
    <a href="https://pypi.org/project/nlp-shap/"><img src="https://img.shields.io/pypi/pyversions/nlp-shap.svg" alt="Python"></a>
    <a href="https://pawlo77.github.io/nlp-shap/"><img src="https://img.shields.io/badge/docs-GitHub%20Pages-blue" alt="Documentation"></a>
    <a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-blue.svg" alt="License"></a>
  </p>
</div>

## Installation

```bash
pip install nlp-shap
```

From source:

```bash
git clone https://github.com/Pawlo77/nlp-shap
cd nlp-shap
make install
```

Requires Python 3.12 and [uv](https://docs.astral.sh/uv/).

## Documentation

Full documentation: **[pawlo77.github.io/nlp-shap](https://pawlo77.github.io/nlp-shap/)**

- [Getting started](https://pawlo77.github.io/nlp-shap/guides/getting_started.html)
- [User guide — estimands](https://pawlo77.github.io/nlp-shap/guides/estimands.html)
- [User guide — masking](https://pawlo77.github.io/nlp-shap/guides/masking.html)
- [Examples (notebooks)](https://pawlo77.github.io/nlp-shap/examples.html)
- [API reference](https://pawlo77.github.io/nlp-shap/api.html)

## Examples

Runnable **Jupyter notebooks** in [`examples/`](examples/):

| Notebook | What it demonstrates |
|----------|----------------------|
| [`estimands_toy_game.ipynb`](examples/estimands_toy_game.ipynb) | Shapley vs Banzhaf aggregators, coalition weights, labelled results, manifests, plugin entry points |
| [`masking_views.ipynb`](examples/masking_views.ipynb) | Token partitioning, absence policies, masked views, mask codec, mask space, plugin registry |

Setup and details: [`examples/README.md`](examples/README.md). Embedded walkthroughs: [docs/examples](https://pawlo77.github.io/nlp-shap/examples.html).

## Development

```bash
make install
make check
```

Run `make help` for other targets.

## License

Apache License 2.0. See [LICENSE](LICENSE).

Copyright 2026 Paweł Pozorski.
