E5-small Latin Intertextuality Embedding Model (v2)
This model is a fine-tuned version of intfloat/multilingual-e5-small for generating embeddings of Latin texts to detect intertextual relationships.
The model is part of the Loci Similes benchmark setup (Schelb et al., 2026), evaluated on expert-verified Latin intertextual links. It is designed to work with the LociSimiles Python package API: https://julianschelb.github.io/locisimiles/api/
Model Description
- Task: Sentence embedding for detecting intertextual links between classical Latin authors
- Model type: Sentence Transformer (Embedding Model)
- Base model: intfloat/multilingual-e5-small
- Loss: online contrastive loss
- Training data: one of five cross-validation splits of the Loci Similes benchmark
- Language: Latin
- License: Apache 2.0
Relation to v1
This replaces julian-schelb/multilingual-e5-small-emb-lat-intertext-v1, which was trained for
the first version of the paper on an earlier revision of the dataset. The task and
the interface are unchanged, so v2 is a drop-in replacement; v1 stays available
for reproducing the earlier results.
Usage
This model was trained with prompt prefixes and should be used with the matching prompt names, otherwise retrieval quality drops noticeably:
prompt_name="query"for query texts (Jerome), corresponding to a"Query: "prefixprompt_name="match"for candidate texts (classical authors), corresponding to a"Candidate: "prefix
from sentence_transformers import SentenceTransformer
from sentence_transformers.util import cos_sim
model = SentenceTransformer("julian-schelb/multilingual-e5-small-emb-lat-intertext-v2")
# Jerome text and candidates (1 positive match, 2 unrelated)
queries = [
"omnia fert aetas, animum quoque; saepe ego longos cantando puerum memini me condere soles."
]
candidates = [
"saepe ego longos cantando puerum memini me condere soles.", # positive match
"Gallia est omnis divisa in partes tres", # unrelated (Caesar)
"in nova fert animus mutatas dicere formas", # unrelated (Ovid)
]
query_embeddings = model.encode(queries, prompt_name="query")
candidate_embeddings = model.encode(candidates, prompt_name="match")
scores = cos_sim(query_embeddings, candidate_embeddings)
print(scores)
print(f"Best candidate: {scores[0].argmax().item()}")
In a retrieval pipeline, embed the corpus once with prompt_name="match" and each
query with prompt_name="query", then rank by cosine similarity. Retrieval is
typically followed by a classification model — see the
*-3class-lat-intertext-v1 classifiers in the same collection.
Citation
@misc{schelb2026locisimilesbenchmarkextracting,
title={Loci Similes: A Benchmark for Extracting Intertextualities in Latin Literature},
author={Julian Schelb and Michael Wittweiler and Marie Revellio and Barbara Feichtinger and Andreas Spitz},
year={2026},
eprint={2601.07533},
archivePrefix={arXiv},
primaryClass={cs.IR},
url={https://arxiv.org/abs/2601.07533},
}