Skip to content

Instantly share code, notes, and snippets.

@ofafa
Created April 9, 2020 15:45
Show Gist options
  • Save ofafa/37169529c5b5eb82556351735abf89ce to your computer and use it in GitHub Desktop.
Save ofafa/37169529c5b5eb82556351735abf89ce to your computer and use it in GitHub Desktop.
A very simple BERT for Chinese mask-filling task
from transformers import pipeline
nlp = pipeline('fill-mask', model="bert-base-chinese", tokenizer="bert-base-chinese")
nlp("內容推薦"+nlp.tokenizer.mask_token+"驗室")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment