Skip to content

Commit

Permalink
Fix(dumb bug)
Browse files Browse the repository at this point in the history
  • Loading branch information
klein-t committed Mar 15, 2024
1 parent e94231e commit 176e416
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions semantic_router/splitters/rolling_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ def __call__(self, docs: List[str]) -> List[DocumentSplit]:
except Exception as e:
logger.error(f"Error splitting document to sentences: {e}")
raise
docs = split_to_sentences(docs[0])
encoded_docs = self._encode_documents(docs)
similarities = self._calculate_similarity_scores(encoded_docs)
if self.dynamic_threshold:
Expand Down Expand Up @@ -415,10 +414,11 @@ def plot_sentence_similarity_scores(
a specified threshold.
"""
if self.pre_splitter == "spacy":
docs = split_to_sentences_spacy(docs)
sentences = [sentence for doc in docs for sentence in split_to_sentences_spacy(doc)]
elif self.pre_splitter == "regex":
docs = split_to_sentences(docs)
sentences = [sentence for doc in docs for sentence in split_to_sentences(doc)]
sentences = [sentence for doc in docs for sentence in split_to_sentences(doc)]
else:
raise ValueError("Invalid pre_splitter value. Supported values are 'spacy' and 'regex'.")
encoded_sentences = self._encode_documents(sentences)
similarity_scores = []

Expand Down

0 comments on commit 176e416

Please sign in to comment.