TRACES commited on
Commit
458520f
1 Parent(s): 9f940ae

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +7 -7
main.py CHANGED
@@ -57,7 +57,7 @@ if all([
57
  st.session_state.untrue_detector_probability = 1
58
 
59
  st.session_state.bert_disinfo_result = [{'label': '', 'score': 1}]
60
-
61
 
62
  content = load_content()
63
  if 'loaded' not in st.session_state:
@@ -102,7 +102,7 @@ if st.session_state.agree:
102
  st.session_state.untrue_detector_probability = max(st.session_state.untrue_detector_probability[0], st.session_state.untrue_detector_probability[1])
103
 
104
  st.session_state.bert_disinfo_result = st.session_state.bert_disinfo(user_input)
105
- st.session_state.bert_disinfo_result = st.session_state.emotions(user_input)
106
 
107
 
108
 
@@ -133,18 +133,18 @@ if st.session_state.agree:
133
  str(round(st.session_state.bert_disinfo_result[0]['score'] * 100, 2)) +
134
  content['bert_no_2'][st.session_state.lang], icon="✅")
135
 
136
- if st.session_state.emotions[0]['score'] < 0.97:
137
  st.warning(content['emotions_label_1'][st.session_state.lang] +
138
- str(st.session_state.emotions[0]['label']) +
139
  content['emotions_label_2'][st.session_state.lang]
140
- str(round(st.session_state.emotions[0]['score'] * 100, 2)) +
141
  content['emotions_label_3'][st.session_state.lang] +
142
  content['emotions_label_4'][st.session_state.lang], icon = "⚠️")
143
  else:
144
  st.success(content['emotions_label_1'][st.session_state.lang] +
145
- str(st.session_state.emotions[0]['label']) +
146
  content['emotions_label_2'][st.session_state.lang]
147
- str(round(st.session_state.emotions[0]['score'] * 100, 2)) +
148
  content['emotions_label_3'][st.session_state.lang], icon="✅")
149
 
150
 
 
57
  st.session_state.untrue_detector_probability = 1
58
 
59
  st.session_state.bert_disinfo_result = [{'label': '', 'score': 1}]
60
+ st.session_state.emotions_result = [{'label': '', 'score': 1}]
61
 
62
  content = load_content()
63
  if 'loaded' not in st.session_state:
 
102
  st.session_state.untrue_detector_probability = max(st.session_state.untrue_detector_probability[0], st.session_state.untrue_detector_probability[1])
103
 
104
  st.session_state.bert_disinfo_result = st.session_state.bert_disinfo(user_input)
105
+ st.session_state.emotions_result = st.session_state.emotions(user_input)
106
 
107
 
108
 
 
133
  str(round(st.session_state.bert_disinfo_result[0]['score'] * 100, 2)) +
134
  content['bert_no_2'][st.session_state.lang], icon="✅")
135
 
136
+ if st.session_state.emotions_result[0]['score'] < 0.97:
137
  st.warning(content['emotions_label_1'][st.session_state.lang] +
138
+ str(st.session_state.emotions_result[0]['label']) +
139
  content['emotions_label_2'][st.session_state.lang]
140
+ str(round(st.session_state.emotions_result[0]['score'] * 100, 2)) +
141
  content['emotions_label_3'][st.session_state.lang] +
142
  content['emotions_label_4'][st.session_state.lang], icon = "⚠️")
143
  else:
144
  st.success(content['emotions_label_1'][st.session_state.lang] +
145
+ str(st.session_state.emotions_result[0]['label']) +
146
  content['emotions_label_2'][st.session_state.lang]
147
+ str(round(st.session_state.emotions_result[0]['score'] * 100, 2)) +
148
  content['emotions_label_3'][st.session_state.lang], icon="✅")
149
 
150