Metadata-Version: 2.4
Name: papie
Version: 1.0.0
Summary: Lemmatization and tagging for historical languages, adapted from PIE / PaPie to PyTorch Lightning
Author-email: Oriane Nédey <oriane.nedey@inria.fr>
Maintainer-email: Oriane Nédey <oriane.nedey@inria.fr>
Keywords: pie,machine learning,tagging,pos,morphology,lemmatization,pytorch-lightning
Classifier: Development Status :: 1 - Planning
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Text Processing :: Linguistic
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: lightning[pytorch-extra]<2.7.0,>=2.5.0
Requires-Dist: torchmetrics<2.0.0,>=1.7.0
Requires-Dist: torch<3.0.0,>=2.4.0
Requires-Dist: pytorch_optimizer<4.0.0,>=3.3.4
Requires-Dist: tensorboard<2.21.0,>=2.19.0
Requires-Dist: transformers<5.0.0,>=4.40.0
Requires-Dist: pyarrow>=15.0.0
Requires-Dist: huggingface_hub>=0.23.0
Requires-Dist: safetensors>=0.4.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Provides-Extra: wandb
Requires-Dist: wandb<0.19,>=0.16; extra == "wandb"

# PaPie 1.0

[![tests](https://github.com/DEFI-COLaF/papie/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/DEFI-COLaF/papie/actions/workflows/tests.yml)
[![docs](https://github.com/DEFI-COLaF/papie/actions/workflows/docs.yml/badge.svg?branch=main)](https://github.com/DEFI-COLaF/papie/actions/workflows/docs.yml)
[![documentation](https://img.shields.io/badge/documentation-online-blue)](https://defi-colaf.github.io/papie/)
![python](https://img.shields.io/badge/python-3.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue)

A PyTorch-Lightning library for **lemmatization and tagging** (POS, morphology) of historical languages, the next major version of [PaPie](https://github.com/OrianeN/PaPie) (0.x), itself a fork of [Pie](https://github.com/emanjavacas/pie), rewritten on PyTorch-Lightning (`pip install papie`, `import papie`, command `papie`). Models trained with PaPie 0.x are converted with `python -m papie.scripts.convert_papie`. Nothing in it is tied to a language.

**Documentation: <https://defi-colaf.github.io/papie/>** — architecture, every option, the API reference, benchmarks and how to publish models.

- Several lemma decoders: attentional, copy/pointer, Levenshtein, masked non-autoregressive, small T5.
- Source encoders: character BiRNN, frozen ByT5, or a tiny byte-level T5 that you can distil.
- Opt-in extras: candidate (lemma/POS) features from a dictionary or analyzer, silver-data pretraining, fine-tuning and vocabulary transfer, input noise, rare-lemma upsampling, INT8 CPU inference.

```bash
pip install -e ".[dev]"
python -m papie.cli fit  -c configs/oc_lemma_pos.yaml
python -m papie.cli test -c configs/oc_lemma_pos.yaml --ckpt_path path/to/best.ckpt
python -m pytest -q
```

The documentation site is built with Hugo from `docs/site/` (`hugo --source docs/site`) and published to GitHub Pages by the `docs` workflow.

## Citation

If you use papie, please cite (GitHub's "Cite this repository" button reads [`CITATION.cff`](CITATION.cff)):

> Oriane Nédey, Rachel Bawden, Benoît Sagot and Thibault Clérice. 2026. *papie: lemmatization and tagging for historical languages* (software).

```bibtex
@software{nedey_papie,
  author = {N{\'e}dey, Oriane and Bawden, Rachel and Sagot, Beno{\^i}t and Cl{\'e}rice, Thibault},
  title  = {papie: lemmatization and tagging for historical languages},
  year   = {2026},
  note   = {Software}
}
```

## Original work

PaPie 1.x continues Pie and PaPie 0.x. If you use the architecture, please also cite the original article:

> Enrique Manjavacas, Ákos Kádár and Mike Kestemont. 2019. [Improving Lemmatization of Non-Standard Languages with Joint Learning](https://arxiv.org/abs/1903.06939). In *Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT)*, pages 1493–1503, Minneapolis, Minnesota. Association for Computational Linguistics.

```bibtex
@inproceedings{manjavacas-etal-2019-improving,
    title     = {Improving Lemmatization of Non-Standard Languages with Joint Learning},
    author    = {Manjavacas, Enrique and K{\'a}d{\'a}r, {\'A}kos and Kestemont, Mike},
    booktitle = {Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies},
    year      = {2019},
    pages     = {1493--1503},
    publisher = {Association for Computational Linguistics},
    url       = {https://arxiv.org/abs/1903.06939},
}
```
