连接数据库、处理。要求数据库中存在only_text表(可自行修改),即只包含id和text的处理后表格。

main
p5rqvkz4o 4 months ago
parent 283d4930a0
commit 73f6de438a

@ -109,6 +109,8 @@ def extract_result(text):
return json_str return json_str
def parse_input(s): def parse_input(s):
# 去掉最外层的大括号 # 去掉最外层的大括号
s = s.replace('\n','')
s = s.replace(' ','')
s = s.strip('{}') s = s.strip('{}')
# 去掉首尾的方括号 # 去掉首尾的方括号
if len(s) >= 2 and s[0] == '[' and s[-1] == ']': if len(s) >= 2 and s[0] == '[' and s[-1] == ']':

Loading…
Cancel
Save