Downstream Model Design of Pre-trained Language Model for Relation Extraction Task
MIT License
95
stars
14
forks
source link
You should either use the --include-package flag to make sure the correct module is loaded, or use a fully qualified class name in your config file like {"model": "my_module.models.MyModel"} to have it imported automatically. #30
error info:
allennlp.common.checks.ConfigurationError: bert-pretrained not in acceptable choices for dataset_reader.token_indexers.tokens.type: ['single_id', 'characters', 'elmo_characters', 'spac
y', 'pretrained_transformer', 'pretrained_transformer_mismatched']. You should either use the --include-package flag to make sure the correct module is loaded, or use a fully qualified
class name in your config file like {"model": "my_module.models.MyModel"} to have it imported automatically.
Hello, I use the following command to run the code, but the feedback is as follows, please what SHOULD I do, thank you
python train.py train -s redn/output -f X:\python\REDN-allennlp-based\REDN-allennlp-based\redn\training_configs\relation_extrac tion\redn-webnlg.jsonnet
error info: allennlp.common.checks.ConfigurationError: bert-pretrained not in acceptable choices for dataset_reader.token_indexers.tokens.type: ['single_id', 'characters', 'elmo_characters', 'spac y', 'pretrained_transformer', 'pretrained_transformer_mismatched']. You should either use the --include-package flag to make sure the correct module is loaded, or use a fully qualified class name in your config file like {"model": "my_module.models.MyModel"} to have it imported automatically.
my config file: redn-webnlg.jsonnet { "dataset_reader": { "type": "relation_extraction_reader", "lazy":false, "tokenizer":{ "type":"pretrained_transformer", "model_name":"X:\python\REDN-allennlp-based\REDN-allennlp-based\redn\data\uncased_L-12_H-768_A-12", "do_lowercase":true }, "token_indexers": { "tokens": { "type": "bert-pretrained", "pretrained_model":"X:\python\REDN-allennlp-based\REDN-allennlp-based\redn\data\uncased_L-12_H-768_A-12", "do_lowercase": true, "use_starting_offsets": true } } }, "train_data_path": "X:\python\REDN-allennlp-based\REDN-allennlp-based\redn\data\webnlg_release_v2_train.json", "validation_data_path": "X:\python\REDN-allennlp-based\REDN-allennlp-based\redn\data\webnlg_release_v2_dev.json", "test_data_path": "X:\python\REDN-allennlp-based\REDN-allennlp-based\redn\data\webnlg_release_v2_test.json", "evaluate_on_test": true, "model": { "type": "redn", "model_path":"X:\python\REDN-allennlp-based\REDN-allennlp-based\redn\data\uncased_L-12_H-768_A-12" }, "iterator": { "type": "bucket", "sorting_keys": [["tokens","num_tokens"]], "batch_size": 64 }, "trainer": { "num_epochs": 50, "patience": 0, "cuda_device": 5, "validation_metric": "+micro_f1", "num_serialized_models_to_keep":3, "optimizer": { "type": "adam", "lr":3e-5, "weight_decay":1e-5 }
} }