Skip to content

Commit

Permalink
Merge pull request #5 from kylepjohnson/main
Browse files Browse the repository at this point in the history
Update split() to return list of lists
  • Loading branch information
agamm authored Jul 11, 2024
2 parents 18558be + 272005c commit a9f2310
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions semantic_split/splitters/SimilarSentenceSplitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def __init__(self, similarity_model, sentence_splitter: Splitter):
self.model = similarity_model
self.sentence_splitter = sentence_splitter

def split(self, text: str, group_max_sentences=5) -> List[str]:
def split(self, text: str, group_max_sentences=5) -> List[List[str]]:
'''
group_max_sentences: The maximum number of sentences in a group.
'''
Expand All @@ -36,4 +36,4 @@ def split(self, text: str, group_max_sentences=5) -> List[str]:
else:
groups.append([sentences[i]])

return groups
return groups

0 comments on commit a9f2310

Please sign in to comment.