Create README.md file
Browse files
README.md
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- am
|
4 |
+
tags:
|
5 |
+
- mms
|
6 |
+
- meta
|
7 |
+
- kenlm
|
8 |
+
- amharic
|
9 |
+
- Automatic Speech Recognition
|
10 |
+
license: cc-by-nc-4.0
|
11 |
+
---
|
12 |
+
|
13 |
+
## Model Summary
|
14 |
+
Well I made a KenLM model that works with Meta's <a href="https://huggingface.co/facebook/mms-1b-all">Massively Multilingual Speech (MMS)</a> to improve ASR transcriptions in the Amharic language.
|
15 |
+
The model is based on the Amharic Common Crawl corpus dating from Jan-Dec of 2018 (<a href="https://data.statmt.org/cc-100/">link</a>). It seems to improve my ASR transcriptions considerably well,
|
16 |
+
but of course I don't expect this LM to improve the WER for amharic transcriptions to the level spoken of in the MMS paper (around 32%). To do that, a larger Amharic corpus would be needed, and I have
|
17 |
+
no clue how to compile one myself. For reference, the one I used is merely 837MB; the
|
18 |
+
<a href="https://scontent.fphx1-2.fna.fbcdn.net/v/t39.8562-6/348827959_6967534189927933_6819186233244071998_n.pdf?_nc_cat=104&ccb=1-7&_nc_sid=ad8a9d&_nc_ohc=APrxV5RqnpwAX_XU5Kf&_nc_ht=scontent.fphx1-2.fna&oh=00_AfDOEKZa4CJrwLrCdt4RwjMVJUCO6Fe3XmpEtjKxtRwUpg&oe=649BD6C2">MMS paper</a> suggests using a corpus of > 5GB. <br />
|
19 |
+
|
20 |
+
## Getting Started
|
21 |
+
To use this LM-boosted processor via the Transformers library, utilize the "Wav2Vec2ProcessorWithLM" class instead of "Wav2Vec2Processor". Here's a quick example of how I use it: <br />
|
22 |
+
```py
|
23 |
+
from transformers import Wav2Vec2ForCTC, Wav2Vec2ProcessorWithLM
|
24 |
+
|
25 |
+
|
26 |
+
# load pretrained model
|
27 |
+
model = Wav2Vec2ForCTC.from_pretrained("facebook/mms-1b-all")
|
28 |
+
processor = Wav2Vec2Processor.from_pretrained("jlonsako/mms-1b-all-AmhLM")
|
29 |
+
|
30 |
+
model.load_adapter("amh")
|
31 |
+
|
32 |
+
input_values = processor("insert audio file path", sampling_rate=16_000, return_tensors="pt").input_values
|
33 |
+
|
34 |
+
with torch.no_grad():
|
35 |
+
logits = model(input_values).logits
|
36 |
+
transcription = processor.batch_decode(logits.numpy()).text
|
37 |
+
print(transcription[0])
|
38 |
+
```
|
39 |
+
|
40 |
+
## Limitations
|
41 |
+
I would love to post stats like WER and BLEU scores on out-of-framework datasets, but considering the fact that I'm a C# web developer by trade,
|
42 |
+
I have no clue how to perform those tests. I just want to make this available for anyone who wants to test MMS performance with an AMH LM,
|
43 |
+
and also for my own use. Happy testing!
|
44 |
+
|
45 |
+
|
46 |
+
## Final Notes
|
47 |
+
I hope it goes without saying that this repository inherits licenses from Facebooks MMS,
|