def read_embeddings(args, graph):
    """Read embeddings from an external file."""

    with open(args.emb_filename) as f:
        # Ignore the first line (# of nodes, # of dimensions).
        emb = f.read().splitlines()[1:]

    emb = [e.split() for e in emb]  # Split with whitespace.

    node_names = list(graph.nodes())  # Used to replace integers with character names.
    emb = {node_names[int(e[0])]: [float(ee) for ee in e[1:]] for e in emb}  # Convert embeddings to float.

    emb_lst = list(emb.values())
    return emb, emb_lst, node_names