Spaces:
Running
Running
| # src/language.py | |
| class LanguageManager: | |
| def __init__(self): | |
| self.current_lang = "en" # 默认中文 | |
| self.translations = { | |
| "zh": { | |
| # app.py 中的文本 | |
| "title": "🚀 ARIES TEST 预测模型性能排名", | |
| "model_leaderboard": "模型排行榜", | |
| "filter_conditions": "筛选条件", | |
| "model_type": "模型类型", | |
| "strategies": "策略", | |
| "filter_mode": "筛选模式", | |
| "refresh": "刷新", | |
| "apply_filters": "应用筛选", | |
| "all": "All", # 保持英文 | |
| "intersection": "交集 (满足所有选中策略)", | |
| "union": "并集 (满足任一选中策略)", | |
| "no_results": "⚠️ 没有找到符合筛选条件的模型。", | |
| "results_dir_not_exist": "❌ 结果目录不存在: {path}", | |
| "not_a_directory": "❌ {path} 不是一个目录", | |
| "no_model_data": "⚠️ 找到模型文件夹,但无法加载数据", | |
| "no_model_folders": "⚠️ 未在 {path} 中找到模型", | |
| "switch_lang": "切换语言", | |
| # 指标类别 - src/display/filters.py | |
| "regular_metrics": "总体性能", | |
| "stationarity": "平稳性", | |
| "trend_strength": "趋势强度", | |
| "seasonality_strength": "季节强度", | |
| "seasonality_count": "季节数", | |
| "volatility": "波动性", | |
| "memory": "记忆性", | |
| "variance_characteristics": "方差特性", | |
| "outliers": "异常值", | |
| # 指标描述 | |
| "regular_desc": "总体性能的评估指标,在所有Synth子序列上的性能", | |
| "stationarity_desc": "模型在平稳和非平稳序列上的表现", | |
| "trend_strength_desc": "模型在不同趋势强度数据上的表现", | |
| "seasonality_strength_desc": "模型在不同季节强度数据上的表现", | |
| "seasonality_count_desc": "模型在不同季节计数(周期数量)数据上的表现", | |
| "volatility_desc": "模型在不同波动性特征数据上的表现", | |
| "memory_desc": "模型在不同记忆性特征数据上的表现", | |
| "variance_characteristics_desc": "模型在同方差和异方差数据上的表现", | |
| "outliers_desc": "模型在包含不同比例异常值数据上的表现", | |
| "about_tab": "关于", # 标签页名称 | |
| "about_title": "关于 ARIES TEST 预测模型性能排名", # 标题 | |
| "about_content": "该排行榜展示了各种模型在标准基准测试中的表现,包含所有评估指标。\n\n" | |
| "### 评估范围\n" | |
| "- 支持多种时间序列预测模型\n" | |
| "- 涵盖平稳性、趋势强度等多维度指标\n" | |
| "- 实时更新最新模型性能数据\n" # 带Markdown格式的内容 | |
| "\n我们的所有baselines来自BasicTS: https://github.com/GestaltCogTeam/BasicTS\n" | |
| "\n我们的数据集已经在HuggingFace上开源:https://huggingface.co/datasets/Blisky-li/ARIES_Synth\n" | |
| "\n我们的论文已经开源:https://arxiv.org/abs/2509.06060\n" | |
| "\n您可向作者提交模型的性能指标。所需格式为 npz 文件,其中必须包含至少 ‘mae’ 和 ‘mse’ 两个键。数值代表每个测试数据子序列的性能表现,数据结构为(1303, 1500)。(1303表示实例数量,1500表示变量维度,具体参照GitHub ARIES/ARIES_TEST/Select_Synth目录中的文件格式)。\n" | |
| "\n邮箱: [email protected] 或者 [email protected]\n" | |
| }, | |
| "en": { | |
| # app.py 中的文本 | |
| "title": "🚀 ARIES TEST: Forecasting Model Performance Rankings", | |
| "model_leaderboard": "Model Leaderboard", | |
| "filter_conditions": "Filter Conditions", | |
| "model_type": "Model Type", | |
| "strategies": "Strategies", | |
| "filter_mode": "Filter Mode", | |
| "refresh": "Refresh", | |
| "apply_filters": "Apply Filters", | |
| "all": "All", | |
| "intersection": "Intersection (meet all selected strategies)", | |
| "union": "Union (meet any selected strategy)", | |
| "no_results": "⚠️ No models found matching the filter criteria.", | |
| "results_dir_not_exist": "❌ Results directory does not exist: {path}", | |
| "not_a_directory": "❌ {path} is not a directory", | |
| "no_model_data": "⚠️ Model folders found, but unable to load data", | |
| "no_model_folders": "⚠️ No models found in {path}", | |
| # 指标类别 | |
| "regular_metrics": "Regular", | |
| "stationarity": "Stationarity", | |
| "trend_strength": "Trend Strength", | |
| "seasonality_strength": "Seasonality Strength", | |
| "seasonality_count": "Seasonality Count", | |
| "volatility": "Volatility", | |
| "memory": "Memory", | |
| "variance_characteristics": "Scadasticity", | |
| "outliers": "Anomaly", | |
| # 指标描述 | |
| "regular_desc": "Overall performance across all Synth sub-sequences", | |
| "stationarity_desc": "Model performance on stationary and non-stationary sequences", | |
| "trend_strength_desc": "Model performance on data with different trend strengths", | |
| "seasonality_strength_desc": "Model performance on data with different seasonality strengths", | |
| "seasonality_count_desc": "Model performance on data with different seasonality counts (number of cycles)", | |
| "volatility_desc": "Model performance on data with different volatility characteristics", | |
| "memory_desc": "Model performance on data with different memory characteristics", | |
| "variance_characteristics_desc": "Model performance on homoscedastic and heteroscedastic data", | |
| "outliers_desc": "Model performance on data containing different proportions of outliers", | |
| "switch_lang": "Switch Language", | |
| "about_tab": "About", # 标签页名称 | |
| "about_title": "About ARIES TEST: Forecasting Model Performance Rankings", # 标题 | |
| "about_content": "This leaderboard displays the performance of various models on standard benchmark tests in ARIES, including all evaluation metrics.\n\n" | |
| "### Evaluation Scope\n" | |
| "- Supports multiple time series forecasting models\n" | |
| "- Covers multi-dimensional metrics such as stationarity and trend strength\n" | |
| "- Real-time updates of the latest model performance data\n" | |
| "\nOur baselines come from BasicTS: https://github.com/GestaltCogTeam/BasicTS\n" | |
| "\nOur datasets is upload to Hugging Face: https://huggingface.co/datasets/Blisky-li/ARIES_Synth\n" | |
| "\nOur paper is now accessible: https://arxiv.org/abs/2509.06060\n" # 带Markdown格式的内容 | |
| "\nYou may submit your model's performance metrics to the authors. The required format is an npz file, with thekeys including at least ‘mae’ and ‘mse’. Thevalues represent the performance for each test data subsequence, with a shape of (1303, 1500). (1303 represents the number of instances, 1500 denotes the variable dimension, as per the files in GitHub ARIES/ARIES_TEST/Select_Synth).\n" | |
| "\nEmails: [email protected] or [email protected]\n" | |
| } | |
| } | |
| def switch_language(self): | |
| """切换语言""" | |
| self.current_lang = "en" if self.current_lang == "zh" else "zh" | |
| return self.current_lang | |
| def get(self, key, **kwargs): | |
| """获取翻译文本,支持格式化参数""" | |
| text = self.translations[self.current_lang].get(key, key) | |
| if kwargs: | |
| return text.format(**kwargs) | |
| return text | |
| # 创建全局实例 | |
| lang = LanguageManager() |