Datasets:

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

Update inspec.py

Browse files
Files changed (1) hide show
  1. inspec.py +12 -9
inspec.py CHANGED
@@ -25,7 +25,7 @@ _URLS = {
25
 
26
 
27
  # TODO: Name of the dataset usually match the script name with CamelCase instead of snake_case
28
- class TestLDKP(datasets.GeneratorBasedBuilder):
29
  """TODO: Short description of my dataset."""
30
 
31
  VERSION = datasets.Version("0.0.1")
@@ -46,7 +46,8 @@ 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
  elif self.config.name == "generation":
@@ -55,7 +56,8 @@ class TestLDKP(datasets.GeneratorBasedBuilder):
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,6 +74,7 @@ class TestLDKP(datasets.GeneratorBasedBuilder):
72
  "bio_tags": datasets.features.Sequence(datasets.Value("string"))
73
  }
74
  )
 
75
  }
76
  )
77
  return datasets.DatasetInfo(
@@ -126,21 +129,21 @@ class TestLDKP(datasets.GeneratorBasedBuilder):
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
  }
 
25
 
26
 
27
  # TODO: Name of the dataset usually match the script name with CamelCase instead of snake_case
28
+ class Inspec(datasets.GeneratorBasedBuilder):
29
  """TODO: Short description of my dataset."""
30
 
31
  VERSION = datasets.Version("0.0.1")
 
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
  "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
  "bio_tags": datasets.features.Sequence(datasets.Value("string"))
75
  }
76
  )
77
+
78
  }
79
  )
80
  return datasets.DatasetInfo(
 
129
  yield key, {
130
  "id": data['paper_id'],
131
  "document": data["document"],
132
+ "doc_bio_tags": data.get("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.get("extractive_keyphrases"),
139
+ "abstractive_keyphrases": data.get("abstractive_keyphrases")
140
  }
141
  else:
142
  yield key, {
143
  "id": data['paper_id'],
144
  "document": data["document"],
145
  "doc_bio_tags": data.get("doc_bio_tags"),
146
+ "extractive_keyphrases": data.get("extractive_keyphrases"),
147
+ "abstractive_keyphrases": data.get("abstractive_keyphrases"),
148
+ "other_metadata": data["other_metadata"]
149
  }