Skip to content

Commit edcb7db

Browse files
committed
docs: update conformer transducer results
1 parent adcaa17 commit edcb7db

File tree

10 files changed

+59
-93
lines changed

10 files changed

+59
-93
lines changed
Lines changed: 39 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,16 @@
11
**Table of Contents**
2-
- [LibriSpeech](#librispeech)
2+
- [\[English\] LibriSpeech](#english-librispeech)
33
- [I. Small + SentencePiece 1k](#i-small--sentencepiece-1k)
4-
- [Training](#training)
5-
- [1. Epoch Loss](#1-epoch-loss)
6-
- [2. Batch Loss](#2-batch-loss)
7-
- [3. Learning Rate](#3-learning-rate)
8-
- [Pretrained Model](#pretrained-model)
4+
- [Config](#config)
95
- [Results](#results)
10-
- [VietBud500](#vietbud500)
11-
- [I. Small + SentencePiece 1k](#i-small--sentencepiece-1k-1)
12-
- [Training](#training-1)
13-
- [1. Epoch Loss](#1-epoch-loss-1)
14-
- [2. Batch Loss](#2-batch-loss-1)
15-
- [3. Learning Rate](#3-learning-rate-1)
16-
- [Pretrained Model](#pretrained-model-1)
6+
- [\[Vietnamese\] VietBud500](#vietnamese-vietbud500)
7+
- [II. Small + Streaming + SentencePiece 1k](#ii-small--streaming--sentencepiece-1k)
8+
- [Config](#config-1)
179
- [Results](#results-1)
1810

11+
<!-- ----------------------------------------------------- EN ------------------------------------------------------ -->
1912

20-
# LibriSpeech
13+
# [English] LibriSpeech
2114

2215
## I. Small + SentencePiece 1k
2316

@@ -30,89 +23,56 @@
3023
| Global Batch Size | 4 * 4 * 8 = 128 (as 4 TPUs, 8 Gradient Accumulation Steps) |
3124
| Max Epochs | 300 |
3225

26+
### Config
3327

34-
### Training
35-
36-
#### 1. Epoch Loss
37-
38-
![Epoch Loss](./figs/)
39-
40-
#### 2. Batch Loss
41-
42-
![Batch Loss](./figs/)
43-
44-
#### 3. Learning Rate
45-
46-
![Learning Rate](./figs/)
47-
48-
### Pretrained Model
49-
50-
[Link]()
28+
```jinja2
29+
{% import "examples/datasets/librispeech/sentencepiece/sp.yml.j2" as decoder_config with context %}
30+
{{decoder_config}}
31+
{% import "examples/models/transducer/conformer/small.yml.j2" as config with context %}
32+
{{config}}
33+
```
5134

5235
### Results
5336

37+
| Epoch | Dataset | decoding | wer | cer | mer | wil | wip |
38+
| :---- | :--------- | :------- | :------- | :------- | :------- | :------- | :------- |
39+
| 157 | test-clean | greedy | 0.062918 | 0.025361 | 0.062527 | 0.109992 | 0.890007 |
40+
| 157 | test-other | greedy | 0.142616 | 0.066839 | 0.140610 | 0.239201 | 0.760798 |
5441

55-
```json
56-
[
57-
{
58-
"epoch": 157,
59-
"test-clean": {
60-
"greedy": {
61-
"wer": 0.0629184418746196,
62-
"cer": 0.025361417966113735,
63-
"mer": 0.06252717134486344,
64-
"wil": 0.10999272148964301,
65-
"wip": 0.890007278510357
66-
}
67-
},
68-
"test-other": {
69-
"greedy": {
70-
"wer": 0.14261696884015054,
71-
"cer": 0.06683946941977871,
72-
"mer": 0.14061028442267848,
73-
"wil": 0.23920137462664237,
74-
"wip": 0.7607986253733576
75-
}
76-
}
77-
}
78-
]
79-
```
42+
<!-- ----------------------------------------------------- VN ------------------------------------------------------ -->
8043

81-
# VietBud500
44+
# [Vietnamese] VietBud500
8245

83-
## I. Small + SentencePiece 1k
46+
## II. Small + Streaming + SentencePiece 1k
8447

8548
| Category | Description |
8649
| :---------------- | :--------------------------------------------------------- |
87-
| Config | [small.yml.j2](../../small.yml.j2) |
50+
| Config | [small-streaming.yml.j2](../../small-streaming.yml.j2) |
8851
| Tensorflow | **2.18.0** |
8952
| Device | Google Cloud TPUs v4-8 |
9053
| Mixed Precision | strict |
9154
| Global Batch Size | 8 * 4 * 8 = 256 (as 4 TPUs, 8 Gradient Accumulation Steps) |
9255
| Max Epochs | 300 |
9356

94-
### Training
95-
96-
#### 1. Epoch Loss
97-
98-
![Epoch Loss](./figs/)
99-
100-
#### 2. Batch Loss
101-
102-
![Batch Loss](./figs/)
57+
### Config
10358

104-
#### 3. Learning Rate
105-
106-
![Learning Rate](./figs/)
107-
108-
### Pretrained Model
109-
110-
[Link]()
59+
```jinja2
60+
{% import "examples/datasets/vietbud500/sentencepiece/sp.yml.j2" as decoder_config with context %}
61+
{{decoder_config}}
62+
{% import "examples/models/transducer/conformer/small-streaming.yml.j2" as config with context %}
63+
{{config}}
64+
```
11165

11266
### Results
11367

114-
```json
115-
[
68+
| Training | Image |
69+
| :------------ | :-------------------------------------------------------------- |
70+
| Epoch Loss | ![Epoch Loss](./figs/vietbud500-small-streaming-epoch-loss.svg) |
71+
| Batch Loss | ![Batch Loss](./figs/vietbud500-small-streaming-batch-loss.svg) |
72+
| Learning Rate | ![Learning Rate](./figs/vietbud500-small-streaming-lr.svg) |
73+
74+
| Epoch | decoding | wer | cer | mer | wil | wip |
75+
| :---- | :------- | :------- | :------- | :------ | :------- | :------- |
76+
| 52 | greedy | 0.053723 | 0.034548 | 0.05362 | 0.086421 | 0.913579 |
11677

117-
]
118-
```
78+
**Pretrained Model**: [Link](https://www.kaggle.com/models/lordh9072/tfasr-vietbud500-conformer-transducer/tensorFlow2/small-streaming)

examples/models/transducer/conformer/results/sentencepiece/figs/vietbud500-small-epoch-loss.svg

Lines changed: 1 addition & 0 deletions
Loading

examples/models/transducer/conformer/results/sentencepiece/figs/vietbud500-small-lr.svg

Lines changed: 1 addition & 0 deletions
Loading

examples/models/transducer/conformer/results/sentencepiece/figs/vietbud500-small-streaming-batch-loss.svg

Lines changed: 1 addition & 0 deletions
Loading

examples/models/transducer/conformer/results/sentencepiece/figs/vietbud500-small-streaming-epoch-loss.svg

Lines changed: 1 addition & 0 deletions
Loading

examples/models/transducer/conformer/results/sentencepiece/figs/vietbud500-small-streaming-lr.svg

Lines changed: 1 addition & 0 deletions
Loading

requirements.dev.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
pytest~=7.4.1
2-
black~=24.3.0
3-
pylint~=3.2.4
4-
matplotlib~=3.7.2
5-
pydot-ng~=2.0.0
6-
graphviz~=0.20.1
7-
pre-commit~=3.7.0
8-
tf2onnx~=1.16.1
9-
netron~=8.0.3
1+
pytest>=7.4.1
2+
black>=24.3.0
3+
pylint>=3.2.4
4+
matplotlib>=3.7.2
5+
pydot-ng>=2.0.0
6+
graphviz>=0.20.1
7+
pre-commit>=3.7.0
8+
tf2onnx>=1.16.1
9+
netron>=8.0.3

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ cached_property~=2.0.1
1313
ipywidgets~=8.1.5
1414
ipython<9.0.0
1515
kagglehub~=0.3.6
16-
datasets~=3.5.1
16+
datasets~=3.5.1
17+
tabulate~=0.9.0

tensorflow_asr/scripts/test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# limitations under the License.
1414

1515

16-
import json
1716
import logging
1817
import os
1918

@@ -86,7 +85,7 @@ def main(
8685
)
8786

8887
evaluation_outputs = app_util.evaluate_hypotheses(output)
89-
logger.info(json.dumps(evaluation_outputs, indent=2))
88+
logger.info(f"Results:\n{evaluation_outputs.to_markdown()}")
9089

9190

9291
if __name__ == "__main__":

tensorflow_asr/utils/app_util.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def evaluate_hypotheses(filepath: str):
3939
{"greedy": {wer, cer, mer, wil, wip}, "beam": {wer, cer, mer, wil, wip}}
4040
The results are original, NOT multiplied with 100.
4141
"""
42+
import pandas as pd # pylint: disable=import-outside-toplevel
4243
from tqdm import tqdm # pylint: disable=import-outside-toplevel
4344

4445
logger.info(f"Reading file {filepath} ...")
@@ -77,8 +78,8 @@ def evaluate_hypotheses(filepath: str):
7778
"wip": beam_wordoutput.wip,
7879
},
7980
}
80-
81-
return outputs
81+
df = pd.DataFrame.from_dict(outputs, orient="index")
82+
return df
8283

8384

8485
def convert_tflite(

0 commit comments

Comments
 (0)