Commit ·
edd2373
0
Parent(s):
Duplicate from facebook/hubert-xlarge-ls960-ft
Browse filesCo-authored-by: Julien Chaumond <julien-c@users.noreply.huggingface.co>
- .gitattributes +17 -0
- README.md +68 -0
- config.json +74 -0
- model.safetensors +3 -0
- preprocessor_config.json +9 -0
- pytorch_model.bin +3 -0
- special_tokens_map.json +1 -0
- tf_model.h5 +3 -0
- tokenizer_config.json +1 -0
- vocab.json +1 -0
.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 |
+
model.safetensors filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
datasets:
|
| 4 |
+
- libri-light
|
| 5 |
+
- librispeech_asr
|
| 6 |
+
tags:
|
| 7 |
+
- speech
|
| 8 |
+
- audio
|
| 9 |
+
- automatic-speech-recognition
|
| 10 |
+
- hf-asr-leaderboard
|
| 11 |
+
license: apache-2.0
|
| 12 |
+
model-index:
|
| 13 |
+
- name: hubert-large-ls960-ft
|
| 14 |
+
results:
|
| 15 |
+
- task:
|
| 16 |
+
name: Automatic Speech Recognition
|
| 17 |
+
type: automatic-speech-recognition
|
| 18 |
+
dataset:
|
| 19 |
+
name: LibriSpeech (clean)
|
| 20 |
+
type: librispeech_asr
|
| 21 |
+
config: clean
|
| 22 |
+
split: test
|
| 23 |
+
args:
|
| 24 |
+
language: en
|
| 25 |
+
metrics:
|
| 26 |
+
- name: Test WER
|
| 27 |
+
type: wer
|
| 28 |
+
value: 1.8
|
| 29 |
+
---
|
| 30 |
+
|
| 31 |
+
# Hubert-Extra-Large-Finetuned
|
| 32 |
+
|
| 33 |
+
[Facebook's Hubert](https://ai.facebook.com/blog/hubert-self-supervised-representation-learning-for-speech-recognition-generation-and-compression)
|
| 34 |
+
|
| 35 |
+
The extra large model fine-tuned on 960h of Librispeech on 16kHz sampled speech audio. When using the model make sure that your speech input is also sampled at 16Khz.
|
| 36 |
+
|
| 37 |
+
The model is a fine-tuned version of [hubert-xlarge-ll60k](https://huggingface.co/facebook/hubert-xlarge-ll60k).
|
| 38 |
+
|
| 39 |
+
[Paper](https://arxiv.org/abs/2106.07447)
|
| 40 |
+
|
| 41 |
+
Authors: Wei-Ning Hsu, Benjamin Bolte, Yao-Hung Hubert Tsai, Kushal Lakhotia, Ruslan Salakhutdinov, Abdelrahman Mohamed
|
| 42 |
+
|
| 43 |
+
**Abstract**
|
| 44 |
+
Self-supervised approaches for speech representation learning are challenged by three unique problems: (1) there are multiple sound units in each input utterance, (2) there is no lexicon of input sound units during the pre-training phase, and (3) sound units have variable lengths with no explicit segmentation. To deal with these three problems, we propose the Hidden-Unit BERT (HuBERT) approach for self-supervised speech representation learning, which utilizes an offline clustering step to provide aligned target labels for a BERT-like prediction loss. A key ingredient of our approach is applying the prediction loss over the masked regions only, which forces the model to learn a combined acoustic and language model over the continuous inputs. HuBERT relies primarily on the consistency of the unsupervised clustering step rather than the intrinsic quality of the assigned cluster labels. Starting with a simple k-means teacher of 100 clusters, and using two iterations of clustering, the HuBERT model either matches or improves upon the state-of-the-art wav2vec 2.0 performance on the Librispeech (960h) and Libri-light (60,000h) benchmarks with 10min, 1h, 10h, 100h, and 960h fine-tuning subsets. Using a 1B parameter model, HuBERT shows up to 19% and 13% relative WER reduction on the more challenging dev-other and test-other evaluation subsets.
|
| 45 |
+
|
| 46 |
+
The original model can be found under https://github.com/pytorch/fairseq/tree/master/examples/hubert .
|
| 47 |
+
|
| 48 |
+
# Usage
|
| 49 |
+
|
| 50 |
+
The model can be used for automatic-speech-recognition as follows:
|
| 51 |
+
|
| 52 |
+
```python
|
| 53 |
+
import torch
|
| 54 |
+
from transformers import Wav2Vec2Processor, HubertForCTC
|
| 55 |
+
from datasets import load_dataset
|
| 56 |
+
|
| 57 |
+
processor = Wav2Vec2Processor.from_pretrained("facebook/hubert-xlarge-ls960-ft")
|
| 58 |
+
model = HubertForCTC.from_pretrained("facebook/hubert-xlarge-ls960-ft")
|
| 59 |
+
|
| 60 |
+
ds = load_dataset("patrickvonplaten/librispeech_asr_dummy", "clean", split="validation")
|
| 61 |
+
|
| 62 |
+
input_values = processor(ds[0]["audio"]["array"], return_tensors="pt").input_values # Batch size 1
|
| 63 |
+
logits = model(input_values).logits
|
| 64 |
+
predicted_ids = torch.argmax(logits, dim=-1)
|
| 65 |
+
transcription = processor.decode(predicted_ids[0])
|
| 66 |
+
|
| 67 |
+
# ->"A MAN SAID TO THE UNIVERSE SIR I EXIST"
|
| 68 |
+
```
|
config.json
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "facebook/hubert-xlarge-ls960-ft",
|
| 3 |
+
"activation_dropout": 0.0,
|
| 4 |
+
"apply_spec_augment": true,
|
| 5 |
+
"architectures": [
|
| 6 |
+
"HubertForCTC"
|
| 7 |
+
],
|
| 8 |
+
"attention_dropout": 0.1,
|
| 9 |
+
"bos_token_id": 1,
|
| 10 |
+
"conv_bias": true,
|
| 11 |
+
"conv_dim": [
|
| 12 |
+
512,
|
| 13 |
+
512,
|
| 14 |
+
512,
|
| 15 |
+
512,
|
| 16 |
+
512,
|
| 17 |
+
512,
|
| 18 |
+
512
|
| 19 |
+
],
|
| 20 |
+
"conv_kernel": [
|
| 21 |
+
10,
|
| 22 |
+
3,
|
| 23 |
+
3,
|
| 24 |
+
3,
|
| 25 |
+
3,
|
| 26 |
+
2,
|
| 27 |
+
2
|
| 28 |
+
],
|
| 29 |
+
"conv_stride": [
|
| 30 |
+
5,
|
| 31 |
+
2,
|
| 32 |
+
2,
|
| 33 |
+
2,
|
| 34 |
+
2,
|
| 35 |
+
2,
|
| 36 |
+
2
|
| 37 |
+
],
|
| 38 |
+
"ctc_loss_reduction": "sum",
|
| 39 |
+
"ctc_zero_infinity": false,
|
| 40 |
+
"do_stable_layer_norm": true,
|
| 41 |
+
"eos_token_id": 2,
|
| 42 |
+
"feat_extract_activation": "gelu",
|
| 43 |
+
"feat_extract_dropout": 0.0,
|
| 44 |
+
"feat_extract_norm": "layer",
|
| 45 |
+
"feat_proj_dropout": 0.1,
|
| 46 |
+
"final_dropout": 0.0,
|
| 47 |
+
"gradient_checkpointing": false,
|
| 48 |
+
"hidden_act": "gelu",
|
| 49 |
+
"hidden_dropout": 0.1,
|
| 50 |
+
"hidden_size": 1280,
|
| 51 |
+
"initializer_range": 0.02,
|
| 52 |
+
"intermediate_size": 5120,
|
| 53 |
+
"layer_norm_eps": 1e-05,
|
| 54 |
+
"layerdrop": 0.1,
|
| 55 |
+
"mask_channel_length": 10,
|
| 56 |
+
"mask_channel_min_space": 1,
|
| 57 |
+
"mask_channel_other": 0.0,
|
| 58 |
+
"mask_channel_prob": 0.0,
|
| 59 |
+
"mask_feature_length": 10,
|
| 60 |
+
"mask_feature_prob": 0.0,
|
| 61 |
+
"mask_time_length": 10,
|
| 62 |
+
"mask_time_min_space": 1,
|
| 63 |
+
"mask_time_other": 0.0,
|
| 64 |
+
"mask_time_prob": 0.075,
|
| 65 |
+
"model_type": "hubert",
|
| 66 |
+
"num_attention_heads": 16,
|
| 67 |
+
"num_conv_pos_embedding_groups": 16,
|
| 68 |
+
"num_conv_pos_embeddings": 128,
|
| 69 |
+
"num_feat_extract_layers": 7,
|
| 70 |
+
"num_hidden_layers": 48,
|
| 71 |
+
"pad_token_id": 0,
|
| 72 |
+
"transformers_version": "4.10.0.dev0",
|
| 73 |
+
"vocab_size": 32
|
| 74 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a4596d21af9a6842bdf6cbe28eb835ea33980c05efbdec65c39b3609943cd537
|
| 3 |
+
size 3850253320
|
preprocessor_config.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"do_normalize": true,
|
| 3 |
+
"feature_extractor_type": "Wav2Vec2FeatureExtractor",
|
| 4 |
+
"feature_size": 1,
|
| 5 |
+
"padding_side": "right",
|
| 6 |
+
"padding_value": 0,
|
| 7 |
+
"return_attention_mask": true,
|
| 8 |
+
"sampling_rate": 16000
|
| 9 |
+
}
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e50f16d74714b7ff6d535af7316f25462555faeacf3725efe60024db99be071f
|
| 3 |
+
size 3850480983
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"bos_token": "<s>", "eos_token": "</s>", "unk_token": "<unk>", "pad_token": "<pad>"}
|
tf_model.h5
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:243d1aceed25538ce8778e44deb0c50ffd54464d682e20040630d9550f2b7097
|
| 3 |
+
size 3851042328
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"unk_token": "<unk>", "bos_token": "<s>", "eos_token": "</s>", "pad_token": "<pad>", "do_lower_case": false, "word_delimiter_token": "|"}
|
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}
|