(path_to_map)
return nltk.Index([(t[1], (t[0], t[2])) for t in return_map])
Load the map of entity labels from a file.

    :param path_to_map: location of the map file
    :return: entity map as an nltk.Index
Load the map of entity labels from a file.
Load the map of entity labels from a file .
def load_entity_map(path_to_map):
    """
    Load the map of entity labels from a file.

    :param path_to_map: location of the map file
    :return: entity map as an nltk.Index
    """
    with open(path_to_map) as f:
        return_map = [l.strip().split("\t") for l in f.readlines()]
    return nltk.Index([(t[1], (t[0], t[2])) for t in return_map])
def load_entity_map ( path_to_map ) : with open ( path_to_map ) as f : return_map = [ l . strip ( ) . split ( "\t" ) for l in f . readlines ( ) ] return nltk . Index ( [ ( t [ 1 ] , ( t [ 0 ] , t [ 2 ] ) ) for t in return_map ] )