def read_sparse_matrix_dict(
    input_file):
  """Read a dictionary of relations from a file.

  Args:
    input_file: Filename string or FileLike object.

  Returns:
    A dictionary mapping relation names to scipy sparse matrices.
  """
  relation_dict = _read_numpy_item(input_file)
  return {
      rel_name: _numpy_dict_to_sparse_matrix(numpy_dict)
      for rel_name, numpy_dict in relation_dict.items()
  }
Read a dictionary of relations from a file.

  Args:
    input_file: Filename string or FileLike object.

  Returns:
    A dictionary mapping relation names to scipy sparse matrices.
  
language/nql/nql/io.py