def read_model_predictions(
    prediction_path):
  """Read a model's validation predictions and convert to a dictionary.

  Args:
    prediction_path: Path to read predictions from

  Returns:
    A dictionary where values are predictions, and keys are composed of
    the claim_id/wikipedia_url/sentence_id/scrape_type
  """
  model_predictions = util.read_json(prediction_path)
  id_to_predictions = {}
  for pred in model_predictions['predictions']:
    claim_id = pred['metadata']['claim_id']
    scrape_type = pred['metadata']['scrape_type']
    wikipedia_url = pred['metadata']['wikipedia_url']
    sentence_id = pred['metadata']['sentence_id']
    identifier = make_example_id(
        claim_id=claim_id,
        wikipedia_url=wikipedia_url,
        sentence_id=sentence_id,
        scrape_type=scrape_type,
    )
    id_to_predictions[identifier] = pred
  return id_to_predictions
Read a model's validation predictions and convert to a dictionary.

  Args:
    prediction_path: Path to read predictions from

  Returns:
    A dictionary where values are predictions, and keys are composed of
    the claim_id/wikipedia_url/sentence_id/scrape_type
  
language/serene/analysis.py