fix : 修改 main

This commit is contained in:
zty 2024-10-29 17:03:38 +08:00
parent bac3ae7fe3
commit 80fef129a9
1 changed files with 5 additions and 4 deletions

View File

@ -284,7 +284,7 @@ async def extract_info(
ocr_text = "\n".join(
[line[1][0] for res in result if res is not None for line in res]
)
# print("ocr_text", ocr_text)
print("ocr_text", ocr_text)
# 提取信息
if extract_method == "re":
if file_type == "patent":
@ -322,6 +322,7 @@ async def extract_info(
prompt = f"我有以下文本,是一个社会标准的内容。请按项目名称,获奖单位,奖励等级,获奖人,奖励年度,证书编号,颁发日期为key的json格式返回数据,注意只返回json数据。文本如下{ocr_text}"
elif file_type=="building":
prompt = f"我有以下文本,是一个建筑标准的内容。请按项目名称奖励等级获奖单位证书编号颁发日期为key的json格式返回数据,注意只返回json数据。文本如下{ocr_text}"
else:
raise HTTPException(
400, detail="Invalid file type. Please choose 'standard' or 'patent'."
)