Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ import re
|
|
11 |
|
12 |
# Initialize the speech recognition pipeline and transliterator
|
13 |
p1 = pipeline(task="automatic-speech-recognition", model="cdactvm/w2v-bert-2.0-odia_v1")
|
14 |
-
|
15 |
p2 = pipeline(task="automatic-speech-recognition", model="cdactvm/w2v-bert-2.0-hindi_v1")
|
16 |
#p3 = pipeline(task="automatic-speech-recognition", model="cdactvm/kannada_w2v-bert_model")
|
17 |
#p4 = pipeline(task="automatic-speech-recognition", model="cdactvm/telugu_w2v-bert_model")
|
@@ -50,14 +50,14 @@ def transcribe_odiya(speech):
|
|
50 |
|
51 |
###################################
|
52 |
def transcribe_odiya_model2(speech):
|
53 |
-
text =
|
54 |
if text is None:
|
55 |
return "Error: ASR returned None"
|
56 |
return text
|
57 |
|
58 |
def transcribe_odiya_eng_model2(speech):
|
59 |
trn = Transliterator(source='ori', target='eng', build_lookup=True)
|
60 |
-
text =
|
61 |
if text is None:
|
62 |
return "Error: ASR returned None"
|
63 |
sentence = trn.transform(text)
|
|
|
11 |
|
12 |
# Initialize the speech recognition pipeline and transliterator
|
13 |
p1 = pipeline(task="automatic-speech-recognition", model="cdactvm/w2v-bert-2.0-odia_v1")
|
14 |
+
odia_model2 = pipeline(task="automatic-speech-recognition", model="cdactvm/w2v-bert-odia_v1")
|
15 |
p2 = pipeline(task="automatic-speech-recognition", model="cdactvm/w2v-bert-2.0-hindi_v1")
|
16 |
#p3 = pipeline(task="automatic-speech-recognition", model="cdactvm/kannada_w2v-bert_model")
|
17 |
#p4 = pipeline(task="automatic-speech-recognition", model="cdactvm/telugu_w2v-bert_model")
|
|
|
50 |
|
51 |
###################################
|
52 |
def transcribe_odiya_model2(speech):
|
53 |
+
text = odia_model2(speech)["text"]
|
54 |
if text is None:
|
55 |
return "Error: ASR returned None"
|
56 |
return text
|
57 |
|
58 |
def transcribe_odiya_eng_model2(speech):
|
59 |
trn = Transliterator(source='ori', target='eng', build_lookup=True)
|
60 |
+
text = odia_model2(speech)["text"]
|
61 |
if text is None:
|
62 |
return "Error: ASR returned None"
|
63 |
sentence = trn.transform(text)
|