tutorials/nel_emerson/scripts/create_kb.py
def _load_entities(entities_loc: Path):
    """ Helper function to read in the pre-defined entities we want to disambiguate to. """
    names = dict()
    descriptions = dict()
    with entities_loc.open("r", encoding="utf8") as csvfile:
        csvreader = csv.reader(csvfile, delimiter=",")
        for row in csvreader:
            qid = row[0]
            name = row[1]
            desc = row[2]
            names[qid] = name
            descriptions[qid] = desc
    return names, descriptions
 Helper function to read in the pre-defined entities we want to disambiguate to. 
Helper function to read in the pre-defined entities we want to disambiguate to.
Helper function to read in the pre - defined entities we want to disambiguate to .
def _load_entities(entities_loc: Path):
    names = dict()
    descriptions = dict()
    with entities_loc.open("r", encoding="utf8") as csvfile:
        csvreader = csv.reader(csvfile, delimiter=",")
        for row in csvreader:
            qid = row[0]
            name = row[1]
            desc = row[2]
            names[qid] = name
            descriptions[qid] = desc
    return names, descriptions
def _load_entities ( entities_loc : Path ) : names = dict ( ) descriptions = dict ( ) with entities_loc . open ( "r" , encoding = "utf8" ) as csvfile : csvreader = csv . reader ( csvfile , delimiter = "," ) for row in csvreader : qid = row [ 0 ] name = row [ 1 ] desc = row [ 2 ] names [ qid ] = name descriptions [ qid ] = desc return names , descriptions
Helper function to read in the pre-defined entities we want to disambiguate to.
Helper function to read in the pre - defined entities we want to disambiguate to .
""" Helper function to read in the pre-defined entities we want to disambiguate to. """
entities_loc
Path