Update README.md
Browse files
README.md
CHANGED
@@ -31,6 +31,28 @@ In training of the model, we used the following data sources:
|
|
31 |
5. Macedonian version of the Mozilla Common Voice (version 18).
|
32 |
|
33 |
|
|
|
|
|
|
|
|
|
34 |
## Usage
|
35 |
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
5. Macedonian version of the Mozilla Common Voice (version 18).
|
32 |
|
33 |
|
34 |
+
## Model description
|
35 |
+
|
36 |
+
This model is an attention-based encoder-decoder (AED). The encoder is a Wav2vec2 model and the decoder is RNN-based.
|
37 |
+
|
38 |
## Usage
|
39 |
|
40 |
+
The model is developed using the [SpeechBrain] (https://speechbrain.github.io) toolkit. To use it, you need to install SpeechBrain with:
|
41 |
+
```
|
42 |
+
pip install speechbrain
|
43 |
+
```
|
44 |
+
SpeechBrain relies on the Transformers library, therefore you need install that library as well with:
|
45 |
+
```
|
46 |
+
pip install transformers```
|
47 |
+
|
48 |
+
An external `py_module_file=custom_interface.py` is used as an external Predictor class into this HF repos. We use `foreign_class` function from `speechbrain.pretrained.interfaces` that allow you to load you custom model.
|
49 |
+
|
50 |
+
```python
|
51 |
+
from speechbrain.inference.interfaces import foreign_class
|
52 |
+
classifier_test = foreign_class(source="Macedonian-ASR/wav2vec2-aed-macedonian-asr", pymodule_file="custom_interface.py", classname="ASR")
|
53 |
+
classifier_test = classifier_test.to(device)
|
54 |
+
predictions = classifier_test.classify_file("/m/triton/scratch/elec/t405-puhe/p/porjazd1/macedonian_asr/data/youtube_audio/audio/vesti_2.m4a", device)
|
55 |
+
print(predictions)
|
56 |
+
```
|
57 |
+
|
58 |
+
|