Views
No views yet
microsoft/deberta-v3-large[CLS] sentence1_marked [SEP] sentence2_marked [SEP] rationale [SEP]<TGT>phrase</TGT> using substring
matching against the raw sentence (whole-word boundaries preferred,
case-insensitive fallback), since PS phrases can be multi-word and
have no explicit position column in the source dataset.| Split | Accuracy |
|---|---|
| Validation | 0.7950 |
| Test | 0.7875 |
1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4tokenizer = AutoTokenizer.from_pretrained("Deehan1866/ps-fullymasked-deberta-v3-large-no_rationale")
5model = AutoModelForSequenceClassification.from_pretrained("Deehan1866/ps-fullymasked-deberta-v3-large-no_rationale")
6
7s1 = "In 1990, Petit accepted a full time overnight on <TGT>air position</TGT> at gospel radio station WYLD AM."
8s2 = "In 1990, Petit accepted a full time overnight on <TGT>posture while jumping</TGT> at gospel radio station WYLD AM."
9rationale = "The first phrase denotes a broadcasting role; the second describes a physical stance during a jump."
10
11sep = tokenizer.sep_token
12enc = tokenizer(s1, s2 + " " + sep + " " + rationale,
13 return_tensors="pt", truncation=True, max_length=512)
14with torch.no_grad():
15 logits = model(**enc).logits
16pred = torch.argmax(logits).item()
17print("Similar" if pred == 1 else "Not similar")