Add README.md
Browse files
README.md
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
tags:
|
5 |
+
- text2text-generation
|
6 |
+
license: mit
|
7 |
+
datasets:
|
8 |
+
- wikifactcheck
|
9 |
+
widget:
|
10 |
+
- text: "Little Miss Sunshine was filmed over 30 days."
|
11 |
+
---
|
12 |
+
# BART base negative claim generation model
|
13 |
+
|
14 |
+
This is a BART-based model fine-tuned for negative claim generation. This model is used in the data augmentation process described in the paper [CrossAug: A Contrastive Data Augmentation Method for Debiasing Fact Verification Models](https://arxiv.org/abs/2109.15107). The model has been fine-tuned using the parallel and opposing claims from WikiFactCheck-English dataset.
|
15 |
+
|
16 |
+
## Usage
|
17 |
+
|
18 |
+
```
|
19 |
+
import torch
|
20 |
+
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
21 |
+
|
22 |
+
model_name = 'minwhoo/bart-base-negative-claim-generation'
|
23 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
24 |
+
|
25 |
+
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
|
26 |
+
model.to('cuda' if torch.cuda.is_available() else 'cpu')
|
27 |
+
|
28 |
+
examples = [
|
29 |
+
"Little Miss Sunshine was filmed over 30 days.",
|
30 |
+
"Magic Johnson did not play for the Lakers.",
|
31 |
+
"Claire Danes is wedded to an actor from England."
|
32 |
+
]
|
33 |
+
|
34 |
+
batch = tokenizer(examples, max_length=1024, padding=True, truncation=True, return_tensors="pt")
|
35 |
+
out = model.generate(batch['input_ids'].to(model.device), num_beams=5)
|
36 |
+
negative_examples = tokenizer.batch_decode(out, skip_special_tokens=True)
|
37 |
+
print(negative_examples)
|
38 |
+
# ['Little Miss Sunshine was filmed less than 3 days.', 'Magic Johnson played for the Lakers.', 'Claire Danes is married to an actor from France.']
|
39 |
+
```
|
40 |
+
|
41 |
+
## Citation
|
42 |
+
|
43 |
+
```
|
44 |
+
@inproceedings{lee2021crossaug,
|
45 |
+
title={CrossAug: A Contrastive Data Augmentation Method for Debiasing Fact Verification Models},
|
46 |
+
author={Minwoo Lee and Seungpil Won and Juae Kim and Hwanhee Lee and Cheoneum Park and Kyomin Jung},
|
47 |
+
booktitle={Proceedings of the 30th ACM International Conference on Information & Knowledge Management},
|
48 |
+
publisher={Association for Computing Machinery},
|
49 |
+
series={CIKM '21},
|
50 |
+
year={2021}
|
51 |
+
}
|
52 |
+
```
|