jmparejaz commited on
Commit
5272af9
1 Parent(s): 6a1445e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -34,8 +34,9 @@ def inference_text(audio):
34
  text,_,_,_ =inference_audio(audio)
35
 
36
  sentiment_task = pipeline("sentiment-analysis", model=model_nlp, tokenizer=tokenizer)
37
- result=sentiment_task(text)
38
- return result
 
39
 
40
  audio = gr.Audio(
41
  label="Input Audio",
@@ -44,7 +45,8 @@ audio = gr.Audio(
44
  type="filepath"
45
  )
46
 
47
- app=gr.Interface(title="Speech Sentiment Classification",fn=inference_text,inputs=[audio],outputs=[text])
 
48
 
49
 
50
 
 
34
  text,_,_,_ =inference_audio(audio)
35
 
36
  sentiment_task = pipeline("sentiment-analysis", model=model_nlp, tokenizer=tokenizer)
37
+ res=sentiment_task(text)[0]
38
+
39
+ return res['label'],res['score']
40
 
41
  audio = gr.Audio(
42
  label="Input Audio",
 
45
  type="filepath"
46
  )
47
 
48
+
49
+ app=gr.Interface(title="Sentiment Audio Analysis",fn=inference_text,inputs=[audio], outputs=["text","text"])
50
 
51
 
52