patrickvonplaten commited on
Commit
301ef17
1 Parent(s): 996832f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -45
README.md CHANGED
@@ -28,55 +28,14 @@ model-index:
28
  value: 3.4
29
  ---
30
 
31
- # Wav2Vec2-Base-960h
32
 
33
- [Facebook's Wav2Vec2](https://ai.facebook.com/blog/wav2vec-20-learning-the-structure-of-speech-from-raw-audio/)
34
-
35
- The base model pretrained and fine-tuned on 960 hours of Librispeech on 16kHz sampled speech audio. When using the model
36
- make sure that your speech input is also sampled at 16Khz.
37
-
38
- [Paper](https://arxiv.org/abs/2006.11477)
39
-
40
- Authors: Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael Auli
41
-
42
- **Abstract**
43
-
44
- 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.
45
-
46
- The original model can be found under https://github.com/pytorch/fairseq/tree/master/examples/wav2vec#wav2vec-20.
47
-
48
-
49
- # Usage
50
-
51
- To transcribe audio files the model can be used as a standalone acoustic model as follows:
52
-
53
- ```python
54
- from transformers import Wav2Vec2Processor, Wav2Vec2ForCTC
55
- from datasets import load_dataset
56
- import soundfile as sf
57
- import torch
58
-
59
- # load model and tokenizer
60
- processor = Wav2Vec2Processor.from_pretrained("facebook/wav2vec2-base-960h")
61
- model = Wav2Vec2ForCTC.from_pretrained("facebook/wav2vec2-base-960h")
62
-
63
- # load dummy dataset and read soundfiles
64
- ds = load_dataset("patrickvonplaten/librispeech_asr_dummy", "clean", split="validation")
65
-
66
- # tokenize
67
- input_values = processor(ds[0]["audio"]["array"], return_tensors="pt", padding="longest").input_values # Batch size 1
68
-
69
- # retrieve logits
70
- logits = model(input_values).logits
71
-
72
- # take argmax and decode
73
- predicted_ids = torch.argmax(logits, dim=-1)
74
- transcription = processor.batch_decode(predicted_ids)
75
- ```
76
 
77
  ## Evaluation
78
 
79
- This code snippet shows how to evaluate **facebook/wav2vec2-base-960h** on LibriSpeech's "clean" and "other" test data.
80
 
81
  ```python
82
  from datasets import load_dataset
 
28
  value: 3.4
29
  ---
30
 
31
+ # Wav2Vec2-Base-960h + 4-gram
32
 
33
+ This model is identical to [Facebook's Wav2Vec2-Base-960h](https://huggingface.co/facebook/wav2vec2-base-960h), but is
34
+ augmented with an English 4-gram. The `4-gram.arpa.gz` of [Librispeech's official ngrams](https://www.openslr.org/11) is used.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
  ## Evaluation
37
 
38
+ This code snippet shows how to evaluate **patrickvonplaten/wav2vec2-base-960h-4-gram** on LibriSpeech's "clean" and "other" test data.
39
 
40
  ```python
41
  from datasets import load_dataset