提交 9e12346b 作者: 吕轶伟

调整提示词

父级 37b0eea6
......@@ -17,7 +17,7 @@ sys.path.append(project_dir)
from tools.ClaudeAPI import claude37_img_respond,claude3_respond,claude37_respond_stream
from tools.fileUtil import extract_filename
ocrPrompt='你是个excel的图片信息抽取助手,你需要将图片的表格信息抽取出来,图片可能包含多个单元格,尽量保持表格原格式'
ocrPrompt='你是个excel的图片信息抽取助手,excel内容跟工厂设备故障维修相关,你需要将图片的表格信息抽取出来,图片可能包含多个单元格,要求:1.尽量保持表格原格式 2.保持语句通顺,语句不通顺请再次抽取'
#excel内容转文字
def excel_to_text_with_merged_cells(file_path, sheet_name=None, output_file=None,image_folder=None):
......@@ -173,8 +173,12 @@ def excel_text_to_md(outPutPath, excel_text):
r'其中Row代表行号,Column代表列号'
r'需要处理的表格内容如下:'
f':{excel_text}'
r'mardown输出必须注意标题格式跟样例一样,如果抽取不到信息markdown标题不要输出,一级标题是文档名称,二级标题是sheet页名称,markdown样例如下:'
"""
要求:
1.mardown输出必须注意标题格式跟样例一样
2.标题内容保持跟表格内容一致,例如:单元格内容是‘钳工’不要给我输出‘粗工’
3.如果抽取不到信息markdown标题不要输出,一级标题是文档名称,二级标题是sheet页名称, markdown样例如下:
# 5重要故障报告书2sheet-重要故障报告书(打砂升降平台)
## 长时间故障修理记录表
### 设备名称: 打砂升降平台
......@@ -275,14 +279,8 @@ def excel_text_to_md(outPutPath, excel_text):
# 使用示例
# 使用函数
#excel_path = r'E:\工作文件\2025-06\需处理文件清单及计划表\5重要故障报告书\5重要故障报告书2sheet-重要故障报告书(打砂升降平台).xls' # 可以是 .xls 或 .xlsx 文件
#file_name=r'\B线-中漆自动喷-小车轮子磨损更换-袁伟-2025.5.18'
folder_path=r'E:\工作文件\2025-06\OneDrive_1_2025-6-11\\'
#excel_path=image_folder+file_name+'.xls'
#outPutPath =image_folder+file_name+'.md'
pdf_path = 'output.pdf'
#excel_text_to_md(outPutPath, excel_to_text_with_merged_cells(excel_path, output_file='output.txt', image_folder=image_folder))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论