MCPcopy Create free account
hub / github.com/DeepGraphLearning/graphvite / load_alias

Method load_alias

python/graphvite/dataset.py:720–733  ·  view source on GitHub ↗
(self, alias_file)

Source from the content-addressed store, hash-verified

718 self.edge_split(graph_file, [train_file, valid_file, test_file], portions=[4000, 1, 1])
719
720 def load_alias(self, alias_file):
721 alias2object = {}
722 ambiguous = set()
723 with open(alias_file, "r") as fin:
724 for line in fin:
725 tokens = line.strip().split("\t")
726 object = tokens[0]
727 for alias in tokens[1:]:
728 if alias in alias2object and alias2object[alias] != object:
729 ambiguous.add(alias)
730 alias2object[alias] = object
731 for alias in ambiguous:
732 alias2object.pop(alias)
733 return alias2object
734
735 def alias2entity_preprocess(self, save_file):
736 return self.load_alias(self.entity)

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected