Commit
•
36f7902
1
Parent(s):
7f0df30
Fix KeyError (#11)
Browse files- Fix KeyError for all (4d668043e9c488bb27523353fabf49de52b799ae)
- open_access.py +6 -4
open_access.py
CHANGED
@@ -72,14 +72,16 @@ class OpenAccessConfig(datasets.BuilderConfig):
|
|
72 |
|
73 |
Args:
|
74 |
date (`str`, default _BASELINE_DATE) : Up to date, in ISO format. Pass 'latest' for latest date.
|
75 |
-
subsets (
|
|
|
76 |
**kwargs: Keyword arguments forwarded to `BuilderConfig`.
|
77 |
"""
|
78 |
-
subsets = [subsets] if isinstance(subsets, str) else subsets
|
79 |
date = datetime.date.today().isoformat() if date=="latest" else date
|
80 |
-
|
|
|
|
|
81 |
super().__init__(name=name, **kwargs)
|
82 |
-
self.subsets = subsets if
|
83 |
self.date = date
|
84 |
|
85 |
|
|
|
72 |
|
73 |
Args:
|
74 |
date (`str`, default _BASELINE_DATE) : Up to date, in ISO format. Pass 'latest' for latest date.
|
75 |
+
subsets (`str` or `list[str]`): List of subsets to load. Possible values are 'all' or any combination
|
76 |
+
of {'commercial', 'non_commercial', 'other'}.
|
77 |
**kwargs: Keyword arguments forwarded to `BuilderConfig`.
|
78 |
"""
|
|
|
79 |
date = datetime.date.today().isoformat() if date=="latest" else date
|
80 |
+
subsets = [subsets] if isinstance(subsets, str) else subsets
|
81 |
+
subsets_name = "+".join(subsets)
|
82 |
+
name = f"{date}.{subsets_name}"
|
83 |
super().__init__(name=name, **kwargs)
|
84 |
+
self.subsets = subsets if subsets_name != "all" else list(_SUBSETS.keys())
|
85 |
self.date = date
|
86 |
|
87 |
|