Datasets:
Tasks:
Token Classification
Modalities:
Text
Sub-tasks:
coreference-resolution
Languages:
English
Size:
< 1K
License:
Arie Cattan
commited on
Commit
•
3bfa95b
1
Parent(s):
9c1dc3e
fix
Browse files
scico.py
CHANGED
@@ -41,27 +41,27 @@ class Scico(datasets.GeneratorBasedBuilder):
|
|
41 |
features=datasets.Features(
|
42 |
{
|
43 |
"flatten_tokens": datasets.features.Sequence(datasets.features.Value("string")),
|
44 |
-
|
45 |
"tokens": datasets.features.Sequence(datasets.features.Sequence(datasets.features.Value("string"))),
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
}
|
66 |
),
|
67 |
supervised_keys=None,
|
@@ -88,11 +88,6 @@ class Scico(datasets.GeneratorBasedBuilder):
|
|
88 |
with jsonlines.open(filepath, 'r') as f:
|
89 |
for i, topic in enumerate(f):
|
90 |
topic['hard_10'] = topic['hard_10'] if 'hard_10' in topic else False
|
91 |
-
topic['hard_20'] = topic['hard_20'] if '
|
92 |
topic["curated"] = topic["curated"] if "curated" in topic else False
|
93 |
-
yield i,
|
94 |
-
"flatten_tokens": topic["flatten_tokens"],
|
95 |
-
# "flatten_mentions": topic["flatten_mentions"],
|
96 |
-
"tokens": topic["tokens"]
|
97 |
-
# "doc_ids": topic["doc_ids"]
|
98 |
-
}
|
|
|
41 |
features=datasets.Features(
|
42 |
{
|
43 |
"flatten_tokens": datasets.features.Sequence(datasets.features.Value("string")),
|
44 |
+
"flatten_mentions": datasets.features.Sequence(datasets.features.Sequence(datasets.features.Value("int32"), length=3)),
|
45 |
"tokens": datasets.features.Sequence(datasets.features.Sequence(datasets.features.Value("string"))),
|
46 |
+
"doc_ids": datasets.features.Sequence(datasets.features.Value("int32")),
|
47 |
+
"metadata": datasets.features.Sequence(
|
48 |
+
{
|
49 |
+
"title": datasets.features.Value("string"),
|
50 |
+
"paper_sha": datasets.features.Value("string"),
|
51 |
+
"fields_of_study": datasets.features.Value("string"),
|
52 |
+
"Year": datasets.features.Value("string"),
|
53 |
+
"BookTitle": datasets.features.Value("string"),
|
54 |
+
"url": datasets.features.Value("string")
|
55 |
+
}
|
56 |
+
),
|
57 |
+
"sentences": datasets.features.Sequence(datasets.features.Sequence(datasets.features.Sequence(datasets.features.Value("int32")))),
|
58 |
+
"mentions": datasets.features.Sequence(datasets.features.Sequence(datasets.features.Value("int32"), length=4)),
|
59 |
+
"relations": datasets.features.Sequence(datasets.features.Sequence(datasets.features.Value("int32"), length=2)),
|
60 |
+
"id": datasets.Value("int32"),
|
61 |
+
"source": datasets.Value("string"),
|
62 |
+
"hard_10": datasets.features.Value("bool"),
|
63 |
+
"hard_20": datasets.features.Value("bool"),
|
64 |
+
"curated": datasets.features.Value("bool")
|
65 |
}
|
66 |
),
|
67 |
supervised_keys=None,
|
|
|
88 |
with jsonlines.open(filepath, 'r') as f:
|
89 |
for i, topic in enumerate(f):
|
90 |
topic['hard_10'] = topic['hard_10'] if 'hard_10' in topic else False
|
91 |
+
topic['hard_20'] = topic['hard_20'] if 'hard_20' in topic else False
|
92 |
topic["curated"] = topic["curated"] if "curated" in topic else False
|
93 |
+
yield i, topic
|
|
|
|
|
|
|
|
|
|