facebook / s2t-small-librispeech-asr

huggingface.co
Total runs: 12.5K
24-hour runs: 219
7-day runs: 485
30-day runs: 6.3K
Model's Last Updated: September 07 2023
automatic-speech-recognition

Introduction of s2t-small-librispeech-asr

Model Details of s2t-small-librispeech-asr

S2T-SMALL-LIBRISPEECH-ASR

s2t-small-librispeech-asr is a Speech to Text Transformer (S2T) model trained for automatic speech recognition (ASR). The S2T model was proposed in this paper and released in this repository

Model description

S2T is an end-to-end sequence-to-sequence transformer model. It is trained with standard autoregressive cross-entropy loss and generates the transcripts autoregressively.

Intended uses & limitations

This model can be used for end-to-end speech recognition (ASR). See the model hub to look for other S2T checkpoints.

How to use

As this a standard sequence to sequence transformer model, you can use the generate method to generate the transcripts by passing the speech features to the model.

Note: The Speech2TextProcessor object uses torchaudio to extract the filter bank features. Make sure to install the torchaudio package before running this example.

Note: The feature extractor depends on torchaudio and the tokenizer depends on sentencepiece so be sure to install those packages before running the examples.

You could either install those as extra speech dependancies with pip install transformers"[speech, sentencepiece]" or install the packages seperatly with pip install torchaudio sentencepiece .

import torch
from transformers import Speech2TextProcessor, Speech2TextForConditionalGeneration
from datasets import load_dataset

model = Speech2TextForConditionalGeneration.from_pretrained("facebook/s2t-small-librispeech-asr")
processor = Speech2TextProcessor.from_pretrained("facebook/s2t-small-librispeech-asr")

ds = load_dataset(
    "patrickvonplaten/librispeech_asr_dummy",
    "clean",
    split="validation"
)

input_features = processor(
    ds[0]["audio"]["array"],
    sampling_rate=16_000,
    return_tensors="pt"
).input_features  # Batch size 1
generated_ids = model.generate(input_features=input_features)

transcription = processor.batch_decode(generated_ids)
Evaluation on LibriSpeech Test

The following script shows how to evaluate this model on the LibriSpeech "clean" and "other" test dataset.

from datasets import load_dataset
from evaluate import load
from transformers import Speech2TextForConditionalGeneration, Speech2TextProcessor

librispeech_eval = load_dataset("librispeech_asr", "clean", split="test")  # change to "other" for other test dataset
wer = load("wer")

model = Speech2TextForConditionalGeneration.from_pretrained("facebook/s2t-small-librispeech-asr").to("cuda")
processor = Speech2TextProcessor.from_pretrained("facebook/s2t-small-librispeech-asr", do_upper_case=True)

def map_to_pred(batch):
    features = processor(batch["audio"]["array"], sampling_rate=16000, padding=True, return_tensors="pt")
    input_features = features.input_features.to("cuda")
    attention_mask = features.attention_mask.to("cuda")

    gen_tokens = model.generate(input_features=input_features, attention_mask=attention_mask)
    batch["transcription"] = processor.batch_decode(gen_tokens, skip_special_tokens=True)[0]
    return batch

result = librispeech_eval.map(map_to_pred, remove_columns=["audio"])

print("WER:", wer.compute(predictions=result["transcription"], references=result["text"]))

Result (WER) :

"clean" "other"
4.3 9.0
Training data

The S2T-SMALL-LIBRISPEECH-ASR is trained on LibriSpeech ASR Corpus , a dataset consisting of approximately 1000 hours of 16kHz read English speech.

Training procedure
Preprocessing

The speech data is pre-processed by extracting Kaldi-compliant 80-channel log mel-filter bank features automatically from WAV/FLAC audio files via PyKaldi or torchaudio. Further utterance-level CMVN (cepstral mean and variance normalization) is applied to each example.

