🚀 ChatTime: マルチモーダル時系列基礎モデル
ChatTimeは、時系列を外国語としてモデル化し、時系列とテキスト処理を統合したフレームワークです。ゼロショット予測機能を備え、時系列とテキストの双方向入出力をサポートするマルチモーダル時系列基礎モデルです。
🚀 クイックスタート
本モデルの概要や使用方法、実験結果などの詳細については、arXivを参照してください。
✨ 主な機能
- 時系列を外国語としてモデル化し、時系列とテキスト処理を統合した新しいフレームワークを構築。
- ゼロショット予測機能を備え、事前学習なしで時系列予測が可能。
- 時系列とテキストの双方向入出力をサポートし、多様なタスクに対応。
💻 使用例
基本的な使用法
ゼロショット時系列予測
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from model.model import ChatTime
dataset = "Traffic"
hist_len = 120
pred_len = 24
model_path = "ChengsenWang/ChatTime-1-7B-Chat"
df = pd.read_csv(f"./dataset/{dataset}.csv")
hist_data = np.array(df["Hist"].apply(eval).values.tolist())[:, -hist_len:][0]
pred_data = np.array(df["Pred"].apply(eval).values.tolist())[:, :pred_len][0]
model = ChatTime(hist_len=hist_len, pred_len=pred_len, model_path=model_path)
out = model.predict(hist_data)
hist_x = np.linspace(0, hist_len-1, hist_len)
pred_x = np.linspace(hist_len, hist_len+pred_len-1, pred_len)
plt.figure(figsize=(8, 2), dpi=500)
plt.plot(hist_x, hist_data, color='#000000')
plt.plot(pred_x, pred_data, color='#000000', label='true')
plt.plot(pred_x, out, color='#FF7F0E', label='pred')
plt.axvline(hist_len, color='red')
plt.legend(loc="upper left")
plt.show()
コンテキストガイド付き時系列予測
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from model.model import ChatTime
dataset = "PTF"
hist_len = 120
pred_len = 24
model_path = "ChengsenWang/ChatTime-1-7B-Chat"
df = pd.read_csv(f"./dataset/{dataset}.csv")
hist_data = np.array(df["Hist"].apply(eval).values.tolist())[:, -hist_len:][0]
pred_data = np.array(df["Pred"].apply(eval).values.tolist())[:, :pred_len][0]
context = df["Text"].values[0]
model = ChatTime(hist_len=hist_len, pred_len=pred_len, model_path=model_path)
out_text = model.predict(hist_data, context)
out = model.predict(hist_data)
hist_x = np.linspace(0, hist_len-1, hist_len)
pred_x = np.linspace(hist_len, hist_len+pred_len-1, pred_len)
plt.figure(figsize=(8, 2), dpi=500)
plt.plot(hist_x, hist_data, color='#000000')
plt.plot(pred_x, pred_data, color='#000000', label='true')
plt.plot(pred_x, out_text, color='#FF7F0E', label='pred_text')
plt.plot(pred_x, out, color='#1F77B4', label='pred')
plt.axvline(hist_len, color='red')
plt.legend(loc="upper left")
plt.show()
時系列質問応答
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from model.model import ChatTime
dataset = "TSQA"
model_path = "ChengsenWang/ChatTime-1-7B-Chat"
df = pd.read_csv(f"./dataset/{dataset}.csv")
series = np.array(df["Series"].apply(eval).values.tolist())[0]
question = df["Question"].values[0]
answer = df["Answer"].values[0]
model = ChatTime(model_path=model_path)
out = model.analyze(question, series)
plt.figure(figsize=(8, 2), dpi=500)
plt.plot(series, color='#000000')
plt.show()
print(question)
print(f"\n{out} / {answer}\n")
📝 引用
本リポジトリや研究があなたの研究に役立った場合、以下の論文を引用していただけると幸いです。
@inproceedings{
author = {Chengsen Wang and Qi Qi and Jingyu Wang and Haifeng Sun and Zirui Zhuang and Jinming Wu and Lei Zhang and Jianxin Liao},
title = {ChatTime: A Unified Multimodal Time Series Foundation Model Bridging Numerical and Textual Data},
booktitle = {AAAI Conference on Artificial Intelligence},
year = {2025},
}
📪 連絡先
何か質問があれば、cswang@bupt.edu.cnまでご連絡ください。
📄 ライセンス
このプロジェクトはApache-2.0ライセンスの下で公開されています。
属性 |
详情 |
モデルタイプ |
マルチモーダル時系列基礎モデル |
学習データ |
ChengsenWang/ChatTime-1-Finetune-100K |