def precision(document_list: Sequence[environment_pb2.Document],
              gold_answer: Sequence[str]) -> float:
  """Computes the precision of a document set.

  Args:
    document_list: The list of document over which to compute the precision.
    gold_answer: The list of gold answers.

  Returns:
    The precision of the document sequence. A document is a 'hit' if it
    *contains* one of the gold answers in its content.
  """
  return np.mean([
      gold_answer_present(doc.content, list(gold_answer))
      for doc in document_list
  ])
Computes the precision of a document set.

  Args:
    document_list: The list of document over which to compute the precision.
    gold_answer: The list of gold answers.

  Returns:
    The precision of the document sequence. A document is a 'hit' if it
    *contains* one of the gold answers in its content.
  
language/search_agents/muzero/utils.py