File size: 1,519 Bytes
be0e2ec
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Config CHỈ task commitment (trích từ config/train.yml gốc, bỏ env/soc/gov/specificity).
# Tune:  python -m src.training.tune_hyperparams --config config/train_commitment.yml --task commitment --trials 10
# Train: python -m src.training.train_model     --config config/train_commitment.yml --task commitment
defaults:
    task: commitment

_model_subst: &model_subst
    name: vinai/phobert-base-v2
    max_length: 256
    word_segment: true

_tune_subst: &tune_subst
    train_batch_size: [8, 16]

_data: &data
    use_context_prev: false
    use_context_next: false

_es: &es
    enabled: true
    patience: 2
    threshold: 0.0

_train: &train
    epochs: 10
    seeds: [42, 43, 44, 45, 46]
    train_batch_size: 16
    eval_batch_size: 32
    learning_rate: 2.0e-5
    weight_decay: 0.01
    warmup_ratio: 0.1
    use_class_weights: true
    weight_method: sqrt_inverse
    gradient_accumulation_steps: 1
    max_grad_norm: 1.0
    label_smoothing_factor: 0.0
    precision: bf16
    metric_for_best_model: macro_f1

tasks:
    commitment:
        labels: [0, 1]
        seed: 42
        model: *model_subst
        data: *data
        tune: *tune_subst
        paths:
            train_data: data/vi_gold/commitment/train.parquet
            val_data: data/vi_gold/commitment/val.parquet
            test_data: data/vi_gold/commitment/test.parquet
            output_dir: outputs/models/commitment
        training: *train
        early_stopping: *es