File size: 1,293 Bytes
6a15de7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0d46682
6a15de7
 
 
 
 
 
 
 
 
 
 
 
 
 
20b871a
6a15de7
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
license: apache-2.0
language:
- en
metrics:
- accuracy: 1
- recall: 1
- f1: 1
base_model:
- distilbert/distilroberta-base
tags:
- fake-news
- text-classification
- transformers
- distilroberta
- nlp
- deep-learning
- pytorch
- huggingface
- fine-tuning
- misinformation
---
**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:
```python
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)