Update app.py
Browse files
app.py
CHANGED
@@ -43,6 +43,18 @@ vocabSize = 11000
|
|
43 |
max_len = 1160
|
44 |
load_dotenv()
|
45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
def predict_emotions(sentence):
|
48 |
sentence = sentence_cleaning(sentence)
|
@@ -78,7 +90,7 @@ def sentence_cleaning(sentence):
|
|
78 |
|
79 |
|
80 |
def main():
|
81 |
-
st.title("Emotion Classifier")
|
82 |
menu = ["Home", "Monitor"]
|
83 |
choice = st.sidebar.selectbox("Menu", menu)
|
84 |
if choice == "Home":
|
@@ -99,7 +111,7 @@ def main():
|
|
99 |
st.write(raw_text)
|
100 |
|
101 |
st.success("Prediction")
|
102 |
-
st.write("{}:{}".format(res,
|
103 |
st.write("Confidence:{}".format(proba))
|
104 |
|
105 |
with col2:
|
|
|
43 |
max_len = 1160
|
44 |
load_dotenv()
|
45 |
|
46 |
+
emotions_emoji_dict = { "anger":"๐ ",
|
47 |
+
"disgust":"๐คฎ",
|
48 |
+
"fear":"๐จ๐ฑ",
|
49 |
+
"happy":"๐ค",
|
50 |
+
"joy":"๐",
|
51 |
+
"neutral":"๐",
|
52 |
+
"sad":"๐",
|
53 |
+
"sadness":"๐",
|
54 |
+
"shame":"๐ณ",
|
55 |
+
"surprise":"๐ฎ"
|
56 |
+
}
|
57 |
+
|
58 |
|
59 |
def predict_emotions(sentence):
|
60 |
sentence = sentence_cleaning(sentence)
|
|
|
90 |
|
91 |
|
92 |
def main():
|
93 |
+
st.title("๐คฎ๐จ๐ฑEmotion Classifier๐๐ณ๐ฎ")
|
94 |
menu = ["Home", "Monitor"]
|
95 |
choice = st.sidebar.selectbox("Menu", menu)
|
96 |
if choice == "Home":
|
|
|
111 |
st.write(raw_text)
|
112 |
|
113 |
st.success("Prediction")
|
114 |
+
st.write("{}:{}".format(res, emotions_emoji_dict[res]))
|
115 |
st.write("Confidence:{}".format(proba))
|
116 |
|
117 |
with col2:
|