File size: 16,083 Bytes
5b51c67
4c4db00
5b51c67
4c4db00
5b51c67
 
 
 
 
 
 
 
c5e2c91
 
 
5b51c67
 
 
 
 
 
 
c5e2c91
135c7c3
4c4db00
5b51c67
c5e2c91
 
 
5b51c67
 
 
 
 
 
 
 
 
 
 
 
 
8080330
 
 
 
 
 
 
 
 
 
 
 
95db25e
8080330
 
 
 
 
95db25e
8080330
31cb095
8080330
 
 
95db25e
8080330
 
 
 
 
 
 
95db25e
8080330
 
 
 
 
95db25e
8080330
 
 
 
 
95db25e
8080330
 
 
 
 
 
 
95db25e
8080330
 
 
 
 
95db25e
8080330
 
 
 
 
95db25e
8080330
 
 
 
 
 
 
 
5b51c67
 
 
8080330
 
 
 
 
 
 
 
 
 
 
 
31cb095
8080330
 
 
 
 
31cb095
8080330
 
 
 
 
31cb095
8080330
 
 
 
 
 
 
31cb095
8080330
 
 
 
 
31cb095
8080330
 
 
 
 
31cb095
8080330
 
 
 
 
 
 
31cb095
8080330
 
 
 
 
31cb095
8080330
 
 
 
 
31cb095
8080330
 
 
 
 
 
 
 
5b51c67
c5e2c91
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1c00c50
 
 
 
 
 
 
 
 
 
 
c5e2c91
 
 
4c4db00
c5e2c91
 
4c4db00
c5e2c91
4c4db00
 
c5e2c91
4c4db00
c5e2c91
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5b51c67
 
 
 
c5e2c91
 
 
 
 
 
 
5b51c67
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4c4db00
5b51c67
 
 
 
 
4c4db00
 
 
 
5b51c67
 
 
4c4db00
 
 
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
## 📄 About
Natural and efficient TTS in Catalan: 🍵+🥑 .

