feat: add GraphRAG framework and integrate TuGraph (#1506)

Co-authored-by: KingSkyLi <15566300566@163.com>
Co-authored-by: aries_ckt <916701291@qq.com>
Co-authored-by: Fangyin Cheng <staneyffer@gmail.com>
This commit is contained in:
Florian
2024-05-16 15:39:50 +08:00
committed by GitHub
parent 593e974405
commit a9087c3853
133 changed files with 10139 additions and 6631 deletions

View File

@@ -0,0 +1,26 @@
"""Transformer base class."""
import logging
from abc import ABC, abstractmethod
from typing import List, Optional
logger = logging.getLogger(__name__)
class TransformerBase:
"""Transformer base class."""
class EmbedderBase(TransformerBase, ABC):
"""Embedder base class."""
class ExtractorBase(TransformerBase, ABC):
"""Extractor base class."""
@abstractmethod
async def extract(self, text: str, limit: Optional[int] = None) -> List:
"""Extract results from text."""
class TranslatorBase(TransformerBase, ABC):
"""Translator base class."""