def compute_nums(question):
  """Finds numbers in a string and convert them to floats."""
  # The funny looking replace is needed to deal with numbers such as 4,000
  # TODO(henrykm) deal with numbers written as words "one", "two", ...
  return [
      float(num.replace(',', '')) for num in re.findall(
          r'[-+]?[.]?[\d]+(?:,\d\d\d)*[\.]?\d*(?:[eE][-+]?\d+)?', question)
  ]
Finds numbers in a string and convert them to floats.
trax/data/tf_inputs.py