vipulraheja
commited on
Commit
·
3c34c48
1
Parent(s):
13a494a
feat: add challenge sets
Browse files- .gitattributes +10 -0
- conversational_weather.py +83 -27
- data/challenge_sets/dial_test_freq_1.tsv +3 -0
- data/challenge_sets/dial_test_freq_2.tsv +3 -0
- data/challenge_sets/dial_test_freq_3.tsv +3 -0
- data/challenge_sets/dial_test_freq_4.tsv +3 -0
- data/challenge_sets/dial_test_freq_5.tsv +3 -0
- data/{disc_test.tsv → challenge_sets/disc_test.tsv} +2 -2
- data/challenge_sets/disc_test_freq_0.tsv +3 -0
- data/challenge_sets/disc_test_freq_1.tsv +3 -0
- data/challenge_sets/disc_test_freq_2.tsv +3 -0
- data/challenge_sets/disc_test_freq_3.tsv +3 -0
.gitattributes
CHANGED
@@ -33,3 +33,13 @@ data/disc_test.tsv filter=lfs diff=lfs merge=lfs -text
|
|
33 |
data/test.tsv filter=lfs diff=lfs merge=lfs -text
|
34 |
data/train.tsv filter=lfs diff=lfs merge=lfs -text
|
35 |
data/val.tsv filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
data/test.tsv filter=lfs diff=lfs merge=lfs -text
|
34 |
data/train.tsv filter=lfs diff=lfs merge=lfs -text
|
35 |
data/val.tsv filter=lfs diff=lfs merge=lfs -text
|
36 |
+
data/challenge_sets/dial_test_freq_5.tsv filter=lfs diff=lfs merge=lfs -text
|
37 |
+
data/challenge_sets/disc_test_freq_1.tsv filter=lfs diff=lfs merge=lfs -text
|
38 |
+
data/challenge_sets/disc_test_freq_2.tsv filter=lfs diff=lfs merge=lfs -text
|
39 |
+
data/challenge_sets/disc_test_freq_3.tsv filter=lfs diff=lfs merge=lfs -text
|
40 |
+
data/challenge_sets/dial_test_freq_1.tsv filter=lfs diff=lfs merge=lfs -text
|
41 |
+
data/challenge_sets/dial_test_freq_2.tsv filter=lfs diff=lfs merge=lfs -text
|
42 |
+
data/challenge_sets/dial_test_freq_3.tsv filter=lfs diff=lfs merge=lfs -text
|
43 |
+
data/challenge_sets/dial_test_freq_4.tsv filter=lfs diff=lfs merge=lfs -text
|
44 |
+
data/challenge_sets/disc_test.tsv filter=lfs diff=lfs merge=lfs -text
|
45 |
+
data/challenge_sets/disc_test_freq_0.tsv filter=lfs diff=lfs merge=lfs -text
|
conversational_weather.py
CHANGED
@@ -55,10 +55,25 @@ _URLs = {
|
|
55 |
'train': 'https://raw.githubusercontent.com/facebookresearch/TreeNLG/master/data/weather/train.tsv',
|
56 |
'validation': 'https://raw.githubusercontent.com/facebookresearch/TreeNLG/master/data/weather/val.tsv',
|
57 |
'test': 'https://raw.githubusercontent.com/facebookresearch/TreeNLG/master/data/weather/test.tsv'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
}
|
59 |
}
|
60 |
|
61 |
-
|
62 |
class ConversationalWeather(datasets.GeneratorBasedBuilder):
|
63 |
"""The Conversational Weather dataset is designed for generation of responses to weather queries
|
64 |
based on a structured input data. The input allows specifying data attributes such as dates, times,
|
@@ -67,6 +82,13 @@ class ConversationalWeather(datasets.GeneratorBasedBuilder):
|
|
67 |
|
68 |
VERSION = datasets.Version("1.1.0")
|
69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
def _info(self):
|
71 |
# This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
|
72 |
features = datasets.Features(
|
@@ -106,32 +128,66 @@ class ConversationalWeather(datasets.GeneratorBasedBuilder):
|
|
106 |
|
107 |
my_urls = _URLs[self.config.name]
|
108 |
data_dir = dl_manager.download_and_extract(my_urls)
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
|
136 |
def _generate_examples(
|
137 |
self, filepath, split # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
|
|
55 |
'train': 'https://raw.githubusercontent.com/facebookresearch/TreeNLG/master/data/weather/train.tsv',
|
56 |
'validation': 'https://raw.githubusercontent.com/facebookresearch/TreeNLG/master/data/weather/val.tsv',
|
57 |
'test': 'https://raw.githubusercontent.com/facebookresearch/TreeNLG/master/data/weather/test.tsv'
|
58 |
+
},
|
59 |
+
'challenge': {
|
60 |
+
'disc_test': './data/challenge_sets/disc_test.tsv',
|
61 |
+
'dial_test_freq': {
|
62 |
+
'dial_test_freq_1': './data/challenge_sets/dial_test_freq_1.tsv',
|
63 |
+
'dial_test_freq_2': './data/challenge_sets/dial_test_freq_2.tsv',
|
64 |
+
'dial_test_freq_3': './data/challenge_sets/dial_test_freq_3.tsv',
|
65 |
+
'dial_test_freq_4': './data/challenge_sets/dial_test_freq_4.tsv',
|
66 |
+
'dial_test_freq_5': './data/challenge_sets/dial_test_freq_5.tsv'
|
67 |
+
},
|
68 |
+
'disc_test_freq': {
|
69 |
+
'disc_test_freq_0': './data/challenge_sets/disc_test_freq_0.tsv',
|
70 |
+
'disc_test_freq_1': './data/challenge_sets/disc_test_freq_1.tsv',
|
71 |
+
'disc_test_freq_2': './data/challenge_sets/disc_test_freq_2.tsv',
|
72 |
+
'disc_test_freq_3': './data/challenge_sets/disc_test_freq_3.tsv'
|
73 |
+
},
|
74 |
}
|
75 |
}
|
76 |
|
|
|
77 |
class ConversationalWeather(datasets.GeneratorBasedBuilder):
|
78 |
"""The Conversational Weather dataset is designed for generation of responses to weather queries
|
79 |
based on a structured input data. The input allows specifying data attributes such as dates, times,
|
|
|
82 |
|
83 |
VERSION = datasets.Version("1.1.0")
|
84 |
|
85 |
+
BUILDER_CONFIGS = [
|
86 |
+
datasets.BuilderConfig(name="default", version=VERSION, description="This part of my dataset covers a first domain"),
|
87 |
+
datasets.BuilderConfig(name="challenge", version=VERSION, description="This part of my dataset covers a second domain"),
|
88 |
+
]
|
89 |
+
|
90 |
+
DEFAULT_CONFIG_NAME = "default"
|
91 |
+
|
92 |
def _info(self):
|
93 |
# This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
|
94 |
features = datasets.Features(
|
|
|
128 |
|
129 |
my_urls = _URLs[self.config.name]
|
130 |
data_dir = dl_manager.download_and_extract(my_urls)
|
131 |
+
if self.config.name is 'challenge':
|
132 |
+
disc_test_freq_data = []
|
133 |
+
for k in range(len(_URLs['challenge']['disc_test_freq'])):
|
134 |
+
disc_test_freq_data.append(
|
135 |
+
datasets.SplitGenerator(
|
136 |
+
name=datasets.NamedSplit(f"disc_test_freq_{k}"),
|
137 |
+
gen_kwargs={
|
138 |
+
"filepath": os.path.join(data_dir['disc_test_freq'][f'disc_test_freq_{k}']),
|
139 |
+
"split": f"disc-test-freq-{k}",
|
140 |
+
},
|
141 |
+
))
|
142 |
+
|
143 |
+
dial_test_freq_data = []
|
144 |
+
for k in range(1, len(_URLs['challenge']['dial_test_freq'])+1):
|
145 |
+
dial_test_freq_data.append(
|
146 |
+
datasets.SplitGenerator(
|
147 |
+
name=datasets.NamedSplit(f"dial_test_freq_{k}"),
|
148 |
+
gen_kwargs={
|
149 |
+
"filepath": os.path.join(data_dir['dial_test_freq'][f'dial_test_freq_{k}']),
|
150 |
+
"split": f"dial-test-freq-{k}",
|
151 |
+
},
|
152 |
+
))
|
153 |
+
|
154 |
+
return [
|
155 |
+
datasets.SplitGenerator(
|
156 |
+
name=datasets.NamedSplit("disc_test"),
|
157 |
+
gen_kwargs={
|
158 |
+
"filepath": os.path.join(data_dir['disc_test']),
|
159 |
+
"split": "disc-test",
|
160 |
+
},
|
161 |
+
)] + disc_test_freq_data + dial_test_freq_data
|
162 |
+
|
163 |
+
else:
|
164 |
+
return [
|
165 |
+
datasets.SplitGenerator(
|
166 |
+
name=datasets.Split.TRAIN,
|
167 |
+
# These kwargs will be passed to _generate_examples
|
168 |
+
gen_kwargs={
|
169 |
+
"filepath": os.path.join(data_dir['train']),
|
170 |
+
"split": "train",
|
171 |
+
},
|
172 |
+
),
|
173 |
+
datasets.SplitGenerator(
|
174 |
+
name=datasets.Split.TEST,
|
175 |
+
# These kwargs will be passed to _generate_examples
|
176 |
+
gen_kwargs={
|
177 |
+
"filepath": os.path.join(data_dir['test']),
|
178 |
+
"split": "test"
|
179 |
+
},
|
180 |
+
),
|
181 |
+
datasets.SplitGenerator(
|
182 |
+
name=datasets.Split.VALIDATION,
|
183 |
+
# These kwargs will be passed to _generate_examples
|
184 |
+
gen_kwargs={
|
185 |
+
"filepath": os.path.join(data_dir['validation']),
|
186 |
+
"split": "dev",
|
187 |
+
},
|
188 |
+
),
|
189 |
+
]
|
190 |
+
|
191 |
|
192 |
def _generate_examples(
|
193 |
self, filepath, split # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
data/challenge_sets/dial_test_freq_1.tsv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3057b7c34ce66ebaadcb22ff5834158b80af5a1a5f3ce92c5b2d237c31d84feb
|
3 |
+
size 296303
|
data/challenge_sets/dial_test_freq_2.tsv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:af3b7471015b87af6fb118ff5d97b12c07070cdd6256498105a0f7be060fc4e5
|
3 |
+
size 729082
|
data/challenge_sets/dial_test_freq_3.tsv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f2999eca340417ecbecead1719df3a9ae8fe0d8afc6624212fa2dc465d18357a
|
3 |
+
size 798326
|
data/challenge_sets/dial_test_freq_4.tsv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:678041916baa5f9cd5d415638689b85c0e8e3fdc9a9fe66273a1342cfd4ba0d4
|
3 |
+
size 450130
|
data/challenge_sets/dial_test_freq_5.tsv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:10bf51037283c8322d3aaea64e6b1ba5e3ae6c45ed621e327eabdf791ce6c1b2
|
3 |
+
size 91432
|
data/{disc_test.tsv → challenge_sets/disc_test.tsv}
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:142608abfb4cae43b760cd7cd5788ce9c599f8c43671ea011a0d16c1dca40b58
|
3 |
+
size 240759
|
data/challenge_sets/disc_test_freq_0.tsv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e70ca7cacfd43b424fbd375ac8fc3e7bde24538caccdcbd19c056b8825437422
|
3 |
+
size 1049105
|
data/challenge_sets/disc_test_freq_1.tsv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0f9ab3179e19ee7d48e9d4ffd81ea0d37f08ff17213d3e6c5c02a3a3d2cc4921
|
3 |
+
size 1055004
|
data/challenge_sets/disc_test_freq_2.tsv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3c912b019fa5d1f39c7d83e404f79250e6b54ef127aff201cab3faeac186995a
|
3 |
+
size 248090
|
data/challenge_sets/disc_test_freq_3.tsv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e99097dd34607d0f6c03a17cb35125f37f15571d5dfe57d4218f4db56d45c40b
|
3 |
+
size 13074
|