Pre-trained DanSpeech Models

All of the available DanSpeech models are shown below. If you need to finetune or train your own model, then you can find more information at DanSpeech training repository.

Recommended usage for all models (except a custom model):

from danspeech.pretrained_models import TestModel
model = TestModel()

Available models

danspeech.pretrained_models.DanSpeechPrimary(cache_dir=None)

Deepest and best performing DanSpeech model.

3 Conv layers

9 RNN Layers with 1200 hidden units

Parameters

cache_dir (str) – If you wish to use custom directory to stash/cache your models. This is generally not recommended, and if left out, the DanSpeech models will be stored in the ~/.danspeech/models/ folder.

Returns

Pretrained DeepSpeech (Best Performing) model.

Return type

danspeech.deepspeech.model.DeepSpeech

danspeech.pretrained_models.TestModel(cache_dir=None)

Test model that runs very fast even on CPUs

Performance is very bad!

2 Conv layers

5 RNN Layers with 400 hidden units

Parameters

cache_dir (str) – If you wish to use custom directory to stash/cache your models. This is generally not recommended, and if left out, the DanSpeech models will be stored in the ~/.danspeech/models/ folder.

Returns

Pretrained DeepSpeech (Testing purposes) model

Return type

danspeech.deepspeech.model.DeepSpeech

danspeech.pretrained_models.Baseline(cache_dir=None)

Baseline DanSpeech model.

2 Conv layers

5 RNN Layers with 800 hidden units

Parameters

cache_dir (str) – If you wish to use custom directory to stash/cache your models. This is generally not recommended, and if left out, the DanSpeech models will be stored in the ~/.danspeech/models/ folder.

Returns

Pretrained DeepSpeech (Baseline) model.

Return type

danspeech.deepspeech.model.DeepSpeech

danspeech.pretrained_models.CPUStreamingRNN(cache_dir=None)

DanSpeech model with lookahead, which works as a real-time streaming model.

This model runs on most modern CPUs.

2 conv layers

5 RNN layers (not bidirectional) with 800 units each

Lookahead context is 20

Parameters

cache_dir (str) – If you wish to use custom directory to stash/cache your models. This is generally not recommended, and if left out, the DanSpeech models will be stored in the ~/.danspeech/models/ folder.

Returns

Pretrained DeepSpeech (Streaming for CPU) model

Return type

danspeech.deepspeech.model.DeepSpeech

danspeech.pretrained_models.GPUStreamingRNN(cache_dir=None)

DanSpeech model with lookahead, which works as a real-time streaming model.

This model will not be able to follow a stream of data on regular CPUS. Hence, use a GPU.

2 conv layers

5 RNN layers (not bidirectional) with 2000 units each

Lookahead context is 20

Parameters

cache_dir (str) – If you wish to use custom directory to stash/cache your models. This is generally not recommended, and if left out, the DanSpeech models will be stored in the ~/.danspeech/models/ folder.

Returns

Pretrained DeepSpeech (Streaming for GPU) model

Return type

danspeech.deepspeech.model.DeepSpeech

danspeech.pretrained_models.Folketinget(cache_dir=None)

The deepest and best performing DanSpeech model finetuned to data from Folketinget.

3 Conv layers

9 RNN Layers with 1200 hidden units

Parameters

cache_dir (str) – If you wish to use custom directory to stash/cache your models. This is generally not recommended, and if left out, the DanSpeech models will be stored in the ~/.danspeech/models/ folder.

Returns

Pretrained DeepSpeech (Folketinget tuned) model.

Return type

danspeech.deepspeech.model.DeepSpeech

danspeech.pretrained_models.TransferLearned(cache_dir=None)

The Librispeech English model adapted to Danish while keeping the conv layers and the lowest/first RNN layer frozen

This model performs better than the DanSpeechPrimary model on noisy data.

2 Conv layers

5 RNN Layers with 800 hidden units

param str cache_dir: If you wish to use custom directory to stash/cache your models. This is generally not recommended, and if left out, the DanSpeech models will be stored in the ~/.danspeech/models/ folder.

Returns

Pretrained DeepSpeech (Transfer learned from English) model

Return type

danspeech.deepspeech.model.DeepSpeech

danspeech.pretrained_models.EnglishLibrispeech(cache_dir=None)

English trained model on the Librispeech corpus.

2 Conv layers

5 RNN Layers with 800 hidden units

Parameters

cache_dir (str) – If you wish to use custom directory to stash/cache your models. This is generally not recommended, and if left out, the DanSpeech models will be stored in the ~/.danspeech/models/ folder.

Returns

Pretrained DeepSpeech (English speech recognition) model.

Return type

danspeech.deepspeech.model.DeepSpeech

danspeech.pretrained_models.CustomModel(model_path)

Instantiates customly trained models

Parameters

model_path (str) – Path to custom trained model

Returns

Custom DeepSpeech model.

Return type

danspeech.deepspeech.model.DeepSpeech