camparchimedes commited on
Commit
9983004
·
verified ·
1 Parent(s): 0b41af6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -12
app.py CHANGED
@@ -134,20 +134,19 @@ def transcribe_audio(audio_file, chunk_length_s=30):
134
  rtf = output_time / audio_duration
135
 
136
  # Format of the result
137
- result = {
138
- f"Time taken: {output_time:.2f} seconds\n"
139
- f"Audio duration: {audio_duration / 60:.2f minutes ({audio_duration:.2f} seconds)\n"
140
- f"Real-time Factor (RTF): {rtf:.2f}\n"
141
- f"Number of words: {len(text.split())}\n\n"
142
- "Real-time Factor (RTF) is a measure used to evaluate the speed of speech recognition systems. "
143
- "It is the ratio of transcription time to the duration of the audio.\n\n"
144
- "An RTF of less than 1 means the transcription process is faster than real-time (expected)."
145
- }
146
-
 
147
  return text, result
148
 
149
-
150
-
151
  # Clean and preprocess/@summarization
152
  def clean_text(text):
153
  text = re.sub(r'https?:\/\/.*[\r\n]*', '', text)
 
134
  rtf = output_time / audio_duration
135
 
136
  # Format of the result
137
+ result = (
138
+ f"Time taken: {output_time:.2f} seconds\n"
139
+ f"Audio duration: {audio_duration / 60:.2f} minutes ({audio_duration:.2f} seconds)\n"
140
+ f"Real-time Factor (RTF): {rtf:.2f}\n"
141
+ f"Number of words: {len(text.split())}\n\n"
142
+ "Real-time Factor (RTF) is a measure used to evaluate the speed of speech recognition systems. "
143
+ "It is the ratio of transcription time to the duration of the audio.\n\n"
144
+ "An RTF of less than 1 means the transcription process is faster than real-time (expected)."
145
+ )
146
+
147
+
148
  return text, result
149
 
 
 
150
  # Clean and preprocess/@summarization
151
  def clean_text(text):
152
  text = re.sub(r'https?:\/\/.*[\r\n]*', '', text)