turkish-stt-66m-v2

🇹🇷 Türkçe · Damga (Turkish ITN/TN) · Previous version (v1)

Real-time, low-latency speech-to-text (STT) for Turkish — second release.

Turkish-only · streaming · CPU-friendly · runs on the edge. Same size and architecture as mihuai/turkish-stt (v1), retrained: about 28% fewer word errors on FLEURS-TR (standard normalization; about 34% with Damga normalization) at identical speed.

Model: 66 M parameters · ~68 MB (int8) · streaming Zipformer transducer · 16 kHz mono


What's new in v2

v1 (turkish-stt) v2 (turkish-stt-66m-v2) Change
FLEURS-TR WER — standard normalization 13.90 10.06 −28%
FLEURS-TR WER — Damga normalization 9.38 6.21 −34%
Parameters / int8 size 66 M / ~68 MB 66 M / ~68 MB same
Latency, throughput — unchanged (same architecture) same

Measured in-house with the same audio, decoder settings and eval/score.py.

What it does

turkish-stt-66m-v2 transcribes Turkish speech as it is spoken — partial results arrive while the speaker is still talking, on an ordinary CPU (no GPU, no cloud). It is built for real-time use cases: voice agents, call centers, live captioning, dictation, IoT and edge devices.

Highlights

  • 🇹🇷 Turkish-first — every parameter serves one language, not ~100
  • ⚡ Streaming — ~320 ms chunks, partial results while you speak
  • 🖥️ CPU-native — faster than real time on a single CPU thread
  • 🔌 Tiny — ~68 MB int8; fits on a Raspberry-Pi-class device
  • 🔢 Pairs with Damga — open-source Turkish ITN turns spoken numbers, dates, money and phone numbers into written form

Benchmarks

Every number below was measured in-house on the same audio with one scoring script (eval/score.py). No figures are taken from external publications; every system, including Whisper, was run by us under identical conditions.

Accuracy — FLEURS-TR (743 clips, real human read speech)

Model Class WER % (standard) WER % (Damga) CER % (Damga)
Whisper large-v3 offline · GPU 7.82 4.48 1.11
Whisper large-v3-turbo offline · GPU 8.26 4.84 1.22
turkish-stt-66m-v2 streaming · CPU 10.06 6.21 1.70
turkish-stt (v1) streaming · CPU 13.90 9.38 2.50
Whisper small offline · GPU 17.41 13.27 3.18

Whisper: Hugging Face transformers, fp16, language="turkish", greedy. turkish-stt-66m-v2 and v1: int8, streaming, modified_beam_search (4 paths), one CPU thread.

What this means. v2 cuts v1's word errors by roughly 28–34% (depending on normalization) and is clearly ahead of Whisper small, while staying a streaming, CPU-only model at a fraction of Whisper's size. The much larger offline Whisper large-v3 / turbo (about 1.5 B / 0.8 B parameters, 12–24× larger) still lead on read speech, but they cannot stream and are slower than real time on a CPU.

Two normalizations — why both columns?

WER depends heavily on how text is normalized before comparison, so we report two:

  • Standard — OpenAI Whisper's BasicTextNormalizer (lower-case, punctuation → space). It is language-agnostic and widely used, so it is the column to compare against other published numbers. It counts formatting differences as errors: 17 vs on yedi, Ay'ın vs ayın, hâlâ vs hala.
  • Damga — Damga text normalization (written → spoken, so 17 = on yedi), then Turkish-aware lower-casing (I/ı, İ/i), apostrophes removed and circumflex folded. It answers "was the word recognized?" — which is what matters when the transcript goes to an LLM or a voice agent.

The model's output is never altered by either; normalization is applied only at scoring time, to the reference and the hypothesis alike.

Medium WER (lenient). Many Turkish STT model cards report with a more lenient rule: digits equal number words, and apostrophes, compound spacing (yurt dışı = yurtdışı) and hesitation fillers are not errors. With that rule, eval/medium_wer, turkish-stt-66m-v2 scores 5.28 % WER on FLEURS-TR (CER 1.63 %). It is about one point lower than Damga, so compare it only with numbers scored by the same rule; Damga stays our primary number.

Domain sets (Damga normalization)

Dataset Domain WER %
FLEURS-TR read speech 6.21
MediaSpeech-TR broadcast media 10.95

Latency and throughput

v2 has exactly the same architecture and size as v1, so speed is unchanged. Timings below were measured on the shared architecture (AMD EPYC 7282, one CPU thread, FLEURS-TR clips):

Model CPU RTF CPU p50 ms CPU p95 ms GPU RTF (RTX 4090)
turkish-stt-66m-v2 (int8) 0.128 1619 2437 CPU-only
Whisper small 1.098 12923 18540 0.0252
Whisper large-v3 6.095 70258 97979 0.0400
Whisper large-v3-turbo 4.296 52760 55969 0.0180

RTF = decode time ÷ audio duration (below 1.0 = faster than real time). On one 16-core CPU box turkish-stt-66m-v2 sustains about 25× real-time throughput (≈10–20 concurrent live streams); Whisper is slower than real time on CPU even for a single stream.

Usage

The easiest way is the turkish-stt package (GitHub) — 2.0.0 and later load this model; weights download on first use.

pip install turkish-stt              # 2.0.0+ — this model
pip install "turkish-stt[itn]"       # + Damga, for written-form output
import mihu_stt

mihu_stt.transcribe("audio.wav")              # "Toplam yüz elli lira ödedim."
mihu_stt.transcribe("audio.wav", itn=True)    # "Toplam 150 TL ödedim."  (Damga)

for seg in mihu_stt.transcribe_segments("audio.wav", itn=True):   # subtitles / timed transcript
    print(seg["start"], seg["end"], seg["text"])

stt = mihu_stt.StreamingSTT(itn=True)         # live: microphone, phone line
text, is_final = stt.accept_pcm16(pcm16, sample_rate=16000)

LiveKit / Pipecat adapters, a microphone CLI and subtitle export are in the GitHub repo.

Without the package (sherpa-onnx directly)

pip install sherpa-onnx soundfile numpy huggingface_hub
import json, numpy as np, sherpa_onnx, soundfile as sf
from huggingface_hub import hf_hub_download

get = lambda f: hf_hub_download("mihuai/turkish-stt-66m-v2", f)
cfg = json.load(open(get("config.json")))          # model settings
rec = sherpa_onnx.OnlineRecognizer.from_transducer(
    tokens=get("tokens.txt"), encoder=get("encoder.int8.onnx"),
    decoder=get("decoder.int8.onnx"), joiner=get("joiner.int8.onnx"),
    num_threads=1, sample_rate=cfg["sample_rate"], feature_dim=cfg["feature_dim"],
    decoding_method=cfg["decoding_method"], max_active_paths=cfg["max_active_paths"],
)

x, sr = sf.read("audio.wav", dtype="float32")      # 16 kHz mono
s = rec.create_stream()
s.accept_waveform(sr, x)
s.accept_waveform(sr, np.zeros(sr // 2, dtype=np.float32))
s.input_finished()
while rec.is_ready(s):
    rec.decode_stream(s)
print(rec.get_result(s))

Live from the microphone (+ Damga)

examples/mic_damga.py streams your microphone into the model, updates the transcript while you speak, detects the end of each sentence, and prints Damga's written form:

pip install sherpa-onnx sounddevice numpy huggingface_hub damga   # Linux: sudo apt install libportaudio2
python examples/mic_damga.py              # --list shows input devices, --device N picks one
python examples/mic_damga.py --wav ses.wav   # same pipeline on a WAV file, no microphone

Say "telefon numaram sıfır beş otuz iki yüz yirmi üç kırk beş altmış yedi, toplam yüz elli lira ödedim":

 … Telefon numaram sıfır beş otuz iki yüz yirmi üç
[01] STT : Telefon numaram sıfır beş otuz iki yüz yirmi üç kırk beş altmış yedi, toplam yüz elli lira ödedim.
     ITN : Telefon numaram 0532 123 45 67, toplam 150 TL ödedim.

The core loop — feed 100 ms chunks, read the partial result, close the sentence on an endpoint:

rec = sherpa_onnx.OnlineRecognizer.from_transducer(
    ...,                                   # same arguments as above, plus:
    enable_endpoint_detection=True,
    rule2_min_trailing_silence=0.8,        # end of sentence after 0.8 s of silence
)
s = rec.create_stream()
for chunk in mic_chunks():                 # float32, 16 kHz mono
    s.accept_waveform(16000, chunk)
    while rec.is_ready(s):
        rec.decode_stream(s)
    partial = rec.get_result(s)            # live text
    if rec.is_endpoint(s):
        print(itn.normalize(partial))      # final sentence, written form
        rec.reset(s)

Damga — written-form output and fair scoring

Damga (PyPI: damga) is mihu's open-source, offline, deterministic text-normalization engine (weighted finite-state transducers, Turkish by default). The model writes what it hears — yüz elli lira, sıfır beş otuz iki…. Damga turns that into what people write. No GPU, no network, no LLM; a few milliseconds per sentence on a CPU.

pip install damga

1. Written-form output (ITN: spoken → written) — run it on the model's final transcript:

from damga import InverseNormalizer

itn = InverseNormalizer()
itn.normalize("yüz elli lira")                     # '150 TL'
itn.normalize("saat dokuz otuzda")                 # "saat 09:30'da"
itn.normalize("sıfır beş otuz iki yüz yirmi üç kırk beş altmış yedi")   # '0532 123 45 67'
itn.normalize_batch(["on beş ekim", "yüzde on"])   # ['15 Ekim', '%10']

text = rec.get_result(s)          # transcript from the Usage example above
print(itn.normalize(text))

Use ITN when a person reads the text (subtitles, minutes, CRM notes). If the transcript goes straight to an LLM you can usually skip it — the LLM understands "on yedi" and "17" alike.

2. Fair scoring (TN: written → spoken) — references are usually written (17, %10), the model speaks (on yedi, yüzde on). Bring both to the spoken form before computing WER; this is what the "Damga" column above does:

from damga import TextNormalizer

tn = TextNormalizer()
tn.normalize("Toplam 25.600 adet, %12,5 indirim.")
# 'Toplam yirmi beş bin altı yüz adet, yüzde on iki virgül beş indirim.'

eval/score.py contains the exact scoring recipe. More: Damga's README (options such as custom_vocab, strict, group_thousands) and its live microphone example.

Reproduce

pip install sherpa-onnx soundfile numpy huggingface_hub jiwer num2words damga
cd eval
python run_fleurs.py --out hypotheses.jsonl        # downloads FLEURS-TR test + weights
python score.py --fleurs-tsv fleurs/tr_tr/test.tsv --hyp hypotheses.jsonl
# standard  WER 10.06  CER  3.90  (743 clips)
# damga     WER  6.21  CER  1.70  (743 clips)
python medium_wer/score.py fleurs/tr_tr/test.tsv hypotheses.jsonl
# medium  WER  5.28  CER  1.63  (743/743 clips)

score.py takes any {"id", "text"} JSONL, so you can score other systems with the exact same pipeline.

Files

File Description
encoder.int8.onnx encoder (int8)
decoder.int8.onnx decoder (int8)
joiner.int8.onnx joiner (int8)
tokens.txt 500 BPE tokens
bpe.model SentencePiece BPE model
config.json model settings (sample rate, features, streaming chunk, decoding)
eval/run_fleurs.py, eval/score.py FLEURS-TR reproduction
eval/medium_wer/ medium (lenient) WER rule, standard library only
examples/mic_damga.py live microphone STT + Damga ITN

Streaming config: chunk 16 frames, left context 128 (about 320 ms chunks), 80-dim fbank, 16 kHz.

Training data

Trained on Turkish speech only.

Use cases

  • Edge & IoT — on-device Turkish STT on single-board computers, embedded devices, offline and private deployments
  • Voice assistants and telephone voice agents
  • Call-center live transcription
  • Live captioning / dictation

Previous version

v1 remains available, unchanged, at mihuai/turkish-stt.

License

mihu Community License — see LICENSE for full terms.


Türkçe

Türkçe için gerçek zamanlı, düşük gecikmeli konuşma tanıma (STT) — ikinci sürüm.

Yalnızca Türkçe · streaming · CPU dostu · uç cihazlarda çalışır. mihuai/turkish-stt (v1) ile aynı boyut ve mimari, yeniden eğitildi: FLEURS-TR'de aynı hızda yaklaşık %28 daha az kelime hatası (standart normalizasyon; Damga normalizasyonuyla yaklaşık %34).

Model: 66 M parametre · ~68 MB (int8) · streaming Zipformer transducer · 16 kHz mono

v2'de neler değişti

v1 (turkish-stt) v2 (turkish-stt-66m-v2) Değişim
FLEURS-TR WER — standart normalizasyon 13.90 10.06 −%28
FLEURS-TR WER — Damga normalizasyonu 9.38 6.21 −%34
Parametre / int8 boyut 66 M / ~68 MB 66 M / ~68 MB aynı
Gecikme, kapasite — değişmedi (aynı mimari) aynı

Ne yapar

turkish-stt-66m-v2, Türkçe konuşmayı konuşuldukça yazıya döker: konuşmacı daha konuşurken ara sonuçlar gelir. Sıradan bir CPU yeterlidir, GPU ve bulut gerekmez. Sesli asistanlar, çağrı merkezleri, canlı altyazı, dikte, IoT ve uç cihazlar gibi gerçek zamanlı kullanımlar için tasarlandı.

  • 🇹🇷 Türkçe odaklı — her parametre tek bir dile hizmet eder, ~100 dile değil
  • ⚡ Streaming — ~320 ms'lik parçalar, siz konuşurken ara sonuçlar
  • 🖥️ CPU'da çalışır — tek CPU thread'inde gerçek zamandan hızlı
  • 🔌 Küçük — ~68 MB int8; Raspberry Pi sınıfı cihazlara sığar
  • 🔢 Damga ile birlikte — açık kaynak Türkçe ITN; sayıları, tarihleri, tutarları ve telefon numaralarını yazılı biçime çevirir

Doğruluk — FLEURS-TR (743 klip, gerçek insan okuma sesi)

Model Sınıf WER % (standart) WER % (Damga) CER % (Damga)
Whisper large-v3 offline · GPU 7.82 4.48 1.11
Whisper large-v3-turbo offline · GPU 8.26 4.84 1.22
turkish-stt-66m-v2 streaming · CPU 10.06 6.21 1.70
turkish-stt (v1) streaming · CPU 13.90 9.38 2.50
Whisper small offline · GPU 17.41 13.27 3.18

Tüm sayılar aynı ses dosyalarıyla ve aynı puanlama betiğiyle (eval/score.py) kendi ortamımızda ölçüldü. Dış kaynaklardan alınmış rakam yok; Whisper dahil tüm sistemleri aynı koşullarda biz çalıştırdık. v2, v1'in kelime hatasını normalizasyona göre yaklaşık %28–34 azaltır ve Whisper small'u açıkça geçer. Çok daha büyük olan Whisper large-v3 / turbo (12–24 kat büyük) okuma sesinde hâlâ öndedir; ancak streaming yapamazlar ve CPU'da gerçek zamandan yavaştırlar.

Neden iki normalizasyon? WER, metinlerin karşılaştırılmadan önce nasıl normalize edildiğine çok bağlıdır:

  • Standart — OpenAI Whisper BasicTextNormalizer (küçük harf, noktalama → boşluk). Dilden bağımsızdır ve yaygın kullanılır; başka yayınlanmış sayılarla bu sütunu karşılaştırın. Biçim farklarını hata sayar: 17 / on yedi, Ay'ın / ayın, hâlâ / hala.
  • Damga — Damga metin normalizasyonu (yazılı → sözlü, yani 17 = on yedi), ardından Türkçe'ye uygun küçük harf (I/ı, İ/i), kesme işareti ve şapka kaldırılır. "Kelime doğru tanındı mı?" sorusunu ölçer; metin bir LLM'e veya sesli asistana gidiyorsa önemli olan budur.

Normalizasyon modelin çıktısını değiştirmez; yalnızca puanlarken, referansa ve model çıktısına aynı şekilde uygulanır.

Orta WER (hoşgörülü). Birçok Türkçe STT model kartı daha hoşgörülü bir kuralla ölçer: rakam ile sayı kelimesi aynı sayılır; kesme işareti, bitişik/ayrı yazım (yurt dışı = yurtdışı) ve "ee, ıı" gibi dolgu sesleri hata sayılmaz. Bu kuralla (eval/medium_wer) turkish-stt-66m-v2 FLEURS-TR'de %5.28 WER (CER %1.63) alır. Damga'dan yaklaşık bir puan düşüktür; yalnızca aynı kuralla ölçülmüş sayılarla karşılaştırın. Ana sayımız Damga'dır.

Alan setleri (Damga normalizasyonu): FLEURS-TR (okuma) 6.21 · MediaSpeech-TR (yayın) 10.95.

Hız: v2, v1 ile birebir aynı mimaride olduğu için hız değişmedi: tek CPU thread'inde RTF 0.128 (gerçek zamandan yaklaşık 8 kat hızlı); 16 çekirdekli bir CPU sunucusunda yaklaşık 25 kat gerçek zaman toplam kapasite (≈10–20 eşzamanlı canlı stream).

Kullanım

En kolay yol turkish-stt paketidir (GitHub) — 2.0.0 ve sonrası bu modeli kullanır; ağırlıklar ilk kullanımda iner.

pip install turkish-stt              # 2.0.0+ — bu model
pip install "turkish-stt[itn]"       # + Damga, yazılı biçimde çıktı için
import mihu_stt

mihu_stt.transcribe("ses.wav")                # "Toplam yüz elli lira ödedim."
mihu_stt.transcribe("ses.wav", itn=True)      # "Toplam 150 TL ödedim."  (Damga)

for seg in mihu_stt.transcribe_segments("ses.wav", itn=True):   # altyazı / zaman damgalı metin
    print(seg["start"], seg["end"], seg["text"])

stt = mihu_stt.StreamingSTT(itn=True)         # canlı: mikrofon, telefon hattı
text, is_final = stt.accept_pcm16(pcm16, sample_rate=16000)

LiveKit / Pipecat adaptörleri, mikrofon aracı ve altyazı dışa aktarma GitHub reposunda.

Paket olmadan (doğrudan sherpa-onnx)

pip install sherpa-onnx soundfile numpy huggingface_hub
import json, numpy as np, sherpa_onnx, soundfile as sf
from huggingface_hub import hf_hub_download

get = lambda f: hf_hub_download("mihuai/turkish-stt-66m-v2", f)
cfg = json.load(open(get("config.json")))          # model ayarları
rec = sherpa_onnx.OnlineRecognizer.from_transducer(
    tokens=get("tokens.txt"), encoder=get("encoder.int8.onnx"),
    decoder=get("decoder.int8.onnx"), joiner=get("joiner.int8.onnx"),
    num_threads=1, sample_rate=cfg["sample_rate"], feature_dim=cfg["feature_dim"],
    decoding_method=cfg["decoding_method"], max_active_paths=cfg["max_active_paths"],
)

x, sr = sf.read("ses.wav", dtype="float32")        # 16 kHz mono
s = rec.create_stream()
s.accept_waveform(sr, x)
s.accept_waveform(sr, np.zeros(sr // 2, dtype=np.float32))
s.input_finished()
while rec.is_ready(s):
    rec.decode_stream(s)
print(rec.get_result(s))

Mikrofondan canlı kullanım (+ Damga)

examples/mic_damga.py mikrofonu modele aktarır, siz konuşurken metni günceller, her cümlenin bittiğini algılar ve Damga ile yazılı biçimini yazdırır:

pip install sherpa-onnx sounddevice numpy huggingface_hub damga   # Linux: sudo apt install libportaudio2
python examples/mic_damga.py              # --list giriş cihazlarını gösterir, --device N seçer
python examples/mic_damga.py --wav ses.wav   # aynı akış bir WAV dosyasıyla, mikrofonsuz

"telefon numaram sıfır beş otuz iki yüz yirmi üç kırk beş altmış yedi, toplam yüz elli lira ödedim" deyin:

 … Telefon numaram sıfır beş otuz iki yüz yirmi üç
[01] STT : Telefon numaram sıfır beş otuz iki yüz yirmi üç kırk beş altmış yedi, toplam yüz elli lira ödedim.
     ITN : Telefon numaram 0532 123 45 67, toplam 150 TL ödedim.

Temel döngü — 100 ms'lik parçaları verin, ara sonucu okuyun, cümle bitince (endpoint) kapatın:

rec = sherpa_onnx.OnlineRecognizer.from_transducer(
    ...,                                   # yukarıdaki argümanlar, artı:
    enable_endpoint_detection=True,
    rule2_min_trailing_silence=0.8,        # 0.8 sn sessizlikten sonra cümle biter
)
s = rec.create_stream()
for parca in mikrofon_parcalari():         # float32, 16 kHz mono
    s.accept_waveform(16000, parca)
    while rec.is_ready(s):
        rec.decode_stream(s)
    ara_metin = rec.get_result(s)          # canlı metin
    if rec.is_endpoint(s):
        print(itn.normalize(ara_metin))    # biten cümle, yazılı biçimde
        rec.reset(s)

Damga — yazılı biçim ve adil puanlama

Damga (PyPI: damga), mihu'nun açık kaynak, çevrimdışı ve deterministik metin normalizasyon motorudur (ağırlıklı sonlu durum dönüştürücüler, varsayılan dil Türkçe). Model duyduğunu yazar: yüz elli lira, sıfır beş otuz iki…. Damga bunu insanların yazdığı biçime çevirir. GPU, ağ bağlantısı veya LLM gerekmez; CPU'da cümle başına birkaç milisaniye sürer.

pip install damga

1. Yazılı biçimde çıktı (ITN: sözlü → yazılı) — modelin son metnine uygulayın:

from damga import InverseNormalizer

itn = InverseNormalizer()
itn.normalize("yüz elli lira")                     # '150 TL'
itn.normalize("saat dokuz otuzda")                 # "saat 09:30'da"
itn.normalize("sıfır beş otuz iki yüz yirmi üç kırk beş altmış yedi")   # '0532 123 45 67'
itn.normalize_batch(["on beş ekim", "yüzde on"])   # ['15 Ekim', '%10']

metin = rec.get_result(s)         # yukarıdaki Kullanım örneğinden gelen metin
print(itn.normalize(metin))

Metni bir insan okuyacaksa (altyazı, tutanak, CRM notu) ITN kullanın. Metin doğrudan bir LLM'e gidiyorsa genellikle gerekmez; LLM "on yedi" ile "17"yi aynı anlar.

2. Adil puanlama (TN: yazılı → sözlü) — referans metinler genelde yazılıdır (17, %10), model ise sözlü yazar (on yedi, yüzde on). WER hesaplamadan önce ikisini de sözlü biçime getirin; yukarıdaki "Damga" sütunu bunu yapar:

from damga import TextNormalizer

tn = TextNormalizer()
tn.normalize("Toplam 25.600 adet, %12,5 indirim.")
# 'Toplam yirmi beş bin altı yüz adet, yüzde on iki virgül beş indirim.'

Puanlamanın tam tarifi eval/score.py içindedir. Daha fazlası için Damga'nın Türkçe README'si (custom_vocab, strict, group_thousands gibi seçenekler) ve canlı mikrofon örneği.

Sonuçları yeniden üretme

pip install sherpa-onnx soundfile numpy huggingface_hub jiwer num2words damga
cd eval
python run_fleurs.py --out hypotheses.jsonl        # FLEURS-TR test setini ve ağırlıkları indirir
python score.py --fleurs-tsv fleurs/tr_tr/test.tsv --hyp hypotheses.jsonl
# standard  WER 10.06  CER  3.90  (743 clips)
# damga     WER  6.21  CER  1.70  (743 clips)
python medium_wer/score.py fleurs/tr_tr/test.tsv hypotheses.jsonl
# medium  WER  5.28  CER  1.63  (743/743 clips)

Eğitim verisi

Yalnızca Türkçe konuşma verisiyle eğitildi.

Önceki sürüm

v1, değiştirilmeden mihuai/turkish-stt adresinde durmaya devam ediyor.

Lisans

mihu Community License — tüm koşullar için LICENSE dosyasına bakın.

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

Space using mihuai/turkish-stt-66m-v2 1