Skip to content

Commit

Permalink
[fix] change use_approximate -> approximate
Browse files Browse the repository at this point in the history
  • Loading branch information
bhavnicksm committed Dec 11, 2024
1 parent bba0b33 commit 8e2f44c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/chonkie/chunker/sentence.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class SentenceChunker(BaseChunker):
chunk_overlap: Number of tokens to overlap between chunks
min_sentences_per_chunk: Minimum number of sentences per chunk (defaults to 1)
min_chunk_size: Minimum number of tokens per sentence (defaults to 2)
use_approximate: Whether to use approximate token counting (defaults to True)
approximate: Whether to use approximate token counting (defaults to True)
Raises:
ValueError: If parameters are invalid
Expand All @@ -32,6 +32,7 @@ def __init__(
min_chunk_size: int = 2,
approximate: bool = True,
delim: Union[str, List[str]] = [".", "!", "?", "\n"],
**kwargs
):
"""Initialize the SentenceChunker with configuration parameters.
Expand Down Expand Up @@ -266,7 +267,7 @@ def _prepare_sentences(self, text: str) -> List[Sentence]:
positions.append(current_pos)
current_pos += len(sent) + 1 # +1 for space/separator

if not self.use_approximate:
if not self.approximate:
# Get accurate token counts in batch
token_counts = self._get_token_counts(sentence_texts)
else:
Expand Down

0 comments on commit 8e2f44c

Please sign in to comment.