所提出的ChartX有两个主要贡献:
ChartX presents two primary contributions.
我们构建了包含4.8万条高质量、多模态、22学科、18类别、7任务的图表数据。每个图表数据都包含4种模态:图像,CSV数据,绘图python代码,任务和图表问答描述
We collected 48K multi-modal chart data covering 22 topics, 18 chart types, and 7 tasks. Each chart data within this dataset includes four modalities: image, CSV, python code, and text description.
Please download the official ChartX Evaluation Set dataset and organize the downloaded files as follows:
ChartX
├── 3D-Bar
│ ├── code
| ├── csv
| ├── png
| ├── txt
├── area_chart
│ ├── code
| ├── csv
| ├── png
| ├── txt
....
....
├── rose
│ ├── code
| ├── csv
| ├── png
| ├── txt
(1) 为了提升图表模型在认知复杂推理任何上的可解释性,ChartVLM首先需要执行图表感知任务(目的是将一个图表形式的图表数据映射到结构化文本描述空间),然后基于提取到的结构化文本描述来进行下游的复杂推理和认知任务。
(2) 为了在上述pipeline系统中实现用户可交互性,ChartVLM提出了指令适配器,其可以根据用户指令来让ChartVLM知道用户目前的任务倾向是基础感知任务还是下游认知推理任务,基于此来动态地进行网络路由。
(1) To enhance the interpretability of the chart model in cognition tasks (e.g. answer questions based on chart image), ChartVLM first performs the base perception task (e.g. structural extraction from the given chart image to a predicted CSV data), and then, finishes other cognition tasks (e.g. chart redrawing, description, summary, and QA) based on the extracted structural data.
(2) To choose the task that users expect to perform according to the prompts they used, the instruction adapter is designed, which can cover a variety of user instructions as illustrated in this figure
pip install torch==2.1.0 transformers==4.31.0 accelerate==0.24.1 sentencepiece==0.1.99 einops==0.6.1 triton==2.0.0
from tools.ChartVLM import infer_ChartVLM
if __name__ == '__main__':
model = '${PATH_TO_PRETRAINED_MODEL}/ChartVLM/base/' #${PATH_TO_PRETRAINED_MODEL}
image = './base_decoder/train/data/test.png'
text = 'who has the largest value?'
output = infer_ChartVLM(image, text, model)
print(output)
所提出的ChartX有两个主要贡献:
ChartX presents two primary contributions.
我们构建了包含4.8万条高质量、多模态、22学科、18类别、7任务的图表数据。每个图表数据都包含4种模态:图像,CSV数据,绘图python代码,任务和图表问答描述
We collected 48K multi-modal chart data covering 22 topics, 18 chart types, and 7 tasks. Each chart data within this dataset includes four modalities: image, CSV, python code, and text description.
Please download the official ChartX Evaluation Set dataset and organize the downloaded files as follows:
ChartX
├── 3D-Bar
│ ├── code
| ├── csv
| ├── png
| ├── txt
├── area_chart
│ ├── code
| ├── csv
| ├── png
| ├── txt
....
....
├── rose
│ ├── code
| ├── csv
| ├── png
| ├── txt
(1) 为了提升图表模型在认知复杂推理任何上的可解释性,ChartVLM首先需要执行图表感知任务(目的是将一个图表形式的图表数据映射到结构化文本描述空间),然后基于提取到的结构化文本描述来进行下游的复杂推理和认知任务。
(2) 为了在上述pipeline系统中实现用户可交互性,ChartVLM提出了指令适配器,其可以根据用户指令来让ChartVLM知道用户目前的任务倾向是基础感知任务还是下游认知推理任务,基于此来动态地进行网络路由。
(1) To enhance the interpretability of the chart model in cognition tasks (e.g. answer questions based on chart image), ChartVLM first performs the base perception task (e.g. structural extraction from the given chart image to a predicted CSV data), and then, finishes other cognition tasks (e.g. chart redrawing, description, summary, and QA) based on the extracted structural data.
(2) To choose the task that users expect to perform according to the prompts they used, the instruction adapter is designed, which can cover a variety of user instructions as illustrated in this figure
pip install torch==2.1.0 transformers==4.31.0 accelerate==0.24.1 sentencepiece==0.1.99 einops==0.6.1 triton==2.0.0
from tools.ChartVLM import infer_ChartVLM
if __name__ == '__main__':
model = '${PATH_TO_PRETRAINED_MODEL}/ChartVLM/base/' #${PATH_TO_PRETRAINED_MODEL}
image = './base_decoder/train/data/test.png'
text = 'who has the largest value?'
output = infer_ChartVLM(image, text, model)
print(output)