Download src/protocol_pilot/guards.py from idiakhoas/protocolcolpilot: direct link, hf CLI and curl.
- Browser
- Download file 313 Bytes
-
https://huggingface.co/datasets/idiakhoas/protocolcolpilot/resolve/main/src/protocol_pilot/guards.py
- Command line
-
hf download hf://datasets/idiakhoas/protocolcolpilot/src/protocol_pilot/guards.py
-
curl -L -o guards.py https://huggingface.co/datasets/idiakhoas/protocolcolpilot/resolve/main/src/protocol_pilot/guards.py
313 Bytes
| from __future__ import annotations | |
| import re | |
| BANNED_PATTERNS = [ | |
| r"diagnos(e|is|tic)", | |
| r"treat(ment|ing)?", | |
| r"patient\-specific", | |
| r"clinical decision", | |
| ] | |
| def contains_banned_language(text: str) -> bool: | |
| text_low = text.lower() | |
| return any(re.search(p, text_low) for p in BANNED_PATTERNS) | |