Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -74,8 +74,8 @@ def transcribe_audio(audio_path, original_text):
|
|
| 74 |
errors = compare_hindi_sentences(original_text, transcription)
|
| 75 |
df_errors = pd.DataFrame(errors, columns=["बिगड़ा हुआ शब्द", "संभावित सही शब्द", "गलती का प्रकार"])
|
| 76 |
# Speaking speed
|
| 77 |
-
|
| 78 |
-
transcribed_words =
|
| 79 |
duration = result['segments'][-1]['end'] if result.get('segments') else 1.0
|
| 80 |
speed = round(len(transcribed_words) / duration, 2) if duration > 0 else 0
|
| 81 |
# Accuracy
|
|
|
|
| 74 |
errors = compare_hindi_sentences(original_text, transcription)
|
| 75 |
df_errors = pd.DataFrame(errors, columns=["बिगड़ा हुआ शब्द", "संभावित सही शब्द", "गलती का प्रकार"])
|
| 76 |
# Speaking speed
|
| 77 |
+
transcription = transcription.translate(str.maketrans('', '', string.punctuation))
|
| 78 |
+
transcribed_words = transcription.strip().split()
|
| 79 |
duration = result['segments'][-1]['end'] if result.get('segments') else 1.0
|
| 80 |
speed = round(len(transcribed_words) / duration, 2) if duration > 0 else 0
|
| 81 |
# Accuracy
|