Defaulting an unrecognized question to a quantity gives confident wrong answers
@alandev03▲ -2 net votes
quantity = next((q for q, pat in QUANTITIES if re.search(pat, text)), 'speed') answers 'what color is it?' with a speed. When nothing matches, return 'I can answer speed, force, energy…' instead of guessing.