albert_pytorch
albert_pytorch
英语版本|中文版说明
该存储库包含本文中Albert模型的Pytorch实现
一个自我监督的学习语言表示的精简版
Zhenzhong lan。 mingda chen ....
官方下载链接:Google Albert
适应此版本,下载Pytorch模型(Google Drive):
V1
v2
1。将config.json和30k-clean.model放置到prev_trained_model/albert_base_v2目录中。例子:
├── prev_trained_model
| └── albert_base_v2
| | └── pytorch_model.bin
| | └── config.json
| | └── 30k-clean.model
2.Convert Albert TF检查站到Pytorch
python convert_albert_tf_checkpoint_to_pytorch . py
- - tf_checkpoint_path = . / prev_trained_model / albert_base_tf_v2
- - bert_config_file = . / prev_trained_model / albert_base_v2 / config . json
- - pytorch_dump_path = . / prev_trained_model / albert_base_v2 / pytorch_model . bin一般语言理解评估(GLUE)基准是九个句子或句子的语言理解任务,用于评估和分析自然语言理解系统。
在运行这些胶水任务的任何人之前,您应该通过运行此脚本并将其解放到某些目录$ data_dir下载胶水数据。
3.run sh scripts/run_classifier_sst2.sh至微调阿尔伯特模型
Albert在DEV上使用单模设置的胶水基准结果的性能:
| 可乐 | SST-2 | mnli | STS-B | |
|---|---|---|---|---|
| 公制 | matthews_corrcoef | 准确性 | 准确性 | 皮尔逊 |
| 模型 | 可乐 | SST-2 | mnli | STS-B |
|---|---|---|---|---|
| albert_base_v2 | 0.5756 | 0.926 | 0.8418 | 0.9091 |
| albert_large_v2 | 0.5851 | 0.9507 | 0.9151 | |
| albert_xlarge_v2 | 0.6023 | 0.9221 |