/ Модель

Характеристики

Контекст
8 192 токена
Параметры
307 млн
Лицензия
Apache 2.0
Архитектура
modernbert · dense
Базовая модель
mmBERT-base
Библиотека
transformers
Опубликована
3 окт 2026

punctuation-restoration-base

Разметка токеновТекст → label

Многоязычная модель на базе mmBERT-base восстанавливает пунктуацию в расшифровках речи и других текстах на 88 языках.

221скачиваний за 30 дней1лайквеса обновлены9 окт 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Horizon Labs разработала многоязычную модель восстановления пунктуации на базе энкодера mmBERT-base. Модель относится к семейству ModernBERT, содержит 306,9 млн параметров и решает задачу классификации токенов: после каждого слова она предсказывает точку, запятую, вопросительный знак, двоеточие, тире или отсутствие знака. Контекст модели — до 8192 токенов.

Модель предназначена для восстановления пунктуации в расшифровках речи, субтитрах, сообщениях и текстах после OCR или извлечения из веба. Она поддерживает 88 языков, включая обработку текста в нижнем регистре, а длинные тексты можно обрабатывать перекрывающимися фрагментами. Для китайского и японского предусмотрена отдельная запись знаков через вспомогательный скрипт. В репозитории доступны веса Safetensors и ONNX, включая квантованную ONNX-версию для CPU и браузера.

Модель восстанавливает только ограниченный набор знаков и не меняет регистр букв или сами слова. На тексте в нижнем регистре и на разговорной речи качество ниже; редкие языки и языки вне заявленного набора могут обрабатываться хуже. Модель распространяется по лицензии Apache-2.0.

Сценарии применения

  • восстановление знаков препинания в расшифровках ASR
  • расстановка пунктуации в субтитрах и заметках голосовых сообщений
  • восстановление пунктуации в сообщениях чата без знаков
  • добавление пунктуации в текст после OCR
  • обработка длинных текстов, извлечённых из веба

Ограничения

Модель предсказывает только точку, запятую, вопросительный знак, двоеточие, тире или отсутствие знака; она не восстанавливает регистр и не меняет слова. На тексте в нижнем регистре, разговорной речи, редких языках и языках вне поддерживаемых 88 качество может быть ниже.

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Punctuation Restoration (base, 307M): 88 languages

Adds punctuation back to text that has none: speech-recognition (ASR) transcripts, subtitles, chat messages, voice notes, OCR or scraped text. It predicts, after each word, one of . , ? : - or nothing, in 88 languages, with any casing (including the all-lowercase output of many ASR systems). Built on mmBERT-base, Apache-2.0, ONNX files for CPU and the browser (transformers.js) included. Try it in the browser. A smaller, faster version is available as punctuation-restoration-small.

  • Same labels as oliverguhr/fullstop-punctuation-multilang-large and kredor/punctuate-all (0 . , ? - :), so it is a drop-in for the deepmultilingualpunctuation package.
  • Chinese and Japanese work too (no word segmentation needed) with the included punctuate.py, which writes ,。?: there, and । (Hindi, Bengali), ، ؟ (Arabic script), ; for questions in Greek and ። ፣ in Amharic.
  • It restores punctuation only. It does not change casing or the words.
  • onnx/model_quantized.onnx (int8 embeddings, 641 MB) predicts the same label as fp32 for 99.93% of tokens on held-out text.

Usage

With the included helper (any language; long texts are processed in overlapping chunks):

from huggingface_hub import hf_hub_download
import importlib.util, sys
spec = importlib.util.spec_from_file_location("punctuate", hf_hub_download("Horizon-Labs/punctuation-restoration-base", "punctuate.py"))
punctuate = importlib.util.module_from_spec(spec); spec.loader.exec_module(punctuate)

p = punctuate.Punctuator("Horizon-Labs/punctuation-restoration-base")
print(p("hello how are you today i hope everything is fine"))
print(p("今天天气很好我们去公园散步吧你觉得怎么样"))

As a drop-in for deepmultilingualpunctuation (space-separated languages; that package needs transformers 4.x, because it passes grouped_entities, which transformers 5 removed):

from deepmultilingualpunctuation import PunctuationModel
model = PunctuationModel(model="Horizon-Labs/punctuation-restoration-base")
print(model.restore_punctuation("my name is anna i live in berlin what about you"))

Plain transformers: the label of each word is the label of its last token ("0" = no mark).

from transformers import pipeline
tagger = pipeline("token-classification", model="Horizon-Labs/punctuation-restoration-base")
tagger("hello how are you today")

transformers.js:

