Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -43,14 +43,25 @@ def filterfunc(x: dict) -> bool:
|
|
43 |
if label in excluded:
|
44 |
return False
|
45 |
|
46 |
-
# FDC pairing: Medicine (61) with another science code
|
47 |
dds_primary = x.get("eai_taxonomy", {}).get("dds", {}).get("primary", {}).get("label", "")
|
48 |
dds_secondary = x.get("eai_taxonomy", {}).get("dds", {}).get("secondary", {}).get("label", "")
|
49 |
|
50 |
-
#
|
|
|
|
|
|
|
|
|
51 |
fdc_paired = (
|
|
|
52 |
(prefix(dds_primary) in FDC_KEEP and prefix(dds_secondary) in SCIENCE_CODES) or
|
53 |
-
(prefix(dds_secondary) in FDC_KEEP and prefix(dds_primary) in SCIENCE_CODES)
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
)
|
55 |
|
56 |
if not fdc_paired:
|
|
|
43 |
if label in excluded:
|
44 |
return False
|
45 |
|
46 |
+
# FDC pairing: Medicine (61) with another science code - widened scope
|
47 |
dds_primary = x.get("eai_taxonomy", {}).get("dds", {}).get("primary", {}).get("label", "")
|
48 |
dds_secondary = x.get("eai_taxonomy", {}).get("dds", {}).get("secondary", {}).get("label", "")
|
49 |
|
50 |
+
# Debug: Log some DDS codes to see what's available
|
51 |
+
if dds_primary or dds_secondary:
|
52 |
+
logger.debug(f"DDS codes found - Primary: {dds_primary}, Secondary: {dds_secondary}")
|
53 |
+
|
54 |
+
# Widened FDC filter: Accept if ANY DDS code starts with medical/science prefixes
|
55 |
fdc_paired = (
|
56 |
+
# Original strict pairing
|
57 |
(prefix(dds_primary) in FDC_KEEP and prefix(dds_secondary) in SCIENCE_CODES) or
|
58 |
+
(prefix(dds_secondary) in FDC_KEEP and prefix(dds_primary) in SCIENCE_CODES) or
|
59 |
+
# Widened: Accept if primary OR secondary has medical code
|
60 |
+
prefix(dds_primary) in FDC_KEEP or
|
61 |
+
prefix(dds_secondary) in FDC_KEEP or
|
62 |
+
# Even wider: Accept if ANY DDS code is in science codes
|
63 |
+
prefix(dds_primary) in SCIENCE_CODES or
|
64 |
+
prefix(dds_secondary) in SCIENCE_CODES
|
65 |
)
|
66 |
|
67 |
if not fdc_paired:
|