Downloads · 30 days
23
28% of all-time downloads
JusperLee/referential-dangling-detector
referential-dangling-detector is a text classification model from JusperLee. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
This is the sentence-pair dependency detector released with Relevant but Incomplete: Referential Dangling as a Paradigm-Level Failure Mode in Hard Prompt Compression.
Downloads · 30 days
23
28% of all-time downloads
All-time downloads
81
Public
Parameters
109M
438 MB on disk
Likes
3
Public
Click a slice to open those files.
.safetensors438 MB · 100%
From the Hugging Face model README
This is the sentence-pair dependency detector released with Relevant but Incomplete: Referential Dangling as a Paradigm-Level Failure Mode in Hard Prompt Compression.
Project page: https://cslikai.cn/Referential-Dangling/
The model scores whether a candidate sentence supplies a necessary dependency for a retained sentence, conditioned on the question. It is used by the repository's automatic context-restoration experiments.
Zhengpei Hu<sup>1,∗</sup>, Kai Li<sup>2,∗</sup>, Dapeng Fu<sup>3</sup>, Xuechao Zou<sup>2</sup>, Yuanhao Tang<sup>1</sup>, Yue Li<sup>1</sup>, Tengfei Cao<sup>1</sup>, and Jianqiang Huang<sup>1,†</sup>
google-bert/bert-base-uncasedNOT_DEPENDENCY (0), DEPENDENCY (1)retained sentence [SEP] candidate support [SEP] questionTraining pairs were constructed from the HotpotQA training split. Positive pairs contain a retained sentence and a missing gold-support sentence that share a discriminative entity. Negatives include entity-overlapping hard negatives and unrelated deleted sentences. Splitting is grouped by source example to prevent sentence pairs from the same example appearing in both the training and validation partitions.
See src/build_train_tight.py and src/train_detector.py in the
Referential-Dangling repository
for the data construction and training code.
import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer
model_id = "JusperLee/referential-dangling-detector"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(model_id).eval()
retained = "The film was directed by Jane Smith."
candidate = "Jane Smith is a Canadian filmmaker."
question = "What nationality is the film's director?"
text = f"{retained} [SEP] {candidate} [SEP] {question}"
inputs = tokenizer(text, truncation=True, max_length=256, return_tensors="pt")
with torch.no_grad():
probability = model(**inputs).logits.softmax(dim=-1)[0, 1].item()
print(probability)
For the paper's restoration pipeline, use BertDependencyDetector from
src/beaver2_bert.py.
This checkpoint is intended for research on dependency loss and automatic support restoration in compressed English QA contexts. It is not a general factuality, entailment, or coreference model. Its predictions depend on the candidate-generation procedure and may not transfer reliably to other domains, languages, or substantially different compression settings without evaluation.
@misc{referentialdangling,
title={Relevant but Incomplete: Referential Dangling as a Paradigm-Level Failure Mode in Hard Prompt Compression},
author={Zhengpei Hu and Kai Li and Dapeng Fu and Xuechao Zou and Yuanhao Tang and Yue Li and Tengfei Cao and Jianqiang Huang},
note={Research code and model release}
}