@@ -95,41 +95,6 @@ def partition(self) -> Iterable[pd.DataFrame]:
9595 )
9696 logger .info ("Total communities partitioned: %d" , count )
9797
98- # def _pre_tokenize(self) -> None:
99- # """Pre-tokenize all nodes and edges to add token length information."""
100- # logger.info("Starting pre-tokenization of nodes and edges...")
101- #
102- # nodes = self.kg_instance.get_all_nodes()
103- # edges = self.kg_instance.get_all_edges()
104- #
105- # # Process nodes
106- # for node_id, node_data in nodes:
107- # if "length" not in node_data:
108- # try:
109- # description = node_data.get("description", "")
110- # tokens = self.tokenizer_instance.encode(description)
111- # node_data["length"] = len(tokens)
112- # self.kg_instance.update_node(node_id, node_data)
113- # except Exception as e:
114- # logger.warning("Failed to tokenize node %s: %s", node_id, e)
115- # node_data["length"] = 0
116- #
117- # # Process edges
118- # for u, v, edge_data in edges:
119- # if "length" not in edge_data:
120- # try:
121- # description = edge_data.get("description", "")
122- # tokens = self.tokenizer_instance.encode(description)
123- # edge_data["length"] = len(tokens)
124- # self.kg_instance.update_edge(u, v, edge_data)
125- # except Exception as e:
126- # logger.warning("Failed to tokenize edge %s-%s: %s", u, v, e)
127- # edge_data["length"] = 0
128- #
129- # # Persist changes
130- # self.kg_instance.index_done_callback()
131- # logger.info("Pre-tokenization completed.")
132-
13398 def _attach_additional_data_to_node (self , batch : tuple ) -> tuple :
13499 """
135100 Attach additional data from chunk_storage to nodes in the batch.
0 commit comments