manu commited on
Commit
075ae74
β€’
1 Parent(s): 2638e28

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -32,18 +32,18 @@ def inference(audio):
32
  ])
33
 
34
  error = jiwer.wer(
35
- passage,
36
  result.text,
37
  truth_transform=transformation,
38
  hypothesis_transform=transformation
39
  )
40
  # error = jiwer.wer(passage, result.text)
41
- print(f"WER is {error * len(result.text.split())}")
42
- print(result.text)
43
- print(passage)
 
44
 
45
- return f"For a {audio_length} second audio, WER is {error * len(result.text.split())} resulting in a final time of {audio_length + error * len(result.text.split())}. \n\n{result.text}", gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
46
-
47
 
48
 
49
 
 
32
  ])
33
 
34
  error = jiwer.wer(
35
+ passage,
36
  result.text,
37
  truth_transform=transformation,
38
  hypothesis_transform=transformation
39
  )
40
  # error = jiwer.wer(passage, result.text)
41
+ we_num = error * len(passage.split())
42
+ # print(f"WER is {we_num}")
43
+ # print(result.text)
44
+ # print(passage)
45
 
46
+ return f"For a {audio_length} second audio, {we_num} errors were made, resulting in a final time of {audio_length + we_num}.\n\n{result.text}", gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
 
47
 
48
 
49