Spaces:
Build error
Build error
Upload 8 files
Browse files- models/wav2vec2-base/README.md +28 -0
- models/wav2vec2-base/config.json +85 -0
- models/wav2vec2-base/gitattributes +17 -0
- models/wav2vec2-base/preprocessor_config.json +8 -0
- models/wav2vec2-base/pytorch_model.bin +3 -0
- models/wav2vec2-base/special_tokens_map.json +1 -0
- models/wav2vec2-base/tokenizer_config.json +1 -0
- models/wav2vec2-base/vocab.json +1 -0
models/wav2vec2-base/README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
datasets:
|
| 4 |
+
- librispeech_asr
|
| 5 |
+
tags:
|
| 6 |
+
- speech
|
| 7 |
+
license: apache-2.0
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# Wav2Vec2-Base
|
| 11 |
+
|
| 12 |
+
[Facebook's Wav2Vec2](https://ai.facebook.com/blog/wav2vec-20-learning-the-structure-of-speech-from-raw-audio/)
|
| 13 |
+
|
| 14 |
+
The base model pretrained on 16kHz sampled speech audio. When using the model make sure that your speech input is also sampled at 16Khz.
|
| 15 |
+
|
| 16 |
+
**Note**: This model does not have a tokenizer as it was pretrained on audio alone. In order to use this model **speech recognition**, a tokenizer should be created and the model should be fine-tuned on labeled text data. Check out [this blog](https://huggingface.co/blog/fine-tune-wav2vec2-english) for more in-detail explanation of how to fine-tune the model.
|
| 17 |
+
|
| 18 |
+
[Paper](https://arxiv.org/abs/2006.11477)
|
| 19 |
+
|
| 20 |
+
Authors: Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael Auli
|
| 21 |
+
|
| 22 |
+
**Abstract**
|
| 23 |
+
We show for the first time that learning powerful representations from speech audio alone followed by fine-tuning on transcribed speech can outperform the best semi-supervised methods while being conceptually simpler. wav2vec 2.0 masks the speech input in the latent space and solves a contrastive task defined over a quantization of the latent representations which are jointly learned. Experiments using all labeled data of Librispeech achieve 1.8/3.3 WER on the clean/other test sets. When lowering the amount of labeled data to one hour, wav2vec 2.0 outperforms the previous state of the art on the 100 hour subset while using 100 times less labeled data. Using just ten minutes of labeled data and pre-training on 53k hours of unlabeled data still achieves 4.8/8.2 WER. This demonstrates the feasibility of speech recognition with limited amounts of labeled data.
|
| 24 |
+
The original model can be found under https://github.com/pytorch/fairseq/tree/master/examples/wav2vec#wav2vec-20.
|
| 25 |
+
|
| 26 |
+
# Usage
|
| 27 |
+
|
| 28 |
+
See [this notebook](https://colab.research.google.com/drive/1FjTsqbYKphl9kL-eILgUc-bl4zVThL8F?usp=sharing) for more information on how to fine-tune the model.
|
models/wav2vec2-base/config.json
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"activation_dropout": 0.0,
|
| 3 |
+
"apply_spec_augment": true,
|
| 4 |
+
"architectures": [
|
| 5 |
+
"Wav2Vec2ForPreTraining"
|
| 6 |
+
],
|
| 7 |
+
"attention_dropout": 0.1,
|
| 8 |
+
"bos_token_id": 1,
|
| 9 |
+
"codevector_dim": 256,
|
| 10 |
+
"contrastive_logits_temperature": 0.1,
|
| 11 |
+
"conv_bias": false,
|
| 12 |
+
"conv_dim": [
|
| 13 |
+
512,
|
| 14 |
+
512,
|
| 15 |
+
512,
|
| 16 |
+
512,
|
| 17 |
+
512,
|
| 18 |
+
512,
|
| 19 |
+
512
|
| 20 |
+
],
|
| 21 |
+
"conv_kernel": [
|
| 22 |
+
10,
|
| 23 |
+
3,
|
| 24 |
+
3,
|
| 25 |
+
3,
|
| 26 |
+
3,
|
| 27 |
+
2,
|
| 28 |
+
2
|
| 29 |
+
],
|
| 30 |
+
"conv_stride": [
|
| 31 |
+
5,
|
| 32 |
+
2,
|
| 33 |
+
2,
|
| 34 |
+
2,
|
| 35 |
+
2,
|
| 36 |
+
2,
|
| 37 |
+
2
|
| 38 |
+
],
|
| 39 |
+
"ctc_loss_reduction": "sum",
|
| 40 |
+
"ctc_zero_infinity": false,
|
| 41 |
+
"diversity_loss_weight": 0.1,
|
| 42 |
+
"do_stable_layer_norm": false,
|
| 43 |
+
"eos_token_id": 2,
|
| 44 |
+
"feat_extract_activation": "gelu",
|
| 45 |
+
"feat_extract_norm": "group",
|
| 46 |
+
"feat_proj_dropout": 0.1,
|
| 47 |
+
"feat_quantizer_dropout": 0.0,
|
| 48 |
+
"final_dropout": 0.0,
|
| 49 |
+
"freeze_feat_extract_train": true,
|
| 50 |
+
"gradient_checkpointing": true,
|
| 51 |
+
"hidden_act": "gelu",
|
| 52 |
+
"hidden_dropout": 0.1,
|
| 53 |
+
"hidden_size": 768,
|
| 54 |
+
"initializer_range": 0.02,
|
| 55 |
+
"intermediate_size": 3072,
|
| 56 |
+
"layer_norm_eps": 1e-05,
|
| 57 |
+
"layerdrop": 0.0,
|
| 58 |
+
"mask_channel_length": 10,
|
| 59 |
+
"mask_channel_min_space": 1,
|
| 60 |
+
"mask_channel_other": 0.0,
|
| 61 |
+
"mask_channel_prob": 0.0,
|
| 62 |
+
"mask_channel_selection": "static",
|
| 63 |
+
"mask_feature_length": 10,
|
| 64 |
+
"mask_feature_prob": 0.0,
|
| 65 |
+
"mask_time_length": 10,
|
| 66 |
+
"mask_time_min_space": 1,
|
| 67 |
+
"mask_time_other": 0.0,
|
| 68 |
+
"mask_time_prob": 0.05,
|
| 69 |
+
"mask_time_selection": "static",
|
| 70 |
+
"model_type": "wav2vec2",
|
| 71 |
+
"no_mask_channel_overlap": false,
|
| 72 |
+
"no_mask_time_overlap": false,
|
| 73 |
+
"num_attention_heads": 12,
|
| 74 |
+
"num_codevector_groups": 2,
|
| 75 |
+
"num_codevectors_per_group": 320,
|
| 76 |
+
"num_conv_pos_embedding_groups": 16,
|
| 77 |
+
"num_conv_pos_embeddings": 128,
|
| 78 |
+
"num_feat_extract_layers": 7,
|
| 79 |
+
"num_hidden_layers": 12,
|
| 80 |
+
"num_negatives": 100,
|
| 81 |
+
"pad_token_id": 0,
|
| 82 |
+
"proj_codevector_dim": 256,
|
| 83 |
+
"transformers_version": "4.7.0.dev0",
|
| 84 |
+
"vocab_size": 32
|
| 85 |
+
}
|
models/wav2vec2-base/gitattributes
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.tar.gz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
models/wav2vec2-base/preprocessor_config.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"do_normalize": true,
|
| 3 |
+
"feature_size": 1,
|
| 4 |
+
"padding_side": "right",
|
| 5 |
+
"padding_value": 0.0,
|
| 6 |
+
"return_attention_mask": false,
|
| 7 |
+
"sampling_rate": 16000
|
| 8 |
+
}
|
models/wav2vec2-base/pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3249fe98bfc62fcbc26067f724716a6ec49d12c4728a2af1df659013905dff21
|
| 3 |
+
size 380267417
|
models/wav2vec2-base/special_tokens_map.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"bos_token": "<s>", "eos_token": "</s>", "unk_token": "<unk>", "pad_token": "<pad>"}
|
models/wav2vec2-base/tokenizer_config.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"unk_token": "<unk>", "bos_token": "<s>", "eos_token": "</s>", "pad_token": "<pad>", "do_lower_case": false, "return_attention_mask": false, "do_normalize": true}
|
models/wav2vec2-base/vocab.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"<pad>": 0, "<s>": 1, "</s>": 2, "<unk>": 3, "|": 4, "E": 5, "T": 6, "A": 7, "O": 8, "N": 9, "I": 10, "H": 11, "S": 12, "R": 13, "D": 14, "L": 15, "U": 16, "M": 17, "W": 18, "C": 19, "F": 20, "G": 21, "Y": 22, "P": 23, "B": 24, "V": 25, "K": 26, "'": 27, "X": 28, "J": 29, "Q": 30, "Z": 31}
|