From 7eb18fbf304af3a78fa020a64caf274223ece6dd Mon Sep 17 00:00:00 2001 From: shaohuzhang1 Date: Mon, 19 Feb 2024 11:29:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=8A=E4=BC=A0=E7=9A=84=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E4=B8=AD=20=E6=9C=AA=E6=99=BA=E8=83=BD=E5=A4=84?= =?UTF-8?q?=E7=90=86=E7=A9=BA=E7=99=BD=E6=AE=B5=E8=90=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/common/util/split_model.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/common/util/split_model.py b/apps/common/util/split_model.py index d9e06424e..4fccc3291 100644 --- a/apps/common/util/split_model.py +++ b/apps/common/util/split_model.py @@ -332,6 +332,8 @@ class SplitModel: """ result_tree = self.parse_to_tree(text.replace('\r', '\n'), 0) result = result_tree_to_paragraph(result_tree, [], []) + # 过滤段落内容不为空字符串的数据 + result = [item for item in result if 'content' in item and len(item.get('content').strip()) > 0] return [{**item, 'title': item.get('title').replace("#", '') if 'title' in item else ''} for item in result]