license: apache-2.0
datasets:
- yuan-tian/chartgpt-dataset
language:
- en
metrics:
- rouge
pipeline_tag: text2text-generation
base_model:
- google/flan-t5-xl
new_version: yuan-tian/chartgpt-llama3
ChartGPT 模型卡片
模型详情
模型描述
该模型用于根据自然语言生成图表。更多信息请参阅相关论文。
模型输入格式
点击展开
模型在第x
步的输入格式。其中<...>
作为分隔符。
{表名}
<head> {列名}
<type> {列类型}
<data> {数据行1} <line> {数据行2} <line>
<utterance> {自然语言描述}
<ans>
<sep> {步骤1提示} {答案2}
...
<sep> {步骤x-1提示} {答案x-1}
<sep> {步骤x提示}
模型应输出对应步骤x
的答案。
步骤1-6的提示如下:
步骤1. 选择列:
步骤2. 添加筛选条件:
步骤3. 添加聚合操作:
步骤4. 选择图表类型:
步骤5. 选择编码方式:
步骤6. 添加排序:
快速开始
在GPU上运行模型
以电影数据集为例,输入描述为"哪种类型的电影最受欢迎?"。
模型应给出步骤1(选择列)的答案。
您可以使用以下代码测试是否能成功运行模型。
点击展开
from transformers import (
AutoTokenizer,
AutoModelForSeq2SeqLM,
)
tokenizer = AutoTokenizer.from_pretrained("yuan-tian/chartgpt")
model = AutoModelForSeq2SeqLM.from_pretrained("yuan-tian/chartgpt", device_map="auto")
input_text = "movies <head> Title,Worldwide_Gross,Production_Budget,Release_Year,Content_Rating,Running_Time,Major_Genre,Creative_Type,Rotten_Tomatoes_Rating,IMDB_Rating <type> nominal,quantitative,quantitative,temporal,nominal,quantitative,nominal,nominal,quantitative,quantitative <data> From Dusk Till Dawn,25728961,20000000,1996,R,107,Horror,Fantasy,63,7.1 <line> Broken Arrow,148345997,65000000,1996,R,108,Action,Contemporary Fiction,55,5.8 <line> <utterance> What kinds of movies are the most popular? <ans> <sep> Step 1. Select the columns:"
inputs = tokenizer(input_text, return_tensors="pt", padding=True).to("cuda")
outputs = model.generate(**inputs)
print(tokenizer.decode(outputs[0], skip_special_tokens = True))
训练详情
训练数据
本模型基于FLAN-T5-XL在chartgpt-dataset数据集上微调而成。
训练过程
计划在未来更新数据预处理和训练过程的详细说明。
引用
BibTeX格式:
@article{tian2024chartgpt,
title={ChartGPT: 利用大语言模型从抽象自然语言生成图表},
author={田原 and 崔伟伟 and 邓大振 and 易新晶 and 杨雨润 and 张海东 and 吴英材},
journal={IEEE可视化与计算机图形学汇刊},
year={2024},
pages={1-15},
doi={10.1109/TVCG.2024.3368621}
}