Arie Cattan commited on
Commit
180dd3d
·
1 Parent(s): d1db7b5
Files changed (1) hide show
  1. scico.py +24 -19
scico.py CHANGED
@@ -44,24 +44,24 @@ class Scico(datasets.GeneratorBasedBuilder):
44
  "flatten_mentions": datasets.features.Sequence(datasets.features.Sequence(datasets.features.Value("int32"), length=3)),
45
  "tokens": 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,
@@ -90,4 +90,9 @@ class Scico(datasets.GeneratorBasedBuilder):
90
  topic['hard_10'] = topic['hard_10'] if 'hard_10' in topic else False
91
  topic['hard_20'] = topic['hard_20'] if 'hard_10' in topic else False
92
  topic["curated"] = topic["curated"] if "curated" in topic else False
93
- yield i, topic
 
 
 
 
 
 
44
  "flatten_mentions": datasets.features.Sequence(datasets.features.Sequence(datasets.features.Value("int32"), length=3)),
45
  "tokens": 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,
 
90
  topic['hard_10'] = topic['hard_10'] if 'hard_10' in topic else False
91
  topic['hard_20'] = topic['hard_20'] if 'hard_10' in topic else False
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
+ }