File size: 1,064 Bytes
503c388
f3d8559
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
## Lie Detector (RoBERTa)

This model is a fine-tuned version of **roberta-base** on the **LIAR dataset**, a benchmark for political fact-checking introduced in ["Liar, Liar Pants on Fire"](https://arxiv.org/abs/1705.00648) (Wang, 2017).

It classifies political statements into six categories: pants-fire, false, barely-true, half-true, mostly-true, true.

Alongside the statement, the model uses:
* Context and subjects
* Metadata: speaker, party, state (as embeddings)
* Numerical features**: historical counts of truthfulness

### Results

* **Test Accuracy (six-way classification)**: 40.5%
* **Original paper accuracy**: 27.4%

### Example

```python
label = lie_detector(
    statement="We’ve added more jobs than any time in history.",
    subjects="economy,jobs",
    speaker_name="Joe Biden",
    speaker_title="President",
    state="delaware",
    party_affiliation="democrat",
    history_barely_true=14,
    history_false=12,
    history_half_true=24,
    history_mostly_true=21,
    history_pants_fire=5,
    context_location="CNN Town Hall"
)
```