patrickvonplaten
commited on
Commit
•
cbeb18d
1
Parent(s):
ac5d2e5
Update README.md
Browse files
README.md
CHANGED
@@ -34,7 +34,7 @@ Fine-tuned facebook/wav2vec2-large-xlsr-53 on Hindi and Marathi using the OpenSL
|
|
34 |
## Usage
|
35 |
The model can be used directly (without a language model) as follows, assuming you have a dataset with Marathi text and audio_path fields:
|
36 |
|
37 |
-
```
|
38 |
import torch
|
39 |
import torchaudio
|
40 |
import librosa
|
@@ -65,8 +65,8 @@ print("Prediction:", processor.batch_decode(predicted_ids))
|
|
65 |
print("Reference:", test_data["text"][:2])
|
66 |
Evaluation
|
67 |
The model can be evaluated as follows on 10% of the Marathi data on OpenSLR.
|
68 |
-
|
69 |
-
```
|
70 |
import torchaudio
|
71 |
from datasets import load_metric
|
72 |
from transformers import Wav2Vec2Processor,Wav2Vec2ForCTC
|
@@ -81,7 +81,7 @@ model = Wav2Vec2ForCTC.from_pretrained("tanmaylaud/wav2vec2-large-xlsr-hindi-mar
|
|
81 |
|
82 |
model.to("cuda")
|
83 |
|
84 |
-
chars_to_ignore_regex = '[
|
85 |
|
86 |
# Preprocessing the datasets.
|
87 |
# We need to read the audio files as arrays
|
34 |
## Usage
|
35 |
The model can be used directly (without a language model) as follows, assuming you have a dataset with Marathi text and audio_path fields:
|
36 |
|
37 |
+
```python
|
38 |
import torch
|
39 |
import torchaudio
|
40 |
import librosa
|
65 |
print("Reference:", test_data["text"][:2])
|
66 |
Evaluation
|
67 |
The model can be evaluated as follows on 10% of the Marathi data on OpenSLR.
|
68 |
+
|
69 |
+
```python
|
70 |
import torchaudio
|
71 |
from datasets import load_metric
|
72 |
from transformers import Wav2Vec2Processor,Wav2Vec2ForCTC
|
81 |
|
82 |
model.to("cuda")
|
83 |
|
84 |
+
chars_to_ignore_regex = '[\\\\\\\\,\\\\\\\\?\\\\\\\\.\\\\\\\\!\\\\\\\\-\\\\\\\\;\\\\\\\\:\\\\\\\\"\\\\\\\\“\\\\\\\\%\\\\\\\\‘\\\\\\\\”\\\\\\\\�\\\\\\\\।]'
|
85 |
|
86 |
# Preprocessing the datasets.
|
87 |
# We need to read the audio files as arrays
|