facebook / s2t-medium-mustc-multilingual-st

huggingface.co
Total runs: 6.5K
24-hour runs: 263
7-day runs: 2.5K
30-day runs: 2.6K
Model's Last Updated: January 25 2023
automatic-speech-recognition

Introduction of s2t-medium-mustc-multilingual-st

Model Details of s2t-medium-mustc-multilingual-st

S2T-MEDIUM-MUSTC-MULTILINGUAL-ST

s2t-medium-mustc-multilingual-st is a Speech to Text Transformer (S2T) model trained for end-to-end Multilingual Speech Translation (ST). The S2T model was proposed in this paper and released in this repository

Model description

S2T is a transformer-based seq2seq (encoder-decoder) model designed for end-to-end Automatic Speech Recognition (ASR) and Speech Translation (ST). It uses a convolutional downsampler to reduce the length of speech inputs by 3/4th before they are fed into the encoder. The model is trained with standard autoregressive cross-entropy loss and generates the transcripts/translations autoregressively.

Intended uses & limitations

This model can be used for end-to-end English speech to French text translation. 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.

For multilingual speech translation models, eos_token_id is used as the decoder_start_token_id and the target language id is forced as the first generated token. To force the target language id as the first generated token, pass the forced_bos_token_id parameter to the generate() method. The following example shows how to transate English speech to French and German text using the facebook/s2t-medium-mustc-multilingual-st checkpoint.

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

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
import soundfile as sf

model = Speech2TextForConditionalGeneration.from_pretrained("facebook/s2t-medium-mustc-multilingual-st")
processor = Speech2TextProcessor.from_pretrained("facebook/s2t-medium-mustc-multilingual-st")

def map_to_array(batch):
    speech, _ = sf.read(batch["file"])
    batch["speech"] = speech
    return batch

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

inputs = processor(ds["speech"][0], sampling_rate=16_000, return_tensors="pt")

# translate English Speech To French Text
generated_ids = model.generate(
    input_ids=inputs["input_features"],
    attention_mask=inputs["attention_mask"],
    forced_bos_token_id=processor.tokenizer.lang_code_to_id["fr"]
)
translation_fr = processor.batch_decode(generated_ids)

# translate English Speech To German Text
generated_ids = model.generate(
    input_ids=inputs["input_features"],
    attention_mask=inputs["attention_mask"],
    forced_bos_token_id=processor.tokenizer.lang_code_to_id["de"]
)
translation_de = processor.batch_decode(generated_ids, skip_special_tokens=True)
Training data

The s2t-medium-mustc-multilingual-st is trained on MuST-C . MuST-C is a multilingual speech translation corpus whose size and quality facilitates the training of end-to-end systems for speech translation from English into several languages. For each target language, MuST-C comprises several hundred hours of audio recordings from English TED Talks, which are automatically aligned at the sentence level with their manual transcriptions and translations.

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. To accelerate model training and for better performance the encoder is pre-trained for multilingual ASR. For multilingual models, target language ID token is used as target BOS.

Evaluation results

MuST-C test results (BLEU score):

En-De En-Nl En-Es En-Fr En-It En-Pt En-Ro En-Ru
24.5 28.6 28.2 34.9 24.6 31.1 23.8 16.0
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-medium-mustc-multilingual-st on huggingface.co

6.5K
Total runs
263
24-hour runs
740
3-day runs
2.5K
7-day runs
2.6K
30-day runs

More Information About s2t-medium-mustc-multilingual-st huggingface.co Model

More s2t-medium-mustc-multilingual-st license Visit here:

https://choosealicense.com/licenses/mit

s2t-medium-mustc-multilingual-st huggingface.co

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

s2t-medium-mustc-multilingual-st huggingface.co Url

https://huggingface.co/facebook/s2t-medium-mustc-multilingual-st

facebook s2t-medium-mustc-multilingual-st online free

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

facebook s2t-medium-mustc-multilingual-st online free url in huggingface.co:

https://huggingface.co/facebook/s2t-medium-mustc-multilingual-st

s2t-medium-mustc-multilingual-st install

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

s2t-medium-mustc-multilingual-st install url in huggingface.co:

https://huggingface.co/facebook/s2t-medium-mustc-multilingual-st

Url of s2t-medium-mustc-multilingual-st

s2t-medium-mustc-multilingual-st huggingface.co Url

Provider of s2t-medium-mustc-multilingual-st huggingface.co

facebook
ORGANIZATIONS

Other API from facebook

huggingface.co

Total runs: 14.8M
Run Growth: 5.4M
Growth Rate: 36.66%
Updated: January 17 2024
huggingface.co