import { pipeline } from "@huggingface/transformers";
const tagger = await pipeline("token-classification", "Horizon-Labs/punctuation-restoration-base", { dtype: "q8" });
console.log(await tagger("hello how are you today i hope everything is fine"));

Evaluation

Punctuation F1: micro-averaged over the five marks (a predicted mark counts only if it is the correct mark at the correct position), averaged over languages. Every model gets the same input: the paragraph with . , ? : ; ! - removed, once with its original casing and once lowercased (as most ASR output is). Same script for every model (code/). The test sets were used only for evaluation:

  • FLORES-200 devtest: professionally translated news, travel and wiki text; the consecutive sentences of one article form a paragraph (about 280 paragraphs per language). Columns: the 12 languages of punctuate-all, and our 88 training languages.
  • TED talks (TED2020 via OPUS): transcripts and their translations, 5 consecutive sentences, 200 paragraphs in each of 25 languages. Spoken style.
  • Europarl: European Parliament proceedings, 5 consecutive sentences, 200 paragraphs in each of 12 languages. punctuate-all and the fullstop models were trained on Europarl, so this column is in-domain for them; we never trained on it.
modellicencelanguagesFLORES, 12 EU languages (cased)(lowercased)FLORES, our 88 languages (cased)(lowercased)TED talks, 25 languages (cased)(lowercased)Europarl, 12 languages (cased)(lowercased)
this model (307M)Apache-2.0880.9220.8910.8470.8040.7950.7220.8810.839
punctuation-restoration-small (140M)Apache-2.0880.9200.8830.8420.7960.7860.7060.8780.830
punctuate-allMIT120.8790.8730.6670.6570.6640.6540.8850.884
fullstop-punctuation-multilang-largeMIT40.8410.8380.6690.6630.6480.6420.8260.824
fullstop-punctuation-multilingual-baseMIT60.8460.8290.6680.6520.6570.6360.8260.822
xlm-roberta_punctuation_fullstop_truecaseApache-2.047—0.818—0.689—0.643—0.751
punct_cap_seg_47_languageApache-2.047—0.565—0.448—0.510—0.504
  • The 1-800-BAD-CODE models expect lowercased input and also restore casing and split sentences; they are scored only on lowercased input, through the punctuators package, by re-reading their output against the input words. Words their output changed beyond casing (about 2% of words for xlm-roberta_punctuation_fullstop_truecase, 11% for punct_cap_seg_47_language) could not be aligned and count as "no mark", which lowers their scores somewhat.
  • On Europarl, punctuate-all (trained on it) is ahead of this model, most clearly on lowercased input.

Per mark (this model; mean over languages, FLORES over our 88):

