Views
No views yet
<s> Jerome_phrase </s></s> Candidate_phrase </s>1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4# Load model and tokenizer
5tokenizer = AutoTokenizer.from_pretrained("julian-schelb/philberta-class-lat-intertext-v2")
6model = AutoModelForSequenceClassification.from_pretrained("julian-schelb/philberta-class-lat-intertext-v2")
7
8# Define your sentence pair
9sentence1 = "omnia fert aetas, animum quoque; saepe ego longos cantando puerum memini me condere soles."
10sentence2 = "saepe ego longos cantando puerum memini me condere soles."
11
12# Tokenize the sentence pair for the model
13inputs = tokenizer(
14 sentence1, # Hieronymus
15 sentence2, # Classical author
16 add_special_tokens=True,
17 truncation=True,
18 padding="max_length",
19 return_tensors='pt'
20 )
21
22# Run the model in evaluation mode (no gradient calculation)
23with torch.no_grad():
24 outputs = model(**inputs)
25 probs = torch.nn.functional.softmax(outputs.logits, dim=-1)
26 # probs[0][1] corresponds to the probability of "citation", if binary labels are 0="no citation", 1="citation"
27 print("Prediction probabilities:", probs)1@misc{schelb2026locisimilesbenchmarkextracting,
2 title={Loci Similes: A Benchmark for Extracting Intertextualities in Latin Literature},
3 author={Julian Schelb and Michael Wittweiler and Marie Revellio and Barbara Feichtinger and Andreas Spitz},
4 year={2026},
5 eprint={2601.07533},
6 archivePrefix={arXiv},
7 primaryClass={cs.IR},
8 url={https://arxiv.org/abs/2601.07533},
9}