speechbrain
English
Spoken language understanding
File size: 5,129 Bytes
1a21ed1
17bf398
1a21ed1
 
9c5e6f6
1a21ed1
17bf398
1a21ed1
29f8976
1a21ed1
 
 
 
 
 
 
a02a15a
 
 
1a21ed1
a02a15a
 
 
1a21ed1
 
 
a02a15a
e3ef246
 
59645f7
f97ae55
822b2e6
df0b711
db48774
1a21ed1
fad57ff
 
1a21ed1
 
 
 
a02a15a
1a21ed1
 
 
 
 
 
 
 
 
 
 
 
 
 
a02a15a
1a21ed1
 
 
c5551b0
1a21ed1
 
 
 
 
 
1bc79cf
 
1c5b928
1bc79cf
 
 
 
1c5b928
 
1a21ed1
 
 
a02a15a
1a21ed1
1bc79cf
a02a15a
 
 
 
 
 
 
 
 
 
 
 
1a21ed1
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
---
language: en
thumbnail:
tags:
- speechbrain
- Spoken language understanding
license: cc0-1.0
datasets:
- FluentSpeechCommands
metrics:
- Accuracy
---

<iframe src="https://ghbtns.com/github-btn.html?user=speechbrain&repo=speechbrain&type=star&count=true&size=large&v=2" frameborder="0" scrolling="0" width="170" height="30" title="GitHub"></iframe>
<br/><br/>

# Fluent Speech Commands
The dataset contains real recordings that define a simple spoken language understanding task. You can download it from [here](https://fluent.ai/fluent-speech-commands-a-dataset-for-spoken-language-understanding-research/). 
The Fluent Speech Commands dataset contains 30,043 utterances from 97 speakers. It is recorded as 16 kHz single-channel .wav files each containing a single utterance used for controlling smart-home appliances or virtual assistant, for example, “put on the music” or “turn up the heat in the kitchen”. Each audio is labeled with three slots: action, object, and location. A slot takes on one of the multiple values: for instance, the “location” slot can take on the values “none”, “kitchen”, “bedroom”, or “washroom”. We refer to the combination of slot values as the intent of the utterance. For each intent, there are multiple possible wordings: for example, the intent {action: “activate”, object: “lights”, location: “none”} can be expressed as “turn on the lights”, “switch the lights on”, “lights on”, etc. The dataset has a total of 248 phrasing mapping to 31 unique intents.

# End-to-end SLU model for Fluent Speech Commands
Attention-based RNN sequence-to-sequence model for the [Fluent Speech Commands](https://arxiv.org/pdf/1904.03670.pdf) dataset. 
This model checkpoint achieves 99.6% accuracy on the test set.
The model uses an ASR model trained on LibriSpeech ([`speechbrain/asr-crdnn-rnnlm-librispeech`](https://huggingface.co/speechbrain/asr-crdnn-rnnlm-librispeech)) to extract features from the input audio, then maps these features to an intent and slot labels using a beam search. 


You can try the model on the `example_fsc.wav` file included here as follows:

```python
from speechbrain.inference.SLU import EndToEndSLU
slu = EndToEndSLU.from_hparams("speechbrain/slu-direct-fluent-speech-commands-librispeech-asr")
# Text: "Please, turn on the light of the bedroom"
slu.decode_file("speechbrain/slu-direct-fluent-speech-commands-librispeech-asr/example_fsc.wav")
#>>> '{"action:" "activate"| "object": "lights"| "location": "bedroom"}'
```
The system is trained with recordings sampled at 16kHz (single channel).
The code will automatically normalize your audio (i.e., resampling + mono channel selection) when calling *decode_file* if needed. Make sure your input tensor is compliant with the expected sampling rate if you use *encode_batch* and *decode_batch*.
### Inference on GPU
To perform inference on the GPU, add  `run_opts={"device":"cuda"}`  when calling the `from_hparams` method.

### Training
The model was trained with SpeechBrain (f1f421b3).
To train it from scratch follows these steps:
1. Clone SpeechBrain:
```bash
git clone https://github.com/speechbrain/speechbrain/
```
2. Install it:
```
cd speechbrain
pip install -r requirements.txt
pip install -e .
```

3. Run Training:
```
cd recipes/fluent-speech-commands
python train.py hparams/train.yaml --data_folder=your_data_folder
```

You can find our training results (models, logs, etc) [here](https://drive.google.com/drive/folders/1Zly54252Z218IHJQ9M0B3kTQPZIw_2yC?usp=sharing).

### Limitations
The SpeechBrain team does not provide any warranty on the performance achieved by this model when used on other datasets.

#### Referencing SpeechBrain

```bibtex
@misc{speechbrain,
  title={{SpeechBrain}: A General-Purpose Speech Toolkit},
  author={Mirco Ravanelli and Titouan Parcollet and Peter Plantinga and Aku Rouhe and Samuele Cornell and Loren Lugosch and Cem Subakan and Nauman Dawalatabad and Abdelwahab Heba and Jianyuan Zhong and Ju-Chieh Chou and Sung-Lin Yeh and Szu-Wei Fu and Chien-Feng Liao and Elena Rastorgueva and François Grondin and William Aris and Hwidong Na and Yan Gao and Renato De Mori and Yoshua Bengio},
  year={2021},
  eprint={2106.04624},
  archivePrefix={arXiv},
  primaryClass={eess.AS},
  note={arXiv:2106.04624}
}
```

#### Referencing Fluent Speech Commands

```bibtex
@inproceedings{fluent,
  author    = {Loren Lugosch and
               Mirco Ravanelli and
               Patrick Ignoto and
               Vikrant Singh Tomar and
               Yoshua Bengio},
  editor    = {Gernot Kubin and
               Zdravko Kacic},
  title     = {Speech Model Pre-Training for End-to-End Spoken Language Understanding},
  booktitle = {Proc. of Interspeech},
  pages     = {814--818},
  year      = {2019},
}
```

#### About SpeechBrain
SpeechBrain is an open-source and all-in-one speech toolkit. It is designed to be simple, extremely flexible, and user-friendly. Competitive or state-of-the-art performance is obtained in various domains.

Website: https://speechbrain.github.io/

GitHub: https://github.com/speechbrain/speechbrain