cdactvm commited on
Commit
c75f007
1 Parent(s): 5f44255

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -28,6 +28,11 @@ def transcribe_odiya(speech):
28
  return "Error: ASR returned None"
29
  return text
30
 
 
 
 
 
 
31
  def transcribe_hindi(speech):
32
  text = p2(speech)["text"]
33
  if text is None:
@@ -52,12 +57,14 @@ def transcribe_bangala(speech):
52
 
53
  def transcribe_assamese_model1(speech):
54
  text = p6(speech)["text"]
 
55
  if text is None:
56
  return "Error: ASR returned None"
57
  return text
58
 
59
  def transcribe_assamese_model2(speech):
60
  text = p7(speech)["text"]
 
61
  if text is None:
62
  return "Error: ASR returned None"
63
  return text
 
28
  return "Error: ASR returned None"
29
  return text
30
 
31
+
32
+ def cleanhtml(raw_html):
33
+ cleantext = re.sub(r'<.*?>', '', raw_html)
34
+ return cleantext
35
+
36
  def transcribe_hindi(speech):
37
  text = p2(speech)["text"]
38
  if text is None:
 
57
 
58
  def transcribe_assamese_model1(speech):
59
  text = p6(speech)["text"]
60
+ text = cleanhtml(text)
61
  if text is None:
62
  return "Error: ASR returned None"
63
  return text
64
 
65
  def transcribe_assamese_model2(speech):
66
  text = p7(speech)["text"]
67
+ text = cleanhtml(text)
68
  if text is None:
69
  return "Error: ASR returned None"
70
  return text