Skip to content

Commit 9a56e30

Browse files
wip: add base_kg_builder
1 parent 6d3bdbd commit 9a56e30

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

graphgen/bases/base_kg_builder.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
from abc import ABC, abstractmethod
2+
from dataclasses import dataclass
3+
from typing import List
4+
5+
from graphgen.bases.datatypes import Chunk
6+
7+
8+
@dataclass
9+
class BaseKGBuilder(ABC):
10+
11+
# node_types: List[str]
12+
def build(self, chunks: List[Chunk]) -> None:
13+
pass
14+
15+
@abstractmethod
16+
def extract(self, chunk: Chunk) -> None:
17+
pass
18+
19+
# 摘要
20+
def condense(self) -> None:
21+
pass
22+
23+
def _merge_nodes(self) -> None:
24+
pass
25+
26+
def _merge_edges(self) -> None:
27+
pass

0 commit comments

Comments
 (0)