Update app.py
Browse files
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 |
-
|
38 |
-
|
|
|
39 |
|
40 |
audio = gr.Audio(
|
41 |
label="Input Audio",
|
@@ -44,7 +45,8 @@ audio = gr.Audio(
|
|
44 |
type="filepath"
|
45 |
)
|
46 |
|
47 |
-
|
|
|
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 |
|