From ea5e0411b85eb643bcf1bf3a930986670c6874af Mon Sep 17 00:00:00 2001 From: Ali Salimli <67149699+elisalimli@users.noreply.github.com> Date: Thu, 7 Mar 2024 21:16:04 +0400 Subject: [PATCH] fix: getting empty chunks in semantic splitter (#85) --- service/splitter.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/service/splitter.py b/service/splitter.py index b4a9237d..2443619f 100644 --- a/service/splitter.py +++ b/service/splitter.py @@ -188,6 +188,8 @@ def _append_chunks( # TODO: Think of how to pass this to LLM metadata={"table_content": table, **metadata}, ) + else: + accumulated_element_texts.append(element.get("text")) # Process any remaining accumulated text after the last table # or if no table was encountered