def get_relpron_hyper(testset=False):
    """
    Get mapping from terms to hypernyms, from the RelPron data
    :param testset: use testset (default, use devset)
    :return: dict of {term: hypernym}
    """
    if testset:
        subset = 'testset'
    else:
        subset = 'devset'
    hyper = {}
    with open('../data/relpron/'+subset, 'r') as f:
        for line in f:
            # e.g.
            # OBJ garrison_N: organization_N that army_N install_V
            _, noun, head, _, _, _ = line.strip().split()
            hyper[noun[:-3]] = head[:-2]
    return hyper