def parse_allennlp_coref_pred(coref_pred):
    """Parses allennlp coref prediction to get tokens, and start and indices"""
    coref_clusters = []
    document = coref_pred['document']
    for cluster in coref_pred['clusters']:
        coref_cluster = []
        for indices_span in cluster:
            start_idx, end_idx = indices_span[0], indices_span[1] + 1
            coref_cluster.append({'tokens': document[start_idx:end_idx], 'pos': [start_idx, end_idx]})
        coref_clusters.append(coref_cluster)
    return coref_clusters