LoginSignup
0
0

タイ語モデルopenthaigpt-1.0.0-7b-chatは「แม่อย่าเก็บไว้คนเดียว」をどうトークナイズするのか

Posted at

OpenThaiGPTから「openthaigpt-1.0.0-7b-chat」がリリースされたので、とりあえずトークナイザを試してみることにした。

>>> from transformers import AutoTokenizer
>>> tkz=AutoTokenizer.from_pretrained("openthaigpt/openthaigpt-1.0.0-7b-chat")
>>> print(tkz.convert_ids_to_tokens(tkz("แม่อย่าเก็บไว้คนเดียว")["input_ids"]))
['<s>', '▁แม', '่อย', '่า', 'เก็บ', 'ไว้', 'คนเดียว']

แม่อย่าเก็บไว้คนเดียว」をトークナイズしてみたところ、単語の切れ目が「แม่」「อย่า」「เก็บ」「ไว้」「คน」「เดียว」になっておらず、非常に気持ち悪い。もう少し細かくみてみよう。

>>> for t in tkz.convert_ids_to_tokens(tkz("แม่อย่าเก็บไว้คนเดียว")["input_ids"]):
...   print(" ",t)
...
  <s>
  ▁แม
  ่อย
  ่า
  เก็บ
  ไว้
  คนเดียว

「เก็บ」「ไว้」の2単語を除いて、残りはボロボロだ。タイ文字クラスター(คลัสเตอร์อักษรไทย)すら、完全に無視してトークナイズしている。うーん、正直なところ使いにくすぎるなぁ。

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