lonePatient / BERT-NER-Pytorch

Chinese NER(Named Entity Recognition) using BERT(Softmax, CRF, Span)
MIT License
2.05k stars 425 forks source link

请问required parameters的list是什么呢? #88

Open xiaohou1112 opened 2 years ago

xiaohou1112 commented 2 years ago

运行报错 run_ner_crf.py: error: the following arguments are required: --task_name, --data_dir, --model_type, --model_name_or_path, --output_dir

然后看get_argparse():函数里面的内容

parser.add_argument("--task_name,", default=None, type=str, required=True,
                        help="The name of the task to train selected in the list: ")
    parser.add_argument("--data_dir", default=None, type=str, required=True,
                        help="The input data dir. Should contain the training files for the CoNLL-2003 NER task.", )
    parser.add_argument("--model_type", default=None, type=str, required=True,
                        help="Model type selected in the list: ")
    parser.add_argument("--model_name_or_path", default=None, type=str, required=True,
                        help="Path to pre-trained model or shortcut name selected in the list: " )
    parser.add_argument("--output_dir", default=None, type=str, required=True,
                        help="The output directory where the model predictions and checkpoints will be written.", )

help里面 taskname、model type、model name 这里list是什么呢?冒号后面就没写了。 不知道这几个要传什么参数。

xiaohou1112 commented 2 years ago

--task_name"cner" --data_dir"./datasets/cner" --model_type"bert" --model_name_or_path"./prev_trained_model/bert-base-chinese" --output_dir"./outputs/cner_output/bert"

我这样子设置了一番。还是报一样的错误。 设置的时候,脚本路径第一次选择的是run_ner_crf.py,第二次选择的是tools下面的finetuning_argparse.py 两次都是报同样的错。

run_ner_crf.py: error: the following arguments are required: --task_name,, --data_dir, --model_type, --model_name_or_path, --output_dir

报错唯一的不同是,task_name后面多了一个逗号😅