Update files from the datasets library (from 1.4.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.4.0
README.md
CHANGED
|
@@ -27,7 +27,7 @@
|
|
| 27 |
- [Citation Information](#citation-information)
|
| 28 |
- [Contributions](#contributions)
|
| 29 |
|
| 30 |
-
##
|
| 31 |
|
| 32 |
- **Homepage:** [https://github.com/google-research/google-research/tree/master/cfq](https://github.com/google-research/google-research/tree/master/cfq)
|
| 33 |
- **Repository:** [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
|
@@ -37,7 +37,7 @@
|
|
| 37 |
- **Size of the generated dataset:** 345.30 MB
|
| 38 |
- **Total amount of disk used:** 2386.92 MB
|
| 39 |
|
| 40 |
-
###
|
| 41 |
|
| 42 |
The CFQ dataset (and it's splits) for measuring compositional generalization.
|
| 43 |
|
|
@@ -46,19 +46,19 @@ See https://arxiv.org/abs/1912.09713.pdf for background.
|
|
| 46 |
Example usage:
|
| 47 |
data = datasets.load_dataset('cfq/mcd1')
|
| 48 |
|
| 49 |
-
###
|
| 50 |
|
| 51 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 52 |
|
| 53 |
-
###
|
| 54 |
|
| 55 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 56 |
|
| 57 |
-
##
|
| 58 |
|
| 59 |
We show detailed information for up to 5 configurations of the dataset.
|
| 60 |
|
| 61 |
-
###
|
| 62 |
|
| 63 |
#### mcd1
|
| 64 |
|
|
@@ -130,7 +130,7 @@ An example of 'train' looks as follows.
|
|
| 130 |
}
|
| 131 |
```
|
| 132 |
|
| 133 |
-
###
|
| 134 |
|
| 135 |
The data fields are the same among all splits.
|
| 136 |
|
|
@@ -154,7 +154,7 @@ The data fields are the same among all splits.
|
|
| 154 |
- `question`: a `string` feature.
|
| 155 |
- `query`: a `string` feature.
|
| 156 |
|
| 157 |
-
###
|
| 158 |
|
| 159 |
| name |train |test |
|
| 160 |
|----------------------|-----:|----:|
|
|
@@ -164,49 +164,49 @@ The data fields are the same among all splits.
|
|
| 164 |
|query_complexity_split|100654| 9512|
|
| 165 |
|query_pattern_split | 94600|12589|
|
| 166 |
|
| 167 |
-
##
|
| 168 |
|
| 169 |
-
###
|
| 170 |
|
| 171 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 172 |
|
| 173 |
-
###
|
| 174 |
|
| 175 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 176 |
|
| 177 |
-
###
|
| 178 |
|
| 179 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 180 |
|
| 181 |
-
###
|
| 182 |
|
| 183 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 184 |
|
| 185 |
-
##
|
| 186 |
|
| 187 |
-
###
|
| 188 |
|
| 189 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 190 |
|
| 191 |
-
###
|
| 192 |
|
| 193 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 194 |
|
| 195 |
-
###
|
| 196 |
|
| 197 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 198 |
|
| 199 |
-
##
|
| 200 |
|
| 201 |
-
###
|
| 202 |
|
| 203 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 204 |
|
| 205 |
-
###
|
| 206 |
|
| 207 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 208 |
|
| 209 |
-
###
|
| 210 |
|
| 211 |
```
|
| 212 |
|
|
|
|
| 27 |
- [Citation Information](#citation-information)
|
| 28 |
- [Contributions](#contributions)
|
| 29 |
|
| 30 |
+
## Dataset Description
|
| 31 |
|
| 32 |
- **Homepage:** [https://github.com/google-research/google-research/tree/master/cfq](https://github.com/google-research/google-research/tree/master/cfq)
|
| 33 |
- **Repository:** [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
|
|
|
| 37 |
- **Size of the generated dataset:** 345.30 MB
|
| 38 |
- **Total amount of disk used:** 2386.92 MB
|
| 39 |
|
| 40 |
+
### Dataset Summary
|
| 41 |
|
| 42 |
The CFQ dataset (and it's splits) for measuring compositional generalization.
|
| 43 |
|
|
|
|
| 46 |
Example usage:
|
| 47 |
data = datasets.load_dataset('cfq/mcd1')
|
| 48 |
|
| 49 |
+
### Supported Tasks
|
| 50 |
|
| 51 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 52 |
|
| 53 |
+
### Languages
|
| 54 |
|
| 55 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 56 |
|
| 57 |
+
## Dataset Structure
|
| 58 |
|
| 59 |
We show detailed information for up to 5 configurations of the dataset.
|
| 60 |
|
| 61 |
+
### Data Instances
|
| 62 |
|
| 63 |
#### mcd1
|
| 64 |
|
|
|
|
| 130 |
}
|
| 131 |
```
|
| 132 |
|
| 133 |
+
### Data Fields
|
| 134 |
|
| 135 |
The data fields are the same among all splits.
|
| 136 |
|
|
|
|
| 154 |
- `question`: a `string` feature.
|
| 155 |
- `query`: a `string` feature.
|
| 156 |
|
| 157 |
+
### Data Splits Sample Size
|
| 158 |
|
| 159 |
| name |train |test |
|
| 160 |
|----------------------|-----:|----:|
|
|
|
|
| 164 |
|query_complexity_split|100654| 9512|
|
| 165 |
|query_pattern_split | 94600|12589|
|
| 166 |
|
| 167 |
+
## Dataset Creation
|
| 168 |
|
| 169 |
+
### Curation Rationale
|
| 170 |
|
| 171 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 172 |
|
| 173 |
+
### Source Data
|
| 174 |
|
| 175 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 176 |
|
| 177 |
+
### Annotations
|
| 178 |
|
| 179 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 180 |
|
| 181 |
+
### Personal and Sensitive Information
|
| 182 |
|
| 183 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 184 |
|
| 185 |
+
## Considerations for Using the Data
|
| 186 |
|
| 187 |
+
### Social Impact of Dataset
|
| 188 |
|
| 189 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 190 |
|
| 191 |
+
### Discussion of Biases
|
| 192 |
|
| 193 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 194 |
|
| 195 |
+
### Other Known Limitations
|
| 196 |
|
| 197 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 198 |
|
| 199 |
+
## Additional Information
|
| 200 |
|
| 201 |
+
### Dataset Curators
|
| 202 |
|
| 203 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 204 |
|
| 205 |
+
### Licensing Information
|
| 206 |
|
| 207 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 208 |
|
| 209 |
+
### Citation Information
|
| 210 |
|
| 211 |
```
|
| 212 |
|
cfq.py
CHANGED
|
@@ -19,13 +19,15 @@
|
|
| 19 |
from __future__ import absolute_import, division, print_function
|
| 20 |
|
| 21 |
import json
|
| 22 |
-
import logging
|
| 23 |
import os
|
| 24 |
import re
|
| 25 |
|
| 26 |
import datasets
|
| 27 |
|
| 28 |
|
|
|
|
|
|
|
|
|
|
| 29 |
_CITATION = """
|
| 30 |
@inproceedings{Keysers2020,
|
| 31 |
title={Measuring Compositional Generalization: A Comprehensive Method on
|
|
@@ -141,10 +143,10 @@ class Cfq(datasets.GeneratorBasedBuilder):
|
|
| 141 |
splits_path = os.path.join(base_directory, splits_file)
|
| 142 |
with open(samples_path, encoding="utf-8") as samples_file:
|
| 143 |
with open(splits_path, encoding="utf-8") as splits_file:
|
| 144 |
-
|
| 145 |
samples = json.loads(self._scrub_json(samples_file.read()))
|
| 146 |
-
|
| 147 |
-
|
| 148 |
splits = json.load(splits_file)
|
| 149 |
for idx in splits[split_id]:
|
| 150 |
sample = samples[idx]
|
|
|
|
| 19 |
from __future__ import absolute_import, division, print_function
|
| 20 |
|
| 21 |
import json
|
|
|
|
| 22 |
import os
|
| 23 |
import re
|
| 24 |
|
| 25 |
import datasets
|
| 26 |
|
| 27 |
|
| 28 |
+
logger = datasets.logging.get_logger(__name__)
|
| 29 |
+
|
| 30 |
+
|
| 31 |
_CITATION = """
|
| 32 |
@inproceedings{Keysers2020,
|
| 33 |
title={Measuring Compositional Generalization: A Comprehensive Method on
|
|
|
|
| 143 |
splits_path = os.path.join(base_directory, splits_file)
|
| 144 |
with open(samples_path, encoding="utf-8") as samples_file:
|
| 145 |
with open(splits_path, encoding="utf-8") as splits_file:
|
| 146 |
+
logger.info("Reading json from %s into memory...", samples_path)
|
| 147 |
samples = json.loads(self._scrub_json(samples_file.read()))
|
| 148 |
+
logger.info("%d samples loaded", len(samples))
|
| 149 |
+
logger.info("Loaded json data from %s.", samples_path)
|
| 150 |
splits = json.load(splits_file)
|
| 151 |
for idx in splits[split_id]:
|
| 152 |
sample = samples[idx]
|