【文件属性】:
文件名称:NeZha_Chinese_PyTorch:内扎
文件大小:19KB
文件格式:ZIP
更新时间:2021-05-04 11:00:59
pytorch chinese language-model nezha Python
NeZha_Chinese_PyTorch
pytorch版NEZHA,适配transformers
论文下载地址:
运行脚本依赖模块
如果需要运行该案例脚本,需要安装以下模块:
模型权重下载
官方提供的Tensorflow版本权重下载地址:
已经转化为PyTorch版本权重下载地址如下:
nezha-cn-base 提取码: hckq
nezha-large-zh 提取码: qks2
nezha-base-wwm 提取码: ysg3
nezha-large-wwm 提取码: 8dig
说明:若加载的模型权重是从下列百度网盘下载的PyTorch模型权重,则需要保证torch版本>=1.6.0
运行
执行命令:
sh scripts/run_task_text_classification_chnsenti.sh
长文本
长文本可以通过设置config.max_position_em
【文件预览】:
NeZha_Chinese_PyTorch-main
----convert_nezha_original_tf_checkpoint_to_pytorch.py(2KB)
----outputs()
--------__init__.py(2B)
----model()
--------configuration_nezha.py(6KB)
--------modeling_nezha.py(60KB)
----dataset()
--------__init__.py(10B)
----LICENSE(1KB)
----scripts()
--------run_task_text_classification_chnsenti.sh(748B)
----README.md(2KB)
----task_text_classification_chnsenti.py(5KB)
----pretrained_models()
--------__init__.py(2B)