Here you'll be able to find all the information regarding our models 🍵 Matxa and 🥑 alVoCat, which have been trained with the use of deep learning. If you want specific information on how to train these model you can find it [here](https://huggingface.co/BSC-LT/matcha-tts-cat-multiaccent) and [here](https://huggingface.co/BSC-LT/vocos-mel-22khz-cat) respectively. The code we've used is also on Github [here](https://github.com/langtech-bsc/Matcha-TTS/tree/dev-cat).

## Table of Contents
<details>
<summary>Click to expand</summary>

- [General Model Description](#general-model-description)
- [Intended Uses and Limitations](#intended-uses-and-limitations)
- [Samples](#samples)
- [Main components](#main-components)
- [The model in detail](#the-model-in-detail)
- [Adaptation to Catalan](#adaptation-to-catalan)
- [Citation](#citation)  
- [Additional Information](#additional-information)

</details>

## General Model Description

The significance of open-source text-to-speech (TTS) technologies for minority languages cannot be overstated. These technologies democratize access to TTS solutions by providing a framework for communities to develop and adapt models according to their linguistic needs. This is why we have developed different open-source TTS solutions in Catalan, using an ensemble of technologies.

Firstly, we created a [TTS model for central Catalan](https://huggingface.co/BSC-LT/matcha-tts-cat-multispeaker) by fine-tuning the Matcha-TTS English model. Matcha-TTS is a state-of-the-art model that employs deep learning, a form of AI, to train models that replicate human speech patterns, allowing it to generate lifelike synthetic voices from written text. After that, we fine-tuned this Catalan central model for four Catalan dialects, central plus three more:

* Balear
* North-Occidental
* Valencian


## Intended Uses and Limitations

This model is intended to serve as an acoustic feature generator for multispeaker text-to-speech systems for the Catalan language. 
It has been finetuned using a Catalan phonemizer, therefore if the model is used for other languages it may will not produce intelligible samples after mapping 
its output into a speech waveform. 

The quality of the samples can vary depending on the speaker. 
This may be due to the sensitivity of the model in learning specific frequencies and also due to the quality of samples for each speaker.

## Samples
* Female samples 
<div class="table-wrapper">
  <table class="tg">
    <thead>
      <tr>
        <th class="tg-0pky">Valencian</td>
        <th class="tg-0pky">Occidental</td>
        <th class="tg-0pky">Balear</td>
      <tr>
    <thead>
    <tbody>
      <tr>
        <td>
          <audio controls="" preload="none">
            audio not supported
            <source src="https://github.com/mllopartbsc/assets/raw/c6a393237e712851dd7cc7d10c70dde29d3412ac/matcha_tts_catalan/valencia/spk1/0.wav" type="audio/wav">
          </audio>
        </td>
        <td>
          <audio controls="" preload="none">
            audio not supported
            <source src="https://github.com/mllopartbsc/assets/raw/c6a393237e712851dd7cc7d10c70dde29d3412ac/matcha_tts_catalan/occidental/spk1/0.wav" type="audio/wav">
          </audio>
        </td>
        <td>
          <audio controls="" preload="none">
            audio not supported
            <source src="https://github.com/mllopartbsc/assets/raw/c6a393237e712851dd7cc7d10c70dde29d3412ac/matcha_tts_catalan/balear/spk1/0.wav" type="audio/wav">
          </audio>
        </td>
      </tr>
      <tr>
        <td>
          <audio controls="" preload="none">
            audio not supported
            <source src="https://github.com/mllopartbsc/assets/raw/c6a393237e712851dd7cc7d10c70dde29d3412ac/matcha_tts_catalan/valencia/spk1/1.wav" type="audio/wav">
          </audio>
        </td>
        <td>
          <audio controls="" preload="none">
            audio not supported
            <source src="https://github.com/mllopartbsc/assets/raw/c6a393237e712851dd7cc7d10c70dde29d3412ac/matcha_tts_catalan/occidental/spk1/1.wav" type="audio/wav">
          </audio>
        </td>
        <td>
          <audio controls="" preload="none">
            audio not supported
            <source src="https://github.com/mllopartbsc/assets/raw/c6a393237e712851dd7cc7d10c70dde29d3412ac/matcha_tts_catalan/balear/spk1/1.wav" type="audio/wav">
          </audio>
        </td>
      </tr>
      <tr>
        <td>
          <audio controls="" preload="none">
            audio not supported
            <source src="https://github.com/mllopartbsc/assets/raw/c6a393237e712851dd7cc7d10c70dde29d3412ac/matcha_tts_catalan/valencia/spk1/2.wav" type="audio/wav">
          </audio>
        </td>
        <td>
          <audio controls="" preload="none">
            audio not supported
            <source src="https://github.com/mllopartbsc/assets/raw/c6a393237e712851dd7cc7d10c70dde29d3412ac/matcha_tts_catalan/occidental/spk1/2.wav" type="audio/wav">
          </audio>
        </td>
        <td>
          <audio controls="" preload="none">
            audio not supported
            <source src="https://github.com/mllopartbsc/assets/raw/c6a393237e712851dd7cc7d10c70dde29d3412ac/matcha_tts_catalan/balear/spk1/2.wav" type="audio/wav">
          </audio>
        </td>
      </tr>
    </tbody>
  </table>
</div>

* Male samples:

<div class="table-wrapper">
  <table class="tg">
    <thead>
      <tr>
        <th class="tg-0pky">Valencian</td>
        <th class="tg-0pky">Occidental</td>
        <th class="tg-0pky">Balear</td>
      <tr>
    <thead>
    <tbody>
      <tr>
        <td>
          <audio controls="" preload="none">
            audio not supported
            <source src="https://github.com/mllopartbsc/assets/raw/c6a393237e712851dd7cc7d10c70dde29d3412ac/matcha_tts_catalan/valencia/spk0/0.wav" type="audio/wav">
          </audio>
        </td>
        <td>
          <audio controls="" preload="none">
            audio not supported
            <source src="https://github.com/mllopartbsc/assets/raw/c6a393237e712851dd7cc7d10c70dde29d3412ac/matcha_tts_catalan/occidental/spk0/0.wav" type="audio/wav"">
          </audio>
        </td>
        <td>
          <audio controls="" preload="none">
            audio not supported
            <source src="https://github.com/mllopartbsc/assets/raw/c6a393237e712851dd7cc7d10c70dde29d3412ac/matcha_tts_catalan/balear/spk0/0.wav" type="audio/wav">
          </audio>
        </td>
      </tr>
      <tr>
        <td>
          <audio controls="" preload="none">
            audio not supported
            <source src="https://github.com/mllopartbsc/assets/raw/c6a393237e712851dd7cc7d10c70dde29d3412ac/matcha_tts_catalan/valencia/spk0/1.wav" type="audio/wav">
          </audio>
        </td>
        <td>
          <audio controls="" preload="none">
            audio not supported
            <source src="https://github.com/mllopartbsc/assets/raw/c6a393237e712851dd7cc7d10c70dde29d3412ac/matcha_tts_catalan/occidental/spk0/1.wav" type="audio/wav">
          </audio>
        </td>
        <td>
          <audio controls="" preload="none">
            audio not supported
            <source src="https://github.com/mllopartbsc/assets/raw/c6a393237e712851dd7cc7d10c70dde29d3412ac/matcha_tts_catalan/balear/spk0/1.wav" type="audio/wav">
          </audio>
        </td>
      </tr>
      <tr>
        <td>
          <audio controls="" preload="none">
            audio not supported
            <source src="https://github.com/mllopartbsc/assets/raw/c6a393237e712851dd7cc7d10c70dde29d3412ac/matcha_tts_catalan/valencia/spk0/2.wav" type="audio/wav">
          </audio>
        </td>
        <td>
          <audio controls="" preload="none">
            audio not supported
            <source src="https://github.com/mllopartbsc/assets/raw/c6a393237e712851dd7cc7d10c70dde29d3412ac/matcha_tts_catalan/occidental/spk0/2.wav" type="audio/wav">
          </audio>
        </td>
        <td>
          <audio controls="" preload="none">
            audio not supported
            <source src="https://github.com/mllopartbsc/assets/raw/c6a393237e712851dd7cc7d10c70dde29d3412ac/matcha_tts_catalan/balear/spk0/2.wav" type="audio/wav">
          </audio>
        </td>
      </tr>
    </tbody>
  </table>
</div>

## Main components

Our text-to-speech model tailored for Catalan employs a multi-step process to convert written text into spoken words with accurate pronunciation. These are the steps:

1- Initially, the model analyzes the input text, breaking it down into smaller linguistic units such as words and sentences while identifying any special characters. It then utilizes our version of eSpeak, a speech phonemizer, to generate phonemes based on the Catalan language's phonetic rules. For each Catalan accent, certain specifically adapted eSpeak rules apply.

2- The matcha-TTS model converts these phonemes into a mel spectrogram, a visual representation of the spectrum of frequencies of a sound over time. 

3- This spectrogram is then fed into [our adaptation of the Vocos vocoder](https://huggingface.co/BSC-LT/vocos-mel-22khz-cat), which synthesizes the speech waveform.

By employing this series of steps, the TTS model ensures accurate pronunciation and natural-sounding Catalan speech output adapted to the nuances of the language. The computing of these steps was performed by Marenostrum 5 from the Barcelona Supercomputing Center, and Finisterrae III from CESGA.

Together, these technologies form a comprehensive TTS solution tailored to the needs of Catalan speakers, exemplifying the power of open-source initiatives in advancing linguistic diversity and inclusivity.


## The model in detail

**Matcha-TTS** is a non-autorregressive encoder-decoder model designed for fast acoustic modelling in TTS. 
The encoder part processes input sequences of phonemes and, together with a phoneme duration predictor, outputs averaged acoustic features. And the decoder,
which is essentially a U-Net backbone based on the Transfomer architecture, predicts the refined spectrogram.
The model is trained with optimal-transport conditional flow matching. 
This yields an ODE-based decoder capable of generating high output quality in fewer synthesis steps.

**Vocos** is a fast neural vocoder designed to synthesize audio waveforms from acoustic features. 
Unlike other typical GAN-based vocoders, Vocos does not model audio samples in the time domain. 
Instead, it generates spectral coefficients, facilitating rapid audio reconstruction through inverse Fourier transform.
The goal of this model is to provide an alternative to hifi-gan that is faster and compatible with the acoustic output of several TTS models. 
This version is tailored for the Catalan language, as it was trained only on Catalan speech datasets.

## Adaptation to Catalan

The original Matcha-TTS model excels in English, but to bring its capabilities to Catalan, a multi-step process was undertaken. Firstly, we fine-tuned the model from English to Catalan central (Matxa-base), which laid the groundwork for understanding the language's nuances. This first fine-tuning from English was done using two datasets:

 * [Our version of the openslr-slr69 dataset.](https://huggingface.co/datasets/projecte-aina/openslr-slr69-ca-trimmed-denoised) 
  
 * [Our version of the Festcat dataset.](https://huggingface.co/datasets/projecte-aina/festcat_trimmed_denoised)

Then we further fine-tuned the single accent Catalan Matxa-based model with the soon to be published LaFrescat dataset that has 8.5 hours of recordings for four dialectal variants:
 
 * Central
 
 * Valencian
 
 * Occidental
 
 * Balear 
 
With a male and a female speaker for each dialect.

Then, through fine-tuning for these specific Catalan dialects, the model adapted to regional variations in pronunciation and cadence. This meticulous approach ensures that the model reflects the linguistic richness and cultural diversity within the Catalan-speaking community, offering seamless communication in previously underserved dialects.
 
In addition to training the Matcha-TTS model for Catalan, integrating the eSpeak phonemizer played a crucial role in enhancing the naturalness and accuracy of generated speech. A TTS (Text-to-Speech) system comprises several components, each contributing to the overall quality of synthesized speech. The first component involves text preprocessing, where the input text undergoes normalization and linguistic analysis to identify words, punctuation, and linguistic features. Next, the text is converted into phonemes, the smallest units of sound in a language, through a process called phonemization. This step is where the eSpeak phonemizer shines, as it accurately converts Catalan text into phonetic representations, capturing the subtle nuances of pronunciation specific to Catalan. You can find the eSpeak version we used [here](https://github.com/projecte-aina/espeak-ng/tree/dev-ca).

After phonemization, the phonemes are passed to the synthesis component, where they are transformed into audible speech. Here, the Matcha-TTS model takes center stage, generating high-quality speech output based on the phonetic input. The model's training, fine-tuning, and adaptation to Catalan ensure that the synthesized speech retains the natural rhythm, intonation, and pronunciation patterns of the language, thereby enhancing the overall user experience.

Finally, the synthesized speech undergoes post-processing, where prosodic features such as pitch, duration, and emphasis are applied to further refine the output and make it sound more natural and expressive. By integrating the eSpeak phonemizer into the TTS pipeline and adapting it for Catalan, alongside training the Matcha-TTS model for the language, we have created a comprehensive and effective system for generating high-quality Catalan speech. This combination of advanced techniques and meticulous attention to linguistic detail is instrumental in bridging language barriers and facilitating communication for Catalan speakers worldwide.

## Citation

If this code contributes to your research, please cite the work:

```
@misc{LTU2024,
  title={Natural and efficient TTS in Catalan: using Matcha-TTS with the Catalan language},
  author={The Language Technologies Unit from Barcelona Supercomputing Center},
  year={2024},
}
```
```
@misc{mehta2024matchatts,
      title={Matcha-TTS: A fast TTS architecture with conditional flow matching}, 
      author={Shivam Mehta and Ruibo Tu and Jonas Beskow and Éva Székely and Gustav Eje Henter},
      year={2024},
      eprint={2309.03199},
      archivePrefix={arXiv},
      primaryClass={eess.AS}
}
```

## Additional Information

### Author
The Language Technologies Unit from Barcelona Supercomputing Center.

### Contact
For further information, please email <[email protected]>.

### Copyright
Copyright(c) 2023 by Language Technologies Unit, Barcelona Supercomputing Center.

### License
The demo page and the inference scripts are under [GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html)

The model weights are licensed under [Creative Commons Attribution Non-commercial 4.0](https://www.creativecommons.org/licenses/by-nc/4.0/). These models are free to use for non-commercial and research purposes. Commercial use is only possible through licensing by
the voice artists. For further information, contact <[email protected]> and <[email protected]>. For more information see the [model page](https://huggingface.co/BSC-LT/matcha-tts-cat-multiaccent/).

### Funding
This work has been promoted and financed by the Generalitat de Catalunya through the [Aina project](https://projecteaina.cat/).

Part of the training of the model was possible thanks to the compute time given by Galician Supercomputing Center CESGA
([Centro de Supercomputación de Galicia](https://www.cesga.es/)), and also by [Barcelona Supercomputing Center](https://www.bsc.es/) in MareNostrum 5.