CT-Transformer punctuation (Core ML)

English | 中文

English

Core ML conversion of FunASR's CT-Transformer punctuation model by Tongyi Lab. Adds ,。?、 to unpunctuated Chinese text (English words allowed). Converted by Sixlab for cctype, a native macOS dictation app, as the companion of cctype-seaco-paraformer-zh.

Variants

Folder Weights Size
original/ FP32, as converted about 280 MB
8bit/ 8-bit (linear symmetric), computation FP32 about 71 MB

Both folders hold the same files. Each pairs with the same variant of the recognizer.

Files

File Inputs → outputs
Punctuator.mlpackage token ids [1, L] (L ≤ 512) → class per token [1, L]: 0 <unk>, 1 none, 2 ,, 3 。, 4 ?, 5 、
tokens.json vocabulary (lowercase English words, Chinese characters), unchanged from FunASR

Tokenize as FunASR does without jieba: ASCII runs are words, every other character is one word. Classify 20 words at a time and carry an unfinished sentence into the next window (see FunASR's CTTransformer.inference, or the Swift Punctuator in cctype's CCTypeCore).

Conversion

Computation FP32 in both variants; 8bit/ stores the weights as 8-bit integers (linear symmetric). Both verified against FunASR's own punctuation: identical output on the reference texts. Conversion scripts: Tools/punctuation in the cctype repository.

License

Apache License 2.0, as the original model. The original model is the work of Tongyi Lab / FunASR; this repository only converts it.

中文

通义实验室 FunASR 的 CT-Transformer 标点模型 的 Core ML 版本。给没有标点的中文文本加上 ,。?、(可以夹带英文单词)。由 Sixlab 转换,用于原生 macOS 语音输入应用 cctype,与 cctype-seaco-paraformer-zh 配套使用。

版本

文件夹 权重 大小
original/ FP32,转换原样 约 280 MB
8bit/ 8 位(线性对称量化),计算 FP32 约 71 MB

两个文件夹的文件相同,各自与识别模型的同名版本配套。

文件

文件 输入 → 输出
Punctuator.mlpackage token id [1, L](L ≤ 512)→ 每个 token 的类别 [1, L]:0 <unk>,1 无,2 ,,3 。,4 ?,5 、
tokens.json 词表(小写英文单词、汉字),与 FunASR 相同

按 FunASR 不用 jieba 时的方式分词:连续的 ASCII 字符算一个词,其他每个字符各算一个词。每次分类 20 个词,没说完的句子带入下一个窗口(参见 FunASR 的 CTTransformer.inference,或 cctype CCTypeCore 中的 Swift 实现 Punctuator)。

转换

两个版本都用 FP32 计算;8bit/ 把权重存为 8 位整数(线性对称量化)。都与 FunASR 官方标点逐字比对,参考文本的结果完全一致。转换脚本在 cctype 仓库的 Tools/punctuation。

许可证

Apache License 2.0,与原模型相同。原模型由通义实验室 / FunASR 开发,本仓库只做了格式转换。

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support