parquet-converter commited on
Commit
26dab4d
β€’
1 Parent(s): c41f77b

Update parquet files

Browse files
OpenSLU.py DELETED
@@ -1,183 +0,0 @@
1
- import json
2
- import os
3
-
4
- import datasets
5
-
6
- _OPEN_SLU_CITATION = """\
7
- xxx"""
8
-
9
- _OPEN_SLU_DESCRIPTION = """\
10
- xxx"""
11
-
12
- _ATIS_DESCRIPTION = """\
13
- @article{wang2019superglue,
14
- title={SuperGLUE: A Stickier Benchmark for General-Purpose Language Understanding Systems},
15
- author={Wang, Alex and Pruksachatkun, Yada and Nangia, Nikita and Singh, Amanpreet and Michael, Julian and Hill, Felix and Levy, Omer and Bowman, Samuel R},
16
- journal={arXiv preprint arXiv:1905.00537},
17
- year={2019}
18
- }
19
- Note that each SuperGLUE dataset has its own citation. Please see the source to
20
- get the correct citation for each contained dataset.
21
- """
22
-
23
- _BOOLQ_CITATION = """\
24
- @inproceedings{clark2019boolq,
25
- title={BoolQ: Exploring the Surprising Difficulty of Natural Yes/No Questions},
26
- author={Clark, Christopher and Lee, Kenton and Chang, Ming-Wei, and Kwiatkowski, Tom and Collins, Michael, and Toutanova, Kristina},
27
- booktitle={NAACL},
28
- year={2019}
29
- }"""
30
-
31
-
32
- class OpenSLUConfig(datasets.BuilderConfig):
33
- """BuilderConfig for OpenSLU."""
34
-
35
- def __init__(self, features, data_url, citation, url, intent_label_classes=None, slot_label_classes=None, **kwargs):
36
- """BuilderConfig for OpenSLU.
37
- Args:
38
- features: `list[string]`, list of the features that will appear in the
39
- feature dict. Should not include "label".
40
- data_url: `string`, url to download the zip file from.
41
- citation: `string`, citation for the data set.
42
- url: `string`, url for information about the data set.
43
- intent_label_classes: `list[string]`, the list of classes for the intent label
44
- slot_label_classes: `list[string]`, the list of classes for the slot label
45
- **kwargs: keyword arguments forwarded to super.
46
- """
47
- # Version history:
48
- # 0.0.1: Initial version.
49
- super(OpenSLUConfig, self).__init__(version=datasets.Version("0.0.1"), **kwargs)
50
- self.features = features
51
- self.intent_label_classes = intent_label_classes
52
- self.slot_label_classes = slot_label_classes
53
- self.data_url = data_url
54
- self.citation = citation
55
- self.url = url
56
-
57
-
58
- class OpenSLU(datasets.GeneratorBasedBuilder):
59
- """The SuperGLUE benchmark."""
60
-
61
- BUILDER_CONFIGS = [
62
- OpenSLUConfig(
63
- name="atis",
64
- description=_ATIS_DESCRIPTION,
65
- features=["text"],
66
- data_url="https://huggingface.co/datasets/LightChen2333/OpenSLU/resolve/main/atis.tar.gz",
67
- citation="",
68
- url="",
69
- ),
70
- OpenSLUConfig(
71
- name="snips",
72
- description=_ATIS_DESCRIPTION,
73
- features=["text"],
74
- data_url="https://huggingface.co/datasets/LightChen2333/OpenSLU/resolve/main/snips.tar.gz",
75
- citation="",
76
- url="",
77
- ),
78
- OpenSLUConfig(
79
- name="mix-atis",
80
- description=_ATIS_DESCRIPTION,
81
- features=["text"],
82
- data_url="https://huggingface.co/datasets/LightChen2333/OpenSLU/resolve/main/mix-atis.tar.gz",
83
- citation="",
84
- url="",
85
- ),
86
- OpenSLUConfig(
87
- name="mix-snips",
88
- description=_ATIS_DESCRIPTION,
89
- features=["text"],
90
- data_url="https://huggingface.co/datasets/LightChen2333/OpenSLU/resolve/main/mix-snips.tar.gz",
91
- citation="",
92
- url="",
93
- ),
94
- ]
95
-
96
- def _info(self):
97
- features = {feature: datasets.Sequence(datasets.Value("string")) for feature in self.config.features}
98
- features["slot"] = datasets.Sequence(datasets.Value("string"))
99
- features["intent"] = datasets.Value("string")
100
-
101
- return datasets.DatasetInfo(
102
- description=_OPEN_SLU_DESCRIPTION + self.config.description,
103
- features=datasets.Features(features),
104
- homepage=self.config.url,
105
- citation=self.config.citation + "\n" + _OPEN_SLU_CITATION,
106
- )
107
-
108
- def _split_generators(self, dl_manager):
109
- print(self.config.data_url)
110
- dl_dir = dl_manager.download_and_extract(self.config.data_url) or ""
111
-
112
- task_name = _get_task_name_from_data_url(self.config.data_url)
113
- print(dl_dir)
114
- print(task_name)
115
- dl_dir = os.path.join(dl_dir, task_name)
116
- return [
117
- datasets.SplitGenerator(
118
- name=datasets.Split.TRAIN,
119
- gen_kwargs={
120
- "data_file": os.path.join(dl_dir, "train.jsonl"),
121
- "split": datasets.Split.TRAIN,
122
- },
123
- ),
124
- datasets.SplitGenerator(
125
- name=datasets.Split.VALIDATION,
126
- gen_kwargs={
127
- "data_file": os.path.join(dl_dir, "dev.jsonl"),
128
- "split": datasets.Split.VALIDATION,
129
- },
130
- ),
131
- datasets.SplitGenerator(
132
- name=datasets.Split.TEST,
133
- gen_kwargs={
134
- "data_file": os.path.join(dl_dir, "test.jsonl"),
135
- "split": datasets.Split.TEST,
136
- },
137
- ),
138
- ]
139
-
140
- def _generate_examples(self, data_file, split):
141
- with open(data_file, encoding="utf-8") as f:
142
- for index, line in enumerate(f):
143
- row = json.loads(line)
144
- yield index, row
145
-
146
-
147
- def _cast_label(label):
148
- """Converts the label into the appropriate string version."""
149
- if isinstance(label, str):
150
- return label
151
- elif isinstance(label, bool):
152
- return "True" if label else "False"
153
- elif isinstance(label, int):
154
- assert label in (0, 1)
155
- return str(label)
156
- else:
157
- raise ValueError("Invalid label format.")
158
-
159
-
160
- def _get_record_entities(passage):
161
- """Returns the unique set of entities."""
162
- text = passage["text"]
163
- entity_spans = list()
164
- for entity in passage["entities"]:
165
- entity_text = text[entity["start"]: entity["end"] + 1]
166
- entity_spans.append({"text": entity_text, "start": entity["start"], "end": entity["end"] + 1})
167
- entity_spans = sorted(entity_spans, key=lambda e: e["start"]) # sort by start index
168
- entity_texts = set(e["text"] for e in entity_spans) # for backward compatability
169
- return entity_texts, entity_spans
170
-
171
-
172
- def _get_record_answers(qa):
173
- """Returns the unique set of answers."""
174
- if "answers" not in qa:
175
- return []
176
- answers = set()
177
- for answer in qa["answers"]:
178
- answers.add(answer["text"])
179
- return sorted(answers)
180
-
181
-
182
- def _get_task_name_from_data_url(data_url):
183
- return data_url.split("/")[-1].split(".")[0]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
README.md DELETED
@@ -1,3 +0,0 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
snips.tar.gz β†’ atis/open_slu-test.parquet RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:10c4ecf7f0bd00bd6c1d63ff1f9254b8ed9bfb36ece0aa598a79189d3a8e8827
3
- size 395494
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f96468193fcb94e349a11c18896b54365f2c658659f54aeee457a79647a85ebc
3
+ size 24547
atis.tar.gz β†’ atis/open_slu-train.parquet RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:57653117e03264012d2d6c1a0707372829d2a1ac4d09b125f78a6a1430457fc3
3
- size 134510
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ff49d08b971bfd4b50d5e72ae51b7ef24a5562d8d202dd2f684a9571ad051b69
3
+ size 133407
mix-atis.tar.gz β†’ atis/open_slu-validation.parquet RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ba9f04e072bf510b7d6cf3ca37d20335800015970ba9ccbbab66aef5bd990cdb
3
- size 602624
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4ec7eaa8e3c932ce95005b3fc3f49fd3114362eebd17b549ecdffdf468f963f2
3
+ size 17917
mix-snips.tar.gz β†’ mix-atis/open_slu-test.parquet RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:0c9988e4558bf66cd85177c6a9414474131abb64e014c1bd501f0c34c6dd87a3
3
- size 2476559
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b03afea86c57b496355aa78838fd5a1b85ddba30e8dc420d69a9d1ceccba756f
3
+ size 35202
mix-atis/open_slu-train.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:036fedc754036252d8e56d9d71839696bf69c749e1f98739a6644ed0ca30ce13
3
+ size 633703
mix-atis/open_slu-validation.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:62128ae079cfe727e96162525f8f2809eec78291a5172ddab2f695ccb8b3c4b1
3
+ size 33806
mix-snips/open_slu-test.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fdc54919c6309708e1ddd3cb3cd64ff97f6775d0a91c0b4e12f4604ca5ce5bc2
3
+ size 132355
mix-snips/open_slu-train.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e3dfc330ed0d48d560c3e91d14094e55ac6e496046fd50e93958374eaba41d8f
3
+ size 2811342
mix-snips/open_slu-validation.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fa25f6056ee313c183a2f8f6eeaab26ec6707ddd8b484e8fe03d5ad01c072212
3
+ size 130949
snips/open_slu-test.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5e92af8e5d72d57e5b4401278c322947f69f6373d099f810ca023d540c540dca
3
+ size 29975
snips/open_slu-train.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:150f1304c5bf2104e20ff2c0338b96ed26652c2e314ae86ff37f734edad8e844
3
+ size 514377
snips/open_slu-validation.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:22d31ed568ffc951c45b663edba4ffeb42c1402bfb1b47cd5bcce34b8f027ca0
3
+ size 29159