parser.add_argument('--batch_size',type=int,default=1,help='the batch size when using taskflow')
parser.add_argument("--do_debug",action='store_true',help="Whether to do debug")
parser.add_argument('--a_prompt',type=str,default='答案',help='the prompt when using taskflow, separate by ,')
parser.add_argument('--a_position_prob',type=float,default=0.01,help='confidence threshold for answer extraction')
parser.add_argument('--a_max_answer_candidates',type=int,default=5,help='the max number of return answer candidate for each input')
parser.add_argument('--q_num_return_sequences',type=int,default=3,help='the number of return sequences for each input sample, it should be less than num_beams')
parser.add_argument('--q_max_question_length',type=int,default=50,help='the max decoding length')
parser.add_argument('--all_sample_num',type=int,default=None,help='the test sample number when convert_json_to_data')
parser.add_argument('--num_return_sequences',type=int,default=3,help='the number of return sequences for each input sample, it should be less than num_beams')
parser.add_argument('--batch_size',type=int,default=1,help='the batch size when using taskflow')
parser.add_argument('--position_prob',type=float,default=0.01,help='the batch size when using taskflow')
# Copyright (c) 2022 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
importjson
fromtqdmimporttqdm
frompaddlenlpimportTaskflow
# yapf: disable
defparse_args():
parser=argparse.ArgumentParser(__doc__)
parser.add_argument('--model_path',type=str,default=None,help='the model path to be loaded for question_generation taskflow')
parser.add_argument('--max_length',type=int,default=50,help='the max decoding length')
parser.add_argument('--num_return_sequences',type=int,default=3,help='the number of return sequences for each input sample, it should be less than num_beams')
# Copyright (c) 2022 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
importjson
importos
# yapf: disable
defparse_args():
parser=argparse.ArgumentParser(__doc__)
parser.add_argument("--do_create_test_qq_pair",action='store_true',help="Whether to do create_test_qq_pair")
parser.add_argument('--qq_pair_source_ori_file_path',type=str,default=None,help='the original source file path for qq-pair creating')
parser.add_argument('--qq_pair_source_trans_file_path',type=str,default=None,help='the translated source file path for qq-pair creating')
parser.add_argument('--qq_pair_target_file_path',type=str,default=None,help='the target file path for qq-pair creating')
parser.add_argument('--trans_query_answer_path',type=str,default=None,help='the target query-answer file path for extract_trans_from_fake_question')
parser.add_argument('--dev_sample_num',type=int,default=None,help='the test sample number when convert_json_to_data, if None, treat all lines as dev samples')
parser.add_argument('--num_return_sequences',type=int,default=3,help='the number of return sequences for each input sample, it should be less than num_beams')
parser.add_argument('--all_sample_num',type=int,default=None,help='the number of valid sample')
parser.add_argument('--bleu_n_size',type=int,default=4,help='the bleu n size')
在分类模型训练过程中,总共训练了10轮,并选择了评估 F1 得分最高的 best 模型,下表展示了训练过程中使用的训练参数。我们同时开源了相应的模型,可点击下表的 `cls_model` 进行下载,下载后将模型重命名为 `best.pdparams`,然后放入父目录的 `checkpoints/cls_checkpoints` 中。
parser.add_argument("--ext_model_path",type=str,default=None,help="The path of extraction model path that you want to load.")
parser.add_argument("--cls_model_path",type=str,default=None,help="The path of classification model path that you want to load.")
parser.add_argument("--ext_label_path",type=str,default=None,help="The path of extraction label dict.")
parser.add_argument("--cls_label_path",type=str,default=None,help="The path of classification label dict.")
parser.add_argument("--ext_max_seq_len",type=int,default=512,help="The maximum total input sequence length after tokenization for extraction model.")
parser.add_argument("--cls_max_seq_len",type=int,default=512,help="The maximum total input sequence length after tokenization for classification model.")