🚀 ChartGPT-Llama3のモデルカード
このモデルは、自然言語からチャートを生成するために使用されます。詳細については論文を参照してください。
🚀 クイックスタート
GPUでのモデルの実行
「教員の職業ステータス別の視覚的表現を与えて」という指示を含む映画データセットの例です。モデルはすべてのステップの回答を出力する必要があります。以下のコードを使用して、モデルを正常に実行できるかテストできます。
基本的な使用法
from transformers import (
AutoTokenizer,
AutoModelForCausalLM,
)
tokenizer = AutoTokenizer.from_pretrained("yuan-tian/chartgpt-llama3")
model = AutoModelForCausalLM.from_pretrained("yuan-tian/chartgpt-llama3", device_map="auto")
input_text = """Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
Your response should follow the following format:
Step 1. Select the columns:
Step 2. Filter the data:
Step 3. Add aggregate functions:
Step 4. Choose chart type:
Step 5. Select encodings:
Step 6. Sort the data:
### Instruction:
Give me a visual representation of the faculty members by their professional status.
### Input:
Table Name: Faculty
Table Header: FacID,Lname,Fname,Rank,Sex,Phone,Room,Building
Table Header Type: quantitative,nominal,nominal,nominal,nominal,quantitative,nominal,nominal
Table Data Example:
1082,Giuliano,Mark,Instructor,M,2424,224,NEB
1121,Goodrich,Michael,Professor,M,3593,219,NEB
Previous Answer:
### Response:"""
inputs = tokenizer(input_text, return_tensors="pt", padding=True).to("cuda")
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0], skip_special_tokens = True))
✨ 主な機能
このモデルは自然言語からチャートを生成することができます。
📦 インストール
ドキュメントに具体的なインストール手順が記載されていないため、このセクションを省略します。
📚 ドキュメント
モデルの詳細
モデルの説明
このモデルは、自然言語からチャートを生成するために使用されます。詳細については論文を参照してください。
モデルの入力形式
クリックして展開
ステップ x
でのモデル入力。
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
Your response should follow the following format:
{Step 1 prompt}
{Step x-1 prompt}
{Step x prompt}
### Instruction:
{instruction}
### Input:
Table Name: {table name}
Table Header: {column names}
Table Header Type: {column types}
Table Data Example:
{data row 1}
{data row 2}
Previous Answer:
{previous answer}
### Response:
そして、モデルはステップ x
に対応する回答を出力する必要があります。
ステップ1 - 6のプロンプトは以下の通りです。
Step 1. Select the columns:
Step 2. Filter the data:
Step 3. Add aggregate functions:
Step 4. Choose chart type:
Step 5. Select encodings:
Step 6. Sort the data:
トレーニングの詳細
トレーニングデータ
このモデルは、chartgpt-dataset-llama3 で Meta-Llama-3-8B-Instruct からファインチューニングされています。
トレーニング手順
将来的に前処理とトレーニング手順を更新する予定です。
🔧 技術詳細
ドキュメントに具体的な技術詳細が記載されていないため、このセクションを省略します。
📄 ライセンス
このモデルはApache 2.0ライセンスの下で提供されています。
引用
BibTeX:
@article{tian2024chartgpt,
title={ChartGPT: Leveraging LLMs to Generate Charts from Abstract Natural Language},
author={Tian, Yuan and Cui, Weiwei and Deng, Dazhen and Yi, Xinjing and Yang, Yurun and Zhang, Haidong and Wu, Yingcai},
journal={IEEE Transactions on Visualization and Computer Graphics},
year={2024},
pages={1-15},
doi={10.1109/TVCG.2024.3368621}
}