Safetensors
modernbert

Encoder model that predicts a difference score for every token in a text pair. Example prediction:

Text A He
0.051
now
0.061
works
0.535
in
0.184
London
0.804
.
0.022
Text B Er
0.040
lebt
0.253
jetzt
0.055
in
0.091
Berlin
0.852
.
0.023

The model was trained on Wikimatrix pairs that were annotated with GPT 5.6 Terra. The dataset is found here: https://huggingface.co/datasets/jvamvas/sensidiff-wikimatrix

Code for reproducing the example is below. Note that the model was only trained to label the second text. To obtain labels for Text A, you would need to do a second pass with the texts swapped.

from transformers import AutoTokenizer, AutoModelForTokenClassification

model_id = "jvamvas/sensidiff-base"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForTokenClassification.from_pretrained(model_id)

text_a = "He now works in London."
text_b = "Er lebt jetzt in Berlin."

# The model labels the second text in the input pair.
inputs = tokenizer(text_a, text_b, return_tensors="pt")
scores = model(**inputs).logits[0, :, 0].sigmoid().tolist()

print("| Token | Difference score |")
print("| --- | ---: |")
for token, side, score in zip(inputs.tokens(), inputs.sequence_ids(), scores):
    if side == 1:
        print(f"| {token} | {score:.3f} |")
Downloads last month
-
Safetensors
Model size
0.3B params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for ZurichNLP/sensidiff-base

Finetuned
(209)
this model

Dataset used to train ZurichNLP/sensidiff-base