From 8897a1cc886def43299123b424fbebab21b2b2f1 Mon Sep 17 00:00:00 2001 From: "majiahui@haimaqingfan.com" Date: Thu, 2 Mar 2023 10:58:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90t5=E5=8D=95=E6=9D=A1=E9=A2=84?= =?UTF-8?q?=E6=B5=8B=E7=89=88=E6=9C=AC,=E5=BC=95=E5=8F=B7=E4=B8=AD?= =?UTF-8?q?=E6=9C=89=E5=8F=A5=E5=8F=B7=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flask_predict_no_batch_t5.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/flask_predict_no_batch_t5.py b/flask_predict_no_batch_t5.py index 9ac64a0..0d5f039 100644 --- a/flask_predict_no_batch_t5.py +++ b/flask_predict_no_batch_t5.py @@ -68,6 +68,17 @@ def chulichangju_1(text, snetence_id, chulipangban_return_list, short_num): def chulipangban_test_1(text, snetence_id): + # 引号处理 + + dialogs_text, dialogs_index, other_index = get_dialogs_index(text) + for dialogs_text_dan in dialogs_text: + text_dan_list = text.split(dialogs_text_dan) + if "。" in dialogs_text_dan: + dialogs_text_dan = str(dialogs_text_dan).replace("。", "&") + text = dialogs_text_dan.join(text_dan_list) + + # text_new_str = "".join(text_new) + sentence_list = text.split("。") # sentence_list_new = [] # for i in sentence_list: @@ -85,6 +96,7 @@ def chulipangban_test_1(text, snetence_id): # sentence_pre = autotitle.gen_synonyms_short(sentence) # return_list.append(sentence_pre) else: + sentence_split_list = chulichangju_1(sentence, snetence_id, [], 0) for sentence_short in sentence_split_list: sentence_batch_list.append(sentence_short)