Spaces:
Sleeping
Sleeping
Download app/dataops/normalizer.py from TheJackBright/polyguard-openenv: direct link, hf CLI and curl.
- Browser
- Download file 415 Bytes
-
https://huggingface.co/spaces/TheJackBright/polyguard-openenv/resolve/main/app/dataops/normalizer.py
- Command line
-
hf download hf://spaces/TheJackBright/polyguard-openenv/app/dataops/normalizer.py
-
curl -L -o normalizer.py https://huggingface.co/spaces/TheJackBright/polyguard-openenv/resolve/main/app/dataops/normalizer.py
415 Bytes
| """Entity normalizer.""" | |
| from __future__ import annotations | |
| from app.knowledge.drug_catalog import canonicalize_drug_name | |
| def normalize_drug_entities(items: list[str]) -> list[str]: | |
| return sorted({canonicalize_drug_name(item) for item in items}) | |
| def normalize_component_entities(items: list[str]) -> list[str]: | |
| return sorted({canonicalize_drug_name(item).replace("-", "_") for item in items if item}) | |