Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -163,14 +163,14 @@ def recognize_speech_telugu(audio_file):
|
|
163 |
text_value = result['text']
|
164 |
print (text_value)
|
165 |
cleaned_text = text_value.replace("<s>", "")
|
166 |
-
|
167 |
# cleaned_text=convert2num(cleaned_text,lex)
|
168 |
# converted_to_list = convert_to_list(cleaned_text, text_to_list())
|
169 |
# processed_doubles = process_doubles(converted_to_list)
|
170 |
# replaced_words = replace_words(processed_doubles)
|
171 |
# converted_text = text_to_int(replaced_words)
|
172 |
-
|
173 |
-
return cleaned_text
|
174 |
|
175 |
# Function to handle speech recognition
|
176 |
def recognize_speech_kannada(audio_file):
|
@@ -197,9 +197,9 @@ def sel_lng(lng, mic=None, file=None):
|
|
197 |
else:
|
198 |
return "You must either provide a mic recording or a file"
|
199 |
|
200 |
-
if lng == "
|
201 |
return recognize_speech_telugu(audio)
|
202 |
-
elif lng == "
|
203 |
return recognize_speech_kannada(audio)
|
204 |
# elif lng== "model_3":
|
205 |
# return transcribe_hindi_lm(audio)
|
@@ -212,7 +212,7 @@ demo=gr.Interface(
|
|
212 |
|
213 |
inputs=[
|
214 |
gr.Dropdown([
|
215 |
-
"Telugu","
|
216 |
gr.Audio(sources=["microphone","upload"], type="filepath"),
|
217 |
],
|
218 |
outputs=[
|
|
|
163 |
text_value = result['text']
|
164 |
print (text_value)
|
165 |
cleaned_text = text_value.replace("<s>", "")
|
166 |
+
converted_text=convert2num(cleaned_text,lex)
|
167 |
# cleaned_text=convert2num(cleaned_text,lex)
|
168 |
# converted_to_list = convert_to_list(cleaned_text, text_to_list())
|
169 |
# processed_doubles = process_doubles(converted_to_list)
|
170 |
# replaced_words = replace_words(processed_doubles)
|
171 |
# converted_text = text_to_int(replaced_words)
|
172 |
+
return cleaned_text +" -----------------> " + converted_text
|
173 |
+
#return cleaned_text
|
174 |
|
175 |
# Function to handle speech recognition
|
176 |
def recognize_speech_kannada(audio_file):
|
|
|
197 |
else:
|
198 |
return "You must either provide a mic recording or a file"
|
199 |
|
200 |
+
if lng == "Telugu":
|
201 |
return recognize_speech_telugu(audio)
|
202 |
+
elif lng == "Kannada":
|
203 |
return recognize_speech_kannada(audio)
|
204 |
# elif lng== "model_3":
|
205 |
# return transcribe_hindi_lm(audio)
|
|
|
212 |
|
213 |
inputs=[
|
214 |
gr.Dropdown([
|
215 |
+
"Telugu","Kannada"],label="Select Model"),
|
216 |
gr.Audio(sources=["microphone","upload"], type="filepath"),
|
217 |
],
|
218 |
outputs=[
|