Datasets:
aembryonic
commited on
Commit
•
1031baf
1
Parent(s):
cac830c
add version 2 and default
Browse files
humset.py
CHANGED
@@ -63,9 +63,14 @@ _SUPPORTED_VERSIONS = [
|
|
63 |
datasets.Version("2.0.0", "Extented data points including secondary tags and geolocations"),
|
64 |
]
|
65 |
|
66 |
-
DEFAULT_CONFIG_NAME = "2.0.0"
|
67 |
|
68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
FIRST_FEATURES = datasets.Features(
|
70 |
{
|
71 |
"entry_id": datasets.Value("string"),
|
@@ -77,121 +82,14 @@ FIRST_FEATURES = datasets.Features(
|
|
77 |
"created_at": datasets.Value("string"),
|
78 |
"document": datasets.Value("string"),
|
79 |
"excerpt": datasets.Value("string"),
|
80 |
-
"sectors": datasets.Sequence(
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
'Education',
|
86 |
-
'Food Security',
|
87 |
-
'Health',
|
88 |
-
'Livelihoods',
|
89 |
-
'Logistics',
|
90 |
-
'Nutrition',
|
91 |
-
'Protection',
|
92 |
-
'Shelter',
|
93 |
-
'WASH'
|
94 |
-
]
|
95 |
-
)
|
96 |
-
),
|
97 |
-
"pillars_1d": datasets.Sequence(
|
98 |
-
feature=datasets.ClassLabel(
|
99 |
-
names=[
|
100 |
-
'Casualties',
|
101 |
-
'Context',
|
102 |
-
'Covid-19',
|
103 |
-
'Displacement',
|
104 |
-
'Humanitarian Access',
|
105 |
-
'Information And Communication',
|
106 |
-
'Shock/Event'
|
107 |
-
]
|
108 |
-
)
|
109 |
-
),
|
110 |
-
"pillars_2d": datasets.Sequence(
|
111 |
-
feature=datasets.ClassLabel(
|
112 |
-
names=[
|
113 |
-
'At Risk',
|
114 |
-
'Capacities & Response',
|
115 |
-
'Humanitarian Conditions',
|
116 |
-
'Impact',
|
117 |
-
'Priority Interventions',
|
118 |
-
'Priority Needs'
|
119 |
-
]
|
120 |
-
)
|
121 |
-
),
|
122 |
-
"subpillars_1d": datasets.Sequence(
|
123 |
-
feature=datasets.ClassLabel(
|
124 |
-
names=[
|
125 |
-
'Casualties->Dead',
|
126 |
-
'Casualties->Injured',
|
127 |
-
'Casualties->Missing',
|
128 |
-
'Context->Demography',
|
129 |
-
'Context->Economy',
|
130 |
-
'Context->Environment',
|
131 |
-
'Context->Legal & Policy',
|
132 |
-
'Context->Politics',
|
133 |
-
'Context->Security & Stability',
|
134 |
-
'Context->Socio Cultural',
|
135 |
-
'Covid-19->Cases',
|
136 |
-
'Covid-19->Contact Tracing',
|
137 |
-
'Covid-19->Deaths',
|
138 |
-
'Covid-19->Hospitalization & Care',
|
139 |
-
'Covid-19->Restriction Measures',
|
140 |
-
'Covid-19->Testing',
|
141 |
-
'Covid-19->Vaccination',
|
142 |
-
'Displacement->Intentions',
|
143 |
-
'Displacement->Local Integration',
|
144 |
-
'Displacement->Pull Factors',
|
145 |
-
'Displacement->Push Factors',
|
146 |
-
'Displacement->Type/Numbers/Movements',
|
147 |
-
'Humanitarian Access->Number Of People Facing Humanitarian Access Constraints/Humanitarian Access Gaps',
|
148 |
-
'Humanitarian Access->Physical Constraints',
|
149 |
-
'Humanitarian Access->Population To Relief',
|
150 |
-
'Humanitarian Access->Relief To Population',
|
151 |
-
'Information And Communication->Communication Means And Preferences',
|
152 |
-
'Information And Communication->Information Challenges And Barriers',
|
153 |
-
'Information And Communication->Knowledge And Info Gaps (Hum)',
|
154 |
-
'Information And Communication->Knowledge And Info Gaps (Pop)',
|
155 |
-
'Shock/Event->Hazard & Threats',
|
156 |
-
'Shock/Event->Type And Characteristics',
|
157 |
-
'Shock/Event->Underlying/Aggravating Factors'
|
158 |
-
]
|
159 |
-
)
|
160 |
-
),
|
161 |
-
"subpillars_2d": datasets.Sequence(
|
162 |
-
feature=datasets.ClassLabel(
|
163 |
-
names=[
|
164 |
-
'At Risk->Number Of People At Risk',
|
165 |
-
'At Risk->Risk And Vulnerabilities',
|
166 |
-
'Capacities & Response->International Response',
|
167 |
-
'Capacities & Response->Local Response',
|
168 |
-
'Capacities & Response->National Response',
|
169 |
-
'Capacities & Response->Number Of People Reached/Response Gaps',
|
170 |
-
'Humanitarian Conditions->Coping Mechanisms',
|
171 |
-
'Humanitarian Conditions->Living Standards',
|
172 |
-
'Humanitarian Conditions->Number Of People In Need',
|
173 |
-
'Humanitarian Conditions->Physical And Mental Well Being',
|
174 |
-
'Impact->Driver/Aggravating Factors',
|
175 |
-
'Impact->Impact On People',
|
176 |
-
'Impact->Impact On Systems, Services And Networks',
|
177 |
-
'Impact->Number Of People Affected',
|
178 |
-
'Priority Interventions->Expressed By Humanitarian Staff',
|
179 |
-
'Priority Interventions->Expressed By Population',
|
180 |
-
'Priority Needs->Expressed By Humanitarian Staff',
|
181 |
-
'Priority Needs->Expressed By Population'
|
182 |
-
]
|
183 |
-
)
|
184 |
-
)
|
185 |
-
|
186 |
}
|
187 |
)
|
188 |
|
189 |
-
"""
|
190 |
-
from: https://huggingface.co/docs/datasets/v2.9.0/en/package_reference/main_classes#datasets.Sequence
|
191 |
-
a python list or a Sequence specifies that the field contains a list of objects.
|
192 |
-
The python list or Sequence should be provided with a single sub-feature as an example of the feature type hosted in this list.
|
193 |
-
"""
|
194 |
-
|
195 |
SECOND_FEATURES = datasets.Features(
|
196 |
{
|
197 |
"entry_id": datasets.Value("string"),
|
@@ -242,6 +140,8 @@ class Humset(datasets.GeneratorBasedBuilder):
|
|
242 |
for version in _SUPPORTED_VERSIONS
|
243 |
]
|
244 |
|
|
|
|
|
245 |
def _info(self):
|
246 |
|
247 |
if self.config.name == "1.0.0":
|
|
|
63 |
datasets.Version("2.0.0", "Extented data points including secondary tags and geolocations"),
|
64 |
]
|
65 |
|
|
|
66 |
|
67 |
+
"""
|
68 |
+
from: https://huggingface.co/docs/datasets/v2.9.0/en/package_reference/main_classes#datasets.Sequence
|
69 |
+
a python list or a Sequence specifies that the field contains a list of objects.
|
70 |
+
The python list or Sequence should be provided with a single sub-feature as an example of the feature type hosted in this list.
|
71 |
+
"""
|
72 |
+
|
73 |
+
|
74 |
FIRST_FEATURES = datasets.Features(
|
75 |
{
|
76 |
"entry_id": datasets.Value("string"),
|
|
|
82 |
"created_at": datasets.Value("string"),
|
83 |
"document": datasets.Value("string"),
|
84 |
"excerpt": datasets.Value("string"),
|
85 |
+
"sectors": datasets.Sequence(datasets.Value("string"), length=-1),
|
86 |
+
"pillars_1d": datasets.Sequence(datasets.Value("string"), length=-1),
|
87 |
+
"pillars_2d": datasets.Sequence(datasets.Value("string"), length=-1),
|
88 |
+
"subpillars_1d": datasets.Sequence(datasets.Value("string"), length=-1),
|
89 |
+
"subpillars_2d": datasets.Sequence(datasets.Value("string"), length=-1),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
}
|
91 |
)
|
92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
SECOND_FEATURES = datasets.Features(
|
94 |
{
|
95 |
"entry_id": datasets.Value("string"),
|
|
|
140 |
for version in _SUPPORTED_VERSIONS
|
141 |
]
|
142 |
|
143 |
+
DEFAULT_CONFIG_NAME = "2.0.0"
|
144 |
+
|
145 |
def _info(self):
|
146 |
|
147 |
if self.config.name == "1.0.0":
|