Implementation:Speechbrain Speechbrain Train TimersAndSuch Decoupled
| Knowledge Sources | |
|---|---|
| Domains | SLU, Training |
| Last Updated | 2026-02-09 00:00 GMT |
Overview
Concrete tool for decoupled (speech to ASR to text to NLU to semantics) SLU training on the Timers-and-Such dataset provided by the SpeechBrain library.
Description
This recipe defines the SLU class (subclass of sb.Brain) for decoupled spoken language understanding on the Timers-and-Such dataset. The NLU component is trained on ground truth transcripts during training and validation, while at test time an ASR model first transcribes the audio and then the transcript is fed to the NLU. ASR tokens are encoded with an input embedding, passed through an SLU encoder, and decoded with a seq2seq decoder to produce semantic outputs. This decoupled approach allows separate optimization of ASR and NLU components.
Usage
Use this recipe to train a decoupled SLU model on the Timers-and-Such dataset. Requires the dataset and a pre-trained ASR model (used only at test time). Configure with hparams/train.yaml.
Code Reference
Source Location
- Repository: SpeechBrain
- File: recipes/timers-and-such/decoupled/train.py
Signature
class SLU(sb.Brain):
def compute_forward(self, batch, stage):
...
def compute_objectives(self, predictions, batch, stage):
...
Import
python recipes/timers-and-such/decoupled/train.py hparams/train.yaml --data_folder /path/to/timers-and-such
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| batch | PaddedBatch | Yes | Batch containing transcript (text) or sig (waveforms at test), and tokens_bos (semantic tokens) |
| stage | sb.Stage | Yes | TRAIN, VALID, or TEST |
Outputs
| Name | Type | Description |
|---|---|---|
| predictions | tuple | Log-softmax sequence probabilities, asr_tokens_lens, and decoded semantic tokens |
| loss | torch.Tensor | Sequence-level NLL loss on semantic tokens |
Usage Examples
python train.py hparams/train.yaml --data_folder /path/to/timers-and-such