0xgaryy commited on
Commit
3b040bd
โ€ข
1 Parent(s): 595c1db

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -2
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, proba))
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: