Datasets:

Modalities:
Text
ArXiv:
Libraries:
Datasets
dmahata commited on
Commit
f2fb736
1 Parent(s): f2caa84

Update inspec.py

Browse files
Files changed (1) hide show
  1. inspec.py +6 -9
inspec.py CHANGED
@@ -46,8 +46,7 @@ class TestLDKP(datasets.GeneratorBasedBuilder):
46
  {
47
  "id": datasets.Value("int64"),
48
  "document": datasets.features.Sequence(datasets.Value("string")),
49
- "doc_bio_tags": datasets.features.Sequence(datasets.Value("string"))
50
-
51
  }
52
  )
53
  elif self.config.name == "generation":
@@ -56,8 +55,7 @@ class TestLDKP(datasets.GeneratorBasedBuilder):
56
  "id": datasets.Value("int64"),
57
  "document": datasets.features.Sequence(datasets.Value("string")),
58
  "extractive_keyphrases": datasets.features.Sequence(datasets.Value("string")),
59
- "abstractive_keyphrases": datasets.features.Sequence(datasets.Value("string"))
60
-
61
  }
62
  )
63
  else:
@@ -74,7 +72,6 @@ class TestLDKP(datasets.GeneratorBasedBuilder):
74
  "bio_tags": datasets.features.Sequence(datasets.Value("string"))
75
  }
76
  )
77
-
78
  }
79
  )
80
  return datasets.DatasetInfo(
@@ -129,21 +126,21 @@ class TestLDKP(datasets.GeneratorBasedBuilder):
129
  yield key, {
130
  "id": data['paper_id'],
131
  "document": data["document"],
132
- "doc_bio_tags": data["doc_bio_tags"]
133
  }
134
  elif self.config.name == "generation":
135
  yield key, {
136
  "id": data['paper_id'],
137
  "document": data["document"],
138
  "extractive_keyphrases": data["extractive_keyphrases"],
139
- "abstractive_keyphrases": data["abstractive_keyphrases"]
140
  }
141
  else:
142
  yield key, {
143
  "id": data['paper_id'],
144
  "document": data["document"],
145
- "doc_bio_tags": data["doc_bio_tags"],
146
  "extractive_keyphrases": data["extractive_keyphrases"],
147
  "abstractive_keyphrases": data["abstractive_keyphrases"],
148
- "other_metadata": data["other_metadata"]
149
  }
 
46
  {
47
  "id": datasets.Value("int64"),
48
  "document": datasets.features.Sequence(datasets.Value("string")),
49
+ "doc_bio_tags": datasets.features.Sequence(datasets.Value("string")),
 
50
  }
51
  )
52
  elif self.config.name == "generation":
 
55
  "id": datasets.Value("int64"),
56
  "document": datasets.features.Sequence(datasets.Value("string")),
57
  "extractive_keyphrases": datasets.features.Sequence(datasets.Value("string")),
58
+ "abstractive_keyphrases": datasets.features.Sequence(datasets.Value("string")),
 
59
  }
60
  )
61
  else:
 
72
  "bio_tags": datasets.features.Sequence(datasets.Value("string"))
73
  }
74
  )
 
75
  }
76
  )
77
  return datasets.DatasetInfo(
 
126
  yield key, {
127
  "id": data['paper_id'],
128
  "document": data["document"],
129
+ "doc_bio_tags": data.get("doc_bio_tags"),
130
  }
131
  elif self.config.name == "generation":
132
  yield key, {
133
  "id": data['paper_id'],
134
  "document": data["document"],
135
  "extractive_keyphrases": data["extractive_keyphrases"],
136
+ "abstractive_keyphrases": data["abstractive_keyphrases"],
137
  }
138
  else:
139
  yield key, {
140
  "id": data['paper_id'],
141
  "document": data["document"],
142
+ "doc_bio_tags": data.get("doc_bio_tags"),
143
  "extractive_keyphrases": data["extractive_keyphrases"],
144
  "abstractive_keyphrases": data["abstractive_keyphrases"],
145
+ "other_metadata": data["other_metadata"],
146
  }