0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

modernbert-ja-130mは『雪国』の冒頭をどうトークナイズするのか

Posted at

日本語ModernBERTモデル「modernbert-ja-130m」がリリースされたので、とりあえずトークナイザを試してみた。

>>> from transformers import AutoTokenizer
>>> tkz=AutoTokenizer.from_pretrained("sbintuitions/modernbert-ja-130m")
>>> tkz.convert_ids_to_tokens(tkz("国境の長いトンネルを抜けると雪国であった。","夜の底が白くなった。")["input_ids"])
['<s>', '国境', 'の長い', 'トンネル', 'を抜け', 'ると', '雪', '国', 'であった', '。', '</s>', '<s>', '夜の', '底', 'が', '白', 'くなった', '。', '</s>']

「の長い」や「を抜け」や「ると」が1トークンになってしまっていて、日本語トークナイザとしてはマズイことになっている。これでは、私(安岡孝一)が『青空文庫ModernBERTモデルによる国語研長単位係り受け解析』で示した手法が、この「modernbert-ja-130m」には乗らないので、2月9日の記事と比較できない。それどころか、品詞付与のModernBertForTokenClassificationすら実装が困難なので、1月3日の記事とも比較できない。うーん、せっかく3.51兆トークンで鍛えた日本語モデルなのに、うまく使えないよう。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?