Metadata-Version: 2.5
Name: linkingtk
Version: 0.1.1
Summary: A toolkit unifying Entity Alignment, Entity Linking, Word Sense Disambiguation and Word Sense Alignment.
Project-URL: Homepage, https://teanga.io/linkingtk/
Project-URL: Documentation, https://teanga.io/linkingtk/
Project-URL: Source, https://github.com/teangaNLP/linkingtk
Project-URL: Issues, https://github.com/teangaNLP/linkingtk/issues
Author-email: "John P. McCrae" <john@mccr.ae>
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: entity-alignment,entity-linking,knowledge-graphs,nlp,word-sense-alignment,word-sense-disambiguation
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Text Processing :: Linguistic
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: datasets>=2.19
Requires-Dist: huggingface-hub>=0.24
Requires-Dist: numpy>=1.24
Requires-Dist: peft>=0.11
Requires-Dist: pyyaml>=6.0
Requires-Dist: scikit-learn>=1.7.2
Requires-Dist: scipy>=1.15
Requires-Dist: torch>=2.1
Requires-Dist: tqdm>=4.60
Requires-Dist: transformers>=4.40
Provides-Extra: all
Requires-Dist: anthropic>=0.40; extra == 'all'
Requires-Dist: faiss-cpu>=1.8; extra == 'all'
Requires-Dist: fastapi>=0.110; extra == 'all'
Requires-Dist: gensim>=4.0; extra == 'all'
Requires-Dist: networkx>=3.0; extra == 'all'
Requires-Dist: openai>=1.50; extra == 'all'
Requires-Dist: pykeen>=1.10; extra == 'all'
Requires-Dist: python-multipart>=0.0.9; extra == 'all'
Requires-Dist: rapidfuzz>=3.14.5; extra == 'all'
Requires-Dist: rdflib>=7.0; extra == 'all'
Requires-Dist: requests>=2.31; extra == 'all'
Requires-Dist: sentence-transformers>=3.0; extra == 'all'
Requires-Dist: spacy>=3.7; extra == 'all'
Requires-Dist: uvicorn[standard]>=0.29; extra == 'all'
Requires-Dist: wn>=0.9; extra == 'all'
Provides-Extra: graph
Requires-Dist: networkx>=3.0; extra == 'graph'
Requires-Dist: rdflib>=7.0; extra == 'graph'
Provides-Extra: kge
Requires-Dist: gensim>=4.0; extra == 'kge'
Requires-Dist: networkx>=3.0; extra == 'kge'
Requires-Dist: pykeen>=1.10; extra == 'kge'
Requires-Dist: rapidfuzz>=3.14.5; extra == 'kge'
Provides-Extra: llm
Requires-Dist: anthropic>=0.40; extra == 'llm'
Requires-Dist: openai>=1.50; extra == 'llm'
Provides-Extra: nlp
Requires-Dist: spacy>=3.7; extra == 'nlp'
Provides-Extra: server
Requires-Dist: fastapi>=0.110; extra == 'server'
Requires-Dist: python-multipart>=0.0.9; extra == 'server'
Requires-Dist: uvicorn[standard]>=0.29; extra == 'server'
Provides-Extra: vector-index
Requires-Dist: faiss-cpu>=1.8; extra == 'vector-index'
Requires-Dist: sentence-transformers>=3.0; extra == 'vector-index'
Provides-Extra: wikipedia
Requires-Dist: requests>=2.31; extra == 'wikipedia'
Provides-Extra: wn
Requires-Dist: wn>=0.9; extra == 'wn'
Description-Content-Type: text/markdown

# LinkingTK

A Python toolkit that unifies four text-linking tasks behind a common
interface:

- **Entity Alignment (EA)** — matching entities between two knowledge graphs.
- **Entity Linking (EL)** — linking mentions in text to a knowledge base.
- **Word Sense Disambiguation (WSD)** — linking mentions in text to dictionary senses.
- **Word Sense Alignment (WSA)** — matching senses between two dictionaries.

See the generated documentation at
[teanga.io/linkingtk](https://teanga.io/linkingtk/) for a
Getting Started guide, the `Entity`/`BaseLinker` design (Key Concepts),
dataset references, and the full API reference.

## Installation

```bash
pip install linkingtk
# with optional extras, e.g.
pip install "linkingtk[graph,nlp,kge]"
```

Available extras: `graph`, `nlp`, `kge`, `wn`, `wikipedia`, `vector-index`,
`llm`, `server`, and `all`. See the
[installation guide](https://teanga.io/linkingtk/getting_started/#installation)
for what each one adds.

## Project layout

```
linkingtk/
├── data/                       # Local data files
├── src/linkingtk/
│   ├── core/                   # Entity, AlignmentResult, EntitySource
│   ├── sources/                 # EntitySource wrappers (wn, ...)
│   ├── blocking/                # BlockingStrategy, ExactMatch, ...
│   ├── algorithms/              # BaseLinker + ea/el/wsd/wsa submodules
│   ├── datasets/                # Dataset loaders & HF integrations
│   ├── utils/                   # NetworkX / RDFLib graph helpers
│   ├── train/                   # Trainer / CrossEncoderTrainer / TrainingArguments
│   └── eval/                    # Evaluator / EvaluationReport
├── tests/                      # Mirrors src/ layout
└── examples/                   # Runnable sample scripts
```

## Development setup

```bash
uv sync --extra graph --extra nlp --group dev
uv run pytest
uv run python examples/basic_exact_match.py
```

## Development

```bash
uv run ruff check .
uv run ruff format .
uv run mypy --strict src/linkingtk
```

## Docs

```bash
uv sync --group docs
uv run mkdocs serve   # live preview at http://127.0.0.1:8000
uv run mkdocs build --strict
```

Docs are built and deployed to GitHub Pages automatically on every push to
`main` (see `.github/workflows/docs.yml`).

## License

Apache License 2.0 — see [`LICENSE`](https://github.com/teangaNLP/linkingtk/blob/main/LICENSE).
