Downloads · 30 days
13
32% of all-time downloads
YerayEsp/FakeBERTa
FakeBERTa is a text classification model from YerayEsp. 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.
FakeBerta: A Fine-Tuned DistilRoBERTa Model for Fake News Detection
Downloads · 30 days
13
32% of all-time downloads
All-time downloads
41
Public
Repo size
657 MB
Likes
0
Public
Click a slice to open those files.
.bin329 MB · 99%
From the Hugging Face model README
FakeBerta: A Fine-Tuned DistilRoBERTa Model for Fake News Detection
You can check the model's fine-tuning code on my GitHub.
Model Overview
FakeBerta is a fine-tuned version of DistilRoBERTa for detecting fake news. The model is trained to classify news articles as real (0) or fake (1) using natural language processing (NLP) techniques. Base Model: DistilRoBERTa Task: Fake news classification
Example of code using AutoModelForSequenceCalssification:
from transformers import AutoModelForSequenceClassification, AutoTokenizer
import torch
model_name = "YerayEsp/FakeBerta"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
inputs = tokenizer("Breaking: Scientists discover water on Mars!", return_tensors="pt")
outputs = model(**inputs)
logits = outputs.logits
predicted_class = torch.argmax(logits).item()
print(f"Predicted class: {predicted_class}") # 0 = Real, 1 = Fake
Library: Transformers (Hugging Face)