A
3-class cross-encoder for systematic review screening that classifies query-document pairs as
Relevant,
Partial, or
Irrelevant. Designed to rerank candidates from the
siren-screening-biencoder.
1from sentence_transformers import CrossEncoder
2
3model = CrossEncoder("Praise2112/siren-screening-crossencoder")
4
5# Pairs of (query, document)
6pairs = [
7 ("RCTs of aspirin in diabetic adults", "A randomized trial of aspirin in 5,000 diabetic patients showed..."),
8 ("RCTs of aspirin in diabetic adults", "This cohort study examined statin use in elderly populations..."),
9]
10
11# Get 3-class scores
12scores = model.predict(pairs)
13print(scores)
14# Output: array([[ 0.02, 0.15, 0.83], # Relevant
15# [ 0.91, 0.07, 0.02]]) # Irrelevant
1import torch
2from transformers import AutoTokenizer, AutoModelForSequenceClassification
3
4tokenizer = AutoTokenizer.from_pretrained("Praise2112/siren-screening-crossencoder")
5model = AutoModelForSequenceClassification.from_pretrained("Praise2112/siren-screening-crossencoder")
6
7query = "RCTs of aspirin in diabetic adults"
8document = "A randomized trial of aspirin in 5,000 diabetic patients showed reduced MI risk..."
9
10inputs = tokenizer(
11 query, document,
12 padding=True,
13 truncation=True,
14 max_length=768,
15 return_tensors="pt"
16)
17
18with torch.no_grad():
19 outputs = model(**inputs)
20 probs = torch.softmax(outputs.logits, dim=-1)
21
22print(f"Irrelevant: {probs[0, 0]:.3f}")
23print(f"Partial: {probs[0, 1]:.3f}")
24print(f"Relevant: {probs[0, 2]:.3f}")
25
26# Get predicted label
27label_id = probs.argmax().item()
28labels = {0: "Irrelevant", 1: "Partial", 2: "Relevant"}
29print(f"Prediction: {labels[label_id]}")
1def rerank_score(probs):
2 """Convert 3-class probs to ranking score.
3
4 Higher score = more relevant.
5 Partial gets partial credit (1x), Relevant gets full credit (2x).
6 """
7 return probs[1] + 2 * probs[2] # P(Partial) + 2 * P(Relevant)
8
9# Example
10probs = [0.02, 0.15, 0.83] # [Irrelevant, Partial, Relevant]
11score = rerank_score(probs) # 0.15 + 2 * 0.83 = 1.81
General-purpose rerankers like
BGE actually hurt performance on screening queries because they're optimized for topical relevance, not criteria matching.
1@misc{oketola2026siren,
2 title={SIREN: Improving Systematic Review Screening with Synthetic Training Data for Neural Retrievers},
3 author={Praise Oketola},
4 year={2026},
5 howpublished={\url{https://huggingface.co/Praise2112/siren-screening-crossencoder}},
6 note={Cross-encoder model}
7}