Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -315,12 +315,26 @@ def transcribe_odiya_eng_model2(speech):
|
|
| 315 |
def cleanhtml(raw_html):
|
| 316 |
cleantext = re.sub(r'<.*?>', '', raw_html)
|
| 317 |
return cleantext
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 318 |
|
| 319 |
def transcribe_hindi(speech):
|
|
|
|
|
|
|
| 320 |
text = p2(speech)["text"]
|
| 321 |
if text is None:
|
| 322 |
return "Error: ASR returned None"
|
|
|
|
|
|
|
|
|
|
| 323 |
return text
|
|
|
|
|
|
|
| 324 |
def transcribe_kannada(speech):
|
| 325 |
text = p3(speech)["text"]
|
| 326 |
if text is None:
|
|
|
|
| 315 |
def cleanhtml(raw_html):
|
| 316 |
cleantext = re.sub(r'<.*?>', '', raw_html)
|
| 317 |
return cleantext
|
| 318 |
+
#######################################
|
| 319 |
+
|
| 320 |
+
# def transcribe_hindi(speech):
|
| 321 |
+
# text = p2(speech)["text"]
|
| 322 |
+
# if text is None:
|
| 323 |
+
# return "Error: ASR returned None"
|
| 324 |
+
# return text
|
| 325 |
|
| 326 |
def transcribe_hindi(speech):
|
| 327 |
+
hindi_text_to_num_map = {"जीरो": "0","वन": "1","दो": "2","तीन": "3","चार": "4","पांच": "5","छह": "6","सात": "7","आठ": "8","नौ": "9","दस": "10"}
|
| 328 |
+
|
| 329 |
text = p2(speech)["text"]
|
| 330 |
if text is None:
|
| 331 |
return "Error: ASR returned None"
|
| 332 |
+
for hindi, num in hindi_text_to_num_map.items():
|
| 333 |
+
text = text.replace(hindi, num)
|
| 334 |
+
|
| 335 |
return text
|
| 336 |
+
|
| 337 |
+
###########################################################
|
| 338 |
def transcribe_kannada(speech):
|
| 339 |
text = p3(speech)["text"]
|
| 340 |
if text is None:
|