进阶任务:使用ERNIE-M进行文本分类
更新时间:2022-12-17
使用ERNIE_M训练模型:
- 下载ERNIE-M模型:
# ernie_m_1.0 模型下载
# 进入models_hub目录
cd ../../models_hub/
# 运行下载脚本
sh download_ernie_m_1.0_base.sh
- 通过加载预置json配置文件进行模型训练
python run_trainer.py --param_path ./examples/cls_ernie_m_1.0_base_one_sent.json
预测我的第一个模型
- 开始预测(由于ernie-m已开源,故训练和预测都走不加密策略)
python run_infer_ernie_model.py --param_path ./examples/cls_ernie_m_1.0_base_one_sent_infer.json
- 预测运行的日志会自动保存在./output/predict_result.txt文件中。