MCPcopy Create free account
hub / github.com/Tencent/embedx / load

Method load

demo/data/scripts/dataset.py:173–194  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

171 self.node_label_map = None
172
173 def load(self):
174
175 def get_full_path(file_name):
176 return os.path.join(self.input_path, file_name)
177
178 with open(get_full_path(PPIDataset.G_FILE_NAME), 'r',
179 encoding='utf-8') as fin:
180 self.nl_graph = json_graph.node_link_graph(json.load(fin))
181 raw_feature = np.load(get_full_path(PPIDataset.FEATURE_FILE_NAME))
182 self.feature = self.__standardized_feature(raw_feature)
183
184 with open(get_full_path(PPIDataset.ID_MAP_FILE_NAME),
185 'r',
186 encoding='utf-8') as fin:
187 json_id_map = json.load(fin)
188 self.node_id_map = {int(k): int(v) for k, v in json_id_map.items()}
189
190 with open(get_full_path(PPIDataset.CLASS_MAP_FILE_NAME),
191 'r',
192 encoding='utf-8') as fin:
193 json_class_map = json.load(fin)
194 self.node_label_map = {int(k): v for k, v in json_class_map.items()}
195
196 def to_nx_graph(self):
197 nx_graph = nx.Graph()

Callers

nothing calls this directly

Calls 2

loadMethod · 0.45

Tested by

no test coverage detected