KeniBrandonGM commited on
Commit
7b9f72b
1 Parent(s): 5a1587b

ya este si correccion 4

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -4,6 +4,13 @@ from transformers import pipeline
4
  trans = pipeline("automatic-speech-recognition", model="facebook/wav2vec2-large-xlsr-53-spanish")
5
  clasificador = pipeline("text-classification", model="pysentimiento/robertuito-sentiment-analysis")
6
 
 
 
 
 
 
 
 
7
  demo = gr.Blocks()
8
 
9
  with demo:
 
4
  trans = pipeline("automatic-speech-recognition", model="facebook/wav2vec2-large-xlsr-53-spanish")
5
  clasificador = pipeline("text-classification", model="pysentimiento/robertuito-sentiment-analysis")
6
 
7
+ def audio_a_text(audio):
8
+ text = trans(audio)["text"]
9
+ return text
10
+
11
+ def texto_a_sentimiento(text):
12
+ return clasificador(text)[0]["label"]
13
+
14
  demo = gr.Blocks()
15
 
16
  with demo: