fix : 修改 main
This commit is contained in:
parent
bac3ae7fe3
commit
80fef129a9
7
main.py
7
main.py
|
@ -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,9 +322,10 @@ 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'."
|
||||
)
|
||||
400, detail="Invalid file type. Please choose 'standard' or 'patent'."
|
||||
)
|
||||
r = requests.post(
|
||||
conf.CHAT_API,
|
||||
json={"model": conf.CHAT_MODEL, "prompt": prompt, "stream": False},
|
||||
|
|
Loading…
Reference in New Issue