albertvillanova HF staff commited on
Commit
0fdf659
1 Parent(s): 260a238

Convert dataset to Parquet (#4)

Browse files

- Convert dataset to Parquet (086083012c004aab9e3218020076b9a9a2ee4fdd)
- Delete loading script (29d4373b6d79f793a4276a98403d0d95e39da514)

README.md CHANGED
@@ -20,6 +20,7 @@ task_ids:
20
  paperswithcode_id: definite-pronoun-resolution-dataset
21
  pretty_name: Definite Pronoun Resolution Dataset
22
  dataset_info:
 
23
  features:
24
  - name: sentence
25
  dtype: string
@@ -34,16 +35,23 @@ dataset_info:
34
  names:
35
  '0': '0'
36
  '1': '1'
37
- config_name: plain_text
38
  splits:
39
  - name: test
40
- num_bytes: 71691
41
  num_examples: 564
42
  - name: train
43
- num_bytes: 171511
44
  num_examples: 1322
45
- download_size: 227452
46
- dataset_size: 243202
 
 
 
 
 
 
 
 
47
  ---
48
 
49
  # Dataset Card for "definite_pronoun_resolution"
 
20
  paperswithcode_id: definite-pronoun-resolution-dataset
21
  pretty_name: Definite Pronoun Resolution Dataset
22
  dataset_info:
23
+ config_name: plain_text
24
  features:
25
  - name: sentence
26
  dtype: string
 
35
  names:
36
  '0': '0'
37
  '1': '1'
 
38
  splits:
39
  - name: test
40
+ num_bytes: 71679
41
  num_examples: 564
42
  - name: train
43
+ num_bytes: 171499
44
  num_examples: 1322
45
+ download_size: 106997
46
+ dataset_size: 243178
47
+ configs:
48
+ - config_name: plain_text
49
+ data_files:
50
+ - split: test
51
+ path: plain_text/test-*
52
+ - split: train
53
+ path: plain_text/train-*
54
+ default: true
55
  ---
56
 
57
  # Dataset Card for "definite_pronoun_resolution"
definite_pronoun_resolution.py DELETED
@@ -1,105 +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 Definite Pronoun Resolution Dataset."""
18
-
19
-
20
- import datasets
21
-
22
-
23
- _CITATION = """\
24
- @inproceedings{rahman2012resolving,
25
- title={Resolving complex cases of definite pronouns: the winograd schema challenge},
26
- author={Rahman, Altaf and Ng, Vincent},
27
- booktitle={Proceedings of the 2012 Joint Conference on Empirical Methods in Natural Language Processing and Computational Natural Language Learning},
28
- pages={777--789},
29
- year={2012},
30
- organization={Association for Computational Linguistics}
31
- }"""
32
-
33
- _DESCRIPTION = """\
34
- Composed by 30 students from one of the author's undergraduate classes. These
35
- sentence pairs cover topics ranging from real events (e.g., Iran's plan to
36
- attack the Saudi ambassador to the U.S.) to events/characters in movies (e.g.,
37
- Batman) and purely imaginary situations, largely reflecting the pop culture as
38
- perceived by the American kids born in the early 90s. Each annotated example
39
- spans four lines: the first line contains the sentence, the second line contains
40
- the target pronoun, the third line contains the two candidate antecedents, and
41
- the fourth line contains the correct antecedent. If the target pronoun appears
42
- more than once in the sentence, its first occurrence is the one to be resolved.
43
- """
44
-
45
-
46
- _DATA_URL_PATTERN = "https://s3.amazonaws.com/datasets.huggingface.co/definite_pronoun_resolution/{}.c.txt"
47
-
48
-
49
- class DefinitePronounResolution(datasets.GeneratorBasedBuilder):
50
- """The Definite Pronoun Resolution Dataset."""
51
-
52
- BUILDER_CONFIGS = [
53
- datasets.BuilderConfig(
54
- name="plain_text",
55
- version=datasets.Version("1.0.0", ""),
56
- description="Plain text import of the Definite Pronoun Resolution Dataset.", # pylint: disable=line-too-long
57
- )
58
- ]
59
-
60
- def _info(self):
61
- return datasets.DatasetInfo(
62
- description=_DESCRIPTION,
63
- features=datasets.Features(
64
- {
65
- "sentence": datasets.Value("string"),
66
- "pronoun": datasets.Value("string"),
67
- "candidates": datasets.features.Sequence(datasets.Value("string"), length=2),
68
- "label": datasets.features.ClassLabel(num_classes=2),
69
- }
70
- ),
71
- supervised_keys=("sentence", "label"),
72
- homepage="http://www.hlt.utdallas.edu/~vince/data/emnlp12/",
73
- citation=_CITATION,
74
- )
75
-
76
- def _split_generators(self, dl_manager):
77
- files = dl_manager.download_and_extract(
78
- {
79
- "train": _DATA_URL_PATTERN.format("train"),
80
- "test": _DATA_URL_PATTERN.format("test"),
81
- }
82
- )
83
- return [
84
- datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": files["test"]}),
85
- datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": files["train"]}),
86
- ]
87
-
88
- def _generate_examples(self, filepath):
89
- with open(filepath, encoding="utf-8") as f:
90
- line_num = -1
91
- while True:
92
- line_num += 1
93
- sentence = f.readline().strip()
94
- pronoun = f.readline().strip()
95
- candidates = [c.strip() for c in f.readline().strip().split(",")]
96
- correct = f.readline().strip()
97
- f.readline()
98
- if not sentence:
99
- break
100
- yield line_num, {
101
- "sentence": sentence,
102
- "pronoun": pronoun,
103
- "candidates": candidates,
104
- "label": candidates.index(correct),
105
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plain_text/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0f48e779f486010faa11aae7c5539802a7c6fef897c8c0856639796f61c53bb7
3
+ size 32221
plain_text/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2106f3f285e7286e95723775703167004593cd679be6c9459a3daa3d4739e739
3
+ size 74776