瀏覽代碼

fix: qa regex (#1738)

crazywoola 1 年之前
父節點
當前提交
994fceece3
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      api/core/indexing_runner.py

+ 2 - 2
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 [
             {