Wav2Vec2 meets phonemes (#14353)
* up * add tokenizer * improve more * finish tokenizer * finish * adapt speech recognition script * adapt convert * more fixes * more fixes * update phonemizer wav2vec2 * better naming * fix more tests * more fixes swedish * correct tests * finish * improve script * remove file * up * lets get those 100 model architectures until the end of the month * make fix-copies * correct more * correct script * more fixes * more fixes * add to docs * Apply suggestions from code review Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com> * replace assert * fix copies * fix docs * new try docs * boom boom * update * add phonemizer to audio tests * make fix-copies * up * upload models * some changes * Update tests/test_tokenization_wav2vec2_phoneme.py Co-authored-by: Anton Lozhkov <aglozhkov@gmail.com> * more fixes * remove @ Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com> Co-authored-by: Anton Lozhkov <aglozhkov@gmail.com>
This commit is contained in:
committed by
GitHub
parent
77d6c826d8
commit
c4a96cecbc
56
docs/source/model_doc/wav2vec2_phoneme.mdx
Normal file
56
docs/source/model_doc/wav2vec2_phoneme.mdx
Normal file
@@ -0,0 +1,56 @@
|
||||
<!--Copyright 2021 The HuggingFace Team. All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
|
||||
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations under the License.
|
||||
-->
|
||||
|
||||
# Wav2Vec2Phoneme
|
||||
|
||||
## Overview
|
||||
|
||||
The Wav2Vec2Phoneme model was proposed in [Simple and Effective Zero-shot Cross-lingual Phoneme Recognition (Xu et al.,
|
||||
2021](https://arxiv.org/abs/2109.11680) by Qiantong Xu, Alexei Baevski, Michael Auli.
|
||||
|
||||
The abstract from the paper is the following:
|
||||
|
||||
*Recent progress in self-training, self-supervised pretraining and unsupervised learning enabled well performing speech
|
||||
recognition systems without any labeled data. However, in many cases there is labeled data available for related
|
||||
languages which is not utilized by these methods. This paper extends previous work on zero-shot cross-lingual transfer
|
||||
learning by fine-tuning a multilingually pretrained wav2vec 2.0 model to transcribe unseen languages. This is done by
|
||||
mapping phonemes of the training languages to the target language using articulatory features. Experiments show that
|
||||
this simple method significantly outperforms prior work which introduced task-specific architectures and used only part
|
||||
of a monolingually pretrained model.*
|
||||
|
||||
Tips:
|
||||
|
||||
- Wav2Vec2Phoneme uses the exact same architecture as Wav2Vec2
|
||||
- Wav2Vec2Phoneme is a speech model that accepts a float array corresponding to the raw waveform of the speech signal.
|
||||
- Wav2Vec2Phoneme model was trained using connectionist temporal classification (CTC) so the model output has to be
|
||||
decoded using [`Wav2Vec2PhonemeCTCTokenizer`].
|
||||
- Wav2Vec2Phoneme can be fine-tuned on multiple language at once and decode unseen languages in a single forward pass
|
||||
to a sequence of phonemes
|
||||
- By default the model outputs a sequence of phonemes. In order to transform the phonemes to a sequence of words one
|
||||
should make use of a dictionary and language model.
|
||||
|
||||
Relevant checkpoints can be found under https://huggingface.co/models?other=phoneme-recognition.
|
||||
|
||||
This model was contributed by [patrickvonplaten](https://huggingface.co/patrickvonplaten)
|
||||
|
||||
The original code can be found [here](https://github.com/pytorch/fairseq/tree/master/fairseq/models/wav2vec).
|
||||
|
||||
Wav2Vec2Phoneme's architecture is based on the Wav2Vec2 model, so one can refer to [`Wav2Vec2`]'s documentation page except for the tokenizer.
|
||||
|
||||
|
||||
## Wav2Vec2PhonemeCTCTokenizer
|
||||
|
||||
[[autodoc]] Wav2Vec2PhonemeCTCTokenizer
|
||||
- __call__
|
||||
- batch_decode
|
||||
- decode
|
||||
- phonemize
|
||||
47
docs/source/model_doc/xls_r.rst
Normal file
47
docs/source/model_doc/xls_r.rst
Normal file
@@ -0,0 +1,47 @@
|
||||
..
|
||||
Copyright 2021 The HuggingFace Team. All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
|
||||
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations under the License.
|
||||
|
||||
XLS-R
|
||||
-----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Overview
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The XLS-R model was proposed in `XLS-R: Self-supervised Cross-lingual Speech Representation Learning at Scale
|
||||
<https://arxiv.org/abs/2111.09296>`__ by Arun Babu, Changhan Wang, Andros Tjandra, Kushal Lakhotia, Qiantong Xu, Naman
|
||||
Goyal, Kritika Singh, Patrick von Platen, Yatharth Saraf, Juan Pino, Alexei Baevski, Alexis Conneau, Michael Auli.
|
||||
|
||||
The abstract from the paper is the following:
|
||||
|
||||
*This paper presents XLS-R, a large-scale model for cross-lingual speech representation learning based on wav2vec 2.0.
|
||||
We train models with up to 2B parameters on nearly half a million hours of publicly available speech audio in 128
|
||||
languages, an order of magnitude more public data than the largest known prior work. Our evaluation covers a wide range
|
||||
of tasks, domains, data regimes and languages, both high and low-resource. On the CoVoST-2 speech translation
|
||||
benchmark, we improve the previous state of the art by an average of 7.4 BLEU over 21 translation directions into
|
||||
English. For speech recognition, XLS-R improves over the best known prior work on BABEL, MLS, CommonVoice as well as
|
||||
VoxPopuli, lowering error rates by 14-34% relative on average. XLS-R also sets a new state of the art on VoxLingua107
|
||||
language identification. Moreover, we show that with sufficient model size, cross-lingual pretraining can outperform
|
||||
English-only pretraining when translating English speech into other languages, a setting which favors monolingual
|
||||
pretraining. We hope XLS-R can help to improve speech processing tasks for many more languages of the world.*
|
||||
|
||||
Tips:
|
||||
|
||||
- XLS-R is a speech model that accepts a float array corresponding to the raw waveform of the speech signal.
|
||||
- XLS-R model was trained using connectionist temporal classification (CTC) so the model output has to be decoded using
|
||||
:class:`~transformers.Wav2Vec2CTCTokenizer`.
|
||||
|
||||
Relevant checkpoints can be found under https://huggingface.co/models?other=xls_r.
|
||||
|
||||
XLS-R's architecture is based on the Wav2Vec2 model, so one can refer to :doc:`Wav2Vec2's documentation page
|
||||
<wav2vec2>`.
|
||||
|
||||
The original code can be found `here <https://github.com/pytorch/fairseq/tree/master/fairseq/models/wav2vec>`__.
|
||||
Reference in New Issue
Block a user