Ucas-HaoranWei / Vary-toy

Official code implementation of Vary-toy (Small Language Model Meets with Reinforced Vision Vocabulary)
564 stars 41 forks source link

Enhancement Request: Improve Table Recognition and Markdown Conversion #8

Open hotwa opened 5 months ago

hotwa commented 5 months ago

Environment

Description

I am currently using the Vary-toy model for image recognition tasks. While the model performs well with text recognition in both Chinese and English, I have observed that its ability to recognize tables is not as effective.

Issue Details

When attempting to recognize images that contain tables, the output does not preserve the table structure, which is essential for my use case. For example, the table titled "表1-2-1" in the image is not displayed in the recognition results.

Expected Behavior

I would like the model to recognize and preserve the structure of tables within images and convert them to Markdown format correctly.

Actual Behavior

The text within tables is recognized, but the structural format of a table (i.e., rows and columns) is not preserved in the output.

Steps to Reproduce

  1. Run the image recognition on an image containing a table.
  2. Observe that the textual content is recognized but not the structure of the table.

Proposed Solution

Could you please provide guidance on settings or configurations that might improve table recognition? Additionally, I am interested in converting the recognition results into Markdown format. Are there specific parameters or methods in Vary-toy that support this functionality?

Additional Context

I am attaching the image that I used for recognition, along with the output that I received. Any help or pointers on this matter would be greatly appreciated.

Thank you for your attention to this issue.

hotwa commented 5 months ago

我在使用vary-toy识别图片时候,中英文字部分很好,但是表格识别很差。例如: 5329 这个识别结果是:

第二节 核酸的结构与功能
一、核酸的化学组成及一级结构
天然存在的核酸有两类,一类为脱氧核糖核酸(deoxyribonucleicacid,DNA),另一类为核糖核 酸(ribonucleicacid,RNA)。核苷酸(nucleotide)是核酸的基本组成单位,而核苷酸则包含碱基、戊 糖和磷酸三种成分。
1. 一级结构 在核苷酸链中,核苷酸的排列顺序(从5' →3')称为核酸的一级结构。由于核苷 酸的差异主要是碱基不同,因此也称为碱基序列。脱氧核苷酸或核苷酸的连接是前一核苷酸的3'-OH与下一核苷酸的5'-位磷酸间形成3',5'-磷酸二酯键,构成一个没有分支的线性大分子。 DNA 的书写应从5'到3'。
2.DNA与 RNA在化学组成、结构与生物学功能方面的异同 见表1-2-1。
表1-2-1 DNA与 RNA在化学组成、结构与生物学功能方面的异同 比较项目 DNA RNA 相同点 分子组成 含有碱基A、G、C、U烯和磷酸 
分子结构 基本组成单位是单核苷酸,以3',5'- 磷酸二酯键相连成一级结构 不同点 分子组成 含脱氧核糖、含T 含核糖、含U 分子结构 一级结构是指脱氧核糖核苷酸的数量 一级结构指核糖核苷酸的数量和排列 和排列顺序 顺序 
二级结构为双螺旋结构 二级结构是发卡形的单链结构,也有 局部的小双螺旋结构。tRNA的二级 结构为三叶草形 
三级结构为超螺旋结构,真核细胞中 tRNA的三级结构为倒“L”形的结构 为核心体结构 
生物学功能 是遗传物质的储存和携带者 参与蛋白质的合成
二、DNA的空间结构与功能
1.DNA的二级结构—双螺旋结构模型 DNA 结构具有多样性,其二级结构模型有 B-DNA (Watson-Crick模型结构)、ZDNA和A-DNA,其中B-DNA为DNA的典型二级结构。Watson-Crick DNA双螺旋结构模型的要点:①DNA是一反向平行的双链结构,脱氧核糖和磷酸骨架位于双链的外 侧,碱基位于内侧,两条链的碱基之间以氢键相连接。A始终与T配对,形成两个氢键(A=T);G始终 与C配对,形成三个氢键(G=C)。碱基平面与线性分子结构的长轴相垂直。一条链的走向是5'- →3',另

可以发现:表格表1-2-1并没有展示出来,是否需要其他的设置才能转化为markdown? 或者说可以使用转化为latex?

Ucas-HaoranWei commented 5 months ago

因为转markdown/latex太容易商业化了,所以Vary-toy在这方面,我们砍了一刀

Gary-code commented 3 months ago

因为转markdown/latex太容易商业化了,所以Vary-toy在这方面,我们砍了一刀

意思就是说,没有公布SAM和OPT-125M的权重吗?

hotwa commented 3 months ago

这种是再提示词上面弄的吗

Gary-code commented 3 months ago

我在使用vary-toy识别图片时候,中英文字部分很好,但是表格识别很差。例如:

请问你是使用哪个python脚本识别markdown的,是SAM+OPT-125M还是SAM+Qwen 1.8B呢?

hkxxxxx commented 1 month ago

这种是再提示词上面弄的吗

如果看demo的模式,貌似是提示词,但是不知道代码里加在哪里