The texts are lowercased and tokenized using SentencePiece and a vocabulary size of 10,000.

Training

The model is trained with standard autoregressive cross-entropy loss and using SpecAugment . The encoder receives speech features, and the decoder generates the transcripts autoregressively.

BibTeX entry and citation info
@inproceedings{wang2020fairseqs2t,
  title = {fairseq S2T: Fast Speech-to-Text Modeling with fairseq},
  author = {Changhan Wang and Yun Tang and Xutai Ma and Anne Wu and Dmytro Okhonko and Juan Pino},
  booktitle = {Proceedings of the 2020 Conference of the Asian Chapter of the Association for Computational Linguistics (AACL): System Demonstrations},
  year = {2020},
}

Runs of facebook s2t-small-librispeech-asr on huggingface.co

12.5K
Total runs
219
24-hour runs
358
3-day runs
485
7-day runs
6.3K
30-day runs

More Information About s2t-small-librispeech-asr huggingface.co Model

More s2t-small-librispeech-asr license Visit here:

https://choosealicense.com/licenses/mit

s2t-small-librispeech-asr huggingface.co

s2t-small-librispeech-asr huggingface.co is an AI model on huggingface.co that provides s2t-small-librispeech-asr's model effect (), which can be used instantly with this facebook s2t-small-librispeech-asr model. huggingface.co supports a free trial of the s2t-small-librispeech-asr model, and also provides paid use of the s2t-small-librispeech-asr. Support call s2t-small-librispeech-asr model through api, including Node.js, Python, http.

s2t-small-librispeech-asr huggingface.co Url

https://huggingface.co/facebook/s2t-small-librispeech-asr

facebook s2t-small-librispeech-asr online free

s2t-small-librispeech-asr huggingface.co is an online trial and call api platform, which integrates s2t-small-librispeech-asr's modeling effects, including api services, and provides a free online trial of s2t-small-librispeech-asr, you can try s2t-small-librispeech-asr online for free by clicking the link below.

facebook s2t-small-librispeech-asr online free url in huggingface.co:

https://huggingface.co/facebook/s2t-small-librispeech-asr

s2t-small-librispeech-asr install

s2t-small-librispeech-asr is an open source model from GitHub that offers a free installation service, and any user can find s2t-small-librispeech-asr on GitHub to install. At the same time, huggingface.co provides the effect of s2t-small-librispeech-asr install, users can directly use s2t-small-librispeech-asr installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

s2t-small-librispeech-asr install url in huggingface.co:

https://huggingface.co/facebook/s2t-small-librispeech-asr

Url of s2t-small-librispeech-asr

s2t-small-librispeech-asr huggingface.co Url

Provider of s2t-small-librispeech-asr huggingface.co

facebook
ORGANIZATIONS

Other API from facebook

huggingface.co

Total runs: 18.8M
Run Growth: 18.7M
Growth Rate: 99.45%
Updated: September 15 2023
huggingface.co

Total runs: 7.5M
Run Growth: 4.0M
Growth Rate: 53.83%
Updated: January 17 2024
huggingface.co

Total runs: 6.2M
Run Growth: -656.5K
Growth Rate: -10.60%
Updated: September 15 2023
huggingface.co

Total runs: 3.1M
Run Growth: -245.7K
Growth Rate: -7.95%
Updated: November 17 2022
huggingface.co

Total runs: 1.3M
Run Growth: 40.2K
Growth Rate: 3.14%
Updated: February 29 2024
huggingface.co

Total runs: 1.2M
Run Growth: 688.2K
Growth Rate: 56.04%
Updated: December 28 2021
huggingface.co

Total runs: 1.2M
Run Growth: 730.9K
Growth Rate: 60.76%
Updated: September 06 2023
huggingface.co

Total runs: 864.6K
Run Growth: 209.7K
Growth Rate: 24.83%
Updated: January 12 2024
huggingface.co

