Ryan Kim commited on
Commit
ec1e335
1 Parent(s): 945f417

first nlp model was outputting label_0 and label_2 instead of negative/positive, so forcefully change label to convert into sentiment message

Browse files
Files changed (1) hide show
  1. src/main.py +8 -1
src/main.py CHANGED
@@ -44,6 +44,13 @@ if submit:
44
  label = result[0]['label']
45
  score = result[0]['score']
46
 
 
 
 
 
 
 
 
47
  st.markdown("#### Result:")
48
- st.markdown("**{}**: {})".format(label,score))
49
 
 
44
  label = result[0]['label']
45
  score = result[0]['score']
46
 
47
+ if label == "LABEL_0":
48
+ label = "Negative"
49
+ elif label == "LABEL_2":
50
+ label = "Positive"
51
+ elif label == "LABEL_1":
52
+ label = "Neutral"
53
+
54
  st.markdown("#### Result:")
55
+ st.markdown("**{}**: {}".format(label,score))
56