semantic-split
semantic-split copied to clipboard
A Python library to chunk/group your texts based on semantic similarity.
Thanks for your library! I noticed a small mistake. Your type annotation for `SimilarSentenceSplitter().split()` is `List[str]` but in fact the method returns `List[List[str]]`, as in your README example. If I...
https://github.com/agamm/semantic-split/blob/18558bef087677f168f30159398ed732768c1d60/pyproject.toml#L11C24-L11C24 "semnatic" instead of semantic thanks for making this tool, it works great :)
In some use cases a Spacy splitter might be overkill. Maybe add something like: https://github.com/mediacloud/sentence-splitter
The return type is defined as `List[str]`, but its actually `List[List[str]]`.
```python from fastapi import FastAPI from pydantic import BaseModel from semantic_split import SimilarSentenceSplitter, SentenceTransformersSimilarity, SpacySentenceSplitter app = FastAPI() class TextRequest(BaseModel): text: str max_tokens: int = 8192 # Default value for...