/ Модель

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

Параметры
55,5 млн
Лицензия
MIT
Архитектура
speech_to_text · dense
Опубликована
2 мар 2022

s2t-medium-mustc-multilingual-st

Распознавание речиАудио → текст3 профессии

Трансформер S2T Facebook для перевода английской речи в текст на восьми языках, обученный на корпусе MuST-C.

138скачиваний за 30 дней7лайковвеса обновлены24 янв 2023

Бенчмарки

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

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Распознавание речи» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

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

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

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

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

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

S2T-MEDIUM-MUSTC-MULTILINGUAL-ST — модель Facebook на базе Speech2Text, обученная для сквозного перевода речи. Это трансформер encoder-decoder с 55,5 млн параметров: свёрточный модуль сокращает длину речевых входов, а декодер авторегрессионно генерирует текст. Модель принимает речевые признаки и обучена на корпусе MuST-C с выступлениями TED на английском языке и переводами на немецкий, нидерландский, испанский, французский, итальянский, португальский, румынский и русский.

Основной сценарий — перевод английской речи в текст на одном из восьми языков. Архитектура S2T также предназначена для распознавания речи, однако карточка описывает эту конкретную модель прежде всего как систему речевого перевода. В тестах MuST-C BLEU составил от 16,0 для перевода на русский до 34,9 для перевода на французский. Модель доступна в форматах PyTorch и TensorFlow по лицензии MIT; показатели на тестовом корпусе не гарантируют такую же точность на других темах и условиях записи.

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

  • перевод выступлений TED с английского на русский
  • перевод английской речи на немецкий, нидерландский или испанский
  • перевод английской речи на французский или итальянский
  • перевод английской речи на португальский или румынский
  • создание текстовых переводов англоязычных аудиозаписей

Ограничения

Обучение и оценка основаны на англоязычных выступлениях TED из MuST-C, поэтому качество на других темах, акцентах и условиях записи может отличаться. Для русского направления в приведённых тестах MuST-C получен BLEU 16,0.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

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

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

Открыть на Hugging Face

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-DeEn-NlEn-EsEn-FrEn-ItEn-PtEn-RoEn-Ru
24.528.628.234.924.631.123.816.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},
}

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

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

GPU в ailist

Универсальный рантайм

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

Подбираем GPU…

Класс архитектуры
Speech2TextForConditionalGeneration
Ревизия весов
79cc423

0 моделей