NEZHA: Neural Contextualized Representation for Chinese Language Understanding
Paper • 1909.00204 • Published
How to use sijunhe/nezha-base-wwm with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("fill-mask", model="sijunhe/nezha-base-wwm") # Load model directly
from transformers import AutoModelForMaskedLM
model = AutoModelForMaskedLM.from_pretrained("sijunhe/nezha-base-wwm", dtype="auto")Please use 'Bert' related tokenizer classes and 'Nezha' related model classes
NEZHA: Neural Contextualized Representation for Chinese Language Understanding Junqiu Wei, Xiaozhe Ren, Xiaoguang Li, Wenyong Huang, Yi Liao, Yasheng Wang, Jiashu Lin, Xin Jiang, Xiao Chen and Qun Liu.
The original checkpoints can be found here
from transformers import BertTokenizer, NezhaModel
tokenizer = BertTokenizer.from_pretrained("sijunhe/nezha-base-wwm")
model = NezhaModel.from_pretrained("sijunhe/nezha-base-wwm")
text = "我爱北京天安门"
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)