Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescalam committed May 13, 2024
1 parent b1f90d5 commit 4ae9f7b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions semantic_chunkers/chunkers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ def __call__(self, docs: List[str]) -> List[List[Chunk]]:
def _split(self, doc: str) -> List[str]:
return regex_splitter(doc)

def _chunk(self, splits: List[Any]) -> List[List[Chunk]]:
def _chunk(self, splits: List[Any]) -> List[Chunk]:
raise NotImplementedError("Subclasses must implement this method")

def print(self, document_splits: List[List[Chunk]]) -> None:
def print(self, document_splits: List[Chunk]) -> None:
colors = [Fore.RED, Fore.GREEN, Fore.BLUE, Fore.MAGENTA]
for i, split in enumerate(document_splits):
color = colors[i % len(colors)]
Expand Down
2 changes: 1 addition & 1 deletion semantic_chunkers/chunkers/consecutive.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def _chunk(self, splits: List[Any], batch_size: int = 64) -> List[Chunk]:
self.chunks = chunks
return chunks

def __call__(self, docs: List[List[Any]]) -> List[List[Chunk]]:
def __call__(self, docs: List[Any]) -> List[List[Chunk]]:
"""Split documents into smaller chunks based on semantic similarity.
:param docs: list of text documents to be split, if only wanted to
Expand Down
2 changes: 1 addition & 1 deletion semantic_chunkers/chunkers/statistical.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def __init__(
self.enable_statistics = enable_statistics
self.statistics: ChunkStatistics

def __call__(self, docs: List[List[str]]) -> List[Chunk]:
def __call__(self, docs: List[str]) -> List[List[Chunk]]:
"""Chunk documents into smaller chunks based on semantic similarity.
:param docs: list of text documents to be split, if only wanted to
Expand Down

0 comments on commit 4ae9f7b

Please sign in to comment.