From c18aa84d4c0310b4f37df7c441681fc40b79153d Mon Sep 17 00:00:00 2001
From: Andrei Fajardo <92402603+nerdai@users.noreply.github.com>
Date: Thu, 22 Feb 2024 17:37:09 -0500
Subject: [PATCH] [FIX] - SemanticSplitterNodeParser (#11295)

---
 .../llama_index/core/node_parser/text/semantic_splitter.py  | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/llama-index-core/llama_index/core/node_parser/text/semantic_splitter.py b/llama-index-core/llama_index/core/node_parser/text/semantic_splitter.py
index e5054ac8cc..6e4760a7b5 100644
--- a/llama-index-core/llama_index/core/node_parser/text/semantic_splitter.py
+++ b/llama-index-core/llama_index/core/node_parser/text/semantic_splitter.py
@@ -227,13 +227,11 @@ class SemanticSplitterNodeParser(NodeParser):
             start_index = 0
 
             for index in indices_above_threshold:
-                end_index = index - 1
-
-                group = sentences[start_index : end_index + 1]
+                group = sentences[start_index : index + 1]
                 combined_text = "".join([d["sentence"] for d in group])
                 chunks.append(combined_text)
 
-                start_index = index
+                start_index = index + 1
 
             if start_index < len(sentences):
                 combined_text = "".join(
-- 
GitLab