hayamimi punct-ja fp16 — 日本語句読点復元モデル(fp16 ONNX、スマホ向け)
hayamimi 早耳 の Flutter パッケージ hayamimi_core が端末上で日本語の句読点(、。)を付けるために使う ONNX モデルです。 ishiki-emo/mojicast-punct-onnx の fp32 モデルを fp16 に変換したもので、重みの内容はそれ以外変えていません。
This is the fp16 conversion of the Japanese punctuation-restoration model from ishiki-emo/mojicast-punct-onnx, packaged for on-device use by hayamimi_core (Flutter).
クレジット / Credits
- 土台 / base: tohoku-nlp/bert-base-japanese-char-v3 (Apache-2.0)
- 句読点予測の重み / punctuation head: bobfromjapan/bert_japanese_punctuation (Apache-2.0)
- ONNX 変換 / ONNX export: Mojicast (ishiki-emo), Apache-2.0
- fp16 変換 / fp16 conversion: hayamimi (
scripts/quantize_punct.py)
なぜ fp16 か / Why fp16
| ファイル / file | 精度 | サイズ | 備考 |
|---|---|---|---|
upstream punct_bert.onnx |
fp32 | 364 MB | PC 版 hayamimi はこれを使う / used by the Python pipeline |
upstream punct_bert.int8.onnx |
int8 | 109 MB | ONNX Runtime CPU EP でロジットがほぼ定数になり使えなかった / found non-functional on onnxruntime CPU EP during hayamimi development |
this repo punct_bert.fp16.onnx |
fp16 | 182 MB | 実放送 15 文で fp32 と F1 / CER 完全一致 / identical F1 and CER to fp32 on 15 real-broadcast ja sentences |
ファイル / Files
| file | sha256 |
|---|---|
punct_bert.fp16.onnx |
bca0d6cb9d35fbb27f2070e9b003ad277e9f7494b0dff69b1e164e84e793149a |
vocab.txt (tohoku-nlp BERT char v3 と同一 / identical to upstream) |
57411bcac5e9559f2aa4d316a2217289048cb40fe23187b02a81aeb3e5d61cf3 |
入出力 / I/O
- inputs:
input_ids,attention_mask(int64, character-level tokens; NFKC-normalised text,[CLS]…[SEP]) - output:
logits(per token: [comma, period] logits; apply sigmoid and a 0.5 threshold) - 完全な仕様(トークナイズ、疑問符の規則、最大 500 文字)/ the full rule set (tokenisation, question-mark rule, 500-char cap): docs/spec/ja_pipeline.md
動作確認 / Verified with
- sherpa-onnx 1.13.6 が同梱する ONNX Runtime 1.27.1 (API version 11): Windows x64 と Android x86_64 (API 35 emulator) / the ONNX Runtime bundled with sherpa-onnx 1.13.6 (1.27.1, API 11) on Windows x64 and an Android x86_64 emulator
- hayamimi_core の
PunctuatorJaは Python 版scripts/punct_ja.pyと 51 ケースで出力一致 /PunctuatorJamatches the Python reference on 51 fixture cases
Model tree for oboroge0/hayamimi-punct-ja-fp16
Base model
bobfromjapan/bert_japanese_punctuation Quantized
ishiki-emo/mojicast-punct-onnx