Update parquet files
Browse filesFiles changed (6)
- README.mdDeleted-205
- dataset_infos.jsonDeleted-1
- default/test/0000.parquetAdded+3
- default/train/0000.parquetAdded+3
- default/validation/0000.parquetAdded+3
- mwsc.pyDeleted-121
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205---annotations_creators:- expert-generatedlanguage:- enlanguage_creators:- expert-generatedlicense:- cc-by-4.0multilinguality:- monolingualpretty_name: Modified Winograd Schema Challenge (MWSC)size_categories:- n<1Ksource_datasets:- extended|winograd_wsctask_categories:- multiple-choicetask_ids:- multiple-choice-coreference-resolutionpaperswithcode_id: nulldataset_info: features: - name: sentence dtype: string - name: question dtype: string - name: options sequence: string - name: answer dtype: string splits: - name: train num_bytes: 11022 num_examples: 80 - name: test num_bytes: 15220 num_examples: 100 - name: validation num_bytes: 13109 num_examples: 82 download_size: 19197 dataset_size: 39351---
# Dataset Card for The modified Winograd Schema Challenge (MWSC)
## Table of Contents- [Dataset Description](#dataset-description) - [Dataset Summary](#dataset-summary) - [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards) - [Languages](#languages)- [Dataset Structure](#dataset-structure) - [Data Instances](#data-instances) - [Data Fields](#data-fields) - [Data Splits](#data-splits)- [Dataset Creation](#dataset-creation) - [Curation Rationale](#curation-rationale) - [Source Data](#source-data) - [Annotations](#annotations) - [Personal and Sensitive Information](#personal-and-sensitive-information)- [Considerations for Using the Data](#considerations-for-using-the-data) - [Social Impact of Dataset](#social-impact-of-dataset) - [Discussion of Biases](#discussion-of-biases) - [Other Known Limitations](#other-known-limitations)- [Additional Information](#additional-information) - [Dataset Curators](#dataset-curators) - [Licensing Information](#licensing-information) - [Citation Information](#citation-information) - [Contributions](#contributions)
## Dataset Description
- **Homepage:** [http://decanlp.com](http://decanlp.com)- **Repository:** https://github.com/salesforce/decaNLP- **Paper:** [The Natural Language Decathlon: Multitask Learning as Question Answering](https://arxiv.org/abs/1806.08730)- **Point of Contact:** [Bryan McCann](mailto:bmccann@salesforce.com), [Nitish Shirish Keskar](mailto:nkeskar@salesforce.com)- **Size of downloaded dataset files:** 19.20 kB- **Size of the generated dataset:** 39.35 kB- **Total amount of disk used:** 58.55 kB
### Dataset Summary
Examples taken from the Winograd Schema Challenge modified to ensure that answers are a single word from the context.This Modified Winograd Schema Challenge (MWSC) ensures that scores are neither inflated nor deflated by oddities in phrasing.
### Supported Tasks and Leaderboards
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
### Languages
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
## Dataset Structure
### Data Instances
#### default
- **Size of downloaded dataset files:** 0.02 MB- **Size of the generated dataset:** 0.04 MB- **Total amount of disk used:** 0.06 MB
An example looks as follows:```{ "sentence": "The city councilmen refused the demonstrators a permit because they feared violence.", "question": "Who feared violence?", "options": [ "councilmen", "demonstrators" ], "answer": "councilmen"}```
### Data Fields
The data fields are the same among all splits.
#### default- `sentence`: a `string` feature.- `question`: a `string` feature.- `options`: a `list` of `string` features.- `answer`: a `string` feature.
### Data Splits
| name |train|validation|test||-------|----:|---------:|---:||default| 80| 82| 100|
## Dataset Creation
### Curation Rationale
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
### Source Data
#### Initial Data Collection and Normalization
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
#### Who are the source language producers?
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
### Annotations
#### Annotation process
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
#### Who are the annotators?
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
### Personal and Sensitive Information
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
## Considerations for Using the Data
### Social Impact of Dataset
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
### Discussion of Biases
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
### Other Known Limitations
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
## Additional Information
### Dataset Curators
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
### Licensing Information
Our code for running decaNLP has been open sourced under BSD-3-Clause.
We chose to restrict decaNLP to datasets that were free and publicly accessible for research, but you should check their individual terms if you deviate from this use case.
From the [Winograd Schema Challenge](https://cs.nyu.edu/~davise/papers/WinogradSchemas/WS.html):> Both versions of the collections are licenced under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/).
### Citation Information
If you use this in your work, please cite:```@article{McCann2018decaNLP, title={The Natural Language Decathlon: Multitask Learning as Question Answering}, author={Bryan McCann and Nitish Shirish Keskar and Caiming Xiong and Richard Socher}, journal={arXiv preprint arXiv:1806.08730}, year={2018}}```
### Contributions
Thanks to [@thomwolf](https://github.com/thomwolf), [@lewtun](https://github.com/lewtun), [@ghomasHudson](https://github.com/ghomasHudson), [@lhoestq](https://github.com/lhoestq) for adding this dataset.1{"default": {"description": "Examples taken from the Winograd Schema Challenge modified to ensure that answers are a single word from the context.\nThis modified Winograd Schema Challenge (MWSC) ensures that scores are neither inflated nor deflated by oddities in phrasing.\n", "citation": "@article{McCann2018decaNLP,\n title={The Natural Language Decathlon: Multitask Learning as Question Answering},\n author={Bryan McCann and Nitish Shirish Keskar and Caiming Xiong and Richard Socher},\n journal={arXiv preprint arXiv:1806.08730},\n year={2018}\n}\n", "homepage": "http://decanlp.com", "license": "", "features": {"sentence": {"dtype": "string", "id": null, "_type": "Value"}, "question": {"dtype": "string", "id": null, "_type": "Value"}, "options": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "answer": {"dtype": "string", "id": null, "_type": "Value"}}, "supervised_keys": null, "builder_name": "mwsc", "config_name": "default", "version": {"version_str": "0.1.0", "description": null, "datasets_version_to_prepare": null, "major": 0, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 11022, "num_examples": 80, "dataset_name": "mwsc"}, "test": {"name": "test", "num_bytes": 15220, "num_examples": 100, "dataset_name": "mwsc"}, "validation": {"name": "validation", "num_bytes": 13109, "num_examples": 82, "dataset_name": "mwsc"}}, "download_checksums": {"https://raw.githubusercontent.com/salesforce/decaNLP/1e9605f246b9e05199b28bde2a2093bc49feeeaa/local_data/schema.txt": {"num_bytes": 19197, "checksum": "31da9bee05796bbe0f6c957f54d1eb82eb5c644a8ee59f2ff1fa890eff3885dd"}}, "download_size": 19197, "dataset_size": 39351, "size_in_bytes": 58548}}123version https://git-lfs.github.com/spec/v1oid sha256:4bde7894c28d6854442831fd7b440cc4056e025163014f1d679903ff35884b6bsize 10962123version https://git-lfs.github.com/spec/v1oid sha256:1623e6894519a6f0f706ffd7cbe72f55a94b7f4f0494934f10a431a4aec716basize 8368123version https://git-lfs.github.com/spec/v1oid sha256:4af3bfac03b678fc4fd4156e2e6dfd273a5554b0a0fd4503a591497ac9ceb066size 9380123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121"""A modification of the Winograd Schema Challenge to ensure answers are a single context word"""
import osimport re
import datasets
_CITATION = """\@article{McCann2018decaNLP, title={The Natural Language Decathlon: Multitask Learning as Question Answering}, author={Bryan McCann and Nitish Shirish Keskar and Caiming Xiong and Richard Socher}, journal={arXiv preprint arXiv:1806.08730}, year={2018}}"""
_DESCRIPTION = """\Examples taken from the Winograd Schema Challenge modified to ensure that answers are a single word from the context.This modified Winograd Schema Challenge (MWSC) ensures that scores are neither inflated nor deflated by oddities in phrasing."""
_DATA_URL = "https://raw.githubusercontent.com/salesforce/decaNLP/1e9605f246b9e05199b28bde2a2093bc49feeeaa/local_data/schema.txt"# Alternate: https://s3.amazonaws.com/research.metamind.io/decaNLP/data/schema.txt
class MWSC(datasets.GeneratorBasedBuilder): """MWSC: modified Winograd Schema Challenge"""
VERSION = datasets.Version("0.1.0")
def _info(self): return datasets.DatasetInfo( description=_DESCRIPTION, features=datasets.Features( { "sentence": datasets.Value("string"), "question": datasets.Value("string"), "options": datasets.features.Sequence(datasets.Value("string")), "answer": datasets.Value("string"), } ), # If there's a common (input, target) tuple from the features, # specify them here. They'll be used if as_supervised=True in # builder.as_dataset. supervised_keys=None, # Homepage of the dataset for documentation homepage="http://decanlp.com", citation=_CITATION, )
def _split_generators(self, dl_manager): """Returns SplitGenerators.""" schemas_file = dl_manager.download_and_extract(_DATA_URL)
if os.path.isdir(schemas_file): # During testing the download manager mock gives us a directory schemas_file = os.path.join(schemas_file, "schema.txt")
return [ datasets.SplitGenerator( name=datasets.Split.TRAIN, gen_kwargs={"filepath": schemas_file, "split": "train"}, ), datasets.SplitGenerator( name=datasets.Split.TEST, gen_kwargs={"filepath": schemas_file, "split": "test"}, ), datasets.SplitGenerator( name=datasets.Split.VALIDATION, gen_kwargs={"filepath": schemas_file, "split": "dev"}, ), ]
def _get_both_schema(self, context): """Split [option1/option2] into 2 sentences. From https://github.com/salesforce/decaNLP/blob/1e9605f246b9e05199b28bde2a2093bc49feeeaa/text/torchtext/datasets/generic.py#L815-L827""" pattern = r"\[.*\]" variations = [x[1:-1].split("/") for x in re.findall(pattern, context)] splits = re.split(pattern, context) results = [] for which_schema in range(2): vs = [v[which_schema] for v in variations] context = "" for idx in range(len(splits)): context += splits[idx] if idx < len(vs): context += vs[idx] results.append(context) return results
def _generate_examples(self, filepath, split): """Yields examples."""
schemas = [] with open(filepath, encoding="utf-8") as schema_file: schema = [] for line in schema_file: if len(line.split()) == 0: schemas.append(schema) schema = [] continue else: schema.append(line.strip())
# Train/test/dev split from decaNLP code splits = {} traindev = schemas[:-50] splits["test"] = schemas[-50:] splits["train"] = traindev[:40] splits["dev"] = traindev[40:]
idx = 0 for schema in splits[split]: sentence, question, answers = schema sentence = self._get_both_schema(sentence) question = self._get_both_schema(question) answers = answers.split("/") for i in range(2): yield idx, {"sentence": sentence[i], "question": question[i], "options": answers, "answer": answers[i]} idx += 1README.mdDeleted-205
dataset_infos.jsonDeleted-1
default/test/0000.parquetAdded+3
default/train/0000.parquetAdded+3
default/validation/0000.parquetAdded+3
mwsc.pyDeleted-121