Intention/uie/data.yaml

84 lines
2.6 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

labels: ['date', 'project_name', 'project_type', 'construction_unit','implementation_organization', 'project_department', 'project_manager','subcontractor', 'team_leader', 'risk_level','page','operating'] # 类别名称
# Model configuration for selecting the pretrained model and other model-related settings
model_args:
# 使用的预训练模型的路径,可以是模型名称如 'uie-base' 或者一个自定义路径
model_name_or_path: "uie-base"
# 导出推理模型的路径,如果为空,则默认使用训练输出目录下的 'export' 文件夹
export_model_dir: null
# 是否使用多语言模型(默认为 false如果是多语言模型设为 true
multilingual: false
# Data configuration for specifying the paths to the training and validation datasets
data_args:
# 训练数据的路径,可以是一个文件路径或者包含文本的文件
train_path: "E:\\workingSpace\\PycharmProjects\\Intention_dev\\uie\\data\\train.json"
# 验证数据的路径
dev_path: "E:\\workingSpace\\PycharmProjects\\Intention_dev\\uie\\data\\val.json"
# 最大序列长度,用于对输入数据进行截断或填充
max_seq_length: 512
# 动态最大序列长度,若为空则按标准 max_seq_length若提供则按 batch 设置不同的最大长度
dynamic_max_length: [16, 32, 64, 128] # 可设为不同长度,例如 16、32、64、128 等
# Training configuration for specifying training-related settings
training_args:
# 训练设备,可以是 'cpu', 'gpu' 或 'npu'
device: "gpu"
# 每 10 步输出一次日志
logging_steps: 10
# 每 2000 步进行一次评估
eval_steps: 2000
# 每 2000 步保存一次模型
save_steps: 2000
# 随机种子,确保每次训练的随机性一致
seed: 1000
# 输出目录,保存模型和日志
output_dir: "./output"
# 每个设备上的训练批大小
per_device_train_batch_size: 16
# 每个设备上的评估批大小
per_device_eval_batch_size: 16
# 训练轮数
num_train_epochs: 10
# 学习率
learning_rate: 1e-5
# 是否进行训练
do_train: true
# 是否进行评估
do_eval: true
# 是否导出推理模型
do_export: true
# 是否覆盖输出目录,如果为 true将清空输出目录并从头开始训练
overwrite_output_dir: true
# 是否禁用 TQDM 进度条
disable_tqdm: false
# 用于评估最佳模型的指标,可以是 'eval_loss' 或 'eval_f1' 等
metric_for_best_model: "eval_f1"
# 训练结束后加载最佳模型
load_best_model_at_end: true
# 保留最新的模型检查点的最大数量
save_total_limit: 3