Screening classifier for PanelApp Australia Literature Assessment

This is a binary classifier over the title and abstract of a PubMed record. It estimates whether the record is likely to carry evidence on a gene–disease association of the kind that is curated for rare disease gene panels.

The classifier is the first stage of the retrospective path of palit (PanelApp Australia Literature Assessment), at the tag manuscript-v1. In that pipeline it reduced about 15 million PubMed records from the previous ten years to about 500,000. A large language model then assessed those abstracts and kept about 100,000 for full-text assessment.

The classifier exists to save computation. It is tuned to discard as few relevant records as possible and accepts low precision in exchange, because the language-model stage removes the false positives afterwards. It is not a diagnostic tool, it does not process patient data, and a positive score is not a curation decision.

Files

File Contents
screening_classifier_epoch3.pt Weights and decision threshold in the format that palit screen-pubmed --checkpoint reads
model.safetensors The same weights in safetensors format
screening_config.json Base model, input format, maximum length and threshold

Model

The encoder is BioClinical-ModernBERT-large. The embedding of the first token goes through one linear layer to a single logit, and a sigmoid turns the logit into a probability. The model has 395 million parameters.

The input is the title, a space, and the abstract, truncated to 1,024 tokens. A record passes the screen when its probability is at least 0.5884.

Use

With palit at the tag manuscript-v1, on a machine with a GPU and the ml extra installed:

uv run palit screen-pubmed \
    --checkpoint screening_classifier_epoch3.pt \
    --baseline-dir data/pubmed_baseline \
    --output-db data/pubmed_baseline_screening.sqlite

Without palit:

import torch
from huggingface_hub import hf_hub_download
from safetensors.torch import load_file
from transformers import AutoModel, AutoTokenizer

BASE = "thomas-sounack/BioClinical-ModernBERT-large"
THRESHOLD = 0.5884


class ScreeningClassifier(torch.nn.Module):
    def __init__(self) -> None:
        super().__init__()
        self.encoder = AutoModel.from_pretrained(BASE)
        self.classifier = torch.nn.Linear(self.encoder.config.hidden_size, 1)

    def forward(self, input_ids: torch.Tensor, attention_mask: torch.Tensor) -> torch.Tensor:
        hidden = self.encoder(input_ids=input_ids, attention_mask=attention_mask).last_hidden_state
        return self.classifier(hidden[:, 0, :]).squeeze(-1)


model = ScreeningClassifier()
weights = hf_hub_download("lgruen-vcgs/palit-screening-classifier", "model.safetensors")
model.load_state_dict(load_file(weights))
model.eval()

tokenizer = AutoTokenizer.from_pretrained(BASE)
title = "Molecular characterization of FAM222B as a novel disease gene"
abstract = "..."
encoded = tokenizer(f"{title} {abstract}", max_length=1024, truncation=True, return_tensors="pt")
with torch.no_grad():
    probability = torch.sigmoid(model(encoded["input_ids"], encoded["attention_mask"])).item()
passes_screen = probability >= THRESHOLD

Training data

The training set holds 626,581 PubMed records, each with a title and an abstract. The labels come from the language-model relevance stage of the same pipeline. That stage assesses each abstract three times, and a record counts as relevant when at least two of the three assessments say so. 4,612 records (0.74%) are relevant.

The records were split at random, stratified by label, with seed 42.

Split Records Relevant
Train (70%) 438,606 3,228
Validation (20%) 125,316 922
Test (10%) 62,659 462

Training procedure

  • Focal loss with gamma 2 and alpha 0.9926, the share of negative records in the training split
  • AdamW with a learning rate of 2e-5, linear warm-up over the first 10% of steps, then linear decay
  • Batch size 128, mixed precision (bfloat16), five epochs, seed 42
  • One NVIDIA H100 GPU, about two and a half hours for each epoch
  • After each epoch, the decision threshold was set on the validation split to the highest value that still reached 99.5% recall

The code is in src/palit/screening_classifier/ of the palit repository.

Evaluation

The published weights are from epoch 3. Results on the test split, at the threshold of 0.5884:

Measure Value
Relevant records kept 462 of 462
Not-relevant records passed 1,086 of 62,197 (1.7%)
Precision 29.8%
Share of not-relevant records removed 98.3%
PR-AUC (test) 0.80
PR-AUC (validation) 0.79

Three things limit what these figures show.

The checkpoint was chosen with the test split in view. Training kept epoch 5 automatically, as the epoch with the best validation PR-AUC (0.85 on the test split). On the test split, epoch 5 missed one relevant record and passed 1,913 not-relevant ones, and epoch 3 was chosen over it for that reason. The test results for epoch 3 are therefore somewhat optimistic.

The test split has 462 relevant records. Missing none of them is compatible with a true miss rate of up to about 0.6% (95% upper bound).

The labels are the language model's decisions, so recall here means agreement with that model, not with expert curation.

Limitations

  • The classifier inherits the judgement of the language model that labelled its training data, including that model's errors.
  • It was trained on English titles and abstracts. A record without an abstract is scored on its title alone.
  • It was built for one use, the pre-filter of this pipeline, and was not evaluated for any other.

Licence

MIT, the same licence as the base model and as the palit code.

Downloads last month

-

Downloads are not tracked for this model. How to track
Safetensors
Model size
0.4B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for lgruen-vcgs/palit-screening-classifier