Felix
commited on
Commit
·
3affcf8
1
Parent(s):
8c7b3c5
add proper typing to swewic
Browse files- superlim-2.py +29 -5
superlim-2.py
CHANGED
@@ -290,11 +290,35 @@ class SuperLim(datasets.GeneratorBasedBuilder):
|
|
290 |
})
|
291 |
elif self.config.name == "swewic":
|
292 |
features = datasets.Features({
|
293 |
-
"idx": datasets.Value(
|
294 |
-
"first": datasets.
|
295 |
-
|
296 |
-
|
297 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
298 |
})
|
299 |
else:
|
300 |
raise ValueError(f"Subset {self.config.name} does not exist.")
|
|
|
290 |
})
|
291 |
elif self.config.name == "swewic":
|
292 |
features = datasets.Features({
|
293 |
+
"idx": datasets.Value(dtype='int32'),
|
294 |
+
"first": datasets.Features({
|
295 |
+
"context": datasets.Value("string"),
|
296 |
+
"word": datasets.Features({
|
297 |
+
"location": datasets.Features({
|
298 |
+
"start": datasets.Value(dtype='int32'),
|
299 |
+
"stop": datasets.Value(dtype='int32')
|
300 |
+
}),
|
301 |
+
"text": datasets.Value("string")
|
302 |
+
})
|
303 |
+
}),
|
304 |
+
"second": datasets.Features({
|
305 |
+
"context": datasets.Value("string"),
|
306 |
+
"word": datasets.Features({
|
307 |
+
"location": datasets.Features({
|
308 |
+
"start": datasets.Value(dtype='int32'),
|
309 |
+
"stop": datasets.Value(dtype='int32')
|
310 |
+
}),
|
311 |
+
"text": datasets.Value("string")
|
312 |
+
})
|
313 |
+
}),
|
314 |
+
"label": datasets.ClassLabel(num_classes=2, names=['same_sense', 'different_sense']),
|
315 |
+
"meta": datasets.Features({
|
316 |
+
"first_source": datasets.Value("string"),
|
317 |
+
"first_sense_id": datasets.Value("string"),
|
318 |
+
"second_source": datasets.Value("string"),
|
319 |
+
"second_sense_id": datasets.Value("string"),
|
320 |
+
"pos": datasets.Value("string")
|
321 |
+
})
|
322 |
})
|
323 |
else:
|
324 |
raise ValueError(f"Subset {self.config.name} does not exist.")
|