Total runs: 6.1M
Run Growth: 1.1M
Growth Rate: 17.77%
Updated: September 15 2023
huggingface.co

Total runs: 4.4M
Run Growth: 3.9M
Growth Rate: 88.77%
Updated: March 23 2023
huggingface.co

Total runs: 2.6M
Run Growth: 198.9K
Growth Rate: 7.69%
Updated: November 17 2022
huggingface.co

Total runs: 2.2M
Run Growth: 2.1M
Growth Rate: 93.79%
Updated: November 14 2023
huggingface.co

Total runs: 1.2M
Run Growth: -25.3K
Growth Rate: -2.05%
Updated: February 29 2024
huggingface.co

Total runs: 1.0M
Run Growth: 429.6K
Growth Rate: 41.24%
Updated: September 06 2023
huggingface.co

Total runs: 793.7K
Run Growth: -220.7K
Growth Rate: -27.81%
Updated: December 28 2021
huggingface.co

Total runs: 729.4K
Run Growth: 554.7K
Growth Rate: 76.05%
Updated: June 15 2023
huggingface.co

Total runs: 707.3K
Run Growth: 151.5K
Growth Rate: 21.42%
Updated: January 12 2024
huggingface.co

Total runs: 633.8K
Run Growth: 549.0K
Growth Rate: 86.62%
Updated: November 16 2023
huggingface.co

Total runs: 632.6K
Run Growth: 334.8K
Growth Rate: 52.92%
Updated: September 06 2023
huggingface.co

Total runs: 587.0K
Run Growth: 317.5K
Growth Rate: 54.09%
Updated: January 25 2024
huggingface.co

Total runs: 498.0K
Run Growth: 68.6K
Growth Rate: 13.77%
Updated: September 01 2023
huggingface.co

Total runs: 372.0K
Run Growth: 1.5K
Growth Rate: 0.39%
Updated: January 20 2022
huggingface.co

Total runs: 346.5K
Run Growth: 158.1K
Growth Rate: 45.62%
Updated: September 15 2023
huggingface.co

Total runs: 331.8K
Run Growth: 218.8K
Growth Rate: 65.95%
Updated: January 12 2024
huggingface.co

Total runs: 230.7K
Run Growth: 70.0K
Growth Rate: 30.35%
Updated: May 22 2023
huggingface.co

Total runs: 226.2K
Run Growth: 133.1K
Growth Rate: 58.84%
Updated: September 06 2023
huggingface.co

Total runs: 218.0K
Run Growth: 106.4K
Growth Rate: 48.83%
Updated: June 03 2022
huggingface.co

Total runs: 178.4K
Run Growth: -70.1K
Growth Rate: -39.31%
Updated: September 05 2023
huggingface.co

Total runs: 141.7K
Run Growth: 51.2K
Growth Rate: 36.14%
Updated: September 15 2023
huggingface.co

Total runs: 74.9K
Run Growth: -25.3K
Growth Rate: -33.79%
Updated: January 12 2024
huggingface.co

Total runs: 72.5K
Run Growth: -2.3K
Growth Rate: -44.21%
Updated: October 16 2024
huggingface.co

Total runs: 59.7K
Run Growth: -5.2M
Growth Rate: -8698.87%
Updated: June 13 2023
huggingface.co

Total runs: 59.3K
Run Growth: 22.4K
Growth Rate: 37.80%
Updated: September 15 2023
huggingface.co

Total runs: 47.6K
Run Growth: 26.8K
Growth Rate: 56.35%
Updated: May 22 2023
huggingface.co

Total runs: 45.1K
Run Growth: 271
Growth Rate: 0.60%
Updated: January 25 2023
huggingface.co

Total runs: 33.4K
Run Growth: 4.0K
Growth Rate: 11.98%
Updated: June 05 2023
huggingface.co

Total runs: 28.1K
Run Growth: 6.1K
Growth Rate: 21.83%
Updated: February 12 2023
huggingface.co

Total runs: 27.6K
Run Growth: 12.1K
Growth Rate: 43.86%
Updated: January 25 2023
huggingface.co

Total runs: 24.2K
Run Growth: -39.3K
Growth Rate: -162.32%
Updated: March 13 2024
huggingface.co

Total runs: 22.5K
Run Growth: -4.8K
Growth Rate: -21.13%
Updated: September 06 2023
huggingface.co

Total runs: 22.1K
Run Growth: 12.2K
Growth Rate: 55.06%
Updated: July 23 2024
huggingface.co

Total runs: 19.8K
Run Growth: -5.5K
Growth Rate: -27.69%
Updated: September 15 2023
huggingface.co

Total runs: 19.2K
Run Growth: 16.5K
Growth Rate: 85.93%
Updated: January 25 2023