/ Модель

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

Параметры
905 млн
Лицензия
Apache 2.0
Архитектура
whisper · dense
Библиотека
transformers
Опубликована
27 сен 2024

kotoba-whisper-bilingual-v1.0

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

Дистиллированная модель Whisper для распознавания японской и английской речи и перевода речи между этими языками в текст.

5 497скачиваний за 30 дней19лайковвеса обновлены30 сен 2024

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Kotoba-Whisper-Bilingual v1.0 — модель распознавания и перевода речи, разработанная Асахи Усио совместно с Kotoba Technologies. Она основана на архитектуре Whisper и обучена методом дистилляции: полный энкодер взят от Whisper large-v3, а двухслойный декодер инициализирован слоями учительской модели. В репозитории указаны веса safetensors; модель также заявлена как совместимая с faster-whisper и whisper.cpp.

Модель принимает аудио и умеет распознавать японскую и английскую речь, а также переводить речь с японского на английский и с английского на японский текст. Для обучения использовались ReazonSpeech и Multilingual LibriSpeech, а переводные обучающие тексты получены с помощью внешней LLM. Модель предназначена для транскрибации и сквозного речевого перевода; авторы указывают ускорение до 6,3 раза относительно Whisper large-v3.

В переводных задачах авторы отмечают более высокие показатели точности у каскадного подхода, хотя он требует больше памяти и усложняет обработку. Модель содержит около 905,2 млн параметров, поддерживается библиотекой Transformers версии 4.39 и новее и распространяется по лицензии Apache-2.0.

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

  • транскрибация японской речи
  • транскрибация английской речи
  • перевод японской речи в английский текст
  • перевод английской речи в японский текст

Ограничения

Переводные результаты в приведённом сравнении уступают каскадному подходу по точности. Заявленное ускорение относится к сравнению с Whisper large-v3; README не уточняет условия для всех вариантов аппаратного обеспечения.

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

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

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

Также подходит для

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

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

Открыть на Hugging Face

Kotoba-Whisper-Bilingual (v1.0)

faster-whisper weight, whisper.cpp weight

Kotoba-Whisper-Bilingual is a collection of distilled Whisper models trained for

  • Japanese ASR
  • English ASR
  • Speech-to-text translation (Japanese -> English)
  • Speech-to-text translation (English -> Japanese)

developed through the collaboration bewteen Asahi Ushio and Kotoba Technologies. Following the original work of distil-whisper (Robust Knowledge Distillation via Large-Scale Pseudo Labelling), we employ OpenAI's Whisper large-v3 as the teacher model for Japanese and English ASR, while we translate the transcription into English and Japanese by external LLM to obtain training dataset for speech-to-text translation. We employ ReazonSpeech for Japanese ASR and Japanese speech to English text translation, and Multilingual LibriSpeech for English ASR and English speech to Japanese text translation. Kotoba-whisper-bilingual's loss objective consists of cross-entropy on both of ASR and translation tasks, while KL divergence loss only for ASR task. The student model consists the full encoder of the teacher large-v3 model and the decoder with two layers initialized from the first and last layer of the large-v3 model.

As kotoba-whisper uses the same architecture as distil-whisper/distil-large-v3, it inherits the benefit of the improved latency compared to openai/whisper-large-v3 (6.3x faster than large-v3, see the table below taken from distil-whisper/distil-large-v3).

Evaluation

We compare our kotoba-whisper-bilingual with OpenAI whisper models, kotoba-whisper models, and cascaded models for translation. Worth noting that kotoba-whisper-bilingual is the only model that can do Japanese and English ASR and speech-to-text translation between Japanese and English, as OpenAI whisper is not trained for English to Japanese speech-to-text translation, and other models are specific to the Task (eg. kotoba-whisper is Japanese ASR and distil whisper is English ASR only).

Speech2Text Translation (Japanese->English): WER (smaller is better)

modelCoVoST2 (Ja->En)Fleurs (Ja->En)
kotoba-tech/kotoba-whisper-bilingual-v1.073.998.7
japanese-asr/ja-cascaded-s2t-translation (facebook/nllb-200-3.3B)64.367.1
japanese-asr/ja-cascaded-s2t-translation (facebook/nllb-200-1.3B)65.468.9
japanese-asr/ja-cascaded-s2t-translation (facebook/nllb-200-distilled-1.3B)65.667.4
japanese-asr/ja-cascaded-s2t-translation (facebook/nllb-200-distilled-600M)68.272.2
openai/whisper-large-v37186.1
openai/whisper-large-v266.478.8
openai/whisper-large66.586.1
openai/whisper-medium70.397.2
openai/whisper-small97.3132.2
openai/whisper-base186.2349.6
openai/whisper-tiny377.2474

Speech2Text Translation (English->Japanese): CER (smaller is better)

modelCoVoST2 (En->Ja)Fleurs (En->JA)
kotoba-tech/kotoba-whisper-bilingual-v1.069.174.4
japanese-asr/en-cascaded-s2t-translation (facebook/nllb-200-3.3B)62.463.5
japanese-asr/en-cascaded-s2t-translation (facebook/nllb-200-1.3B)64.467.2
japanese-asr/en-cascaded-s2t-translation (facebook/nllb-200-distilled-1.3B)62.462.9
japanese-asr/en-cascaded-s2t-translation (facebook/nllb-200-distilled-600M)63.466.2
openai/whisper-large-v3178.9209.5
openai/whisper-large-v2179.6201.8
openai/whisper-large178.7201.8
openai/whisper-medium178.7202
openai/whisper-small178.9206.8
openai/whisper-base179.5214.2
openai/whisper-tiny185.2200.5

