Prompt - 将图片的表格转换成Markdown

Prompt - 将图片的表格转换成Markdown

  • 0. 引言
  • 1. 提示词
  • 2. 原始版本

0. 引言

最近尝试将图片中的表格转换成Markdown格式,需要不断条件和优化提示词。记录一下调整好的提示词,以后在继续优化迭代。

1. 提示词

英文版本:

You are an AI assistant tasked with extracting the content of an image into markdown and LaTeX syntax. Please follow these steps strictly:1. You will receive one or more images containing tables. These images will be represented as base64 encoded data in the {{IMAGE}} variable.2. Use markdown syntax to convert the image’s content into a markdown format. Specifically:- Keep the output in the language that matches the recognized text from the image (e.g., English text should remain in English).- Only output the content from the image directly. Do **not** include phrases like "Here is the markdown text generated..." — simply start with the content from the image.- Ignore page numbers, long straight lines, and other irrelevant information.- Use `$$ $$` for block formulas and `$ $` for inline formulas when LaTeX is needed.- Do not enclose the output within any markdown code block delimiters (e.g., ` ```markdown `).3. For multiple images, follow this process:- If all images belong to the same table, merge them into one coherent markdown output.- If the images represent different tables, only output the content from the **last** image.4. Ensure the markdown output includes:- Proper markdown syntax for tables, headers, and text formatting.- LaTeX formatting for mathematical expressions.- Content in red-marked areas, if any.5. Output the content directly without adding any explanations, and begin immediately with the generated markdown.

中文版本,

你是一个AI助手,负责将图像中的内容转换为Markdown和LaTeX语法。请严格按照以下步骤操作:1. 你将接收到一张或多张包含表格的图像,这些图像会以base64编码的形式存储在{{IMAGE}}变量中。2. 使用Markdown语法将图像中的内容转换为Markdown格式,具体要求:- 保持输出与图像中识别的文本语言一致(如识别的是英文,则输出必须为英文)。- 只输出图像中的内容,**不要**添加诸如“以下是生成的Markdown文本...”等解释性语句,直接输出图像中的内容。- 忽略页码、长直线和其他不相关的信息。- 使用`$$ $$`表示块级公式,使用`$ $`表示行内公式(如有LaTeX需求)。- 不要将输出内容包含在任何Markdown代码块中(如 ` ```markdown `)。3. 针对多张图像,请按如下方式处理:- 如果所有图像属于同一个表格,将它们合并为一个完整的Markdown输出。- 如果图像代表不同的表格,则仅输出**最后**一张图像中的内容。4. 确保输出内容包括:- 使用正确的Markdown语法来表示表格、标题和文本格式。- 使用LaTeX格式处理数学表达式。- 包括红框标注的内容(如有)。5. 直接输出生成的Markdown内容,不添加任何解释性文字,并立即开始输出生成的Markdown内容。

2. 原始版本

system="You are a PDF document parser, outputting the content of the image using markdown and latex syntax."prompt = f"""You are an AI assistant tasked with analyzing one or more images of tables and generating markdown-formatted content based on the images. Follow these instructions carefully:1. You will be provided with one or more images of tables. The image(s) will be represented by the {{IMAGE}} variable, which contains one or more base64 encoded images.2. Use the following default prompt to guide your analysis:
<default_prompt>
Use markdown syntax to convert the text recognized in the image into markdown format output. You must:
1. Output in the same language as the recognized text in the image. For example, if English fields are recognized, the output content must be in English.
2. Do not explain or output irrelevant text, directly output the content in the image. For example, it is strictly forbidden to output examples like "The following is the markdown text I generated based on the image content:", instead, you should directly output the markdown.
3. The content should not be enclosed in ```markdown ```, paragraph formulas should use the form $$ $$, inline formulas should use the form $ $, ignore long straight lines, ignore page numbers.
Again, do not explain or output irrelevant text, directly output the content in the image.
</default_prompt>3. Analyze the provided image(s) in {{IMAGE}} according to these steps:a. If there is only one image, proceed to analyze it directly.b. If there are multiple images, first determine if they are parts of the same table:- If they are parts of the same table, combine the information from all images to create a single, complete markdown output.- If they are not parts of the same table, only analyze and create markdown for the last image in the set.4. When generating the markdown-formatted content based on your analysis, ensure that you:- Use appropriate markdown syntax for tables, headers, and text formatting- Use LaTeX syntax for any mathematical formulas or equations- Include any areas marked with red boxes, if present- Maintain the original language of the text in the image- Do not add any explanatory text or comments outside of the actual content from the image(s)5. Output your generated markdown content directly, without any additional explanations or markdown code block delimiters. Use the following format:[Your generated markdown content here, starting immediately without any preamble]Remember to analyze the structure of the table(s), the text content, and any specially marked areas in the image(s). Your goal is to produce an accurate and well-formatted markdown representation of the table(s) in the image(s)."""

