Cole French
commited on
Commit
•
65c2500
1
Parent(s):
03f5afc
Add `versions` and `authors_parsed` to schema
Browse files- arxiv_dataset.py +19 -1
arxiv_dataset.py
CHANGED
@@ -51,7 +51,9 @@ _REPORT_NO = "report-no"
|
|
51 |
_CATEGORIES = "categories"
|
52 |
_LICENSE = "license"
|
53 |
_ABSTRACT = "abstract"
|
|
|
54 |
_UPDATE_DATE = "update_date"
|
|
|
55 |
|
56 |
_FILENAME = "arxiv-metadata-oai-snapshot.json"
|
57 |
|
@@ -87,11 +89,25 @@ class ArxivDataset(datasets.GeneratorBasedBuilder):
|
|
87 |
_CATEGORIES,
|
88 |
_LICENSE,
|
89 |
_ABSTRACT,
|
|
|
90 |
_UPDATE_DATE,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
]
|
92 |
return datasets.DatasetInfo(
|
93 |
description=_DESCRIPTION,
|
94 |
-
features=datasets.Features(
|
95 |
supervised_keys=None,
|
96 |
homepage=_HOMEPAGE,
|
97 |
citation=_CITATION,
|
@@ -123,5 +139,7 @@ class ArxivDataset(datasets.GeneratorBasedBuilder):
|
|
123 |
_CATEGORIES: data["categories"],
|
124 |
_LICENSE: data["license"],
|
125 |
_ABSTRACT: data["abstract"],
|
|
|
126 |
_UPDATE_DATE: data["update_date"],
|
|
|
127 |
}
|
|
|
51 |
_CATEGORIES = "categories"
|
52 |
_LICENSE = "license"
|
53 |
_ABSTRACT = "abstract"
|
54 |
+
_VERSIONS = "versions"
|
55 |
_UPDATE_DATE = "update_date"
|
56 |
+
_AUTHORS_PARSED = "authors_parsed"
|
57 |
|
58 |
_FILENAME = "arxiv-metadata-oai-snapshot.json"
|
59 |
|
|
|
89 |
_CATEGORIES,
|
90 |
_LICENSE,
|
91 |
_ABSTRACT,
|
92 |
+
_VERSIONS,
|
93 |
_UPDATE_DATE,
|
94 |
+
_AUTHORS_PARSED,
|
95 |
+
]
|
96 |
+
features = {k: datasets.Value("string") for k in feature_names}
|
97 |
+
features[_VERSIONS] = [
|
98 |
+
{
|
99 |
+
"version": datasets.Value("string"),
|
100 |
+
"created": datasets.Value("string"),
|
101 |
+
}
|
102 |
+
]
|
103 |
+
features[_AUTHORS_PARSED] = [
|
104 |
+
[
|
105 |
+
datasets.Value("string"),
|
106 |
+
]
|
107 |
]
|
108 |
return datasets.DatasetInfo(
|
109 |
description=_DESCRIPTION,
|
110 |
+
features=datasets.Features(features),
|
111 |
supervised_keys=None,
|
112 |
homepage=_HOMEPAGE,
|
113 |
citation=_CITATION,
|
|
|
139 |
_CATEGORIES: data["categories"],
|
140 |
_LICENSE: data["license"],
|
141 |
_ABSTRACT: data["abstract"],
|
142 |
+
_VERSIONS: data["versions"],
|
143 |
_UPDATE_DATE: data["update_date"],
|
144 |
+
_AUTHORS_PARSED: data["authors_parsed"],
|
145 |
}
|