Download parser.py from santanche/sml-agents-publish-subscribe-dbvec: direct link, hf CLI and curl.
- Browser
- Download file 205 Bytes
-
https://huggingface.co/spaces/santanche/sml-agents-publish-subscribe-dbvec/resolve/main/parser.py
- Command line
-
hf download hf://spaces/santanche/sml-agents-publish-subscribe-dbvec/parser.py
-
curl -L -o parser.py https://huggingface.co/spaces/santanche/sml-agents-publish-subscribe-dbvec/resolve/main/parser.py
205 Bytes
| import re | |
| def parse_symptoms(symptom_string): | |
| pattern = r"([^,]+?)\s*\(([\d\.]+)\)" | |
| matches = re.findall(pattern, symptom_string) | |
| return [(m[0].strip().lower(), float(m[1])) for m in matches] | |