Downloads · 30 days
27
20% of all-time downloads
tommibazzo01/factuality-classifier-pubmedbert-ClaimBased
factuality-classifier-pubmedbert-ClaimBased is a text classification model from tommibazzo01. Use it when you need a label for a piece of text. The card lists the license as mit.
This model is a fine-tuned version of PubMedBERT (microsoft/BiomedNLP-BiomedBERT-base-uncased-abstract-fulltext), designed to classify the factuality of medical documents. It was developed as the core factuality estim…
Downloads · 30 days
27
20% of all-time downloads
All-time downloads
137
Public
Repo size
438 MB
Likes
0
Public
Click a slice to open those files.
.h5438 MB · 100%
From the Hugging Face model README
This model is a fine-tuned version of PubMedBERT (microsoft/BiomedNLP-BiomedBERT-base-uncased-abstract-fulltext), designed to classify the factuality of medical documents. It was developed as the core factuality estimation component for FRAG (Factuality-aware Retrieval-Augmented Generation), a multidimensional RAG framework that retrieves external knowledge based on both topical relevance and factual reliability.
The classifier evaluates whether a medical text takes a correct scientific stance toward the medical claims it contains, acting as a safeguard against medical misinformation in LLM-based question answering.
1 = Factual, 0 = Non-Factual)microsoft/BiomedNLP-BiomedBERT-base-uncased-abstract-fulltextIntended Use: This model is intended to be used as a re-ranking or filtering component within a Retrieval-Augmented Generation (RAG) pipeline in the healthcare domain. Given a retrieved medical document, it predicts whether the document's content aligns with verified scientific truth.
Limitations:
The model was fine-tuned on a custom "Claim-Based Dataset" derived from the Monant Medical Misinformation Dataset. Specifically, the data relies on Monant's Type 6 annotations, which cross-reference the cited medical claim, the article's stance, and the claim's actual scientific veracity.
To ensure the highest data quality, a strict zero-tolerance policy was adopted: an article is labeled as 'Factual' (Class 1) only if it maintains a correct stance toward every single claim it contains. The presence of just one incorrect association leads to the classification of the whole document as 'Non-Factual' (Class 0).
The final dataset consists of 14,696 perfectly balanced records:
The model was trained using TensorFlow/Keras with the following hyperparameters:
val_loss, patience=5, restoring best weights)Note: During training, divergence between training and validation loss was observed starting from the third epoch, indicating the onset of overfitting. The Early Stopping mechanism successfully intervened, restoring the model configuration with the highest generalization capability.
Evaluated on the unseen test set (2,940 articles), the model demonstrated a strong ability to capture the subtle semantic discrepancies that distinguish factual medical claims from misinformation.
Confusion Matrix Breakdown:
You can easily load and use this model via the Hugging Face transformers library. The model takes the raw HTML-cleaned text of the medical article as input.
import tensorflow as tf
from transformers import AutoTokenizer, TFAutoModelForSequenceClassification
# Load tokenizer and model
tokenizer = AutoTokenizer.from_pretrained("tommibazzo01/factuality-classifier-pubmedbert-ClaimBased")
model = TFAutoModelForSequenceClassification.from_pretrained("tommibazzo01/factuality-classifier-pubmedbert-ClaimBased")
# Example medical article text
article_text = "Extensive scientific research has proven that there is no link between vaccines and autism."
# Tokenize
inputs = tokenizer(
article_text,
return_tensors="tf",
truncation=True,
padding=True,
max_length=512
)
# Predict
outputs = model(inputs)
predicted_class = tf.argmax(outputs.logits, axis=1).numpy()[0]
labels = {0: "Non-Factual", 1: "Factual"}
print(f"Prediction: {labels[predicted_class]}")