Separate rerankers, splitters and extractors (#85)
This commit is contained in:
committed by
GitHub
parent
0dede9c82d
commit
2186c5558f
21
knowledgehub/indices/splitters/__init__.py
Normal file
21
knowledgehub/indices/splitters/__init__.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from ..base import DocTransformer, LlamaIndexMixin
|
||||
|
||||
|
||||
class BaseSplitter(DocTransformer):
|
||||
"""Represent base splitter class"""
|
||||
|
||||
...
|
||||
|
||||
|
||||
class TokenSplitter(LlamaIndexMixin, BaseSplitter):
|
||||
def _get_li_class(self):
|
||||
from llama_index.text_splitter import TokenTextSplitter
|
||||
|
||||
return TokenTextSplitter
|
||||
|
||||
|
||||
class SentenceWindowSplitter(LlamaIndexMixin, BaseSplitter):
|
||||
def _get_li_class(self):
|
||||
from llama_index.node_parser import SentenceWindowNodeParser
|
||||
|
||||
return SentenceWindowNodeParser
|
Reference in New Issue
Block a user