markFLORES (cased)FLORES (lowercased)TED (cased)TED (lowercased)
.0.9480.8900.9070.808
,0.7300.7000.6930.641
?0.7770.6700.8140.736
:0.4510.4120.5990.519
-0.1870.1880.0750.061
languagethis model (cased)this model (lowercased)punctuate-all (cased)xlm-roberta_punctuation_fullstop_truecase (lowercased)
Afrikaans0.8550.8280.7380.767
Albanian0.8950.8450.8120.769
Amharic0.7760.7760.5570.721
Arabic0.7600.7600.6230.652
Armenian0.6190.5860.5400.551
Azerbaijani0.8710.8200.6850.753
Basque0.8670.8080.5760.543
Belarusian0.9400.8970.8230.808
Bengali0.7520.7520.6340.626
Bosnian0.9170.8760.6850.805
Bulgarian0.9260.8910.8810.849
Catalan0.8920.8540.8250.751
Central Kurdish0.6420.6410.1750.147
Chinese (Simplified)0.8480.8470.5760.771
Croatian0.9100.8750.6880.797
Czech0.9530.9220.9090.839
Danish0.9050.8940.7760.751
Dutch0.9270.9080.8990.835
English0.8740.8370.8100.780
Esperanto0.9060.8620.7790.713
Estonian0.9480.9140.8660.846
Faroese0.8700.8340.4380.466
Filipino0.8640.7890.6840.658
Finnish0.9470.9170.8590.864
French0.9130.8810.8610.806
Galician0.8970.8620.8330.752
Georgian0.7900.7910.6150.652
German0.9500.9390.9350.899
Greek0.8730.8190.8000.750
Gujarati0.7600.7600.6820.690
Hausa0.7290.4960.4990.512
Hebrew0.8030.8030.7440.611
Hindi0.8100.8100.7040.708
Hungarian0.9310.8830.7990.818
Icelandic0.8850.8430.7650.780
Indonesian0.8790.8250.7590.768
Irish0.8320.7490.6220.584
Italian0.8950.8510.8450.774
Japanese0.9090.9100.4460.806
Javanese0.8220.6920.5270.536
Kannada0.7580.7580.6480.709
Kazakh0.9090.8510.7110.752
Kinyarwanda0.7360.5370.2150.571
Korean0.8740.8750.7580.858
Kyrgyz0.9120.8610.6430.792
Latvian0.9460.9120.8450.861
Lithuanian0.9300.8790.7900.816
Luxembourgish0.8690.8450.2470.266
Macedonian0.8970.8550.7490.777
Malay0.8590.7890.7270.707
Malayalam0.7010.7000.5760.658
Maltese0.8490.7860.1880.246
Marathi0.7580.7580.6440.706
Mongolian0.8980.8500.6610.750
Nepali0.8180.8170.6860.686
Norwegian Bokmål0.8820.8520.8320.785
Odia0.6420.6400.6620.717
Pashto0.7400.7420.5220.652
Persian0.8170.8170.7450.678
Polish0.9340.8990.8980.857
Portuguese0.9050.8750.8480.793
Punjabi0.7850.7850.6810.685
Romanian0.9060.8750.8480.793
Russian0.9530.9190.8310.850
Serbian0.9090.8680.7110.798
Sindhi0.7440.7430.5870.646
Sinhala0.7320.7320.6240.731
Slovak0.9490.9170.9090.848
Slovenian0.9550.9210.9220.764
Somali0.7540.6220.4850.583
Spanish0.8840.8550.8350.778
Sundanese0.7750.6360.4720.489
Swahili0.8280.7360.6600.671
Swedish0.8780.8580.8370.796
Tajik0.9250.8990.1720.220
Tamil0.7090.7100.5990.688
Tatar0.8740.8060.2090.293
Telugu0.7280.7280.6280.695
Turkish0.8500.8150.6780.753
Ukrainian0.9330.9020.8460.848
Urdu0.7890.7890.6670.701
Uyghur0.7470.7460.6440.757
Uzbek0.9000.8490.6460.733
Vietnamese0.8660.7910.7180.668
Welsh0.8520.7780.6690.648
Xhosa0.8070.6670.3800.387
Yoruba0.7000.3930.2150.258
Zulu0.7950.6330.3600.365

Training

  • Data: 1,168,626 text windows (119M words) in 88 languages from FineWeb-2 and FineWeb (ODC-BY). The labels come from the text's own punctuation: snippets that end in a full stop, are mostly letters and are not lists; 1-4 snippets per window (up to 230 words), 30% cut mid-sentence. 70% of the inputs were lowercased.
  • Spoken-style text (v1.1): 49,144 windows of edited transcripts of everyday speech (talks, podcasts, interviews, meetings, lectures, vlogs, phone calls ...) in 69 languages, written by Qwen3.8-27B (Apache-2.0) for this purpose; transcripts that shared a sentence with any test set were removed.
  • Normalisation: !, ;, … and script full stops (。 । ። ۔ ...) count as .; ,、، as ,; ?؟ (and ; in Greek) as ?; a free-standing dash as -. A . before a lowercase word (abbreviations) counts as no mark.
  • Model: mmBERT-base token classification, one label per word on its last token, 1 epoch, learning rate 3e-5. Checkpoint chosen on held-out web text, not on the test sets.
  • Code: code/ in this repository.

Changelog

  • v1.1 (2026-10-09): + 49k windows of synthetic spoken-style transcripts (69 languages). TED talks (spoken, 25 languages), two training seeds: punctuation F1 .784 -> .796 (cased) and .707 -> .723 (lowercased); : F1 .544 -> .605. FLORES (written text, 88 languages) unchanged (.847 / .804).
  • v1.0 (2026-10-03): first release.

Limitations

  • Only . , ? : - are predicted. Exclamation marks, semicolons, quotes, brackets and Spanish inverted marks are not restored. : and especially - (a free-standing dash) are much less reliable than . , ? (see the per-mark table).
  • Accuracy on lowercased text is lower than on cased text, because capital letters reveal sentence starts.
  • Trained mostly on written web text, plus synthetic spoken-style transcripts. Disfluent speech (fillers, false starts, repetitions) is harder, and punctuation conventions vary by writer. Thai, Lao, Khmer, Burmese and Tibetan are not supported.
  • Low-resource languages and languages outside the 88 score lower (see the per-language table).

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers · token-classification

Можно запустить

Подбираем GPU…

Класс архитектуры
ModernBertForTokenClassification
Ревизия весов
63ec204

0 моделей