def score(gold, answer):
  """Compares answer to ground truth to return TP / FP stats."""
  if gold:
    gold = set([simplify(g) for g in gold])
  answer = simplify(answer)
  result = np.zeros(4)
  if gold:
    result[3] += 1
    if answer in gold:
      result[0] += 1
  else:
    if not answer:
      result[1] += 1
  if answer:
    result[2] += 1
  return result
Compares answer to ground truth to return TP / FP stats.
language/labs/drkit/evaluate.py