ncoop57
commited on
Commit
•
b66a2ac
1
Parent(s):
c60d144
Add loading and processing length datasets
Browse files- completeformer-masked.py +31 -0
completeformer-masked.py
CHANGED
@@ -61,6 +61,22 @@ _DATA_URLs = {
|
|
61 |
"valid": "https://huggingface.co/datasets/semeru/completeformer-masked/resolve/main/validation_mix.csv",
|
62 |
"test": "https://huggingface.co/datasets/semeru/completeformer-masked/resolve/main/test_mix.csv",
|
63 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
}
|
65 |
|
66 |
|
@@ -131,6 +147,14 @@ class CSNCHumanJudgementDataset(datasets.GeneratorBasedBuilder):
|
|
131 |
"target": datasets.Value("string"),
|
132 |
}
|
133 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
|
135 |
return datasets.DatasetInfo(
|
136 |
description=_DESCRIPTION,
|
@@ -224,3 +248,10 @@ class CSNCHumanJudgementDataset(datasets.GeneratorBasedBuilder):
|
|
224 |
"input": input,
|
225 |
"target": target,
|
226 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
"valid": "https://huggingface.co/datasets/semeru/completeformer-masked/resolve/main/validation_mix.csv",
|
62 |
"test": "https://huggingface.co/datasets/semeru/completeformer-masked/resolve/main/test_mix.csv",
|
63 |
}
|
64 |
+
"length_short": {
|
65 |
+
"train": "https://huggingface.co/datasets/semeru/completeformer-masked/resolve/main/training_short.csv",
|
66 |
+
"train_long": "https://huggingface.co/datasets/semeru/completeformer-masked/resolve/main/training_long.csv",
|
67 |
+
"valid": "https://huggingface.co/datasets/semeru/completeformer-masked/resolve/main/validation_length.csv",
|
68 |
+
"test": "https://huggingface.co/datasets/semeru/completeformer-masked/resolve/main/test_length.csv",
|
69 |
+
},
|
70 |
+
"length_medium": {
|
71 |
+
"train": "https://huggingface.co/datasets/semeru/completeformer-masked/resolve/main/training_medium.csv",
|
72 |
+
"valid": "https://huggingface.co/datasets/semeru/completeformer-masked/resolve/main/validation_length.csv",
|
73 |
+
"test": "https://huggingface.co/datasets/semeru/completeformer-masked/resolve/main/test_length.csv",
|
74 |
+
},
|
75 |
+
"length_long": {
|
76 |
+
"train": "https://huggingface.co/datasets/semeru/completeformer-masked/resolve/main/training_long.csv",
|
77 |
+
"valid": "https://huggingface.co/datasets/semeru/completeformer-masked/resolve/main/validation_length.csv",
|
78 |
+
"test": "https://huggingface.co/datasets/semeru/completeformer-masked/resolve/main/test_length.csv",
|
79 |
+
},
|
80 |
}
|
81 |
|
82 |
|
|
|
147 |
"target": datasets.Value("string"),
|
148 |
}
|
149 |
)
|
150 |
+
elif self.config.name.startswith("length_"):
|
151 |
+
features = datasets.Features(
|
152 |
+
{
|
153 |
+
"input": datasets.Value("string"),
|
154 |
+
"target": datasets.Value("string"),
|
155 |
+
"size": datasets.Value("int64"),
|
156 |
+
}
|
157 |
+
)
|
158 |
|
159 |
return datasets.DatasetInfo(
|
160 |
description=_DESCRIPTION,
|
|
|
248 |
"input": input,
|
249 |
"target": target,
|
250 |
}
|
251 |
+
elif self.config.name.startswith("length_"):
|
252 |
+
_, input, target, size = row
|
253 |
+
yield row_id, {
|
254 |
+
"input": input,
|
255 |
+
"target": target,
|
256 |
+
"size": int(size),
|
257 |
+
}
|