From 994fceece379bec3571ace6e53398330159f76ee Mon Sep 17 00:00:00 2001 From: crazywoola <100913391+crazywoola@users.noreply.github.com> Date: Mon, 11 Dec 2023 15:53:37 +0800 Subject: [PATCH] fix: qa regex (#1738) --- api/core/indexing_runner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/core/indexing_runner.py b/api/core/indexing_runner.py index 56c45bfd85..2baecedfd7 100644 --- a/api/core/indexing_runner.py +++ b/api/core/indexing_runner.py @@ -632,8 +632,8 @@ class IndexingRunner: return text def format_split_text(self, text): - regex = r"Q\d+:\s*(.*?)\s*A\d+:\s*([\s\S]*?)(?=Q|$)" - matches = re.findall(regex, text, re.MULTILINE) + regex = r"Q\d+:\s*(.*?)\s*A\d+:\s*([\s\S]*?)(?=Q\d+:|$)" + matches = re.findall(regex, text, re.UNICODE) return [ {