Spaces:
Runtime error
Runtime error
shawarmabytes
commited on
Commit
•
652f314
1
Parent(s):
758f4ba
Update app.py
Browse files
app.py
CHANGED
@@ -2,8 +2,6 @@ import streamlit as st
|
|
2 |
from streamlit_player import st_player
|
3 |
from transformers import pipeline
|
4 |
|
5 |
-
x = st.slider('Select a value')
|
6 |
-
st.write(x, 'squared is', x * x)
|
7 |
|
8 |
|
9 |
def tester(text):
|
@@ -12,6 +10,28 @@ def tester(text):
|
|
12 |
classifier = pipeline("sentiment-analysis", 'j-hartmann/emotion-english-distilroberta-base')
|
13 |
results = classifier(text)
|
14 |
st.write(results[0]['label'])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
emo = st.text_input('Enter text here:')
|
17 |
tester(emo)
|
|
|
2 |
from streamlit_player import st_player
|
3 |
from transformers import pipeline
|
4 |
|
|
|
|
|
5 |
|
6 |
|
7 |
def tester(text):
|
|
|
10 |
classifier = pipeline("sentiment-analysis", 'j-hartmann/emotion-english-distilroberta-base')
|
11 |
results = classifier(text)
|
12 |
st.write(results[0]['label'])
|
13 |
+
|
14 |
+
if (results[0]['label']=="anger"):
|
15 |
+
st_player("https://youtu.be/CmSKVW1v0xM")
|
16 |
+
|
17 |
+
elif (results[0]['label']=="disgust"):
|
18 |
+
st_player("https://youtu.be/CmSKVW1v0xM")
|
19 |
+
|
20 |
+
elif (results[0]['label']=="fear"):
|
21 |
+
st_player("https://youtu.be/CmSKVW1v0xM")
|
22 |
+
|
23 |
+
elif (results[0]['label']=="joy"):
|
24 |
+
st_player("https://youtu.be/CmSKVW1v0xM")
|
25 |
+
|
26 |
+
elif (results[0]['label']=="sadness"):
|
27 |
+
st_player("https://youtu.be/CmSKVW1v0xM")
|
28 |
+
|
29 |
+
elif (results[0]['label']=="surprise"):
|
30 |
+
st_player("https://youtu.be/CmSKVW1v0xM")
|
31 |
+
|
32 |
+
|
33 |
+
return results[0]['label']
|
34 |
+
#return results
|
35 |
|
36 |
emo = st.text_input('Enter text here:')
|
37 |
tester(emo)
|