Total runs: 752.1K
Run Growth: 397.5K
Growth Rate: 52.84%
Updated: September 06 2023
huggingface.co

Total runs: 750.6K
Run Growth: -67.6K
Growth Rate: -9.01%
Updated: January 20 2022
huggingface.co

Total runs: 698.5K
Run Growth: -2.2M
Growth Rate: -319.62%
Updated: March 23 2023
huggingface.co

Total runs: 657.3K
Run Growth: -404.2K
Growth Rate: -61.50%
Updated: July 25 2023
huggingface.co

Total runs: 276.1K
Run Growth: -45.8K
Growth Rate: -16.19%
Updated: January 12 2024
huggingface.co

Total runs: 256.6K
Run Growth: -26.1K
Growth Rate: -10.12%
Updated: May 22 2023
huggingface.co

Total runs: 236.6K
Run Growth: 124.8K
Growth Rate: 52.75%
Updated: January 25 2024
huggingface.co

Total runs: 232.2K
Run Growth: -276.5K
Growth Rate: -120.52%
Updated: January 12 2024
huggingface.co

Total runs: 226.8K
Run Growth: 7.3K
Growth Rate: 3.21%
Updated: September 15 2023
huggingface.co

Total runs: 199.9K
Run Growth: 43.7K
Growth Rate: 21.87%
Updated: September 05 2023
huggingface.co

Total runs: 189.3K
Run Growth: 79.8K
Growth Rate: 42.15%
Updated: November 20 2023
huggingface.co

Total runs: 167.3K
Run Growth: 21.7K
Growth Rate: 12.97%
Updated: January 25 2023
huggingface.co

Total runs: 154.8K
Run Growth: 45.2K
Growth Rate: 29.21%
Updated: June 03 2022
huggingface.co

Total runs: 121.5K
Run Growth: -1.1M
Growth Rate: -913.23%
Updated: June 15 2023
huggingface.co

Total runs: 115.8K
Run Growth: 79.8K
Growth Rate: 69.11%
Updated: March 13 2024
huggingface.co

Total runs: 111.0K
Run Growth: 57.7K
Growth Rate: 52.00%
Updated: May 22 2023
huggingface.co

Total runs: 98.5K
Run Growth: -3.4K
Growth Rate: -3.40%
Updated: November 16 2023
huggingface.co

Total runs: 86.2K
Run Growth: -66.2K
Growth Rate: -76.84%
Updated: September 06 2023
huggingface.co

Total runs: 78.5K
Run Growth: -109.6K
Growth Rate: -130.51%
Updated: June 14 2023
huggingface.co

Total runs: 36.4K
Run Growth: 5.8K
Growth Rate: 16.07%
Updated: September 15 2023
huggingface.co

Total runs: 29.4K
Run Growth: 23.7K
Growth Rate: 80.47%
Updated: February 29 2024
huggingface.co

Total runs: 28.5K
Run Growth: 5.7K
Growth Rate: 19.99%
Updated: February 12 2023
huggingface.co

Total runs: 25.7K
Run Growth: 763
Growth Rate: 2.96%
Updated: November 14 2023
huggingface.co

Total runs: 25.7K
Run Growth: -227.0K
Growth Rate: -882.85%
Updated: June 05 2023
huggingface.co

Total runs: 24.6K
Run Growth: -972
Growth Rate: -3.97%
Updated: September 15 2023
huggingface.co

Total runs: 24.1K
Run Growth: 23.3K
Growth Rate: 96.78%
Updated: June 13 2023
huggingface.co

Total runs: 24.0K
Run Growth: -6.4K
Growth Rate: -26.70%
Updated: November 20 2023
huggingface.co

Total runs: 23.7K
Run Growth: 5.2K
Growth Rate: 21.93%
Updated: March 17 2023
huggingface.co

Total runs: 22.6K
Run Growth: 1.7K
Growth Rate: 7.54%
Updated: January 25 2023