A Python library to simplify handling causality in natural language: extraction, training extraction models, unified datasets, and storing/querying results as causal graphs.
What is this?
causalatee covers the full lifecycle of working with causality in text:
- Datasets — causality corpora, converted into one consistent HuggingFace-compatible schema
across three standardized tasks:
- Causality Detection — does a sentence express a causal relation at all?
- Causal Candidate Extraction — which spans in a sentence are causes/effects?
- Causality Identification — given two marked spans, does a causal relation hold between them?
causalatee.models— batch-callabletyping.Protocolinterfaces (Detection,CandidateExtraction,PairwiseIdentification,Identification,Extraction) that any conforming model (rule-based, HuggingFace, or otherwise) satisfies with zero inheritance, pluscompose_extractionto build an end-to-end extractor from the three sub-tasks.causalatee.graph— a typedGraph/Node/Edgeinterface with several interchangeable backends: an eager CauseNet loader, CGF (a compact, memory-mappable on-disk format), a CausalBank Cause-Effect Graph loader, andSQLGraph, a generic mutable graph you build yourself viaadd_node/add_edge.causalatee.mining— a streaming, concurrency-aware pipeline (source -> flat_map -> filter -> map -> map -> reduce) that turns a corpus of raw documents into an aggregated causal graph, without materializing the corpus in memory.causalatee.nn/causalatee.integrations— a biaffine span-grid extraction head, and ready-made HuggingFacePipeline/ PyTorch Lightning integrations for the three tasks above.
See causalatee.webis.de for the full documentation, including the dataset inventory, task/model reference, and runnable example notebooks.
Installation
pip install causalatee
Optional extras pull in dependencies for specific pieces: huggingface (fine-tuning/inference
pipelines), baselines (dependency-parse baselines), mining (the corpus-mining pipeline), and
docs (building this documentation locally).
Quick start
Every converted dataset is a standard HuggingFace dataset, indexed by task:
from datasets import load_dataset
dataset = load_dataset("thagen/CausalNewsCorpus", "causality identification")
See the Datasets page for the full list, and the Examples notebooks for fine-tuning a model, building a causal graph, and mining one from a raw corpus.
Development
pip install -e ".[tests]"
ruff check .
mypy -p causalatee
pytest
Building the Documentation
pip install -e ".[docs]"
mkdocs serve # live-reloading local server
mkdocs build # static site written to site/
Metadata
Release files for causalatee 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| causalatee-0.0.5.tar.gz | 937.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| causalatee-0.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.9 MB
Release files / causalatee-0.0.5.tar.gz
| Download URL | causalatee-0.0.5.tar.gz |
|---|---|
| Size | 937.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d00db3c4c6696a4f718e5c2d7d48b826e058bb4de9d825d592219b588c55c7d4
|
|
BLAKE2b-256 checksum How to use checksums |
455bbe090453caca3259136eb4cac0b97a5736465803c2c5013cd2dcf7a021d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.
Transparency logRelease files / causalatee-0.0.5-py3-none-any.whl
| Download URL | causalatee-0.0.5-py3-none-any.whl |
|---|---|
| Size | 991.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
24f18ec100e3fd0108b888e3e9d3b4edd0fb0f9fee98ec4b4c2ca55b73bb783f
|
|
BLAKE2b-256 checksum How to use checksums |
5db2920d10fba97a083961602e3439fed4b72e8e3ae379eb9079b7cdec48147f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.
Transparency log