def get_lookup_dicts(pred_name):
    """
    Create part-of-speech-specific dicts mapping lemmas to sets of indices
    :param pred_name: list of pred names, in order
    :return: {'v':verb_dict, 'n':noun_dict}
    """
    # Initialise lookup dicts
    v_lookup = {}
    n_lookup = {}
    lookup = {'v':v_lookup, 'n':n_lookup}
    # Sort preds by part of speech and lemma 
    for i, x in enumerate(pred_name):
        lemma, pos, _ = x[1:].rsplit('_', 2)
        # Add the index to the correct set, initialising one if necessary
        lookup[pos].setdefault(lemma, set()).add(i)
    return lookup