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)