AI SeedbankHelp preserve open and free AI for humanity's future

← All models

airesearch_wav2vec2-large-xlsr-53-th

airesearch · View on Hugging Face ↗

Get this model

Download TorrentMagnet Link

Seeders: · Leechers:

Model card

The complete upstream card, rendered from this payload's README.md — the same hash-verified bytes the torrent distributes. Images and off-site links are removed; the original card on Hugging Face carries them.


language: th datasets:

  • common_voice tags:
  • audio
  • automatic-speech-recognition
  • hf-asr-leaderboard
  • robust-speech-event
  • speech
  • xlsr-fine-tuning license: cc-by-sa-4.0 model-index:
  • name: XLS-R-53 - Thai results:
    • task: name: Automatic Speech Recognition type: automatic-speech-recognition dataset: name: Common Voice 7 type: mozilla-foundation/common_voice_7_0 args: th metrics:
      • name: Test WER type: wer value: 0.9524
      • name: Test SER type: ser value: 1.2346
      • name: Test CER type: cer value: 0.1623
    • task: name: Automatic Speech Recognition type: automatic-speech-recognition dataset: name: Robust Speech Event - Dev Data type: speech-recognition-community-v2/dev_data args: sv metrics:
      • name: Test WER type: wer value: null
      • name: Test SER type: ser value: null
      • name: Test CER type: cer value: null

wav2vec2-large-xlsr-53-th

Finetuning wav2vec2-large-xlsr-53 on Thai Common Voice 7.0

Read more on our blog

We finetune wav2vec2-large-xlsr-53 based on Fine-tuning Wav2Vec2 for English ASR using Thai examples of Common Voice Corpus 7.0. The notebooks and scripts can be found in vistec-ai/wav2vec2-large-xlsr-53-th. The pretrained model and processor can be found at airesearch/wav2vec2-large-xlsr-53-th.

robust-speech-event

Add syllable_tokenize, word_tokenize (PyThaiNLP) and deepcut tokenizers to eval.py from robust-speech-event

> python eval.py --model_id ./ --dataset mozilla-foundation/common_voice_7_0 --config th --split test --log_outputs --thai_tokenizer newmm/syllable/deepcut/cer

Eval results on Common Voice 7 "test":

WER PyThaiNLP 2.3.1 WER deepcut SER CER
Only Tokenization 0.9524% 2.5316% 1.2346% 0.1623%
Cleaning rules and Tokenization TBD TBD TBD TBD

Usage

#load pretrained processor and model
processor = Wav2Vec2Processor.from_pretrained("airesearch/wav2vec2-large-xlsr-53-th")
model = Wav2Vec2ForCTC.from_pretrained("airesearch/wav2vec2-large-xlsr-53-th")

#function to resample to 16_000
def speech_file_to_array_fn(batch, 
                            text_col="sentence", 
                            fname_col="path",
                            resampling_to=16000):
    speech_array, sampling_rate = torchaudio.load(batch[fname_col])
    resampler=torchaudio.transforms.Resample(sampling_rate, resampling_to)
    batch["speech"] = resampler(speech_array)[0].numpy()
    batch["sampling_rate"] = resampling_to
    batch["target_text"] = batch[text_col]
    return batch

#get 2 examples as sample input
test_dataset = test_dataset.map(speech_file_to_array_fn)
inputs = processor(test_dataset["speech"][:2], sampling_rate=16_000, return_tensors="pt", padding=True)

#infer
with torch.no_grad():
    logits = model(inputs.input_values,).logits

predicted_ids = torch.argmax(logits, dim=-1)

print("Prediction:", processor.batch_decode(predicted_ids))
print("Reference:", test_dataset["sentence"][:2])

>> Prediction: ['และ เขา ก็ สัมผัส ดีบุก', 'คุณ สามารถ รับทราบ เมื่อ ข้อความ นี้ ถูก อ่าน แล้ว']
>> Reference: ['และเขาก็สัมผัสดีบุก', 'คุณสามารถรับทราบเมื่อข้อความนี้ถูกอ่านแล้ว']

