Added documentation (#219)

This commit is contained in:
aaishikdutta
2023-07-11 08:31:42 +05:30
committed by GitHub
parent eda28cc491
commit 6936d6983d
15 changed files with 21 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ import hashlib
class BaseChunker:
def __init__(self, text_splitter):
''' Initialize the chunker. '''
self.text_splitter = text_splitter
def create_chunks(self, loader, src):

View File

@@ -14,6 +14,7 @@ TEXT_SPLITTER_CHUNK_PARAMS = {
class DocxFileChunker(BaseChunker):
''' Chunker for .docx file. '''
def __init__(self, config: Optional[ChunkerConfig] = None):
if config is None:
config = TEXT_SPLITTER_CHUNK_PARAMS

View File

@@ -13,6 +13,7 @@ TEXT_SPLITTER_CHUNK_PARAMS = {
class PdfFileChunker(BaseChunker):
''' Chunker for PDF file. '''
def __init__(self, config: Optional[ChunkerConfig] = None):
if config is None:
config = TEXT_SPLITTER_CHUNK_PARAMS

View File

@@ -13,6 +13,7 @@ TEXT_SPLITTER_CHUNK_PARAMS = {
class QnaPairChunker(BaseChunker):
''' Chunker for QnA pair. '''
def __init__(self, config: Optional[ChunkerConfig] = None):
if config is None:
config = TEXT_SPLITTER_CHUNK_PARAMS

View File

@@ -13,6 +13,7 @@ TEXT_SPLITTER_CHUNK_PARAMS = {
class TextChunker(BaseChunker):
''' Chunker for text. '''
def __init__(self, config: Optional[ChunkerConfig] = None):
if config is None:
config = TEXT_SPLITTER_CHUNK_PARAMS

View File

@@ -13,6 +13,7 @@ TEXT_SPLITTER_CHUNK_PARAMS = {
class WebPageChunker(BaseChunker):
''' Chunker for web page. '''
def __init__(self, config: Optional[ChunkerConfig] = None):
if config is None:
config = TEXT_SPLITTER_CHUNK_PARAMS

View File

@@ -13,6 +13,7 @@ TEXT_SPLITTER_CHUNK_PARAMS = {
class YoutubeVideoChunker(BaseChunker):
''' Chunker for Youtube video. '''
def __init__(self, config: Optional[ChunkerConfig] = None):
if config is None:
config = TEXT_SPLITTER_CHUNK_PARAMS