Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -34,7 +34,14 @@ def transcribe_audio(audio_path):
|
|
| 34 |
def correct_text(text):
|
| 35 |
spell = SpellChecker(language='es') # Usamos espa帽ol para la correcci贸n
|
| 36 |
words = text.split() # Separar el texto en palabras
|
| 37 |
-
corrected_words = [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
corrected_text = " ".join(corrected_words) # Volver a unir las palabras
|
| 39 |
return corrected_text
|
| 40 |
|
|
|
|
| 34 |
def correct_text(text):
|
| 35 |
spell = SpellChecker(language='es') # Usamos espa帽ol para la correcci贸n
|
| 36 |
words = text.split() # Separar el texto en palabras
|
| 37 |
+
corrected_words = []
|
| 38 |
+
|
| 39 |
+
for word in words:
|
| 40 |
+
corrected = spell.correction(word)
|
| 41 |
+
if corrected is None: # Si no se encuentra correcci贸n, dejamos la palabra original
|
| 42 |
+
corrected = word
|
| 43 |
+
corrected_words.append(corrected)
|
| 44 |
+
|
| 45 |
corrected_text = " ".join(corrected_words) # Volver a unir las palabras
|
| 46 |
return corrected_text
|
| 47 |
|