bhavitvyamalik
commited on
Commit
•
130d1ed
1
Parent(s):
0c06b9c
Update README.md
Browse files
README.md
CHANGED
@@ -1,20 +1,36 @@
|
|
1 |
-
---
|
2 |
-
license: mit
|
3 |
-
---
|
4 |
-
### Dataset used
|
5 |
-
[Fake and real news dataset](https://www.kaggle.com/datasets/clmentbisaillon/fake-and-real-news-dataset)
|
6 |
-
|
7 |
-
### Labels
|
8 |
-
Fake news: 1 </br>
|
9 |
-
Real news: 0
|
10 |
-
|
11 |
-
###
|
12 |
-
```
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
[Wandb project for Fake news classifier](https://wandb.ai/bhavitvya/Fake%20news%20classifier?workspace=user-bhavitvya)
|
|
|
1 |
+
---
|
2 |
+
license: mit
|
3 |
+
---
|
4 |
+
### Dataset used
|
5 |
+
[Fake and real news dataset](https://www.kaggle.com/datasets/clmentbisaillon/fake-and-real-news-dataset)
|
6 |
+
|
7 |
+
### Labels
|
8 |
+
Fake news: 1 </br>
|
9 |
+
Real news: 0
|
10 |
+
|
11 |
+
### Usage
|
12 |
+
```python
|
13 |
+
from transformers import AutoModelForSequenceClassification, AutoTokenizer, AutoConfig
|
14 |
+
import torch
|
15 |
+
|
16 |
+
config = AutoConfig.from_pretrained("bhavitvyamalik/fake-news_xtremedistil-l6-h256-uncased")
|
17 |
+
model = AutoModelForSequenceClassification.from_pretrained("bhavitvyamalik/fake-news_xtremedistil-l6-h256-uncased", config=config)
|
18 |
+
tokenizer = AutoTokenizer.from_pretrained("microsoft/xtremedistil-l6-h256-uncased", usefast=True)
|
19 |
+
|
20 |
+
text = "According to reports by Fox News, Biden is the President of the USA"
|
21 |
+
encode = tokenizer(text, max_length=512, truncation=True, padding="max_length", return_tensors="pt")
|
22 |
+
|
23 |
+
output = model(**encode)
|
24 |
+
print(torch.argmax(output["logits"]))
|
25 |
+
```
|
26 |
+
|
27 |
+
### Performance on test data
|
28 |
+
```json
|
29 |
+
'test/accuracy': 0.9977836608886719,
|
30 |
+
'test/aucroc': 0.9999998807907104,
|
31 |
+
'test/f1': 0.9976308941841125,
|
32 |
+
'test/loss': 0.00828308891505003
|
33 |
+
```
|
34 |
+
|
35 |
+
### Run can be tracked here
|
36 |
[Wandb project for Fake news classifier](https://wandb.ai/bhavitvya/Fake%20news%20classifier?workspace=user-bhavitvya)
|