Rajor78 commited on
Commit
2c0a3d0
verified
1 Parent(s): a6d49c7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
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 = [spell.correction(word) for word in words] # Corregir las palabras
 
 
 
 
 
 
 
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