Skip to content

Commit

Permalink
update: SuperGLUE and GLUE models (#1647)
Browse files Browse the repository at this point in the history
Co-authored-by: vasily <vasili.konov@gmail.com>
Co-authored-by: Fedor Ignatov <ignatov.fedor@gmail.com>
  • Loading branch information
3 people committed Jul 3, 2023
1 parent 65eb612 commit 375534b
Show file tree
Hide file tree
Showing 16 changed files with 754 additions and 814 deletions.
70 changes: 18 additions & 52 deletions deeppavlov/configs/classifiers/glue/glue_cola_roberta.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,47 +14,29 @@
"seed": 42
},
"chainer": {
"in": [
"x"
],
"in_y": [
"y"
],
"in": ["x"],
"in_y": ["y"],
"pipe": [
{
"class_name": "torch_transformers_preprocessor",
"vocab_file": "{BASE_MODEL}",
"do_lower_case": false,
"max_seq_length": 64,
"in": [
"x"
],
"out": [
"bert_features"
]
"in": ["x"],
"out": ["bert_features"]
},
{
"id": "classes_vocab",
"class_name": "simple_vocab",
"fit_on": [
"y"
],
"fit_on": ["y"],
"save_path": "{MODEL_PATH}/classes.dict",
"load_path": "{MODEL_PATH}/classes.dict",
"in": [
"y"
],
"out": [
"y_ids"
]
"in": ["y"],
"out": ["y_ids"]
},
{
"in": [
"y_ids"
],
"out": [
"y_onehot"
],
"in": ["y_ids"],
"out": ["y_onehot"],
"class_name": "one_hotter",
"depth": "#classes_vocab.len",
"single_vector": true
Expand All @@ -72,42 +54,26 @@
},
"learning_rate_drop_patience": 3,
"learning_rate_drop_div": 2.0,
"in": [
"bert_features"
],
"in_y": [
"y_ids"
],
"out": [
"y_pred_probas"
]
"in": ["bert_features"],
"in_y": ["y_ids"],
"out": ["y_pred_probas"]
},
{
"in": [
"y_pred_probas"
],
"out": [
"y_pred_ids"
],
"in": ["y_pred_probas"],
"out": ["y_pred_ids"],
"class_name": "proba2labels",
"max_proba": true
},
{
"in": [
"y_pred_ids"
],
"out": [
"y_pred_labels"
],
"in": ["y_pred_ids"],
"out": ["y_pred_labels"],
"ref": "classes_vocab"
}
],
"out": [
"y_pred_labels"
]
"out": ["y_pred_labels"]
},
"train": {
"batch_size": 128,
"batch_size": 32,
"metrics": ["matthews_correlation"],
"validation_patience": 10,
"val_every_n_batches": 250,
Expand Down
95 changes: 27 additions & 68 deletions deeppavlov/configs/classifiers/glue/glue_mnli_roberta.json
Original file line number Diff line number Diff line change
@@ -1,65 +1,42 @@
{
"dataset_reader": {
"class_name": "huggingface_dataset_reader",
"path": "glue",
"name": "mnli",
"path": "{COMPETITION}",
"name": "{TASK}",
"train": "train",
"valid": "validation_matched",
"test": "test_matched"
},
"dataset_iterator": {
"class_name": "huggingface_dataset_iterator",
"features": [
"hypothesis",
"premise"
],
"features": ["hypothesis", "premise"],
"label": "label",
"seed": 42
},
"chainer": {
"in": [
"hypothesis",
"premise"
],
"in_y": [
"y"
],
"in": ["hypothesis", "premise"],
"in_y": ["y"],
"pipe": [
{
"class_name": "torch_transformers_preprocessor",
"vocab_file": "{BASE_MODEL}",
"do_lower_case": false,
"max_seq_length": 128,
"in": [
"hypothesis",
"premise"
],
"out": [
"bert_features"
]
"in": ["hypothesis", "premise"],
"out": ["bert_features"]
},
{
"id": "classes_vocab",
"class_name": "simple_vocab",
"fit_on": [
"y"
],
"fit_on": ["y"],
"save_path": "{MODEL_PATH}/classes.dict",
"load_path": "{MODEL_PATH}/classes.dict",
"in": [
"y"
],
"out": [
"y_ids"
]
"in": ["y"],
"out": ["y_ids"]
},
{
"in": [
"y_ids"
],
"out": [
"y_onehot"
],
"in": ["y_ids"],
"out": ["y_onehot"],
"class_name": "one_hotter",
"depth": "#classes_vocab.len",
"single_vector": true
Expand All @@ -77,68 +54,50 @@
},
"learning_rate_drop_patience": 3,
"learning_rate_drop_div": 2.0,
"in": [
"bert_features"
],
"in_y": [
"y_ids"
],
"out": [
"y_pred_probas"
]
"in": ["bert_features"],
"in_y": ["y_ids"],
"out": ["y_pred_probas"]
},
{
"in": [
"y_pred_probas"
],
"out": [
"y_pred_ids"
],
"in": ["y_pred_probas"],
"out": ["y_pred_ids"],
"class_name": "proba2labels",
"max_proba": true
},
{
"in": [
"y_pred_ids"
],
"out": [
"y_pred_labels"
],
"in": ["y_pred_ids"],
"out": ["y_pred_labels"],
"ref": "classes_vocab"
}
],
"out": [
"y_pred_labels"
]
"out": ["y_pred_labels"]
},
"train": {
"batch_size": 4,
"metrics": [
"accuracy"
],
"metrics": ["accuracy"],
"validation_patience": 10,
"val_every_n_batches": 250,
"log_every_n_batches": 250,
"show_examples": false,
"evaluation_targets": [
"valid"
],
"evaluation_targets": ["valid"],
"class_name": "torch_trainer",
"tensorboard_log_dir": "{MODEL_PATH}/",
"pytest_max_batches": 2
},
"metadata": {
"variables": {
"ROOT_PATH": "~/.deeppavlov",
"BASE_MODEL": "roberta-large",
"ROOT_PATH": "~/.deeppavlov",
"DOWNLOADS_PATH": "{ROOT_PATH}/downloads",
"MODELS_PATH": "{ROOT_PATH}/models",
"MODEL_PATH": "{MODELS_PATH}/classifiers/glue_mnli_{BASE_MODEL}"
"COMPETITION": "glue",
"TASK": "mnli",
"MODEL_PATH": "{MODELS_PATH}/{COMPETITION}/{TASK}/{BASE_MODEL}"
},
"download": [
{
"url": "http://files.deeppavlov.ai/0.16/classifiers/glue_mnli.tar.gz",
"subdir": "{MODELS_PATH}"
"subdir": "{MODEL_PATH}"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion deeppavlov/configs/classifiers/glue/glue_qnli_roberta.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"out": ["y_pred_labels"]
},
"train": {
"batch_size": 64,
"batch_size": 16,
"metrics": ["accuracy"],
"validation_patience": 10,
"val_every_n_batches": 250,
Expand Down
2 changes: 1 addition & 1 deletion deeppavlov/configs/classifiers/glue/glue_qqp_roberta.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"out": ["y_pred_ids"]
},
"train": {
"batch_size": 64,
"batch_size": 16,
"metrics": [
"f1",
"accuracy"
Expand Down

0 comments on commit 375534b

Please sign in to comment.