Downloads · 30 days
13
3% of all-time downloads
weijiang99/clinvarbert
clinvarbert is a text classification model from weijiang99. 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.
A BERT-based model fine-tuned for clinical variant interpretation and pathogenicity classification, built upon BioBERT-Large. ClinVarBERT is designed to understand the nuanced biomedical language used in variant descr…
Downloads · 30 days
13
3% of all-time downloads
All-time downloads
374
Public
Parameters
108M
867 MB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors433 MB · 100%
From the Hugging Face model README
A BERT-based model fine-tuned for clinical variant interpretation and pathogenicity classification, built upon BioBERT-Large.
ClinVarBERT is designed to understand the nuanced biomedical language used in variant descriptions and clinical genetics reports.
ClinVarBERT-Large is a domain-specific transformer model fine-tuned from BioBERT-Large for the task of genetic variant interpretation.
It is trained to capture subtle linguistic patterns in ClinVar submissions and related clinical genetics texts, enabling accurate classification of variant pathogenicity.
ClinVarBERT can be directly applied to:
| Class ID | Label | Description |
|---|---|---|
| 0 | P/LP | Pathogenic or Likely Pathogenic |
| 1 | VUS | Variant of Uncertain Significance |
| 2 | B/LB | Benign or Likely Benign |
from transformers import pipeline
# Load the pipeline
pipe = pipeline("text-classification", model="weijiang99/clinvarbert")
# Example text
text = "This missense variant in exon 5 of the BRCA1 gene has been observed in multiple families with breast cancer."
# Predict
result = pipe(text)
print(result)
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
# Load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("weijiang99/clinvarbert")
model = AutoModelForSequenceClassification.from_pretrained("weijiang99/clinvarbert")
# Input text
text = "This variant was reported as likely benign in multiple submissions."
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
# Inference
with torch.no_grad():
outputs = model(**inputs)
probs = torch.nn.functional.softmax(outputs.logits, dim=-1)
predicted_class_id = torch.argmax(probs, dim=-1).item()
predicted_label = model.config.id2label[predicted_class_id]
print(f"Predicted label: {predicted_label}")
print(f"Probabilities: {probs}")