https://github.com/sooftware/deepspeech2
PyTorch implementation of "Deep Speech 2: End-to-End Speech Recognition in English and Mandarin" (ICML, 2016)
https://github.com/sooftware/deepspeech2
Last synced: about 1 month ago
JSON representation
PyTorch implementation of "Deep Speech 2: End-to-End Speech Recognition in English and Mandarin" (ICML, 2016)
- Host: GitHub
- URL: https://github.com/sooftware/deepspeech2
- Owner: sooftware
- License: mit
- Created: 2021-03-05T15:18:33.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-03-05T15:53:01.000Z (about 4 years ago)
- Last Synced: 2025-04-09T23:51:36.880Z (about 1 month ago)
- Language: Python
- Size: 11.7 KB
- Stars: 23
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# deepspeech2
Released in 2015, Baidu Research's Deep Speech 2 model converts speech to text end to end from a normalized sound spectrogram to the sequence of characters. It consists of a few convolutional layers over both time and frequency, followed by gated recurrent unit (GRU) layers (modified with an additional batch normalization).
![]()
This repository contains only model code, but you can train with deepspeech2 with [this repository](https://github.com/sooftware/kospeech).
## Installation
This project recommends Python 3.7 or higher.
We recommend creating a new virtual environment for this project (using virtual env or conda).
### Prerequisites
* Numpy: `pip install numpy` (Refer [here](https://github.com/numpy/numpy) for problem installing Numpy).
* Pytorch: Refer to [PyTorch website](http://pytorch.org/) to install the version w.r.t. your environment.
### Install from source
Currently we only support installation from source code using setuptools. Checkout the source code and run the
following commands:
```
pip install -e .
```## Usage
```python
import torch
import torch.nn as nn
from deepspeech2 import DeepSpeech2batch_size, sequence_length, dim = 3, 12345, 80
cuda = torch.cuda.is_available()
device = torch.device('cuda' if cuda else 'cpu')inputs = torch.rand(batch_size, sequence_length, dim).to(device)
input_lengths = torch.IntTensor([12345, 12300, 12000])model = DeepSpeech2(num_classes=10, input_dim=dimension).to(device)
# Forward propagate
outputs = model(inputs, input_lengths)# Recognize input speech
outputs = model.module.recognize(inputs, input_lengths)
```
## Troubleshoots and Contributing
If you have any questions, bug reports, and feature requests, please [open an issue](https://github.com/sooftware/conformer/issues) on github or
contacts [email protected] please.
I appreciate any kind of feedback or contribution. Feel free to proceed with small issues like bug fixes, documentation improvement. For major contributions and new features, please discuss with the collaborators in corresponding issues.
## Code Style
I follow [PEP-8](https://www.python.org/dev/peps/pep-0008/) for code style. Especially the style of docstrings is important to generate documentation.
## Author
* Soohwan Kim [@sooftware](https://github.com/sooftware)
* Contacts: [email protected]