Downloads · 30 days
7
16% of all-time downloads
Deehan1866/ps-fullymasked-structbert-large
ps-fullymasked-structbert-large is a machine learning model from Deehan1866. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Cross-encoder model for the PiC (Phrase in Context) phrase-similarity binary classification task. Both sentences — plus an LLM-generated rationale — are fed together so the model can attend across them simultaneously.
Downloads · 30 days
7
16% of all-time downloads
All-time downloads
44
Public
Parameters
335M
1.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.3 GB · 100%
From the Hugging Face model README
Cross-encoder model for the PiC (Phrase in Context) phrase-similarity binary classification task. Both sentences — plus an LLM-generated rationale — are fed together so the model can attend across them simultaneously.
bayartsogt/structbert-large
[CLS] sentence1_marked [SEP] sentence2_marked [SEP] rationale [SEP]
The target phrase is wrapped with <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.7440 |
| Test | 0.7370 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
tokenizer = AutoTokenizer.from_pretrained("Deehan1866/ps-fullymasked-structbert-large")
model = AutoModelForSequenceClassification.from_pretrained("Deehan1866/ps-fullymasked-structbert-large")
s1 = "In 1990, Petit accepted a full time overnight on <TGT>air position</TGT> at gospel radio station WYLD AM."
s2 = "In 1990, Petit accepted a full time overnight on <TGT>posture while jumping</TGT> at gospel radio station WYLD AM."
rationale = "The first phrase denotes a broadcasting role; the second describes a physical stance during a jump."
sep = tokenizer.sep_token
enc = tokenizer(s1, s2 + " " + sep + " " + rationale,
return_tensors="pt", truncation=True, max_length=512)
with torch.no_grad():
logits = model(**enc).logits
pred = torch.argmax(logits).item()
print("Similar" if pred == 1 else "Not similar")