Skip to content

Commit 6b84c38

Browse files
authored
Merge branch 'ASUS-AICS:master' into pipeline_tutorial
2 parents b27b19d + 2982ed3 commit 6b84c38

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

example_config/EUR-Lex-57k/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ The best model is selected by **RP@5** on validation set then evaluated on test
1111
| Kim-CNN | [Chen et al. 2022](https://www.csie.ntu.edu.tw/~cjlin/papers/xmlcnn/xml_cnn_study.pdf) | 20.0767 | 69.9073 | 90.7833 | 66.8733 | 77.5347 | 80.3488 | [Cfg](./kim_cnn.yml) | 30 mins |
1212
| CNN-LWAN | [Mullenbach et al. 2018](https://aclanthology.org/N18-1100/) | 26.3245 | 71.6865 | 89.8167 | 67.3100 | 78.0261 | 80.5446 | [Cfg](./cnn_lwan.yml) | 2 hrs |
1313
| BiGRU-LWAN | [Chalkidis et al. 2019](https://aclanthology.org/P19-1636/) | 25.4260 | 71.3199 | 90.7333 | 67.0800 | 77.7506 | 80.5999 | [Cfg](./bigru_lwan.yml) | 3 hrs 20 mins |
14-
| BERT-BASE-LWAN | [Chalkidis et al. 2020](http://aclanthology.lst.uni-saarland.de/2020.emnlp-main.607/) | 26.1981 | 72.7849 | 89.9833 | 67.8533 | 78.4742 | 80.9834 | [Cfg](./bert_lwan.yml) | 9 hrs |
14+
| BERT-BASE-LWAN | [Chalkidis et al. 2020](https://aclanthology.org/2020.emnlp-main.607/) | 26.1981 | 72.7849 | 89.9833 | 67.8533 | 78.4742 | 80.9834 | [Cfg](./bert_lwan.yml) | 9 hrs |

example_config/EUR-Lex-57k/bert_lwan_tune.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ val_file: data/EUR-Lex-57k/valid.txt
44
test_file: data/EUR-Lex-57k/test.txt
55
data_name: EUR-Lex-57k
66
min_vocab_freq: 1
7-
max_seq_length: 500
7+
max_seq_length: 512
88
include_test_labels: true
99
remove_no_label_data: false
1010
add_special_tokens: false

search_params.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,11 @@ def prepare_retrain_config(best_config, best_log_dir, retrain):
171171
best_config.merge_train_val = False
172172

173173

174-
def load_static_data(config, merge_train_val=False):
174+
def load_static_data(config):
175175
"""Preload static data once for multiple trials.
176176
177177
Args:
178178
config (AttributeDict): Config of the experiment.
179-
merge_train_val (bool, optional): Whether to merge the training and validation data.
180-
Defaults to False.
181179
182180
Returns:
183181
dict: A dict of static data containing datasets, classes, and word_dict.
@@ -187,7 +185,7 @@ def load_static_data(config, merge_train_val=False):
187185
test_data=config.test_file,
188186
val_data=config.val_file,
189187
val_size=config.val_size,
190-
merge_train_val=merge_train_val,
188+
merge_train_val=config.merge_train_val,
191189
tokenize_text="lm_weight" not in config.network_config,
192190
remove_no_label_data=config.remove_no_label_data,
193191
)
@@ -231,7 +229,7 @@ def retrain_best_model(exp_name, best_config, best_log_dir, retrain):
231229
with open(os.path.join(checkpoint_dir, "params.yml"), "w") as fp:
232230
yaml.dump(dict(best_config), fp)
233231

234-
data = load_static_data(best_config, merge_train_val=best_config.merge_train_val)
232+
data = load_static_data(best_config)
235233

236234
if retrain:
237235
logging.info(f"Re-training with best config: \n{best_config}")

0 commit comments

Comments
 (0)