Text Classification
Transformers
ONNX
Safetensors
Transformers.js
English
roberta
fake-news-detection
misinformation
fact-checking
liar
Eval Results (legacy)
text-embeddings-inference
Instructions to use emonHasan01/liar-roberta with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use emonHasan01/liar-roberta with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="emonHasan01/liar-roberta")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("emonHasan01/liar-roberta") model = AutoModelForSequenceClassification.from_pretrained("emonHasan01/liar-roberta", device_map="auto") - Transformers.js
How to use emonHasan01/liar-roberta with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-classification', 'emonHasan01/liar-roberta'); - Notebooks
- Google Colab
- Kaggle
RoBERTa fine-tuned on LIAR + evaluation, charts, model card
Browse files- README.md +237 -0
- assets/baselines.png +0 -0
- assets/calibration.png +0 -0
- assets/confusion-matrix.png +0 -0
- assets/per-class.png +0 -0
- assets/threshold.png +0 -0
- config.json +36 -0
- model.safetensors +3 -0
- results.json +257 -0
- tokenizer.json +0 -0
- tokenizer_config.json +17 -0
README.md
ADDED
|
@@ -0,0 +1,237 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
license: mit
|
| 4 |
+
library_name: transformers
|
| 5 |
+
pipeline_tag: text-classification
|
| 6 |
+
base_model: roberta-base
|
| 7 |
+
base_model_relation: finetune
|
| 8 |
+
tags:
|
| 9 |
+
- text-classification
|
| 10 |
+
- fake-news-detection
|
| 11 |
+
- misinformation
|
| 12 |
+
- fact-checking
|
| 13 |
+
- roberta
|
| 14 |
+
- liar
|
| 15 |
+
datasets:
|
| 16 |
+
- liar
|
| 17 |
+
metrics:
|
| 18 |
+
- accuracy
|
| 19 |
+
- f1
|
| 20 |
+
model-index:
|
| 21 |
+
- name: liar-roberta
|
| 22 |
+
results:
|
| 23 |
+
- task:
|
| 24 |
+
type: text-classification
|
| 25 |
+
name: Fake news detection
|
| 26 |
+
dataset:
|
| 27 |
+
name: LIAR
|
| 28 |
+
type: liar
|
| 29 |
+
split: test
|
| 30 |
+
metrics:
|
| 31 |
+
- type: accuracy
|
| 32 |
+
value: 0.6446
|
| 33 |
+
- type: f1
|
| 34 |
+
name: Macro F1
|
| 35 |
+
value: 0.6351
|
| 36 |
+
widget:
|
| 37 |
+
- text: "The moon landing was filmed in a Hollywood studio."
|
| 38 |
+
- text: "The unemployment rate fell to 3.8 percent last quarter."
|
| 39 |
+
---
|
| 40 |
+
|
| 41 |
+
# liar-roberta
|
| 42 |
+
|
| 43 |
+
**A binary classifier that labels a short political statement as REAL or FAKE.**
|
| 44 |
+
Full fine-tune of [`roberta-base`](https://huggingface.co/roberta-base) on
|
| 45 |
+
[LIAR](https://huggingface.co/datasets/liar), the PolitiFact fact-check corpus.
|
| 46 |
+
|
| 47 |
+
On the LIAR test split it reaches **64.5% accuracy and 0.6351 macro-F1**, clearly ahead of
|
| 48 |
+
a TF-IDF + logistic regression baseline trained on the same data (0.6025 macro-F1).
|
| 49 |
+
Every number on this page comes from the single run that produced these weights; the raw
|
| 50 |
+
values are in [`results.json`](results.json).
|
| 51 |
+
|
| 52 |
+
```python
|
| 53 |
+
from transformers import pipeline
|
| 54 |
+
clf = pipeline("text-classification", model="emonHasan01/liar-roberta")
|
| 55 |
+
clf("The moon landing was filmed in a Hollywood studio.")
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
## Label scheme
|
| 59 |
+
|
| 60 |
+
LIAR ships six truthfulness classes, collapsed here into two:
|
| 61 |
+
|
| 62 |
+
| Binary label | LIAR classes |
|
| 63 |
+
|---|---|
|
| 64 |
+
| `REAL` (0) | true, mostly-true |
|
| 65 |
+
| `FAKE` (1) | false, half-true, barely-true, pants-fire |
|
| 66 |
+
|
| 67 |
+
Worth flagging: LIAR's integer label order is **not** sorted by truthfulness
|
| 68 |
+
(`4 = barely-true` and `5 = pants-fire` are the two least truthful, not the most).
|
| 69 |
+
A fair amount of published code treats them as the truthful end and inverts the whole
|
| 70 |
+
task. This model resolves the mapping from the dataset's label *names*, never indices.
|
| 71 |
+
|
| 72 |
+
The collapse leaves the data imbalanced — 460 REAL against 823 FAKE in the
|
| 73 |
+
test split — so training used class-weighted cross-entropy and the checkpoint was chosen
|
| 74 |
+
on macro-F1 rather than accuracy.
|
| 75 |
+
|
| 76 |
+
## Results
|
| 77 |
+
|
| 78 |
+

|
| 79 |
+
|
| 80 |
+
| | Accuracy | Macro F1 | F1 (FAKE) | Precision (FAKE) | Recall (FAKE) | ROC AUC |
|
| 81 |
+
|---|---|---|---|---|---|---|
|
| 82 |
+
| Majority class | 0.6415 | 0.3908 | — | — | — | — |
|
| 83 |
+
| TF-IDF + LogReg | 0.6220 | 0.6025 | 0.6905 | 0.7272 | 0.6574 | 0.6496 |
|
| 84 |
+
| **RoBERTa (this model)** | **0.6446** | **0.6351** | **0.6940** | **0.7751** | **0.6282** | **0.6959** |
|
| 85 |
+
|
| 86 |
+
The majority-class row is there on purpose. Accuracy alone on this dataset says very
|
| 87 |
+
little, since always answering FAKE already scores 0.6415.
|
| 88 |
+
|
| 89 |
+

|
| 90 |
+
|
| 91 |
+
## Where it succeeds and fails
|
| 92 |
+
|
| 93 |
+
Accuracy across the six original LIAR classes, before the binary collapse:
|
| 94 |
+
|
| 95 |
+

|
| 96 |
+
|
| 97 |
+
| LIAR class | Mapped to | n | Accuracy | Mean P(FAKE) |
|
| 98 |
+
|---|---|---|---|---|
|
| 99 |
+
| false | FAKE | 250 | 0.652 | 0.586 |
|
| 100 |
+
| half-true | FAKE | 267 | 0.532 | 0.534 |
|
| 101 |
+
| mostly-true | REAL | 249 | 0.663 | 0.456 |
|
| 102 |
+
| true | REAL | 211 | 0.687 | 0.449 |
|
| 103 |
+
| barely-true | FAKE | 214 | 0.668 | 0.594 |
|
| 104 |
+
| pants-fire | FAKE | 92 | 0.750 | 0.639 |
|
| 105 |
+
|
| 106 |
+
The ends of the scale are separable; the middle is not. `half-true` and `mostly-true`
|
| 107 |
+
differ by an editorial judgement that is largely unrecoverable from 18 words of text,
|
| 108 |
+
and the model's scores reflect that.
|
| 109 |
+
|
| 110 |
+
### Most confident mistakes
|
| 111 |
+
|
| 112 |
+
| LIAR class | True | Predicted | Confidence | Statement |
|
| 113 |
+
|---|---|---|---|---|
|
| 114 |
+
| true | REAL | FAKE | 0.90 | "Obama has more czars than the Romanovs." |
|
| 115 |
+
| true | REAL | FAKE | 0.88 | The words subhuman mongrel, which Ted Nugent called President Barack Obama, were used by the Na |
|
| 116 |
+
| mostly-true | REAL | FAKE | 0.88 | Obama-Nelson economic record: Job creation ... at slowest post-recession rate since Great Depre |
|
| 117 |
+
|
| 118 |
+
Of 456 errors, 150 are real statements flagged as fake and 306 are fake
|
| 119 |
+
statements let through.
|
| 120 |
+
|
| 121 |
+
## Choosing a threshold
|
| 122 |
+
|
| 123 |
+
P(FAKE) is exposed, so the 0.5 cutoff is a starting point rather than a verdict:
|
| 124 |
+
|
| 125 |
+

|
| 126 |
+
|
| 127 |
+
| Threshold | Precision (FAKE) | Recall (FAKE) | F1 | Share flagged |
|
| 128 |
+
|---|---|---|---|---|
|
| 129 |
+
| 0.20 | 0.642 | 1.000 | 0.782 | 99.9% |
|
| 130 |
+
| 0.30 | 0.669 | 0.939 | 0.782 | 90.0% |
|
| 131 |
+
| 0.40 | 0.733 | 0.785 | 0.758 | 68.7% |
|
| 132 |
+
| 0.50 | 0.775 | 0.628 | 0.694 | 52.0% |
|
| 133 |
+
| 0.60 | 0.796 | 0.485 | 0.603 | 39.0% |
|
| 134 |
+
| 0.70 | 0.835 | 0.301 | 0.443 | 23.1% |
|
| 135 |
+
| 0.80 | 0.884 | 0.139 | 0.239 | 10.1% |
|
| 136 |
+
|
| 137 |
+
At threshold 0.65 precision reaches 0.811, with recall falling to 0.385.
|
| 138 |
+
|
| 139 |
+
## Is the confidence meaningful?
|
| 140 |
+
|
| 141 |
+

|
| 142 |
+
|
| 143 |
+
Expected calibration error is **0.042** over 10 bins. Points below the diagonal mean
|
| 144 |
+
overconfidence: when the model says 0.9 it is right less often than 90% of the time.
|
| 145 |
+
Treat the score as a ranking signal, not as a probability of being lied to.
|
| 146 |
+
|
| 147 |
+
## Usage
|
| 148 |
+
|
| 149 |
+
```python
|
| 150 |
+
import torch
|
| 151 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 152 |
+
|
| 153 |
+
tok = AutoTokenizer.from_pretrained("emonHasan01/liar-roberta")
|
| 154 |
+
model = AutoModelForSequenceClassification.from_pretrained("emonHasan01/liar-roberta")
|
| 155 |
+
|
| 156 |
+
inputs = tok("Your statement here", return_tensors="pt", truncation=True, max_length=128)
|
| 157 |
+
with torch.no_grad():
|
| 158 |
+
probs = model(**inputs).logits.softmax(-1)[0]
|
| 159 |
+
print("P(REAL)", probs[0].item(), "P(FAKE)", probs[1].item())
|
| 160 |
+
```
|
| 161 |
+
|
| 162 |
+
### Longer documents
|
| 163 |
+
|
| 164 |
+
The model saw statements of about 22 tokens and has a 128-token window. Feeding
|
| 165 |
+
a whole article truncates it. Chunk and average instead:
|
| 166 |
+
|
| 167 |
+
```python
|
| 168 |
+
def classify_long(text, tok, model, chunk_words=60):
|
| 169 |
+
w = text.split()
|
| 170 |
+
chunks = [" ".join(w[i:i+chunk_words]) for i in range(0, len(w), chunk_words)] or [text]
|
| 171 |
+
enc = tok(chunks[:32], return_tensors="pt", truncation=True, padding=True, max_length=128)
|
| 172 |
+
with torch.no_grad():
|
| 173 |
+
p = model(**enc).logits.softmax(-1).mean(0)
|
| 174 |
+
return {"REAL": p[0].item(), "FAKE": p[1].item()}
|
| 175 |
+
```
|
| 176 |
+
|
| 177 |
+
Results on full articles are out of distribution either way — see Limitations.
|
| 178 |
+
|
| 179 |
+
## Training
|
| 180 |
+
|
| 181 |
+
| | |
|
| 182 |
+
|---|---|
|
| 183 |
+
| Base model | `roberta-base`, 125M parameters, all trained |
|
| 184 |
+
| Objective | Class-weighted cross-entropy (weights 1.41, 0.78) |
|
| 185 |
+
| Max length | 128 tokens |
|
| 186 |
+
| Learning rate | 2e-5, AdamW, 10% warmup |
|
| 187 |
+
| Batch size | 16 |
|
| 188 |
+
| Epochs | 3, best checkpoint by validation macro-F1 |
|
| 189 |
+
| Weight decay | 0.01 |
|
| 190 |
+
| Seed | 42 |
|
| 191 |
+
| Hardware | Tesla T4 |
|
| 192 |
+
| Training time | ~5 minutes |
|
| 193 |
+
|
| 194 |
+
Statement length in the training set: median 22 tokens, 95th percentile
|
| 195 |
+
40, so a 128-token window truncates almost nothing.
|
| 196 |
+
|
| 197 |
+
## Limitations
|
| 198 |
+
|
| 199 |
+
Please read this section before using the model for anything that matters.
|
| 200 |
+
|
| 201 |
+
- **It does not check facts.** There is no retrieval and no knowledge base. The model
|
| 202 |
+
learns lexical and stylistic patterns that correlate with a PolitiFact verdict. A false
|
| 203 |
+
claim written in the register of a true one gets through, which the confident-mistakes
|
| 204 |
+
table above shows directly.
|
| 205 |
+
- **The domain is narrow.** Short US political statements, roughly 2007–2016, selected
|
| 206 |
+
for fact-checking by PolitiFact. It has not learned to judge full news articles,
|
| 207 |
+
scientific claims, health advice, or non-US or non-political content, and accuracy
|
| 208 |
+
there is unmeasured and probably much worse.
|
| 209 |
+
- **The binary collapse discards information.** Grouping `half-true` with `pants-fire`
|
| 210 |
+
throws away most of the distinction the annotators recorded.
|
| 211 |
+
- **It inherits PolitiFact's selection.** Which speakers and claims get fact-checked at
|
| 212 |
+
all is an editorial decision, absorbed here along with the labels.
|
| 213 |
+
- **It is overconfident** (ECE 0.042). Do not read the softmax score as a probability.
|
| 214 |
+
- **Temporal drift.** Names, events, and political vocabulary have moved on since the
|
| 215 |
+
corpus was collected.
|
| 216 |
+
- **The ceiling is low, and that is expected.** LIAR is a hard benchmark and published
|
| 217 |
+
binary results sit broadly in this range. A very high accuracy on LIAR usually means a
|
| 218 |
+
label-mapping bug or a leak rather than a better model.
|
| 219 |
+
|
| 220 |
+
Do not use this as an automated arbiter of truth, for moderation at scale, or in any
|
| 221 |
+
decision affecting a person without a human reading the output.
|
| 222 |
+
|
| 223 |
+
## Citation
|
| 224 |
+
|
| 225 |
+
```bibtex
|
| 226 |
+
@inproceedings{wang2017liar,
|
| 227 |
+
title = {"Liar, Liar Pants on Fire": A New Benchmark Dataset for Fake News Detection},
|
| 228 |
+
author = {Wang, William Yang},
|
| 229 |
+
booktitle = {Proceedings of ACL},
|
| 230 |
+
year = {2017}
|
| 231 |
+
}
|
| 232 |
+
```
|
| 233 |
+
|
| 234 |
+
## Reproducing
|
| 235 |
+
|
| 236 |
+
Everything on this page — training, both baselines, all five charts and this card — comes
|
| 237 |
+
from one Colab notebook run on a Tesla T4. No metric was typed in by hand.
|
assets/baselines.png
ADDED
|
assets/calibration.png
ADDED
|
assets/confusion-matrix.png
ADDED
|
assets/per-class.png
ADDED
|
assets/threshold.png
ADDED
|
config.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_cross_attention": false,
|
| 3 |
+
"architectures": [
|
| 4 |
+
"RobertaForSequenceClassification"
|
| 5 |
+
],
|
| 6 |
+
"attention_probs_dropout_prob": 0.1,
|
| 7 |
+
"bos_token_id": 0,
|
| 8 |
+
"classifier_dropout": null,
|
| 9 |
+
"dtype": "float32",
|
| 10 |
+
"eos_token_id": 2,
|
| 11 |
+
"hidden_act": "gelu",
|
| 12 |
+
"hidden_dropout_prob": 0.1,
|
| 13 |
+
"hidden_size": 768,
|
| 14 |
+
"id2label": {
|
| 15 |
+
"0": "REAL",
|
| 16 |
+
"1": "FAKE"
|
| 17 |
+
},
|
| 18 |
+
"initializer_range": 0.02,
|
| 19 |
+
"intermediate_size": 3072,
|
| 20 |
+
"is_decoder": false,
|
| 21 |
+
"label2id": {
|
| 22 |
+
"FAKE": 1,
|
| 23 |
+
"REAL": 0
|
| 24 |
+
},
|
| 25 |
+
"layer_norm_eps": 1e-05,
|
| 26 |
+
"max_position_embeddings": 514,
|
| 27 |
+
"model_type": "roberta",
|
| 28 |
+
"num_attention_heads": 12,
|
| 29 |
+
"num_hidden_layers": 12,
|
| 30 |
+
"pad_token_id": 1,
|
| 31 |
+
"tie_word_embeddings": true,
|
| 32 |
+
"transformers_version": "5.19.0",
|
| 33 |
+
"type_vocab_size": 1,
|
| 34 |
+
"use_cache": false,
|
| 35 |
+
"vocab_size": 50265
|
| 36 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ba129a3b629e9ba1f56912e728b00eda36e164ccde6d5275b4c39b805aae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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model": {
|
| 3 |
+
"accuracy": 0.6445830085736555,
|
| 4 |
+
"macro_f1": 0.6350839549911429,
|
| 5 |
+
"f1_fake": 0.6939597315436241,
|
| 6 |
+
"precision_fake": 0.775112443778111,
|
| 7 |
+
"recall_fake": 0.6281895504252734,
|
| 8 |
+
"roc_auc": 0.6959308468487506
|
| 9 |
+
},
|
| 10 |
+
"baseline_majority": {
|
| 11 |
+
"accuracy": 0.6414653156664069,
|
| 12 |
+
"macro_f1": 0.39078822412155745,
|
| 13 |
+
"f1_fake": 0.7815764482431149,
|
| 14 |
+
"precision_fake": 0.6414653156664069,
|
| 15 |
+
"recall_fake": 1.0
|
| 16 |
+
},
|
| 17 |
+
"baseline_tfidf_logreg": {
|
| 18 |
+
"accuracy": 0.6219797349961029,
|
| 19 |
+
"macro_f1": 0.6025029496631283,
|
| 20 |
+
"f1_fake": 0.6904913848117422,
|
| 21 |
+
"precision_fake": 0.7271505376344086,
|
| 22 |
+
"recall_fake": 0.6573511543134872,
|
| 23 |
+
"roc_auc": 0.6495694437107086
|
| 24 |
+
},
|
| 25 |
+
"confusion_matrix": [
|
| 26 |
+
[
|
| 27 |
+
310,
|
| 28 |
+
150
|
| 29 |
+
],
|
| 30 |
+
[
|
| 31 |
+
306,
|
| 32 |
+
517
|
| 33 |
+
]
|
| 34 |
+
],
|
| 35 |
+
"ece": 0.04245237071162911,
|
| 36 |
+
"per_class": [
|
| 37 |
+
{
|
| 38 |
+
"label_name": "false",
|
| 39 |
+
"n": 250,
|
| 40 |
+
"accuracy": 0.652,
|
| 41 |
+
"mean_p_fake": 0.5863052606582642,
|
| 42 |
+
"binary": "FAKE"
|
| 43 |
+
},
|
| 44 |
+
{
|
| 45 |
+
"label_name": "half-true",
|
| 46 |
+
"n": 267,
|
| 47 |
+
"accuracy": 0.5318352059925093,
|
| 48 |
+
"mean_p_fake": 0.5340710878372192,
|
| 49 |
+
"binary": "FAKE"
|
| 50 |
+
},
|
| 51 |
+
{
|
| 52 |
+
"label_name": "mostly-true",
|
| 53 |
+
"n": 249,
|
| 54 |
+
"accuracy": 0.6626506024096386,
|
| 55 |
+
"mean_p_fake": 0.45594820380210876,
|
| 56 |
+
"binary": "REAL"
|
| 57 |
+
},
|
| 58 |
+
{
|
| 59 |
+
"label_name": "true",
|
| 60 |
+
"n": 211,
|
| 61 |
+
"accuracy": 0.6872037914691943,
|
| 62 |
+
"mean_p_fake": 0.44890156388282776,
|
| 63 |
+
"binary": "REAL"
|
| 64 |
+
},
|
| 65 |
+
{
|
| 66 |
+
"label_name": "barely-true",
|
| 67 |
+
"n": 214,
|
| 68 |
+
"accuracy": 0.6682242990654206,
|
| 69 |
+
"mean_p_fake": 0.5944609642028809,
|
| 70 |
+
"binary": "FAKE"
|
| 71 |
+
},
|
| 72 |
+
{
|
| 73 |
+
"label_name": "pants-fire",
|
| 74 |
+
"n": 92,
|
| 75 |
+
"accuracy": 0.75,
|
| 76 |
+
"mean_p_fake": 0.6390070915222168,
|
| 77 |
+
"binary": "FAKE"
|
| 78 |
+
}
|
| 79 |
+
],
|
| 80 |
+
"thresholds": [
|
| 81 |
+
{
|
| 82 |
+
"threshold": 0.05,
|
| 83 |
+
"precision": 0.6414653156664069,
|
| 84 |
+
"recall": 1.0,
|
| 85 |
+
"f1": 0.7815764482431149,
|
| 86 |
+
"accuracy": 0.6414653156664069,
|
| 87 |
+
"flagged_rate": 1.0
|
| 88 |
+
},
|
| 89 |
+
{
|
| 90 |
+
"threshold": 0.1,
|
| 91 |
+
"precision": 0.6414653156664069,
|
| 92 |
+
"recall": 1.0,
|
| 93 |
+
"f1": 0.7815764482431149,
|
| 94 |
+
"accuracy": 0.6414653156664069,
|
| 95 |
+
"flagged_rate": 1.0
|
| 96 |
+
},
|
| 97 |
+
{
|
| 98 |
+
"threshold": 0.15,
|
| 99 |
+
"precision": 0.6414653156664069,
|
| 100 |
+
"recall": 1.0,
|
| 101 |
+
"f1": 0.7815764482431149,
|
| 102 |
+
"accuracy": 0.6414653156664069,
|
| 103 |
+
"flagged_rate": 1.0
|
| 104 |
+
},
|
| 105 |
+
{
|
| 106 |
+
"threshold": 0.2,
|
| 107 |
+
"precision": 0.641965678627145,
|
| 108 |
+
"recall": 1.0,
|
| 109 |
+
"f1": 0.7819477434679335,
|
| 110 |
+
"accuracy": 0.642244738893219,
|
| 111 |
+
"flagged_rate": 0.9992205767731879
|
| 112 |
+
},
|
| 113 |
+
{
|
| 114 |
+
"threshold": 0.25,
|
| 115 |
+
"precision": 0.649164677804296,
|
| 116 |
+
"recall": 0.991494532199271,
|
| 117 |
+
"f1": 0.7846153846153846,
|
| 118 |
+
"accuracy": 0.6508183943881528,
|
| 119 |
+
"flagged_rate": 0.9797349961028838
|
| 120 |
+
},
|
| 121 |
+
{
|
| 122 |
+
"threshold": 0.3,
|
| 123 |
+
"precision": 0.6692640692640692,
|
| 124 |
+
"recall": 0.9392466585662211,
|
| 125 |
+
"f1": 0.78159757330637,
|
| 126 |
+
"accuracy": 0.6632891660171473,
|
| 127 |
+
"flagged_rate": 0.9002338269680437
|
| 128 |
+
},
|
| 129 |
+
{
|
| 130 |
+
"threshold": 0.35,
|
| 131 |
+
"precision": 0.7057057057057057,
|
| 132 |
+
"recall": 0.8566221142162819,
|
| 133 |
+
"f1": 0.7738748627881449,
|
| 134 |
+
"accuracy": 0.6788776305533905,
|
| 135 |
+
"flagged_rate": 0.7786438035853468
|
| 136 |
+
},
|
| 137 |
+
{
|
| 138 |
+
"threshold": 0.4,
|
| 139 |
+
"precision": 0.7332576617480137,
|
| 140 |
+
"recall": 0.7849331713244229,
|
| 141 |
+
"f1": 0.7582159624413145,
|
| 142 |
+
"accuracy": 0.6788776305533905,
|
| 143 |
+
"flagged_rate": 0.686671862821512
|
| 144 |
+
},
|
| 145 |
+
{
|
| 146 |
+
"threshold": 0.45,
|
| 147 |
+
"precision": 0.7464239271781534,
|
| 148 |
+
"recall": 0.6974483596597812,
|
| 149 |
+
"f1": 0.7211055276381909,
|
| 150 |
+
"accuracy": 0.6539360872954014,
|
| 151 |
+
"flagged_rate": 0.5993764614185503
|
| 152 |
+
},
|
| 153 |
+
{
|
| 154 |
+
"threshold": 0.5,
|
| 155 |
+
"precision": 0.775112443778111,
|
| 156 |
+
"recall": 0.6281895504252734,
|
| 157 |
+
"f1": 0.6939597315436241,
|
| 158 |
+
"accuracy": 0.6445830085736555,
|
| 159 |
+
"flagged_rate": 0.5198752922837101
|
| 160 |
+
},
|
| 161 |
+
{
|
| 162 |
+
"threshold": 0.55,
|
| 163 |
+
"precision": 0.7837370242214533,
|
| 164 |
+
"recall": 0.5504252733900364,
|
| 165 |
+
"f1": 0.6466809421841542,
|
| 166 |
+
"accuracy": 0.6141855027279813,
|
| 167 |
+
"flagged_rate": 0.4505066250974279
|
| 168 |
+
},
|
| 169 |
+
{
|
| 170 |
+
"threshold": 0.6,
|
| 171 |
+
"precision": 0.7964071856287425,
|
| 172 |
+
"recall": 0.4848116646415553,
|
| 173 |
+
"f1": 0.6027190332326284,
|
| 174 |
+
"accuracy": 0.5900233826968043,
|
| 175 |
+
"flagged_rate": 0.39049103663289164
|
| 176 |
+
},
|
| 177 |
+
{
|
| 178 |
+
"threshold": 0.65,
|
| 179 |
+
"precision": 0.8107416879795396,
|
| 180 |
+
"recall": 0.38517618469015796,
|
| 181 |
+
"f1": 0.5222405271828665,
|
| 182 |
+
"accuracy": 0.5479345284489477,
|
| 183 |
+
"flagged_rate": 0.3047544816835542
|
| 184 |
+
},
|
| 185 |
+
{
|
| 186 |
+
"threshold": 0.7,
|
| 187 |
+
"precision": 0.835016835016835,
|
| 188 |
+
"recall": 0.30133657351154314,
|
| 189 |
+
"f1": 0.44285714285714284,
|
| 190 |
+
"accuracy": 0.5136399064692128,
|
| 191 |
+
"flagged_rate": 0.23148869836321123
|
| 192 |
+
},
|
| 193 |
+
{
|
| 194 |
+
"threshold": 0.75,
|
| 195 |
+
"precision": 0.8564356435643564,
|
| 196 |
+
"recall": 0.21020656136087484,
|
| 197 |
+
"f1": 0.3375609756097561,
|
| 198 |
+
"accuracy": 0.47077162899454406,
|
| 199 |
+
"flagged_rate": 0.15744349181605613
|
| 200 |
+
},
|
| 201 |
+
{
|
| 202 |
+
"threshold": 0.8,
|
| 203 |
+
"precision": 0.8837209302325582,
|
| 204 |
+
"recall": 0.1385176184690158,
|
| 205 |
+
"f1": 0.23949579831932774,
|
| 206 |
+
"accuracy": 0.4356975837879969,
|
| 207 |
+
"flagged_rate": 0.10054559625876851
|
| 208 |
+
},
|
| 209 |
+
{
|
| 210 |
+
"threshold": 0.85,
|
| 211 |
+
"precision": 0.873015873015873,
|
| 212 |
+
"recall": 0.06682867557715674,
|
| 213 |
+
"f1": 0.12415349887133183,
|
| 214 |
+
"accuracy": 0.3951675759937646,
|
| 215 |
+
"flagged_rate": 0.049103663289166016
|
| 216 |
+
},
|
| 217 |
+
{
|
| 218 |
+
"threshold": 0.9,
|
| 219 |
+
"precision": 1.0,
|
| 220 |
+
"recall": 0.014580801944106925,
|
| 221 |
+
"f1": 0.02874251497005988,
|
| 222 |
+
"accuracy": 0.36788776305533905,
|
| 223 |
+
"flagged_rate": 0.009353078721745909
|
| 224 |
+
},
|
| 225 |
+
{
|
| 226 |
+
"threshold": 0.95,
|
| 227 |
+
"precision": 0.0,
|
| 228 |
+
"recall": 0.0,
|
| 229 |
+
"f1": 0.0,
|
| 230 |
+
"accuracy": 0.35853468433359315,
|
| 231 |
+
"flagged_rate": 0.0
|
| 232 |
+
}
|
| 233 |
+
],
|
| 234 |
+
"label_map": {
|
| 235 |
+
"false": 1,
|
| 236 |
+
"half-true": 1,
|
| 237 |
+
"mostly-true": 0,
|
| 238 |
+
"true": 0,
|
| 239 |
+
"barely-true": 1,
|
| 240 |
+
"pants-fire": 1
|
| 241 |
+
},
|
| 242 |
+
"config": {
|
| 243 |
+
"base_model": "roberta-base",
|
| 244 |
+
"max_len": 128,
|
| 245 |
+
"epochs": 3,
|
| 246 |
+
"lr": 2e-05,
|
| 247 |
+
"batch_size": 16,
|
| 248 |
+
"seed": 42,
|
| 249 |
+
"class_weights": [
|
| 250 |
+
1.4071,
|
| 251 |
+
0.7756
|
| 252 |
+
],
|
| 253 |
+
"train_minutes": 5.5,
|
| 254 |
+
"hardware": "Tesla T4",
|
| 255 |
+
"data_source": "hub:ucsbnlp/liar"
|
| 256 |
+
}
|
| 257 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": "<s>",
|
| 5 |
+
"cls_token": "<s>",
|
| 6 |
+
"eos_token": "</s>",
|
| 7 |
+
"errors": "replace",
|
| 8 |
+
"is_local": false,
|
| 9 |
+
"local_files_only": false,
|
| 10 |
+
"mask_token": "<mask>",
|
| 11 |
+
"model_max_length": 512,
|
| 12 |
+
"pad_token": "<pad>",
|
| 13 |
+
"sep_token": "</s>",
|
| 14 |
+
"tokenizer_class": "RobertaTokenizer",
|
| 15 |
+
"trim_offsets": true,
|
| 16 |
+
"unk_token": "<unk>"
|
| 17 |
+
}
|