Upload folder using huggingface_hub
Browse files- README.md +57 -1
- config.json +72 -0
- merges.txt +0 -0
- pytorch_model.bin +3 -0
- special_tokens_map.json +51 -0
- tokenizer_config.json +66 -0
- vocab.json +0 -0
README.md
CHANGED
@@ -1,3 +1,59 @@
|
|
1 |
---
|
2 |
-
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
language: en
|
3 |
+
tags:
|
4 |
+
- table-fact-checking
|
5 |
+
datasets:
|
6 |
+
- tabfact
|
7 |
---
|
8 |
+
|
9 |
+
# ReasTAP
|
10 |
+
|
11 |
+
ReasTAP is a table reasoning model proposed in the EMNLP 2022 paper [ReasTAP: Injecting Table Reasoning Skills During Pre-training via Synthetic Reasoning Examples](https://arxiv.org/pdf/2210.12374.pdf). The original Github repository is [https://github.com/Yale-LILY/ReasTAP](https://github.com/Yale-LILY/ReasTAP).
|
12 |
+
|
13 |
+
## Description
|
14 |
+
|
15 |
+
`Yale-LILY/reastap-large-finetuned-tabfact` is initialized with `Yale-LILY/reastap-large` and finetuned on [TabFact](https://huggingface.co/datasets/tab_fact).
|
16 |
+
|
17 |
+
## Usage
|
18 |
+
|
19 |
+
```python
|
20 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
21 |
+
import pandas as pd
|
22 |
+
|
23 |
+
tokenizer = AutoTokenizer.from_pretrained("Yale-LILY/reastap-large-finetuned-tabfact")
|
24 |
+
model = AutoModelForSequenceClassification.from_pretrained("Yale-LILY/reastap-large-finetuned-tabfact")
|
25 |
+
|
26 |
+
data = {
|
27 |
+
"year": [1896, 1900, 1904, 2004, 2008, 2012],
|
28 |
+
"city": ["athens", "paris", "st. louis", "athens", "beijing", "london"]
|
29 |
+
}
|
30 |
+
table = pd.DataFrame.from_dict(data)
|
31 |
+
|
32 |
+
query = "beijing hosts the olympic games in 2012"
|
33 |
+
encoding = tokenizer(table=table, query=query, return_tensors="pt")
|
34 |
+
|
35 |
+
outputs = model(**encoding)
|
36 |
+
output_id = int(outputs.logits[0].argmax(dim=0))
|
37 |
+
print(model.config.id2label[output_id])
|
38 |
+
```
|
39 |
+
|
40 |
+
## Reference
|
41 |
+
|
42 |
+
```bibtex
|
43 |
+
@inproceedings{zhao-etal-2022-reastap,
|
44 |
+
title = "{R}eas{TAP}: Injecting Table Reasoning Skills During Pre-training via Synthetic Reasoning Examples",
|
45 |
+
author = "Zhao, Yilun and
|
46 |
+
Nan, Linyong and
|
47 |
+
Qi, Zhenting and
|
48 |
+
Zhang, Rui and
|
49 |
+
Radev, Dragomir",
|
50 |
+
booktitle = "Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing",
|
51 |
+
month = dec,
|
52 |
+
year = "2022",
|
53 |
+
address = "Abu Dhabi, United Arab Emirates",
|
54 |
+
publisher = "Association for Computational Linguistics",
|
55 |
+
url = "https://aclanthology.org/2022.emnlp-main.615",
|
56 |
+
pages = "9006--9018",
|
57 |
+
abstract = "Reasoning over tabular data requires both table structure understanding and a broad set of table reasoning skills. Current models with table-specific architectures and pre-training methods perform well on understanding table structures, but they still struggle with tasks that require various table reasoning skills. In this work, we develop ReasTAP to show that high-level table reasoning skills can be injected into models during pre-training without a complex table-specific architecture design. We define 7 table reasoning skills, such as numerical operation, temporal comparison, and conjunction. Each reasoning skill is associated with one example generator, which synthesizes questions over semi-structured tables according to the sampled templates. We model the table pre-training task as a sequence generation task and pre-train ReasTAP to generate precise answers of the synthetic examples. ReasTAP is evaluated on four benchmarks covering three downstream tasks including 1) WikiSQL-Weak and WikiTQ for Table Question Answering, 2) TabFact for Table Fact Verification, and 3) LogicNLG for Faithful Table-to-Text Generation. Experimental results demonstrate that ReasTAP achieves new state-of-the-art results on all of them and delivers a significant improvement under low-resource setting. Our code is publicly available at https://github.com/Yale-LILY/ReasTAP.",
|
58 |
+
}
|
59 |
+
```
|
config.json
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "Yale-LILY/reastap-large-finetuned-tabfact",
|
3 |
+
"activation_dropout": 0.1,
|
4 |
+
"activation_function": "gelu",
|
5 |
+
"add_bias_logits": false,
|
6 |
+
"add_final_layer_norm": false,
|
7 |
+
"architectures": [
|
8 |
+
"BartForSequenceClassification"
|
9 |
+
],
|
10 |
+
"attention_dropout": 0.1,
|
11 |
+
"bos_token_id": 0,
|
12 |
+
"classif_dropout": 0.1,
|
13 |
+
"classifier_dropout": 0.0,
|
14 |
+
"d_model": 1024,
|
15 |
+
"decoder_attention_heads": 16,
|
16 |
+
"decoder_ffn_dim": 4096,
|
17 |
+
"decoder_layerdrop": 0.0,
|
18 |
+
"decoder_layers": 12,
|
19 |
+
"decoder_start_token_id": 2,
|
20 |
+
"dropout": 0.1,
|
21 |
+
"encoder_attention_heads": 16,
|
22 |
+
"encoder_ffn_dim": 4096,
|
23 |
+
"encoder_layerdrop": 0.0,
|
24 |
+
"encoder_layers": 12,
|
25 |
+
"eos_token_id": 2,
|
26 |
+
"forced_bos_token_id": 0,
|
27 |
+
"forced_eos_token_id": 2,
|
28 |
+
"gradient_checkpointing": false,
|
29 |
+
"id2label": {
|
30 |
+
"0": "Refused",
|
31 |
+
"1": "Entailed"
|
32 |
+
},
|
33 |
+
"init_std": 0.02,
|
34 |
+
"is_encoder_decoder": true,
|
35 |
+
"label2id": {
|
36 |
+
"Entailed": 1,
|
37 |
+
"Refused": 0
|
38 |
+
},
|
39 |
+
"max_length": 1024,
|
40 |
+
"max_position_embeddings": 1024,
|
41 |
+
"model_type": "bart",
|
42 |
+
"no_repeat_ngram_size": 3,
|
43 |
+
"normalize_before": false,
|
44 |
+
"num_beams": 4,
|
45 |
+
"num_hidden_layers": 12,
|
46 |
+
"pad_token_id": 1,
|
47 |
+
"scale_embedding": false,
|
48 |
+
"task_specific_params": {
|
49 |
+
"summarization": {
|
50 |
+
"length_penalty": 1.0,
|
51 |
+
"max_length": 128,
|
52 |
+
"min_length": 12,
|
53 |
+
"num_beams": 4
|
54 |
+
},
|
55 |
+
"summarization_cnn": {
|
56 |
+
"length_penalty": 2.0,
|
57 |
+
"max_length": 142,
|
58 |
+
"min_length": 56,
|
59 |
+
"num_beams": 4
|
60 |
+
},
|
61 |
+
"summarization_xsum": {
|
62 |
+
"length_penalty": 1.0,
|
63 |
+
"max_length": 62,
|
64 |
+
"min_length": 11,
|
65 |
+
"num_beams": 6
|
66 |
+
}
|
67 |
+
},
|
68 |
+
"torch_dtype": "float32",
|
69 |
+
"transformers_version": "4.29.2",
|
70 |
+
"use_cache": true,
|
71 |
+
"vocab_size": 50265
|
72 |
+
}
|
merges.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ede9186e8b205bc6a7ed286a80e0c3bc804669c6b57a3974a7fc21c0053234ab
|
3 |
+
size 1629547865
|
special_tokens_map.json
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": {
|
3 |
+
"content": "<s>",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": true,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"cls_token": {
|
10 |
+
"content": "<s>",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": true,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"eos_token": {
|
17 |
+
"content": "</s>",
|
18 |
+
"lstrip": false,
|
19 |
+
"normalized": true,
|
20 |
+
"rstrip": false,
|
21 |
+
"single_word": false
|
22 |
+
},
|
23 |
+
"mask_token": {
|
24 |
+
"content": "<mask>",
|
25 |
+
"lstrip": true,
|
26 |
+
"normalized": true,
|
27 |
+
"rstrip": false,
|
28 |
+
"single_word": false
|
29 |
+
},
|
30 |
+
"pad_token": {
|
31 |
+
"content": "<pad>",
|
32 |
+
"lstrip": false,
|
33 |
+
"normalized": true,
|
34 |
+
"rstrip": false,
|
35 |
+
"single_word": false
|
36 |
+
},
|
37 |
+
"sep_token": {
|
38 |
+
"content": "</s>",
|
39 |
+
"lstrip": false,
|
40 |
+
"normalized": true,
|
41 |
+
"rstrip": false,
|
42 |
+
"single_word": false
|
43 |
+
},
|
44 |
+
"unk_token": {
|
45 |
+
"content": "<unk>",
|
46 |
+
"lstrip": false,
|
47 |
+
"normalized": true,
|
48 |
+
"rstrip": false,
|
49 |
+
"single_word": false
|
50 |
+
}
|
51 |
+
}
|
tokenizer_config.json
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_prefix_space": true,
|
3 |
+
"bos_token": {
|
4 |
+
"__type": "AddedToken",
|
5 |
+
"content": "<s>",
|
6 |
+
"lstrip": false,
|
7 |
+
"normalized": true,
|
8 |
+
"rstrip": false,
|
9 |
+
"single_word": false
|
10 |
+
},
|
11 |
+
"clean_up_tokenization_spaces": true,
|
12 |
+
"cls_token": {
|
13 |
+
"__type": "AddedToken",
|
14 |
+
"content": "<s>",
|
15 |
+
"lstrip": false,
|
16 |
+
"normalized": true,
|
17 |
+
"rstrip": false,
|
18 |
+
"single_word": false
|
19 |
+
},
|
20 |
+
"do_lower_case": true,
|
21 |
+
"eos_token": {
|
22 |
+
"__type": "AddedToken",
|
23 |
+
"content": "</s>",
|
24 |
+
"lstrip": false,
|
25 |
+
"normalized": true,
|
26 |
+
"rstrip": false,
|
27 |
+
"single_word": false
|
28 |
+
},
|
29 |
+
"errors": "replace",
|
30 |
+
"mask_token": {
|
31 |
+
"__type": "AddedToken",
|
32 |
+
"content": "<mask>",
|
33 |
+
"lstrip": true,
|
34 |
+
"normalized": true,
|
35 |
+
"rstrip": false,
|
36 |
+
"single_word": false
|
37 |
+
},
|
38 |
+
"max_cell_length": 15,
|
39 |
+
"model_max_length": 1024,
|
40 |
+
"pad_token": {
|
41 |
+
"__type": "AddedToken",
|
42 |
+
"content": "<pad>",
|
43 |
+
"lstrip": false,
|
44 |
+
"normalized": true,
|
45 |
+
"rstrip": false,
|
46 |
+
"single_word": false
|
47 |
+
},
|
48 |
+
"sep_token": {
|
49 |
+
"__type": "AddedToken",
|
50 |
+
"content": "</s>",
|
51 |
+
"lstrip": false,
|
52 |
+
"normalized": true,
|
53 |
+
"rstrip": false,
|
54 |
+
"single_word": false
|
55 |
+
},
|
56 |
+
"tokenizer_class": "TapexTokenizer",
|
57 |
+
"unk_token": {
|
58 |
+
"__type": "AddedToken",
|
59 |
+
"content": "<unk>",
|
60 |
+
"lstrip": false,
|
61 |
+
"normalized": true,
|
62 |
+
"rstrip": false,
|
63 |
+
"single_word": false
|
64 |
+
},
|
65 |
+
"use_fast": true
|
66 |
+
}
|
vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|