Skip to main content

Retexo

CI Docs Dataset License: MIT

Word-level explanations of text reuse in Latin literature.

When a later author quotes or alludes to an earlier one, the interesting question is how the source was reworked. Retexo answers it word by word: it aligns every word of the reusing passage to the source word it takes up, or to none, and names the operation behind each link, such as a copy, a change of inflection, or a substitution. The result is an edit script: a set of labeled links between two passages that a philologist can read and contest.

Retexo learns these scripts from very little annotation. Synthetic pairs, built by applying known operations to Latin text, teach a pointer network the task before a single pair is annotated, and active learning chooses the few pairs an annotator corrects.

Quick start

pip install "retexo @ git+https://github.com/julianschelb/retexo"

Read the predictions, with the Hugging Face datasets library:

from datasets import load_dataset

scripts = load_dataset("julian-schelb/latin-classical-intertextuality-edit-scripts", split="fold_4")
pair = scripts[0]

for link in pair["links"]:
    print(pair["reuse"]["tokens"][link["reuse"]], "<-", pair["source"]["tokens"][link["source"]], link["label"])

Convert the raw predictions of a run into the same format:

retexo export runs/f0/predictions.jsonl runs/f1/predictions.jsonl runs/f2/predictions.jsonl \
              runs/f3/predictions.jsonl runs/f4/predictions.jsonl --out export/ --format parquet

Labels

Label Meaning
COPY the same form, spelling variants folded
INFLECT the same lemma in another form
SUBST another lemma in the same slot, optionally with a named relation such as a synonym
SPLIT, MERGE two reuse words for one source word, or one for two
INS, FRAME, DEL an unlinked reuse word, a word of a citing formula, an unclaimed source word

See the documentation for the conventions.

Repository layout

src/retexo/         the package: model, generator, active learning, baselines, scorer
src/retexo_gui/     Gradio demo and annotation app (gui extra)
tests/              pytest suite
examples/           notebooks on the operations, the generator, the passage class and the decoder
docs/               documentation (MkDocs)
webapp/             the review app (React, Vite), published under /demo/

The experiments behind the paper live in a separate repository that installs retexo as a dependency.

Development

pip install -e ".[dev,lexical]"
pytest
mkdocs serve

See docs/development.md.

Authors

Julian Schelb (University of Konstanz), Michael Wittweiler (University of Zurich), Marie Revellio (University of Konstanz).

License

MIT

Metadata

Release files for retexo 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for retexo 0.1.0
File Size Uploaded
retexo-0.1.0.tar.gz 414.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for retexo 0.1.0
File Interpreter ABI Platform
retexo-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 903.4 kB

Release files / retexo-0.1.0.tar.gz

Download URL retexo-0.1.0.tar.gz
Size 414.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c2e85595a95e8c3467be255550d598fa688f623d72eae0cfc9ca3cc36c512351
BLAKE2b-256 checksum
How to use checksums
a210570850f8b1ee33a2416154e257ea1319a9f148fcf711b3f7f8df1c9f6189
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 4, 2026.

Transparency log

Release files / retexo-0.1.0-py3-none-any.whl

Download URL retexo-0.1.0-py3-none-any.whl
Size 488.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f11fec5cbaa613af962817879cd3eddb709a01a0dc40fd5a35b61d1033305987
BLAKE2b-256 checksum
How to use checksums
d9fbbbe3b3abba3bdeb725554ec0b6e0252bf93ebefbf7ac3709251d390bbb57
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 4, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page