Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,47 @@
|
|
1 |
---
|
2 |
license: mit
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: mit
|
3 |
+
pipeline_tag: text-classification
|
4 |
---
|
5 |
+
# roberta-nei-fact-check
|
6 |
+
|
7 |
+
This is a machine learning model trained for text classification using the Roberta architecture and a tokenizer. The purpose of this model is to identify whether a given claim with evidence contains enough information to make a fact-checking decision.
|
8 |
+
|
9 |
+
## Model Details
|
10 |
+
|
11 |
+
The model was trained using the Adam optimizer with a learning rate of 2-4e, an epsilon of 1-8, and a weight decay of 2-8e. The training data consisted mainly of the Fever and Hover datasets, with a small sample of created data. The model returns two labels:
|
12 |
+
|
13 |
+
- 0: Enough information
|
14 |
+
- 1: Not enough information
|
15 |
+
|
16 |
+
The model uses a tokenizer for text classification and requires input in the form of a claim with evidence. This means that the input should be a text string containing both the claim and the evidence to provide best result.
|
17 |
+
|
18 |
+
## Usage
|
19 |
+
|
20 |
+
To use this model, you can load it into your Python code using a library such as PyTorch or TensorFlow. You can then pass in a claim with evidence string and the model will return a label indicating whether there is enough information in the claim with evidence for fact-checking.
|
21 |
+
|
22 |
+
Here is an example of how to use the model in PyTorch:
|
23 |
+
|
24 |
+
```python
|
25 |
+
import torch
|
26 |
+
from transformers import RobertaTokenizer, RobertaForSequenceClassification
|
27 |
+
|
28 |
+
# Load the tokenizer and model
|
29 |
+
tokenizer = RobertaTokenizer.from_pretrained('Dzeniks/roberta-nei-fact-check')
|
30 |
+
model = RobertaForSequenceClassification.from_pretrained('Dzeniks/roberta-nei-fact-check')
|
31 |
+
|
32 |
+
# Define the claim with evidence to classify
|
33 |
+
claim = "Albert Einstein work in the field of computer science"
|
34 |
+
evidence = "Albert Einstein was a German-born theoretical physicist, widely acknowledged to be one of the greatest and most influential physicists of all time."
|
35 |
+
|
36 |
+
# Tokenize the claim with evidence
|
37 |
+
x = tokenizer.encode_plus(claim, evidence, return_tensors="pt")
|
38 |
+
|
39 |
+
model.eval()
|
40 |
+
with torch.no_grad():
|
41 |
+
prediction = model(**x)
|
42 |
+
|
43 |
+
label = torch.argmax(outputs[0]).item()
|
44 |
+
|
45 |
+
print(f"Label: {label}")
|
46 |
+
```
|
47 |
+
In this example, the claim_with_evidence variable contains the claim with evidence to classify. The claim with evidence is tokenized using the tokenizer and converted to a tensor. The model is then used to classify the claim with evidence and the resulting label is printed to the console.
|