-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from aurelio-labs/ashraq/splitters
feat: splitters module
- Loading branch information
Showing
9 changed files
with
61 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
from semantic_chunkers.chunkers import BaseChunker | ||
from semantic_chunkers.chunkers import ConsecutiveChunker | ||
from semantic_chunkers.chunkers import CumulativeChunker | ||
from semantic_chunkers.chunkers import StatisticalChunker | ||
from semantic_chunkers.chunkers import ( | ||
BaseChunker, | ||
ConsecutiveChunker, | ||
CumulativeChunker, | ||
StatisticalChunker, | ||
) | ||
from semantic_chunkers.splitters import BaseSplitter, RegexSplitter | ||
|
||
__all__ = [ | ||
"BaseChunker", | ||
"ConsecutiveChunker", | ||
"CumulativeChunker", | ||
"StatisticalChunker", | ||
"BaseSplitter", | ||
"RegexSplitter", | ||
] | ||
|
||
__version__ = "0.0.5" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from semantic_chunkers.splitters.base import BaseSplitter | ||
from semantic_chunkers.splitters.sentence import RegexSplitter | ||
|
||
|
||
__all__ = [ | ||
"BaseSplitter", | ||
"RegexSplitter", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from typing import List | ||
|
||
from pydantic.v1 import BaseModel, Extra | ||
|
||
|
||
class BaseSplitter(BaseModel): | ||
class Config: | ||
extra = Extra.allow | ||
|
||
def __call__(self, doc: str) -> List[str]: | ||
raise NotImplementedError("Subclasses must implement this method") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters