Examples¶
The examples/ directory contains Jupyter notebooks with runnable
nlp-shap workflows. They complement guides, theory pages, and the API
reference.
Setup¶
Install the package:
pip install nlp-shap
From a local clone:
make install
Use the project .venv as the notebook kernel when working from source.
Notebooks¶
Each row links to the rendered walkthrough in these docs. Use Source to
open the .ipynb on GitHub or browse the full catalog in
examples/README.md.
Notebook |
What it demonstrates |
Source |
|---|---|---|
Shapley and Banzhaf aggregators on majority vs additive games;
|
||
Token partition, delete/pad/neutral absence policies,
|
||
Run archive persistence, coalition dedup keys, hot LRU cache, and async
|
||
|
||
Eight-player benchmark (cap ≤ 20) plus five-player fraction sweep 0.1–0.5, MC bias analysis, multi-seed L1 vs exact Shapley. CPU-only. |
||
Mock exact explain run with |
||
Refund-policy prompt explained with LM Studio and transformers backends on
the same model id, then visualized with
|