Datasets

Common Voice Corpus 7.0](https://commonvoice.mozilla.org/en/datasets) contains 133 validated hours of Thai (255 total hours) at 5GB. We pre-tokenize with pythainlp.tokenize.word_tokenize. We preprocess the dataset using cleaning rules described in notebooks/cv-preprocess.ipynb by @tann9949. We then deduplicate and split as described in ekapolc/Thai_commonvoice_split in order to 1) avoid data leakage due to random splits after cleaning in Common Voice Corpus 7.0 and 2) preserve the majority of the data for the training set. The dataset loading script is scripts/th_common_voice_70.py. You can use this scripts together with train_cleand.tsv, validation_cleaned.tsv and test_cleaned.tsv to have the same splits as we do. The resulting dataset is as follows:

DatasetDict({
    train: Dataset({
        features: ['path', 'sentence'],
        num_rows: 86586
    })
    test: Dataset({
        features: ['path', 'sentence'],
        num_rows: 2502
    })
    validation: Dataset({
        features: ['path', 'sentence'],
        num_rows: 3027
    })
})

Training

We fintuned using the following configuration on a single V100 GPU and chose the checkpoint with the lowest validation loss. The finetuning script is scripts/wav2vec2_finetune.py

# create model
model = Wav2Vec2ForCTC.from_pretrained(
    "facebook/wav2vec2-large-xlsr-53",
    attention_dropout=0.1,
    hidden_dropout=0.1,
    feat_proj_dropout=0.0,
    mask_time_prob=0.05,
    layerdrop=0.1,
    gradient_checkpointing=True,
    ctc_loss_reduction="mean",
    pad_token_id=processor.tokenizer.pad_token_id,
    vocab_size=len(processor.tokenizer)
)
model.freeze_feature_extractor()
training_args = TrainingArguments(
    output_dir="../data/wav2vec2-large-xlsr-53-thai",
    group_by_length=True,
    per_device_train_batch_size=32,
    gradient_accumulation_steps=1,
    per_device_eval_batch_size=16,
    metric_for_best_model='wer',
    evaluation_strategy="steps",
    eval_steps=1000,
    logging_strategy="steps",
    logging_steps=1000,
    save_strategy="steps",
    save_steps=1000,
    num_train_epochs=100,
    fp16=True,
    learning_rate=1e-4,
    warmup_steps=1000,
    save_total_limit=3,
    report_to="tensorboard"
)

Evaluation

We benchmark on the test set using WER with words tokenized by PyThaiNLP 2.3.1 and deepcut, and CER. We also measure performance when spell correction using TNC ngrams is applied. Evaluation codes can be found in notebooks/wav2vec2_finetuning_tutorial.ipynb. Benchmark is performed on test-unique split.

WER PyThaiNLP 2.3.1 WER deepcut CER
Kaldi from scratch 23.04 7.57
Ours without spell correction 13.634024 8.152052 2.813019
Ours with spell correction 17.996397 14.167975 5.225761
Google Web Speech API※ 13.711234 10.860058 7.357340
Microsoft Bing Speech API※ 12.578819 9.620991 5.016620
Amazon Transcribe※ 21.86334 14.487553 7.077562
NECTEC AI for Thai Partii API※ 20.105887 15.515631 9.551027

※ APIs are not finetuned with Common Voice 7.0 data

LICENSE

cc-by-sa 4.0

Ackowledgements

  • model training and validation notebooks/scripts @cstorm125
  • dataset cleaning scripts @tann9949
  • dataset splits @ekapolc and @14mss
  • running the training @mrpeerat
  • spell correction @wannaphong

Magnet link

Opens the swarm directly in your torrent client — no file download needed. Copy-paste works too:

magnet:?xt=urn:btih:a017e4e90af3e28e170890a8314dd53d3cb33c76&dn=airesearch_wav2vec2-large-xlsr-53-th

Open magnet in torrent client · infohash a017e4e90af3e28e170890a8314dd53d3cb33c76

Files & hashes

PathSizesha1sha256
README.md8.4 KB (8,638 B)25c4bb6e1bd9599abf5bbc6a34d899cc87d6c13a494011d71bc66736d012cb60be37ad0049cbaff237a1dc05d104f4359159d5fb
config.json1.8 KB (1,837 B)e49f69931bfa2f5833a5ffadeeb91ef95b4c2df8a02e17b3052326e31a7519114b2ec969d7412559921191dcce9f304aef09c330
eval.py5.4 KB (5,549 B)f0af998dcc05fd73d8778f815aa4afba51a693aeb782b3715dba92b825baa0302e579db56c61224bf0b81cfa1a97a97a451115bc
preprocessor_config.json215 B (215 B)a0b7227fc1d916e469b14f6c154ad6dfea1e68918cdfd65ff4115423185a1512bdae100e2e0cd744f5b322417429944aaafd0827
pytorch_model.bin1.18 GB (1,262,210,673 B)c4e55ccbedc6397618e16cc3eaaee2498b6407a554824f24eb41e1b095bcc1d1b735da40b344ed24e484abccfd0795d0036418b8
robust-speech-event/log_mozilla-foundation_common_voice_7_0_th_test_predictions_cer.txt1.2 KB (1,272 B)f5ae7b55f9721f11a29ddb90c098775ffce3c71d674260b37fc2e27786f3ea02a9495247d5945377858628e56c8e829bd934ef30
robust-speech-event/log_mozilla-foundation_common_voice_7_0_th_test_predictions_deepcut.txt1.0 KB (1,040 B)7785c1d569a6dca6ef312df7473fc20b111cc65bf3364e3238c76ea328c842980249e35b5c682fa7fad9d1c36554e0fc1c37efa3
robust-speech-event/log_mozilla-foundation_common_voice_7_0_th_test_predictions_newmm.txt1.0 KB (1,039 B)0c8f6311b3d56e5877bdab9141ba86002cc35aa34ba9017271b75a8d785fcb76eb21c6c4ef3c89788bd255badab83c46f8bfd081
robust-speech-event/log_mozilla-foundation_common_voice_7_0_th_test_predictions_syllable.txt1.0 KB (1,064 B)bcbca321b5811a66da8938deba7e3512051ace8980bf8e115910b469e8114d97ca89c6337d139d33d00a5c347fc1ff6e940546b6
robust-speech-event/log_mozilla-foundation_common_voice_7_0_th_test_targets_cer.txt1.2 KB (1,272 B)d1ee29d000cdaff4ee2094edb1755887e9aad824ee22d1937927918866a454967a2caa233f952da76dc35a94f1acaf235475d757
robust-speech-event/log_mozilla-foundation_common_voice_7_0_th_test_targets_deepcut.txt1.0 KB (1,044 B)7d8708d105b3190719f2ae41d3fb0389e760c1f84d7ff5f38244e4c841d78ceadea03d3892bf9780d5968b4f320e6ded49563d58
robust-speech-event/log_mozilla-foundation_common_voice_7_0_th_test_targets_newmm.txt1.0 KB (1,042 B)9174a16fe45e25d38ba44d2037c9b4f48ec35e85802adbbe78c7a2ae816fac2a970aee3755204e13c7eae61787f0abe53d3ab5b3
robust-speech-event/log_mozilla-foundation_common_voice_7_0_th_test_targets_syllable.txt1.0 KB (1,068 B)8abbbd9e3ab8f2ce2f083675fd710ae4ce28e3b77a63b8f7f29441bb4d4310ea7c29886c0abc0a72463fe8bfd9060a6b75e468c2
robust-speech-event/mozilla-foundation_common_voice_7_0_th_test_eval_results_cer.txt52 B (52 B)3bc97ef82644bc4b7679b6b923c8dae4fb2a574b4954e1eefa354bb6fcde6e211f6ebdb4e378dc175bd9202813dc4a90a391eb84
robust-speech-event/mozilla-foundation_common_voice_7_0_th_test_eval_results_deepcut.txt52 B (52 B)e02cefc0128fb875fd553ed57acbdec3eaf8b2bdd61b77269e54feb3823d89e36fd55db022fdcc48ac5d73e0094e4d232443ae40
robust-speech-event/mozilla-foundation_common_voice_7_0_th_test_eval_results_newmm.txt50 B (50 B)c2b1e1651a2753196593a0aa8a8af9b150e911a0114e1e2388b97e67a6d9e38a6dfca6ddcb227cc631e8d1b18813c0fbd6b6d464
robust-speech-event/mozilla-foundation_common_voice_7_0_th_test_eval_results_syllable.txt52 B (52 B)c74e00b4b34f8ec7c2f434b3a1d679ffc1eee58b5cfb8f4633bb9320e1de1b97d2d3e8d9361288095c44c65a0211064c51ec891b
scaler.pt559 B (559 B)08913d14f2b4b31bcd3e90cc24af1375d0dbd23eeaad0a550aad796c00c2715fb3dd07c74e5ca1520507a15a505e4faf0123239f
scheduler.pt623 B (623 B)eea6a57098d8cba336d7ce789fb714bd8a6ecd1cbb118fee7b3cd82205b90d8e4ffc01eee7dfb1f3f32f5210cf6b36e69150bc49
special_tokens_map.json85 B (85 B)9abf71998c3e0de2f13c0fd73ed81477c9dae11850eb73d51191696209d30d42d6ede50e57e7a542ca1db12df714b2c0aa3da8e2
tokenizer_config.json181 B (181 B)f5118ab3bdf894ed167e31a8e62014d25116a476573f3d46704a5482552885e2ca828fdcb2df1fbe90059a4d18ac2ee15820ca31
trainer_state.json48.6 KB (49,807 B)c7070847ef17563b4ffcc988d14ed80c4e97209f067475b7d33b59ca7c0e6ffc39fbe8b68e1b552b33c2062e46c2302d716f50fc
training_args.bin2.6 KB (2,671 B)5aa05c85402e437335a268638e7cc936506291979b84fdc2b5205eb905d41c1c2102380221b9f615acfe849482ef528e3e37c723
vocab.json762 B (762 B)0046279bc3c22197f8732e1733e88eae59b7370934cb13014de24604e4fa30aa54424d1e0f9a380290e968f1279fe8e1fb67e9f6

Cite this release

Canonical URL
https://aiseedbank.org/models/airesearch_wav2vec2-large-xlsr-53-th/
Slug
airesearch_wav2vec2-large-xlsr-53-th
Infohash
a017e4e90af3e28e170890a8314dd53d3cb33c76
License
cc-by-sa-4.0
Signing key fingerprint
85a3b32c3712427b

Every file carries a locally computed sha256 — verify a download against the signed sums: airesearch_wav2vec2-large-xlsr-53-th.SHA256SUMS (+ minisign signature).

Provenance

Upstream repositoryairesearch/wav2vec2-large-xlsr-53-th
Revision (pinned)3155938c549b23eee16b1d4b55dcb161b7fe4bcf
Fetched at2026-09-03T20:50:30Z
License at fetchcc-by-sa-4.0
Snapshot toolhuggingface · seedbank 0.1.0

Trackers

✓ verified · rehash-vs-hf-metadata at 2026-09-03T20:50:45Z

cc-by-sa-4.01.18 GB (1,262,290,647 bytes)transformerspytorchwav2vec2automatic-speech-recognitionaudiohf-asr-leaderboardrobust-speech-eventspeechxlsr-fine-tuningmodel-indexendpoints_compatible1 language (th)