许可证:apache-2.0
数据集:
- ChengsenWang/ChatTime-1-Finetune-100K
基础模型:
- ChengsenWang/ChatTime-1-7B-Base
标签:
- 时间序列
- 预训练模型
- 基础模型
- 多模态
- 多模态时间序列基础模型
管道标签:时间序列预测
ChatTime:多模态时间序列基础模型
✨ 简介
本文创新性地将时间序列建模为外语,构建了ChatTime——一个统一处理时间序列与文本的框架。作为开箱即用的多模态时间序列基础模型,ChatTime具备零样本预测能力,支持时间序列与文本的双模态输入/输出。我们通过系列实验验证了ChatTime在多重任务与场景中的卓越表现,并创建了四个多模态数据集以填补数据空白。实验结果证明了ChatTime的潜力与实用性。
如图1(c)所示,在指令微调阶段,我们在ChengsenWang/ChatTime-1-Finetune-100K上微调ChengsenWang/ChatTime-1-7B-Base,最终得到ChengsenWang/ChatTime-1-7B-Chat。
关于ChatTime模型、训练数据与流程及实验结果的详细信息,请参阅arXiv论文。

📈 使用指南
我们提供三个精简示例,展示如何利用ChatTime模型进行多模态时间序列分析。完整代码详见GitHub仓库。
零样本时间序列预测
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)
上下文引导的时间序列预测
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)
时间序列问答
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)
📝 引用
若本仓库或我们的工作对您的研究有所助益,请引用论文:
@inproceedings{
author = {王成森 and 齐琪 and 王静宇 and 孙海峰 and 庄梓铨 and 吴金明 and 张磊 and 廖建新},
title = {ChatTime:连接数值与文本数据的统一多模态时间序列基础模型},
booktitle = {AAAI人工智能会议},
year = {2025},
}
📪 联系方式
如有疑问,请联系cswang@bupt.edu.cn。