Views
No views yet
1from transformers import AutoTokenizer, AutoModelForMaskedLM
2tokenizer = AutoTokenizer.from_pretrained("nlp-waseda/roberta-large-japanese-seq512-with-auto-jumanpp")
3model = AutoModelForMaskedLM.from_pretrained("nlp-waseda/roberta-large-japanese-seq512-with-auto-jumanpp")
4
5sentence = '早稲田大学で自然言語処理を[MASK]する。'
6encoding = tokenizer(sentence, return_tensors='pt')
7...BertJapaneseTokenizer now supports automatic tokenization for Juman++. However, if your dataset is large, you may take a long time since BertJapaneseTokenizer still does not supoort fast tokenization. You can still do the Juman++ tokenization by your self and use the old model nlp-waseda/roberta-large-japanese-seq512.