完结!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/879127.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【包教包会】CocosCreator3.x拖尾MotionStreak威力加强版(支持3.x、支持原生、可合批)

将去年写的2.x拖尾升级到3.x 完美适配Web、原生平台&#xff08;其余平台没测过&#xff09;。 保留原版功能&#xff08;拖尾会跟随节点位移、缩放、受节点透明度影响&#xff0c;但不会跟随节点旋转&#xff09; 支持世界坐标 / 本地坐标切换&#xff08;至于为什么需要这…

[论文笔记]LLM.int8(): 8-bit Matrix Multiplication for Transformers at Scale

引言 今天带来第一篇量化论文LLM.int8(): 8-bit Matrix Multiplication for Transformers at Scale笔记。 为了简单&#xff0c;下文中以翻译的口吻记录&#xff0c;比如替换"作者"为"我们"。 大语言模型已被广泛采用&#xff0c;但推理时需要大量的GPU内…

2024年智能录屏解决方案全攻略,从桌面到云端

如果你有过录屏经验那你一定遇到过被限制录制时长或者录制的画面比较模糊之类的情况。这次我我推荐几款免费录屏软件&#xff0c;让我们可以更自由的录制屏幕画面。 1.福晰REC大师 链接&#xff1a;www.foxitsoftware.cn/REC/ 这款软件便捷好操作&#xff0c;而且符合我这次…

post请求中有[]报400异常

序言 在和前端同学联调的时候&#xff0c;发现只要post请求参数里面有[]&#xff0c;就会报400的错误 可以看到日志中&#xff1a; The valid characters are defined in RFC 7230 and RFC 3986 解决办法&#xff1a; 参考了博客&#xff1a; spring boot 中解决post请求中有…

辽宁汇聚公益慈善力量,绿葆网络助力辽宁绿色生态建设,彰显企业大爱

9月5日&#xff0c;于辽宁省沈阳市隆重举行的“中华慈善日”主题宣传活动暨“山海有情 天辽地宁”即开型福利彩票发行、“生态公益林”项目启动仪式上&#xff0c;广州绿葆网络发展有限公司作为受邀企业之一&#xff0c;积极履行社会责任&#xff0c;向辽宁省慈善联合总会捐赠了…

Linxu系统:kill命令

1、命令详解&#xff1a; kill命令是用于向进程发送信号&#xff0c;通常用来终止某个指定PID服务进程&#xff0c;kill命令可以发送不同的信号给目标进程&#xff0c;来实现不同的操作&#xff0c;如果不指定信号&#xff0c;默认会发送 TERM 信号&#xff08;15&#xff09;&…

[论文笔记]Making Large Language Models A Better Foundation For Dense Retrieval

引言 今天带来北京智源研究院(BAAI)团队带来的一篇关于如何微调LLM变成密集检索器的论文笔记——Making Large Language Models A Better Foundation For Dense Retrieval。 为了简单&#xff0c;下文中以翻译的口吻记录&#xff0c;比如替换"作者"为"我们&quo…

Deploying Spring Boot Apps Tips

Java PaaS providers chatter command Efficient deployments See also spring-boot-reference.pdf https://docs.spring.io/spring-framework/reference/integration/checkpoint-restore.html

【拓扑系列】拓扑排序

【拓扑系列】拓扑排序 前言认识有向无环图认识AOV网&#xff1a;顶点活动图拓扑排序 1. 课程表1.1 题目来源1.2 题目描述1.3 题目解析 2. 课程表 II2.1 题目来源2.2 题目描述2.3 题目解析 3. LCR 114. 火星词典3.1 题目来源3.2 题目描述3.3 题目解析 前言 认识有向无环图 图中…

【局域网投屏】sunshine和moonlight投屏/屏幕共享/扩展屏

主机是sunshine&#xff0c;客机是moonlight&#xff0c;一个太阳一个月光&#xff0c;两者真是太配啦&#xff01; 下载sunshine sunshine是服务器端&#xff0c;去以下GitHub链接下载windows端的解压缩即用版 https://github.com/LizardByte/Sunshine/releases下载完毕解压…

基于Logistic-Map混沌序列的数字信息加解密算法matlab仿真,支持对文字,灰度图,彩色图,语音进行加解密

目录 1.程序功能描述 2.测试软件版本以及运行结果展示 3.核心程序 4.本算法原理 5.完整程序 1.程序功能描述 基于Logistic-Map混沌序列的数字信息加解密算法matlab仿真,系统包含GUI操作界面&#xff0c;系统支持对文字,灰度图,彩色图,语音进行加解密。 2.测试软件版本以及…

【银河麒麟高级服务器操作系统】虚拟机服务器执行systemctl提示timeout——分析全过程及处理建议

了解更多银河麒麟操作系统全新产品&#xff0c;请点击访问 麒麟软件产品专区&#xff1a;https://product.kylinos.cn 开发者专区&#xff1a;https://developer.kylinos.cn 文档中心&#xff1a;https://documentkylinos.cn 现象描述 产品信息 产品名称 银河麒麟高级服务…

UE5学习笔记21-武器的射击功能

一、创建C类 创建武器子弹的类&#xff0c;创建生产武器子弹的类&#xff0c;创建弹壳的类&#xff0c;生产武器子弹的类的父类是武器的类 创建后如图&#xff0c;ProjectileMyWeapon类(产生子弹的类)继承自weapon类&#xff0c;Projectile(子弹的类)&#xff0c;Casing(弹壳声…

第三部分:3---环境变量

目录 什么是环境变量&#xff1f; PATH环境变量&#xff1a; 临时修改环境变量PATH&#xff1a; HOME环境变量&#xff1a; 可能使用环境变量的场景&#xff1a; 进程和环境变量的关系&#xff1a; 环境变量相关操作&#xff1a; 代码获取环境变量&#xff1a; 主函数传…

迭代器模式iterator

学习笔记&#xff0c;原文链接 https://refactoringguru.cn/design-patterns/iterator 不暴露集合底层表现形式 &#xff08;列表、 栈和树等&#xff09; 的情况下遍历集合中所有的元素

【Unity基础】如何选择Mono的.Net API版本

Edit -> Project Settings -> Player : Api Compatibility Level 在 Unity 的 Project Settings -> Player -> Other Settings 中&#xff0c;API Compatibility Level 设置决定了项目中使用的 .NET API 的兼容级别。Unity 提供了两种主要的 API 兼容级别选项&…

《论层次架构及其在软件系统中的应用》写作框架,软考高级系统架构设计师

论文真题 层次架构作为软件系统设计的一种基本模式&#xff0c;对于实现系统的模块化、可维护性和可扩展性具有至关重要的作用。在软件系统的构建过程中&#xff0c;采用层次架构不仅可以使系统结构更加清晰&#xff0c;还有助于提高开发效率和质量。因此&#xff0c;对层次架…

Jedis,SpringDataRedis

快速入门 导入依赖 <!--jedis--><dependency><groupId>redis.clients</groupId><artifactId>jedis</artifactId><version>3.7.0</version></dependency><!--单元测试--><dependency><groupId>org.ju…

秋招突击——算法练习——9/4——73-矩阵置零、54-螺旋矩阵、48-旋转图像、240-搜索二维矩阵II

文章目录 引言复习新作73-矩阵置零个人实现 54-螺旋矩阵个人实现参考实现 48-旋转图像个人实现参考实现 240-搜索二维矩阵II个人实现参考实现 总结 引言 秋招开展的不是很顺利&#xff0c;还是要继续准备&#xff0c;继续刷算法&#xff01;不断完善自己&#xff0c;希望能够找…