parser.add_argument("--model_type",default='roberta',required=True,type=str,help="Model type selected in the list: "+", ".join(MODEL_CLASSES.keys()))
parser.add_argument("--model_name_or_path",default='roberta-wwm-ext',required=True,type=str,help="Path to pre-trained model or shortcut name selected in the list: "+
parser.add_argument("--params_path",type=str,required=True,default='./checkpoint/model_200/model_state.pdparams',help="The path to model parameters to be loaded.")
parser.add_argument("--output_path",type=str,default='./static_graph_params',help="The path of model parameter in static graph to be saved.")
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
importargparse
importpaddle
importpaddlenlpasppnlp
fromutilsimportload_vocab
# yapf: disable
parser=argparse.ArgumentParser(__doc__)
parser.add_argument("--vocab_path",type=str,default="./senta_word_dict.txt",help="The path to vocabulary.")
parser.add_argument('--network',type=str,default="bilstm",help="Which network you would like to choose bow, lstm, bilstm, gru, bigru, rnn, birnn, bilstm_attn, cnn and textcnn?")
parser.add_argument("--params_path",type=str,default='./checkpoints/final.pdparams',help="The path of model parameter to be loaded.")
parser.add_argument("--output_path",type=str,default='./static_graph_params',help="The path of model parameter in static graph to be saved.")
parser.add_argument("--use_gpu",type=eval,default=False,help="Whether use GPU for training, input should be True or False")
parser.add_argument("--use_gpu",type=eval,default=False,help="Whether use GPU for training, input should be True or False")
parser.add_argument("--batch_size",type=int,default=64,help="Total examples' number of a batch for training.")
parser.add_argument("--batch_size",type=int,default=1,help="Total examples' number of a batch for training.")
parser.add_argument("--vocab_path",type=str,default="./word_dict.txt",help="The path to vocabulary.")
parser.add_argument("--vocab_path",type=str,default="./senta_word_dict.txt",help="The path to vocabulary.")
parser.add_argument('--network',type=str,default="bilstm_attn",help="Which network you would like to choose bow, lstm, bilstm, gru, bigru, rnn, birnn, bilstm_attn, cnn and textcnn?")
parser.add_argument('--network',type=str,default="bilstm",help="Which network you would like to choose bow, lstm, bilstm, gru, bigru, rnn, birnn, bilstm_attn, cnn and textcnn?")
parser.add_argument("--params_path",type=str,default='./chekpoints/final.pdparams',help="The path of model parameter to be loaded.")
parser.add_argument("--params_path",type=str,default='./checkpoints/final.pdparams',help="The path of model parameter to be loaded.")
parser.add_argument("--epochs",type=int,default=10,help="Number of epoches for training.")
parser.add_argument("--epochs",type=int,default=10,help="Number of epoches for training.")
parser.add_argument('--use_gpu',type=eval,default=False,help="Whether use GPU for training, input should be True or False")
parser.add_argument('--use_gpu',type=eval,default=False,help="Whether use GPU for training, input should be True or False")
parser.add_argument("--lr",type=float,default=5e-5,help="Learning rate used to train.")
parser.add_argument("--lr",type=float,default=5e-5,help="Learning rate used to train.")
parser.add_argument("--save_dir",type=str,default='chekpoints/',help="Directory to save model checkpoint")
parser.add_argument("--save_dir",type=str,default='checkpoints/',help="Directory to save model checkpoint")
parser.add_argument("--batch_size",type=int,default=64,help="Total examples' number of a batch for training.")
parser.add_argument("--batch_size",type=int,default=64,help="Total examples' number of a batch for training.")
parser.add_argument("--vocab_path",type=str,default="./senta_word_dict.txt",help="The directory to dataset.")
parser.add_argument("--vocab_path",type=str,default="./senta_word_dict.txt",help="The directory to dataset.")
parser.add_argument('--network',type=str,default="bilstm_attn",help="Which network you would like to choose bow, lstm, bilstm, gru, bigru, rnn, birnn, bilstm_attn and textcnn?")
parser.add_argument('--network',type=str,default="bilstm",help="Which network you would like to choose bow, lstm, bilstm, gru, bigru, rnn, birnn, bilstm_attn and textcnn?")
parser.add_argument("--init_from_ckpt",type=str,default=None,help="The path of checkpoint to be loaded.")
parser.add_argument("--init_from_ckpt",type=str,default=None,help="The path of checkpoint to be loaded.")