Commit
4b3cfe3
·
0 Parent(s):

Duplicate from hover-nlp/hover

Browse files

Co-authored-by: Parquet-converter (BOT) <parquet-converter@users.noreply.huggingface.co>

Files changed (3) hide show
  1. .gitattributes +27 -0
  2. README.md +191 -0
  3. hover.py +111 -0
.gitattributes ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bin.* filter=lfs diff=lfs merge=lfs -text
5
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.model filter=lfs diff=lfs merge=lfs -text
12
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
13
+ *.onnx filter=lfs diff=lfs merge=lfs -text
14
+ *.ot filter=lfs diff=lfs merge=lfs -text
15
+ *.parquet filter=lfs diff=lfs merge=lfs -text
16
+ *.pb filter=lfs diff=lfs merge=lfs -text
17
+ *.pt filter=lfs diff=lfs merge=lfs -text
18
+ *.pth filter=lfs diff=lfs merge=lfs -text
19
+ *.rar filter=lfs diff=lfs merge=lfs -text
20
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
21
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
22
+ *.tflite filter=lfs diff=lfs merge=lfs -text
23
+ *.tgz filter=lfs diff=lfs merge=lfs -text
24
+ *.xz filter=lfs diff=lfs merge=lfs -text
25
+ *.zip filter=lfs diff=lfs merge=lfs -text
26
+ *.zstandard filter=lfs diff=lfs merge=lfs -text
27
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,191 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - expert-generated
4
+ language_creators:
5
+ - expert-generated
6
+ - found
7
+ language:
8
+ - en
9
+ license:
10
+ - cc-by-sa-4.0
11
+ multilinguality:
12
+ - monolingual
13
+ size_categories:
14
+ - 10K<n<100K
15
+ source_datasets:
16
+ - original
17
+ task_categories:
18
+ - text-retrieval
19
+ task_ids:
20
+ - fact-checking-retrieval
21
+ paperswithcode_id: hover
22
+ pretty_name: HoVer
23
+ dataset_info:
24
+ features:
25
+ - name: id
26
+ dtype: int32
27
+ - name: uid
28
+ dtype: string
29
+ - name: claim
30
+ dtype: string
31
+ - name: supporting_facts
32
+ list:
33
+ - name: key
34
+ dtype: string
35
+ - name: value
36
+ dtype: int32
37
+ - name: label
38
+ dtype:
39
+ class_label:
40
+ names:
41
+ '0': NOT_SUPPORTED
42
+ '1': SUPPORTED
43
+ - name: num_hops
44
+ dtype: int32
45
+ - name: hpqa_id
46
+ dtype: string
47
+ splits:
48
+ - name: train
49
+ num_bytes: 5532178
50
+ num_examples: 18171
51
+ - name: validation
52
+ num_bytes: 1299252
53
+ num_examples: 4000
54
+ - name: test
55
+ num_bytes: 927513
56
+ num_examples: 4000
57
+ download_size: 12257835
58
+ dataset_size: 7758943
59
+ ---
60
+
61
+ # Dataset Card for HoVer
62
+
63
+ ## Table of Contents
64
+ - [Dataset Description](#dataset-description)
65
+ - [Dataset Summary](#dataset-summary)
66
+ - [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
67
+ - [Languages](#languages)
68
+ - [Dataset Structure](#dataset-structure)
69
+ - [Data Instances](#data-instances)
70
+ - [Data Fields](#data-fields)
71
+ - [Data Splits](#data-splits)
72
+ - [Dataset Creation](#dataset-creation)
73
+ - [Curation Rationale](#curation-rationale)
74
+ - [Source Data](#source-data)
75
+ - [Annotations](#annotations)
76
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
77
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
78
+ - [Social Impact of Dataset](#social-impact-of-dataset)
79
+ - [Discussion of Biases](#discussion-of-biases)
80
+ - [Other Known Limitations](#other-known-limitations)
81
+ - [Additional Information](#additional-information)
82
+ - [Dataset Curators](#dataset-curators)
83
+ - [Licensing Information](#licensing-information)
84
+ - [Citation Information](#citation-information)
85
+ - [Contributions](#contributions)
86
+
87
+ ## Dataset Description
88
+
89
+ - **Homepage:** https://hover-nlp.github.io/
90
+ - **Repository:** https://github.com/hover-nlp/hover
91
+ - **Paper:** https://arxiv.org/abs/2011.03088
92
+ - **Leaderboard:** https://hover-nlp.github.io/
93
+ - **Point of Contact:** [More Information Needed]
94
+
95
+ ### Dataset Summary
96
+
97
+ [More Information Needed]
98
+
99
+ ### Supported Tasks and Leaderboards
100
+
101
+ [More Information Needed]
102
+
103
+ ### Languages
104
+
105
+ [More Information Needed]
106
+
107
+ ## Dataset Structure
108
+
109
+ ### Data Instances
110
+
111
+ A sample training set is provided below
112
+
113
+ ```
114
+ {'id': 14856, 'uid': 'a0cf45ea-b5cd-4c4e-9ffa-73b39ebd78ce', 'claim': 'The park at which Tivolis Koncertsal is located opened on 15 August 1843.', 'supporting_facts': [{'key': 'Tivolis Koncertsal', 'value': 0}, {'key': 'Tivoli Gardens', 'value': 1}], 'label': 'SUPPORTED', 'num_hops': 2, 'hpqa_id': '5abca1a55542993a06baf937'}
115
+ ```
116
+
117
+ Please note that in test set sentence only id, uid and claim are available. Labels are not available in test set and are represented by -1.
118
+
119
+
120
+ ### Data Fields
121
+
122
+ [More Information Needed]
123
+
124
+ ### Data Splits
125
+
126
+ [More Information Needed]
127
+
128
+ ## Dataset Creation
129
+
130
+ ### Curation Rationale
131
+
132
+ [More Information Needed]
133
+
134
+ ### Source Data
135
+
136
+ [More Information Needed]
137
+
138
+ #### Initial Data Collection and Normalization
139
+
140
+ [More Information Needed]
141
+
142
+ #### Who are the source language producers?
143
+
144
+ [More Information Needed]
145
+
146
+ ### Annotations
147
+
148
+ [More Information Needed]
149
+
150
+ #### Annotation process
151
+
152
+ [More Information Needed]
153
+
154
+ #### Who are the annotators?
155
+
156
+ [More Information Needed]
157
+
158
+ ### Personal and Sensitive Information
159
+
160
+ [More Information Needed]
161
+
162
+ ## Considerations for Using the Data
163
+
164
+ ### Social Impact of Dataset
165
+
166
+ [More Information Needed]
167
+
168
+ ### Discussion of Biases
169
+
170
+ [More Information Needed]
171
+
172
+ ### Other Known Limitations
173
+
174
+ [More Information Needed]
175
+
176
+ ## Additional Information
177
+
178
+ ### Dataset Curators
179
+
180
+ [More Information Needed]
181
+
182
+ ### Licensing Information
183
+
184
+ [More Information Needed]
185
+
186
+ ### Citation Information
187
+
188
+ [More Information Needed]
189
+ ### Contributions
190
+
191
+ Thanks to [@abhishekkrthakur](https://github.com/abhishekkrthakur) for adding this dataset.
hover.py ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2020 HuggingFace Datasets Authors.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ # Lint as: python3
17
+ import json
18
+
19
+ import datasets
20
+
21
+
22
+ _DESCRIPTION = """\
23
+ HoVer is an open-domain, many-hop fact extraction and claim verification dataset built upon the Wikipedia corpus. The original 2-hop claims are adapted from question-answer pairs from HotpotQA. It is collected by a team of NLP researchers at UNC Chapel Hill and Verisk Analytics.
24
+ """
25
+ _HOMEPAGE_URL = "https://hover-nlp.github.io/"
26
+ _CITATION = """\
27
+ @inproceedings{jiang2020hover,
28
+ title={{HoVer}: A Dataset for Many-Hop Fact Extraction And Claim Verification},
29
+ author={Yichen Jiang and Shikha Bordia and Zheng Zhong and Charles Dognin and Maneesh Singh and Mohit Bansal.},
30
+ booktitle={Findings of the Conference on Empirical Methods in Natural Language Processing ({EMNLP})},
31
+ year={2020}
32
+ }
33
+ """
34
+
35
+ _TRAIN_URL = "https://raw.githubusercontent.com/hover-nlp/hover/main/data/hover/hover_train_release_v1.1.json"
36
+ _VALID_URL = "https://raw.githubusercontent.com/hover-nlp/hover/main/data/hover/hover_dev_release_v1.1.json"
37
+ _TEST_URL = "https://raw.githubusercontent.com/hover-nlp/hover/main/data/hover/hover_test_release_v1.1.json"
38
+
39
+
40
+ class Hover(datasets.GeneratorBasedBuilder):
41
+ VERSION = datasets.Version("1.1.0")
42
+
43
+ def _info(self):
44
+ return datasets.DatasetInfo(
45
+ description=_DESCRIPTION,
46
+ features=datasets.Features(
47
+ {
48
+ "id": datasets.Value("int32"),
49
+ "uid": datasets.Value("string"),
50
+ "claim": datasets.Value("string"),
51
+ "supporting_facts": [
52
+ {
53
+ "key": datasets.Value("string"),
54
+ "value": datasets.Value("int32"),
55
+ }
56
+ ],
57
+ "label": datasets.ClassLabel(names=["NOT_SUPPORTED", "SUPPORTED"]),
58
+ "num_hops": datasets.Value("int32"),
59
+ "hpqa_id": datasets.Value("string"),
60
+ },
61
+ ),
62
+ supervised_keys=None,
63
+ homepage=_HOMEPAGE_URL,
64
+ citation=_CITATION,
65
+ )
66
+
67
+ def _split_generators(self, dl_manager):
68
+ train_path = dl_manager.download_and_extract(_TRAIN_URL)
69
+ valid_path = dl_manager.download_and_extract(_VALID_URL)
70
+ test_path = dl_manager.download_and_extract(_TEST_URL)
71
+ return [
72
+ datasets.SplitGenerator(
73
+ name=datasets.Split.TRAIN,
74
+ gen_kwargs={"datapath": train_path, "datatype": "train"},
75
+ ),
76
+ datasets.SplitGenerator(
77
+ name=datasets.Split.VALIDATION,
78
+ gen_kwargs={"datapath": valid_path, "datatype": "valid"},
79
+ ),
80
+ datasets.SplitGenerator(
81
+ name=datasets.Split.TEST,
82
+ gen_kwargs={"datapath": test_path, "datatype": "test"},
83
+ ),
84
+ ]
85
+
86
+ def _generate_examples(self, datapath, datatype):
87
+ with open(datapath, encoding="utf-8") as f:
88
+ data = json.load(f)
89
+
90
+ for sentence_counter, d in enumerate(data):
91
+ if datatype != "test":
92
+ resp = {
93
+ "id": sentence_counter,
94
+ "uid": d["uid"],
95
+ "claim": d["claim"],
96
+ "supporting_facts": [{"key": x[0], "value": x[1]} for x in d["supporting_facts"]],
97
+ "label": d["label"],
98
+ "num_hops": d["num_hops"],
99
+ "hpqa_id": d["hpqa_id"],
100
+ }
101
+ else:
102
+ resp = {
103
+ "id": sentence_counter,
104
+ "uid": d["uid"],
105
+ "claim": d["claim"],
106
+ "supporting_facts": [],
107
+ "label": -1,
108
+ "num_hops": -1,
109
+ "hpqa_id": "None",
110
+ }
111
+ yield sentence_counter, resp