Datasets:
Modalities:
Text
Sub-tasks:
masked-language-modeling
Languages:
English
Size:
1M - 10M
ArXiv:
License:
Commit
·
02d10e9
1
Parent(s):
699143e
Update parquet files
Browse files- .gitattributes +0 -37
- README.md +0 -194
- abstracts/ftrace-train-00000-of-00002.parquet +3 -0
- abstracts/ftrace-train-00001-of-00002.parquet +3 -0
- dataset_infos.json +0 -136
- dummy/abstracts/dummy_data.zip +0 -0
- dummy/queries/dummy_data.zip +0 -0
- ftrace.py +0 -181
- queries/ftrace-train.parquet +3 -0
.gitattributes
DELETED
@@ -1,37 +0,0 @@
|
|
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 |
-
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
-
*.ftz filter=lfs diff=lfs merge=lfs -text
|
6 |
-
*.gz filter=lfs diff=lfs merge=lfs -text
|
7 |
-
*.h5 filter=lfs diff=lfs merge=lfs -text
|
8 |
-
*.joblib filter=lfs diff=lfs merge=lfs -text
|
9 |
-
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
10 |
-
*.model filter=lfs diff=lfs merge=lfs -text
|
11 |
-
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
12 |
-
*.onnx filter=lfs diff=lfs merge=lfs -text
|
13 |
-
*.ot filter=lfs diff=lfs merge=lfs -text
|
14 |
-
*.parquet filter=lfs diff=lfs merge=lfs -text
|
15 |
-
*.pb filter=lfs diff=lfs merge=lfs -text
|
16 |
-
*.pt filter=lfs diff=lfs merge=lfs -text
|
17 |
-
*.pth filter=lfs diff=lfs merge=lfs -text
|
18 |
-
*.rar filter=lfs diff=lfs merge=lfs -text
|
19 |
-
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
20 |
-
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
21 |
-
*.tflite filter=lfs diff=lfs merge=lfs -text
|
22 |
-
*.tgz filter=lfs diff=lfs merge=lfs -text
|
23 |
-
*.wasm 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
|
28 |
-
# Audio files - uncompressed
|
29 |
-
*.pcm filter=lfs diff=lfs merge=lfs -text
|
30 |
-
*.sam filter=lfs diff=lfs merge=lfs -text
|
31 |
-
*.raw filter=lfs diff=lfs merge=lfs -text
|
32 |
-
# Audio files - compressed
|
33 |
-
*.aac filter=lfs diff=lfs merge=lfs -text
|
34 |
-
*.flac filter=lfs diff=lfs merge=lfs -text
|
35 |
-
*.mp3 filter=lfs diff=lfs merge=lfs -text
|
36 |
-
*.ogg filter=lfs diff=lfs merge=lfs -text
|
37 |
-
*.wav filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
README.md
DELETED
@@ -1,194 +0,0 @@
|
|
1 |
-
---
|
2 |
-
language:
|
3 |
-
- en
|
4 |
-
license:
|
5 |
-
- cc-by-sa-4.0
|
6 |
-
- cc-by-nc-4.0
|
7 |
-
multilinguality:
|
8 |
-
- monolingual
|
9 |
-
pretty_name: FTRACE
|
10 |
-
size_categories:
|
11 |
-
- 1M<n<10M
|
12 |
-
source_datasets:
|
13 |
-
- TRex
|
14 |
-
- Lama
|
15 |
-
task_categories:
|
16 |
-
- influence-attribution
|
17 |
-
- information-retrieval
|
18 |
-
- question-answering-retrieval
|
19 |
-
task_ids:
|
20 |
-
- influence-attribution
|
21 |
-
- masked-language-modeling
|
22 |
-
---
|
23 |
-
# Dataset Card for "FTRACE"
|
24 |
-
## Table of Contents
|
25 |
-
- [Dataset Description](#dataset-description)
|
26 |
-
- [Dataset Summary](#dataset-summary)
|
27 |
-
- [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
|
28 |
-
- [Languages](#languages)
|
29 |
-
- [Dataset Structure](#dataset-structure)
|
30 |
-
- [Data Instances](#data-instances)
|
31 |
-
- [Data Fields](#data-fields)
|
32 |
-
- [Data Splits](#data-splits)
|
33 |
-
- [Dataset Creation](#dataset-creation)
|
34 |
-
- [Curation Rationale](#curation-rationale)
|
35 |
-
- [Source Data](#source-data)
|
36 |
-
- [Annotations](#annotations)
|
37 |
-
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
38 |
-
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
39 |
-
- [Social Impact of Dataset](#social-impact-of-dataset)
|
40 |
-
- [Discussion of Biases](#discussion-of-biases)
|
41 |
-
- [Other Known Limitations](#other-known-limitations)
|
42 |
-
- [Additional Information](#additional-information)
|
43 |
-
- [Dataset Curators](#dataset-curators)
|
44 |
-
- [Licensing Information](#licensing-information)
|
45 |
-
- [Citation Information](#citation-information)
|
46 |
-
- [Contributions](#contributions)
|
47 |
-
|
48 |
-
## Dataset Description
|
49 |
-
|
50 |
-
- **Homepage:** https://huggingface.co/datasets/ekinakyurek/ftrace
|
51 |
-
- **Repository:** https://github.com/ekinakyurek/influence
|
52 |
-
- **Paper:** https://arxiv.org/pdf/2205.11482.pdf
|
53 |
-
- **Point of Contact:** [Ekin Akyürek](mailto:[email protected])
|
54 |
-
- **Size of downloaded dataset files:** 113.7 MB
|
55 |
-
- **Size of the generated dataset:** 1006.6 MB
|
56 |
-
- **Total amount of disk used:** 1120.3 MB
|
57 |
-
|
58 |
-
### Dataset Summary
|
59 |
-
[PAPER]
|
60 |
-
FTRACE is a zero-shot infromation retrieval benchmark deviced for tracing a language model’s predictions back to training examples. In the accompanying paper, we evaluate commonly studied influence methods, including gradient-based (TracIn) and embedding-based approaches. The dataset contains two parts. First, factual queries for that we trace the knowledge are extracted from existing LAMA queries (Petroni et al., 2019). Second, Wikidata sentences are extracted from TREx corpus (Elsahar et al., 2018). We annotate the extracted sentences with their stated facts, and these facts can be mathed with the facts in query set. In both parts, we provide (input, target) pairs as a masked language modeling task -- see examples in the below. However, one can use the same data in other formalities for example auto-regressive completion via a processing of `input_pretokenized` and `targets_pretokenized` field.
|
61 |
-
### Supported Tasks and Leaderboards
|
62 |
-
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
63 |
-
### Languages
|
64 |
-
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
65 |
-
## Dataset Structure
|
66 |
-
### Data Instances
|
67 |
-
#### Abstracts
|
68 |
-
- **Size of downloaded dataset files:** 112 MB
|
69 |
-
- **Size of the generated dataset:** 884 MB
|
70 |
-
- **Total amount of disk used:** 996 MB
|
71 |
-
|
72 |
-
An example of 'abstract' looks as follows.
|
73 |
-
```
|
74 |
-
{"inputs_pretokenized": "The name Austroasiatic comes from the Latin words for \"south\" and \"Asia\", hence \"<extra_id_0>\".",
|
75 |
-
"targets_pretokenized": "<extra_id_0> South Asia",
|
76 |
-
"page_uri": "Q33199",
|
77 |
-
"masked_uri": "Q771405",
|
78 |
-
"masked_type": "subject",
|
79 |
-
"example_uris": "Q33199-1-Q48-Q771405-1",
|
80 |
-
"facts": "P361,Q48,Q771405;P30,Q48,Q771405",
|
81 |
-
"id": 8}
|
82 |
-
```
|
83 |
-
#### Queries
|
84 |
-
- **Size of downloaded dataset files:** 1.7 MB
|
85 |
-
- **Size of the generated dataset:** 8.9 MB
|
86 |
-
- **Total amount of disk used:** 10.6 MB
|
87 |
-
|
88 |
-
An example of 'query' looks as follows.
|
89 |
-
|
90 |
-
```
|
91 |
-
{"inputs_pretokenized": "Paul Ehrlich used to work in <extra_id_0> .",
|
92 |
-
"targets_pretokenized": "<extra_id_0> Frankfurt",
|
93 |
-
"uuid": "5b063008-a8ba-4064-9f59-e70102bb8c50",
|
94 |
-
"obj_uri": "Q1794",
|
95 |
-
"sub_uri": "Q57089",
|
96 |
-
"predicate_id": "P937",
|
97 |
-
"obj_surface": "Frankfurt",
|
98 |
-
"sub_surface": "Paul Ehrlich"}
|
99 |
-
```
|
100 |
-
|
101 |
-
### Data Fields
|
102 |
-
The data fields are the same among all splits.
|
103 |
-
|
104 |
-
#### Abstracts
|
105 |
-
- `inputs_pretokenized`: a `string` feature.
|
106 |
-
- `targets_pretokenized`: a `string` feature.
|
107 |
-
- `masked_uri`: a `string` feature.
|
108 |
-
- `masked_type`: a `string` feature.
|
109 |
-
- `facts`: a `string` feature.
|
110 |
-
- `id`: a `string` feature.
|
111 |
-
- `example_uris`: a `string` feature.
|
112 |
-
- `page_uri`: a `string` feature.
|
113 |
-
|
114 |
-
#### Queries
|
115 |
-
- `inputs_pretokenized`: a `string` feature.
|
116 |
-
- `targets_pretokenized`: a `string` feature.
|
117 |
-
- `obj_surface`: a `string` feature.
|
118 |
-
- `sub_surface`: a `string` feature.
|
119 |
-
- `obj_uri`: a `string` feature.
|
120 |
-
- `sub_uri`: a `string` feature.
|
121 |
-
- `predicate_id`: a `string` feature.
|
122 |
-
- `uuid`: a `string` feature.
|
123 |
-
|
124 |
-
### Data Splits
|
125 |
-
| name | train |
|
126 |
-
|-----------|------:|
|
127 |
-
|Abstracts |1560453|
|
128 |
-
|Queries |31479 |
|
129 |
-
|
130 |
-
## Dataset Creation
|
131 |
-
### Curation Rationale
|
132 |
-
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
133 |
-
### Source Data
|
134 |
-
LAMA: https://github.com/facebookresearch/LAMA
|
135 |
-
TRex: https://hadyelsahar.github.io/t-rex/
|
136 |
-
#### Initial Data Collection and Normalization
|
137 |
-
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
138 |
-
#### Who are the source language producers?
|
139 |
-
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
140 |
-
### Annotations
|
141 |
-
#### Annotation process
|
142 |
-
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
143 |
-
#### Who are the annotators?
|
144 |
-
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
145 |
-
### Personal and Sensitive Information
|
146 |
-
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
147 |
-
## Considerations for Using the Data
|
148 |
-
### Social Impact of Dataset
|
149 |
-
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
150 |
-
### Discussion of Biases
|
151 |
-
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
152 |
-
### Other Known Limitations
|
153 |
-
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
154 |
-
## Additional Information
|
155 |
-
### Dataset Curators
|
156 |
-
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
157 |
-
### Licensing Information
|
158 |
-
The parts of this dataset are available under the [Creative Commons Attribution-ShareAlike License (CC BY-SA 4.0)](https://creativecommons.org/licenses/by-sa/4.0/) and [The Creative Commons Attribution-Noncommercial 4.0 International License](https://github.com/facebookresearch/LAMA/blob/master/LICENSE)
|
159 |
-
### Citation Information
|
160 |
-
The main paper should be cited as follow:
|
161 |
-
```
|
162 |
-
@misc{https://doi.org/10.48550/arxiv.2205.11482,
|
163 |
-
doi = {10.48550/ARXIV.2205.11482},
|
164 |
-
url = {https://arxiv.org/abs/2205.11482},
|
165 |
-
author = {Akyürek, Ekin and Bolukbasi, Tolga and Liu, Frederick and Xiong, Binbin and Tenney, Ian and Andreas, Jacob and Guu, Kelvin},
|
166 |
-
keywords = {Computation and Language (cs.CL), Information Retrieval (cs.IR), FOS: Computer and information sciences, FOS: Computer and information sciences},
|
167 |
-
title = {Tracing Knowledge in Language Models Back to the Training Data},
|
168 |
-
publisher = {arXiv},
|
169 |
-
year = {2022},
|
170 |
-
}
|
171 |
-
```
|
172 |
-
|
173 |
-
Please also cite Petroni et al., 2019 for the query set, and Elsahar et al., 2018 for the abstract set.
|
174 |
-
|
175 |
-
```
|
176 |
-
@inproceedings{petroni2019language,
|
177 |
-
title={Language Models as Knowledge Bases?},
|
178 |
-
author={F. Petroni, T. Rockt{\"{a}}schel, A. H. Miller, P. Lewis, A. Bakhtin, Y. Wu and S. Riedel},
|
179 |
-
booktitle={In: Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing (EMNLP), 2019},
|
180 |
-
year={2019}
|
181 |
-
}
|
182 |
-
```
|
183 |
-
|
184 |
-
```
|
185 |
-
@inproceedings{elsahar2018t,
|
186 |
-
title={T-rex: A large scale alignment of natural language with knowledge base triples},
|
187 |
-
author={Elsahar, Hady and Vougiouklis, Pavlos and Remaci, Arslen and Gravier, Christophe and Hare, Jonathon and Laforest, Frederique and Simperl, Elena},
|
188 |
-
booktitle={Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018)},
|
189 |
-
year={2018}
|
190 |
-
}
|
191 |
-
```
|
192 |
-
|
193 |
-
|
194 |
-
### Contributions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
abstracts/ftrace-train-00000-of-00002.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0df36356ec08044e67c66acb01b2b16668cf243145097e1f4adfe4fcd7482eac
|
3 |
+
size 133483882
|
abstracts/ftrace-train-00001-of-00002.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3e22fd872885ecb3eb3b01844630bb796512bfd8f826e23b88c3a913ad7c2628
|
3 |
+
size 58733331
|
dataset_infos.json
DELETED
@@ -1,136 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"abstracts": {
|
3 |
-
"description": "Abstracts from TREx dataset",
|
4 |
-
"citation": "@inproceedings{elsahar2018t, title={T-rex: A large scale alignment of natural language with knowledge base triples}, author={Elsahar, Hady and Vougiouklis, Pavlos and Remaci, Arslen and Gravier, Christophe and Hare, Jonathon and Laforest, Frederique and Simperl, Elena},booktitle={Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018)}, year={2018}}",
|
5 |
-
"homepage": "https://hadyelsahar.github.io/t-rex/",
|
6 |
-
"license": "Creative Commons Attribution-ShareAlike 4.0 International License. see https://creativecommons.org/licenses/by-sa/4.0/",
|
7 |
-
"features": {
|
8 |
-
"inputs_pretokenized": {
|
9 |
-
"dtype": "string",
|
10 |
-
"id": null,
|
11 |
-
"_type": "Value"
|
12 |
-
},
|
13 |
-
"targets_pretokenized": {
|
14 |
-
"dtype": "string",
|
15 |
-
"id": null,
|
16 |
-
"_type": "Value"
|
17 |
-
},
|
18 |
-
"masked_uri": {
|
19 |
-
"dtype": "string",
|
20 |
-
"id": null,
|
21 |
-
"_type": "Value"
|
22 |
-
},
|
23 |
-
"masked_type": {
|
24 |
-
"dtype": "string",
|
25 |
-
"id": null,
|
26 |
-
"_type": "Value"
|
27 |
-
},
|
28 |
-
"facts": {
|
29 |
-
"dtype": "string",
|
30 |
-
"id": null,
|
31 |
-
"_type": "Value"
|
32 |
-
},
|
33 |
-
"id": {
|
34 |
-
"dtype": "string",
|
35 |
-
"id": null,
|
36 |
-
"_type": "Value"
|
37 |
-
},
|
38 |
-
"example_uris": {
|
39 |
-
"dtype": "string",
|
40 |
-
"id": null,
|
41 |
-
"_type": "Value"
|
42 |
-
},
|
43 |
-
"page_uri": {
|
44 |
-
"dtype": "string",
|
45 |
-
"id": null,
|
46 |
-
"_type": "Value"
|
47 |
-
}
|
48 |
-
},
|
49 |
-
"supervised_keys": null,
|
50 |
-
"builder_name": "ftrace",
|
51 |
-
"config_name": "abstracts",
|
52 |
-
"version": {
|
53 |
-
"version_str": "0.0.2",
|
54 |
-
"description": null,
|
55 |
-
"datasets_version_to_prepare": null,
|
56 |
-
"major": 0,
|
57 |
-
"minor": 0,
|
58 |
-
"patch": 2
|
59 |
-
},
|
60 |
-
"splits": {
|
61 |
-
"train": {
|
62 |
-
"name": "train",
|
63 |
-
"num_bytes": 473823085,
|
64 |
-
"num_examples": 1560453,
|
65 |
-
"dataset_name": "abstracts"
|
66 |
-
}
|
67 |
-
}
|
68 |
-
},
|
69 |
-
"queries": {
|
70 |
-
"description": "Queries from LAMA dataset",
|
71 |
-
"citation": "@inproceedings{petroni2019language,title={Language Models as Knowledge Bases?},author={F. Petroni, T. Rockt{\"{a}}schel, A. H. Miller, P. Lewis, A. Bakhtin, Y. Wu and S. Riedel},booktitle={In: Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing (EMNLP), 2019},year={2019}}",
|
72 |
-
"homepage": "https://github.com/facebookresearch/LAMA",
|
73 |
-
"license": "The Creative Commons Attribution-Noncommercial 4.0 International License. see https://github.com/facebookresearch/LAMA/blob/master/LICENSE",
|
74 |
-
"features": {
|
75 |
-
"inputs_pretokenized": {
|
76 |
-
"dtype": "string",
|
77 |
-
"id": null,
|
78 |
-
"_type": "Value"
|
79 |
-
},
|
80 |
-
"targets_pretokenized": {
|
81 |
-
"dtype": "string",
|
82 |
-
"id": null,
|
83 |
-
"_type": "Value"
|
84 |
-
},
|
85 |
-
"obj_surface": {
|
86 |
-
"dtype": "string",
|
87 |
-
"id": null,
|
88 |
-
"_type": "Value"
|
89 |
-
},
|
90 |
-
"sub_surface": {
|
91 |
-
"dtype": "string",
|
92 |
-
"id": null,
|
93 |
-
"_type": "Value"
|
94 |
-
},
|
95 |
-
"obj_uri": {
|
96 |
-
"dtype": "string",
|
97 |
-
"id": null,
|
98 |
-
"_type": "Value"
|
99 |
-
},
|
100 |
-
"sub_uri": {
|
101 |
-
"dtype": "string",
|
102 |
-
"id": null,
|
103 |
-
"_type": "Value"
|
104 |
-
},
|
105 |
-
"predicate_id": {
|
106 |
-
"dtype": "string",
|
107 |
-
"id": null,
|
108 |
-
"_type": "Value"
|
109 |
-
},
|
110 |
-
"uuid": {
|
111 |
-
"dtype": "string",
|
112 |
-
"id": null,
|
113 |
-
"_type": "Value"
|
114 |
-
}
|
115 |
-
},
|
116 |
-
"supervised_keys": null,
|
117 |
-
"builder_name": "ftrace",
|
118 |
-
"config_name": "queries",
|
119 |
-
"version": {
|
120 |
-
"version_str": "0.0.2",
|
121 |
-
"description": null,
|
122 |
-
"datasets_version_to_prepare": null,
|
123 |
-
"major": 0,
|
124 |
-
"minor": 0,
|
125 |
-
"patch": 2
|
126 |
-
},
|
127 |
-
"splits": {
|
128 |
-
"train": {
|
129 |
-
"name": "train",
|
130 |
-
"num_bytes": 5426318,
|
131 |
-
"num_examples": 31479,
|
132 |
-
"dataset_name": "abstracts"
|
133 |
-
}
|
134 |
-
}
|
135 |
-
}
|
136 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dummy/abstracts/dummy_data.zip
DELETED
Binary file (1.18 kB)
|
|
dummy/queries/dummy_data.zip
DELETED
Binary file (1.1 kB)
|
|
ftrace.py
DELETED
@@ -1,181 +0,0 @@
|
|
1 |
-
# coding=utf-8
|
2 |
-
# Copyright 2020 The TensorFlow Datasets Authors and the 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 |
-
"""The FTRACE benchmark."""
|
18 |
-
|
19 |
-
|
20 |
-
import json
|
21 |
-
import os
|
22 |
-
import textwrap
|
23 |
-
|
24 |
-
import datasets
|
25 |
-
|
26 |
-
_FTRACE_CITATION = """\
|
27 |
-
"""
|
28 |
-
|
29 |
-
_FTRACE_DESCRIPTION = """\
|
30 |
-
Factual Tracing Dataset that contains queries and abstracts, and their corresponding ground truth.
|
31 |
-
"""
|
32 |
-
|
33 |
-
_FTRACE_ABSTRACTS_DESCRIPTION = """\
|
34 |
-
Abstracts based on TREx dataset.
|
35 |
-
"""
|
36 |
-
|
37 |
-
_FTRACE_ABSTRACTS_LICENSE = """\
|
38 |
-
Creative Commons Attribution-ShareAlike 4.0 International License.
|
39 |
-
see https://creativecommons.org/licenses/by-sa/4.0/"""
|
40 |
-
|
41 |
-
_FTRACE_ABSTRACTS_CITATION = """\
|
42 |
-
@inproceedings{elsahar2018t,
|
43 |
-
title={T-rex: A large scale alignment of natural language with knowledge base triples},
|
44 |
-
author={Elsahar, Hady and Vougiouklis, Pavlos and Remaci, Arslen and Gravier, Christophe and Hare, Jonathon and Laforest, Frederique and Simperl, Elena},
|
45 |
-
booktitle={Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018)},
|
46 |
-
year={2018}
|
47 |
-
}"""
|
48 |
-
|
49 |
-
_FTRACE_QUERIES_DESCRIPTION = """\
|
50 |
-
Queries based on LAMA dataset.
|
51 |
-
"""
|
52 |
-
|
53 |
-
_FTRACE_QUERIES_CITATION = """\
|
54 |
-
@inproceedings{petroni2019language,
|
55 |
-
title={Language Models as Knowledge Bases?},
|
56 |
-
author={F. Petroni, T. Rockt{\"{a}}schel, A. H. Miller, P. Lewis, A. Bakhtin, Y. Wu and S. Riedel},
|
57 |
-
booktitle={In: Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing (EMNLP), 2019},
|
58 |
-
year={2019}
|
59 |
-
}"""
|
60 |
-
|
61 |
-
FTRACE_QUERIES_LICENSE = """\
|
62 |
-
The Creative Commons Attribution-Noncommercial 4.0 International License.
|
63 |
-
see https://github.com/facebookresearch/LAMA/blob/master/LICENSE"""
|
64 |
-
|
65 |
-
|
66 |
-
class FTRACEConfig(datasets.BuilderConfig):
|
67 |
-
"""BuilderConfig for FTRACE."""
|
68 |
-
|
69 |
-
def __init__(
|
70 |
-
self,
|
71 |
-
features,
|
72 |
-
data_url,
|
73 |
-
citation,
|
74 |
-
license,
|
75 |
-
url,
|
76 |
-
**kwargs,
|
77 |
-
):
|
78 |
-
"""BuilderConfig for FTRACE.
|
79 |
-
Args:
|
80 |
-
features: `list[string]`, list of the features that will appear in the
|
81 |
-
feature dict. Should not include "label".
|
82 |
-
data_url: `string`, url to download the zip file from.
|
83 |
-
citation: `string`, citation for the data set.
|
84 |
-
url: `string`, url for information about the data set.
|
85 |
-
**kwargs: keyword arguments forwarded to super.
|
86 |
-
"""
|
87 |
-
# Version history:
|
88 |
-
# 0.0.2: Initial version.
|
89 |
-
super(FTRACEConfig, self).__init__(
|
90 |
-
version=datasets.Version("0.0.2"), **kwargs
|
91 |
-
)
|
92 |
-
self.features = features
|
93 |
-
self.data_url = data_url
|
94 |
-
self.citation = citation
|
95 |
-
self.license = license
|
96 |
-
self.url = url
|
97 |
-
|
98 |
-
|
99 |
-
class FTRACE(datasets.GeneratorBasedBuilder):
|
100 |
-
"""The SuperFTRACE benchmark."""
|
101 |
-
|
102 |
-
BUILDER_CONFIGS = [
|
103 |
-
FTRACEConfig(
|
104 |
-
name="abstracts",
|
105 |
-
description=_FTRACE_ABSTRACTS_DESCRIPTION,
|
106 |
-
features=[
|
107 |
-
"inputs_pretokenized",
|
108 |
-
"targets_pretokenized",
|
109 |
-
"masked_uri",
|
110 |
-
"masked_type",
|
111 |
-
"facts",
|
112 |
-
"id",
|
113 |
-
"example_uris",
|
114 |
-
"page_uri",
|
115 |
-
],
|
116 |
-
data_url="https://people.csail.mit.edu/akyurek/ftrace/abstracts.zip",
|
117 |
-
citation=textwrap.dedent(_FTRACE_ABSTRACTS_CITATION),
|
118 |
-
license=_FTRACE_ABSTRACTS_LICENSE,
|
119 |
-
url="https://hadyelsahar.github.io/t-rex/",
|
120 |
-
),
|
121 |
-
FTRACEConfig(
|
122 |
-
name="queries",
|
123 |
-
description=_FTRACE_QUERIES_DESCRIPTION,
|
124 |
-
features=[
|
125 |
-
"inputs_pretokenized",
|
126 |
-
"targets_pretokenized",
|
127 |
-
"uuid",
|
128 |
-
"obj_uri",
|
129 |
-
"sub_uri",
|
130 |
-
"predicate_id",
|
131 |
-
"sub_surface",
|
132 |
-
"obj_surface",
|
133 |
-
],
|
134 |
-
data_url="https://people.csail.mit.edu/akyurek/ftrace/queries.zip",
|
135 |
-
citation=textwrap.dedent(_FTRACE_QUERIES_CITATION),
|
136 |
-
license=FTRACE_QUERIES_LICENSE,
|
137 |
-
url="https://github.com/facebookresearch/LAMA",
|
138 |
-
),
|
139 |
-
]
|
140 |
-
|
141 |
-
def _info(self):
|
142 |
-
features = {
|
143 |
-
feature: datasets.Value("string")
|
144 |
-
for feature in self.config.features
|
145 |
-
}
|
146 |
-
|
147 |
-
return datasets.DatasetInfo(
|
148 |
-
description=_FTRACE_DESCRIPTION + self.config.description,
|
149 |
-
features=datasets.Features(features),
|
150 |
-
homepage=self.config.url,
|
151 |
-
citation=self.config.citation + "\n" + _FTRACE_CITATION,
|
152 |
-
)
|
153 |
-
|
154 |
-
def _split_generators(self, dl_manager):
|
155 |
-
dl_dir = dl_manager.download_and_extract(self.config.data_url) or ""
|
156 |
-
task_name = _get_task_name_from_data_url(self.config.data_url)
|
157 |
-
dl_dir = os.path.join(dl_dir, task_name)
|
158 |
-
return [
|
159 |
-
datasets.SplitGenerator(
|
160 |
-
name=datasets.Split.TRAIN,
|
161 |
-
gen_kwargs={
|
162 |
-
"data_file": os.path.join(dl_dir, "train.jsonl"),
|
163 |
-
"split": "train",
|
164 |
-
},
|
165 |
-
),
|
166 |
-
]
|
167 |
-
|
168 |
-
def _generate_examples(self, data_file, split):
|
169 |
-
with open(data_file, encoding="utf-8") as f:
|
170 |
-
for idx, line in enumerate(f):
|
171 |
-
row = json.loads(line)
|
172 |
-
yield idx, row
|
173 |
-
|
174 |
-
|
175 |
-
def _get_task_name_from_data_url(data_url):
|
176 |
-
if "queries" in data_url:
|
177 |
-
return "queries"
|
178 |
-
elif "abstracts" in data_url:
|
179 |
-
return "abstracts"
|
180 |
-
|
181 |
-
return "queries"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
queries/ftrace-train.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b824a4838977d08139df0919cf1b13c25ba899cfbe992e81fbb1139fa58de3fd
|
3 |
+
size 2831070
|