Skip to content

NEZHA: Neural Contextualized Representation for Chinese Language Understanding

License

Notifications You must be signed in to change notification settings

cqupt-lwk/NeZha_Chinese_PyTorch

 
 

Repository files navigation

NeZha_Chinese_PyTorch

pytorch版NEZHA,适配transformers

论文下载地址: NEZHA: Neural Contextualized Representation for Chinese Language Understanding

运行脚本依赖模块

如果需要运行该案例脚本,需要安装以下模块:

  1. trainsformers>=4.1.1
  2. TorchBlocks

模型权重下载

官方提供的Tensorflow版本权重下载地址:huawei-noah

已经转化为PyTorch版本权重下载地址如下:

说明:若加载的模型权重是从下列百度网盘下载的PyTorch模型权重,则需要保证torch版本>=1.6.0

运行

执行命令:

sh scripts/run_task_text_classification_chnsenti.sh

长文本

长文本可以通过设置config.max_position_embeddings参数实现,默认值为512,如:

config.max_position_embeddings=args.train_max_seq_length

结果

NEZHA(base-wwm) chnsenti
tensorflow 94.75
pytorch 94.92

About

NEZHA: Neural Contextualized Representation for Chinese Language Understanding

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.1%
  • Shell 0.9%