santanche's picture
refactor (dbvec): adding a vector database
16d3318
raw
history blame contribute delete
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]