Skip to content

Commit 45e44be

Browse files
committed
remove unauthorized classifications
1 parent b18e0e8 commit 45e44be

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

scripts/ej/create_ej_dump.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,26 @@ def process_classifications(data: dict[str, any], threshold: float = 0.5) -> dic
4040

4141
predicted_cmr = []
4242

43+
authorized_classifications = [
44+
"Climate Change",
45+
"Disasters",
46+
"Extreme Heat",
47+
"Food Availability",
48+
"Health & Air Quality",
49+
"Human Dimensions",
50+
"Urban Flooding",
51+
"Water Availability",
52+
]
53+
54+
4355
for inference in inferences:
4456
classifications = process_classifications(inference)
4557
if classifications == ["Not EJ"]:
4658
continue
4759

60+
# Filter classifications to keep only those in the authorized list
61+
classifications = [cls for cls in classifications if cls in authorized_classifications]
62+
4863
cmr_dataset = cmr_dict.get(inference["concept-id"])
4964
if cmr_dataset:
5065
cmr_dataset["indicators"] = ";".join(classifications)

0 commit comments

Comments
 (0)