Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -324,12 +324,25 @@ def cleanhtml(raw_html):
|
|
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
333 |
text = text.replace(hindi, num)
|
334 |
|
335 |
return text
|
|
|
324 |
# return text
|
325 |
|
326 |
def transcribe_hindi(speech):
|
|
|
|
|
327 |
text = p2(speech)["text"]
|
328 |
if text is None:
|
329 |
return "Error: ASR returned None"
|
330 |
+
|
331 |
+
hindi_map = {
|
332 |
+
"जीरो": "0",
|
333 |
+
"वन": "1",
|
334 |
+
"दो": "2",
|
335 |
+
"तीन": "3",
|
336 |
+
"चार": "4",
|
337 |
+
"पांच": "5",
|
338 |
+
"छह": "6",
|
339 |
+
"सात": "7",
|
340 |
+
"आठ": "8",
|
341 |
+
"नौ": "9",
|
342 |
+
"दस": "10"
|
343 |
+
}
|
344 |
+
|
345 |
+
for hindi, num in hindi_map.items():
|
346 |
text = text.replace(hindi, num)
|
347 |
|
348 |
return text
|