# ESPnet

> End-to-end speech processing toolkit for recognition, synthesis, and translation

- Category: Multimodal Generation / Audio, Music & Voice
- Language: Python
- Licence: Apache-2.0
- Repository: https://github.com/espnet/espnet
- Website: https://espnet.github.io/espnet/
- Canonical page: https://ai-tldr.dev/tools/espnet/

## In short

ESPnet is an end-to-end speech processing toolkit that covers a wide range of tasks, including speech recognition (ASR), text-to-speech (TTS), speech translation, speech enhancement, speaker diarization, and spoken language understanding. It sits in the Audio, Music & Voice category of the Multimodal Generation tools and is open-source, written in Python and licensed Apache-2.0.

## Overview

ESPnet is an end-to-end speech processing toolkit that covers a wide range of tasks, including speech recognition (ASR), text-to-speech (TTS), speech translation, speech enhancement, speaker diarization, and spoken language understanding. It is built on PyTorch as its deep learning engine.

It also follows the Kaldi style for data processing, feature extraction, and recipes, so each task ships with a complete, reproducible setup. Many ESPnet models are published on the Hugging Face Hub, which makes it easy to download a pretrained model and run inference without training from scratch.

## What it does

- End-to-end automatic speech recognition with hybrid CTC/attention and Transducer architectures, plus encoders such as Transformer, Conformer, and E-Branchformer
- Text-to-speech support including Tacotron 2, Transformer-TTS, FastSpeech, and other neural vocoder pipelines
- Speech translation and machine translation recipes for many public datasets
- Speech enhancement, source separation, and speaker diarization tasks
- Kaldi-style complete recipes for dozens of benchmarks (Librispeech, LJSpeech, TED, AMI, and more)
- A large library of pretrained models available through the ESPnet Hugging Face repository and model zoo

## Getting started

If you only need the Python module for inference, you can install ESPnet from PyPI. For full DNN training experiments, follow the detailed installation guide in the ESPnet docs. It is recommended to install PyTorch first.

1. Install the Python module

   Install PyTorch first by following the official PyTorch instructions, then install ESPnet from PyPI. To pull in optional task dependencies, install the all extra.

```bash
# install PyTorch first, then:
pip install espnet

# to install with additional packages
pip install "espnet[all]"
```

2. Download a pretrained model

   Use the espnet_model_zoo downloader to fetch and unpack a pretrained model. Many models are also hosted on the ESPnet Hugging Face repository.

```python
from espnet_model_zoo.downloader import ModelDownloader

d = ModelDownloader(cachedir="./modelcache")
model = d.download_and_unpack("kamo-naoyuki/wsj")
```

3. Run a recipe or inference

   Each task ships with Kaldi-style recipes under the egs2 directory, giving you a complete setup for training and evaluation. You can also load downloaded models directly in Python to run inference, such as CTC segmentation for aligning utterances within an audio file.

```python
import soundfile
from espnet2.bin.asr_align import CTCSegmentation

speech, rate = soundfile.read("./test_utils/ctc_align_test.wav")
aligner = CTCSegmentation(**model, fs=rate)
segments = aligner(speech, text)
print(segments)
```

## When to use it

- Building and training end-to-end speech recognition systems on standard benchmarks
- Generating speech from text with neural text-to-speech models
- Running speech translation, enhancement, or speaker diarization experiments with reproducible recipes
- Loading pretrained ESPnet models from Hugging Face to run inference without training
