Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

fix(nlp): tokenize content_tks by whitespace in FulltextQueryer.paragraph (#15721)

seekmistar0168b93605362f
diff --git a/rag/nlp/query.py b/rag/nlp/query.py
index db04eb3753..aefc15ed4e 100644
--- a/rag/nlp/query.py
+++ b/rag/nlp/query.py
@@ -223,7 +223,7 @@ class FulltextQueryer(QueryBase):
def paragraph(self, content_tks: str, keywords: list = [], keywords_topn=30):
if isinstance(content_tks, str):
- content_tks = [c.strip() for c in content_tks.strip() if c.strip()]
+ content_tks = [c.strip() for c in content_tks.split() if c.strip()]
tks_w = self.tw.weights(content_tks, preprocess=False)
origin_keywords = keywords.copy()