ASR (Japanese): CER (smaller is better)

modelCommonVoice 8 (Japanese test set)JSUT Basic 5000ReazonSpeech (held out test set)
kotoba-tech/kotoba-whisper-bilingual-v1.09.89.316.8
kotoba-tech/kotoba-whisper-v2.09.28.411.6
kotoba-tech/kotoba-whisper-v1.09.48.512.2
openai/whisper-large-v38.57.114.9
openai/whisper-large-v29.78.228.1
openai/whisper-large108.934.1
openai/whisper-medium11.51033.2
openai/whisper-small15.114.241.5
openai/whisper-base28.624.970.4
openai/whisper-tiny53.736.5137.9
reazon-research/reazonspeech-nemo-v29.17.411.2

ASR (English): WER (smaller is better)

modelESB (ami)ESB (earnings22)ESB (librispeech)ESB (tedlium)ESB (voxpopuli)
kotoba-tech/kotoba-whisper-bilingual-v1.016.715.32.44.18.3
openai/whisper-large-v317.914.92.13.812.7
openai/whisper-large-v218.916.72.34.97.7
openai/whisper-large18.814.92.64.27.7
openai/whisper-medium18.314.92.54.37.9
openai/whisper-small23.117.23.55.310.8
openai/whisper-base26.62166.111.3
openai/whisper-tiny31.930.58.211.715.1
japanese-asr/distil-whisper-bilingual-v1.020.718.62.46.410

Inference Speed

Although the cascaded approach is better in translation task, due to the nature of cascaded approach, the pipeline has additional complexity and memory consumption compared to the single end2end models for the sake of high accuracy. Following table shows the mean inference time on a single RTX 4090 (VRAM 24 GB) in second averaged over 10 trials on audio sample with different durations, along with the parameter size.

modelParam. (M)10 (sec.)30 (sec.)60 (sec.)300 (sec.)
kotoba-tech/kotoba-whisper-bilingual-v1.07560.0410.1110.2141.077
japanese-asr/en-cascaded-s2t-translation (facebook/nllb-200-3.3B)40560.1730.2470.3521.772
japanese-asr/en-cascaded-s2t-translation (facebook/nllb-200-1.3B)20560.1730.240.3481.515
japanese-asr/en-cascaded-s2t-translation (facebook/nllb-200-distilled-1.3B)20560.170.2450.3481.882
japanese-asr/en-cascaded-s2t-translation (facebook/nllb-200-distilled-600M)12560.1080.1790.2831.33

Transformers Usage

Kotoba-Whisper is supported in the Hugging Face 🤗 Transformers library from version 4.39 onwards. To run the model, first install the latest version of Transformers.

pip install --upgrade pip
pip install --upgrade transformers accelerate

The model can be used with the pipeline class to transcribe short-form audio files (< 30-seconds) as follows:

Download sample audio.

wget https://huggingface.co/datasets/japanese-asr/en_asr.esb_eval/resolve/main/sample.wav -O sample_en.wav
wget https://huggingface.co/datasets/japanese-asr/ja_asr.jsut_basic5000/resolve/main/sample.flac -O sample_ja.flac
import torch
from transformers import pipeline
from datasets import load_dataset

# config
torch_dtype = torch.bfloat16 if torch.cuda.is_available() else torch.float32
device = "cuda:0" if torch.cuda.is_available() else "cpu"
model_kwargs = {"attn_implementation": "sdpa"} if torch.cuda.is_available() else {}
pipe = pipeline(
    "automatic-speech-recognition",
    model="kotoba-tech/kotoba-whisper-bilingual-v1.0",
    torch_dtype=torch_dtype,
    device=device,
    model_kwargs=model_kwargs,
    chunk_length_s=15,
    batch_size=16
)

# Japanese ASR
generate_kwargs = {"language": "ja", "task": "transcribe"}
result = pipe("sample_ja.flac", generate_kwargs=generate_kwargs)
print(result["text"])

# English ASR
generate_kwargs = {"language": "en", "task": "transcribe"}
result = pipe("sample_en.wav", generate_kwargs=generate_kwargs)
print(result["text"])

# Translate Japanese speech to English text
generate_kwargs = {"language": "en", "task": "translate"}
result = pipe("sample_ja.flac", generate_kwargs=generate_kwargs)
print(result["text"])

# Translate English speech to Japanese text
generate_kwargs = {"language": "ja", "task": "translate"}
result = pipe("sample_en.wav", generate_kwargs=generate_kwargs)
print(result["text"])
  • For segment-level timestamps, pass the argument return_timestamps=True and return the "chunks" output:
result = pipe(sample, return_timestamps=True, generate_kwargs=generate_kwargs)
print(result["chunks"])

Training

Please refer to https://github.com/kotoba-tech/kotoba-whisper for the model training detail. Datasets used in distillation and the whole model variations can be found at https://huggingface.co/japanese-asr.

Acknowledgements

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
WhisperForConditionalGeneration
Ревизия весов
5b2c01e

0 моделей