你确认删除该任务么?此任务一旦删除不可恢复。
yinhong 1c820bd8f6 | 2 年前 | |
---|---|---|
backbone | 2 年前 | |
config | 2 年前 | |
paradigm | 2 年前 | |
reader | 2 年前 | |
utils | 2 年前 | |
.gitignore | 2 年前 | |
LICENSE | 2 年前 | |
README.md | 2 年前 | |
mtl_config.yaml | 2 年前 | |
mtl_run.py | 2 年前 | |
run.sh | 2 年前 | |
wget_data.sh | 2 年前 |
Multi task learning (MTL) has been used in many NLP tasks to obtain better language representations. Hence, we experiment with several auxiliary tasks to improve the generalization capability of a MRC model. The auxiliary tasks that we use include
D-NET的主干结构为BERT。下面接了3个下游任务。
To download the MRQA training and development data, as well as other auxiliary data for MTL, run
bash wget_data.sh
The downloaded data will be saved into data/mrqa
(combined MRQA training and development data), data/mrqa_dev
(seperated MRQA in-domain and out-of-domain data, for model evaluation), mlm4mrqa
(training data for masked language model task) and data/am4mrqa
(training data for paragraph matching task).
从官网下载安装MindSpore之后,您可以按照如下步骤进行训练和评估:
bash run.sh
在Ascend设备上做分布式训练时,请提前创建JSON格式的HCCL配置文件。
在Ascend设备上做单机分布式训练时,请参考here创建HCCL配置文件。
在Ascend设备上做多机分布式训练时,训练命令需要在很短的时间间隔内在各台设备上执行。因此,每台设备上都需要准备HCCL配置文件。请参考here创建多机的HCCL配置文件。
如需设置数据集格式和参数,请创建JSON格式的模式配置文件,详见TFRecord格式。
Schema file contains ['task_id', 'src_ids', 'pos_ids', 'sent_ids', 'input_mask', 'start_positions', 'end_positions', 'mask_label', 'mask_pos', 'labels']
`numRows` is the only option which could be set by user, other values must be set according to the dataset.
For example, the schema file shows as follows:
{
"datasetType": "TF",
"numRows": 7680,
"columns": {
"task_id": {
"type": "int64",
"rank": 1,
"shape": [1]
},
"src_ids": {
"type": "int64",
"rank": 1,
"shape": [512]
},
"pos_ids": {
"type": "int64",
"rank": 1,
"shape": [512]
},
"sent_ids": {
"type": "int64",
"rank": 1,
"shape": [512]
},
"input_mask": {
"type": "int64",
"rank": 1,
"shape": [512]
},
"start_positions": {
"type": "int64",
"rank": 1,
"shape": [1]
},
"end_positions": {
"type": "float32",
"rank": 1,
"shape": [1]
}
"mask_label": {
"type": "float32",
"rank": 1,
"shape": [76]
}
"mask_pos": {
"type": "float32",
"rank": 1,
"shape": [76]
}
"labels": {
"type": "float32",
"rank": 1,
"shape": [1]
}
}
}
.
└─D-NET
├─README_CN.md
├─backbone
└─bert_model.py # 骨干网络 bert
├─config
├─answer_matching.yaml # answer_matching 配置文件
├─mask_language_model.yaml # mask_language_model 配置文件
└─reading_comprehension.yaml # reading_comprehension 配置文件
├─paradigm
├─joint_model.py # 合并后的模型
├─answer_matching.py # answer_matching 模型文件
├─mask_language_model.py # mask_language_model 模型文件
└─reading_comprehension.py # reading_comprehension 模型文件
├─reader
├─joint_reader.py # 合并后的数据加载模块
├─answer_matching_reader.py # answer_matching 数据加载
├─mask_language_model_reader.py # mask_language_model 数据加载
└─reading_comprehension_reader.py # reading_comprehension 数据加载
├─utils
├─batching.py # 用于生成batch
├─configure.py # 处理参数
└─tokenization.py # 将文本token化
├─mtl_config.yaml # 多任务训练参数
├─mtl_run.py # 训练脚本
├─run.sh # 训练脚本
└─wget_data.sh # 数据集下载脚本
用法:mtl_run.py
可以在mtl_config.yaml
文件中分别配置参数。
Parameters for optimizer:
learning_rate 学习率
weight_decay 权重衰减
bash run.sh
请浏览官网主页。
hello
尊敬的启智用户
感谢您一直以来对Openl启智社区AI协作平台的支持。为了保障您的使用权益和确保网络安全,我们于2024年1月份更新了《Openl启智社区AI协作平台使用协议》。更新后的协议明确了用户禁止使用内网穿透工具的条例。您单击“同意并继续”后,便可以继续使用我们的服务。感谢您的合作与理解。
更多协议内容,请参考《Openl启智社区AI协作平台使用协议》