baobuiquang commited on
Commit
c0fa8f1
1 Parent(s): c587cbe

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -9
app.py CHANGED
@@ -244,12 +244,20 @@ def chatbot_mechanism(message, history, additional_input_1):
244
 
245
  # Just add some text to warn users
246
  eval_text_1 = ""
 
247
  eval_text_2 = ""
248
  eval_text_sub_title = ""
 
 
 
 
 
249
  if x_score <= 0.865 or y_score <= 0.865:
250
  eval_text_sub_title = "Cảnh báo:"
251
- eval_text_1 = "⚠️ Độ tương quan thấp ⚠️"
252
- eval_text_2 = "opacity: 0.5;"
 
 
253
 
254
  # Score display
255
  x_score_display = str(round((x_score - 0.8) / (1.0 - 0.8) * 100, 1))
@@ -262,7 +270,7 @@ def chatbot_mechanism(message, history, additional_input_1):
262
  final_output_message = f"\
263
  <div style='{eval_text_2}'>\
264
  <div style='color: gray; font-size: 80%; font-family: courier, monospace; margin-top: 6px;'>\
265
- Đặc trưng trích xuất được (vector trong dữ liệu):\
266
  </div>\
267
  • {x_text}<br>\
268
  • {y_text if extra_information_for_special_cases_flag == False else extra_information_for_special_cases}<br>\
@@ -275,13 +283,13 @@ def chatbot_mechanism(message, history, additional_input_1):
275
  </div>\
276
  Độ tương quan: [x={x_score_display}%, y={y_score_display}%]<br>\
277
  </div>\
278
- <div style='color: gray; font-size: 80%; font-family: courier, monospace; margin-top: 6px;'>\
279
- {eval_text_sub_title}\
280
- </div>\
281
- <div style='color: red; font-weight: bold;'>\
282
- {eval_text_1}\
283
- </div>\
284
  "
 
 
 
 
 
 
285
  # <div style='color: gray; font-size: 80%; font-family: courier, monospace; margin-top: 6px;'>\
286
  # Kết quả:\
287
  # </div>\
 
244
 
245
  # Just add some text to warn users
246
  eval_text_1 = ""
247
+ eval_text_color = ""
248
  eval_text_2 = ""
249
  eval_text_sub_title = ""
250
+ if x_score <= 0.875 or y_score <= 0.875:
251
+ eval_text_sub_title = "Cảnh báo:"
252
+ eval_text_1 = "Độ tương quan thấp"
253
+ eval_text_2 = "opacity: 0.9;"
254
+ eval_text_color = "orange"
255
  if x_score <= 0.865 or y_score <= 0.865:
256
  eval_text_sub_title = "Cảnh báo:"
257
+ eval_text_1 = "⚠️ Độ tương quan rất thấp ⚠️"
258
+ eval_text_2 = "opacity: 0.8;"
259
+ eval_text_color = "red"
260
+
261
 
262
  # Score display
263
  x_score_display = str(round((x_score - 0.8) / (1.0 - 0.8) * 100, 1))
 
270
  final_output_message = f"\
271
  <div style='{eval_text_2}'>\
272
  <div style='color: gray; font-size: 80%; font-family: courier, monospace; margin-top: 6px;'>\
273
+ Đặc trưng trích xuất được (vector trong dữ liệu):\
274
  </div>\
275
  • {x_text}<br>\
276
  • {y_text if extra_information_for_special_cases_flag == False else extra_information_for_special_cases}<br>\
 
283
  </div>\
284
  Độ tương quan: [x={x_score_display}%, y={y_score_display}%]<br>\
285
  </div>\
 
 
 
 
 
 
286
  "
287
+ # <div style='color: gray; font-size: 80%; font-family: courier, monospace; margin-top: 6px;'>\
288
+ # {eval_text_sub_title}\
289
+ # </div>\
290
+ # <div style='color: {eval_text_color}; font-weight: bold;'>\
291
+ # {eval_text_1}\
292
+ # </div>\
293
  # <div style='color: gray; font-size: 80%; font-family: courier, monospace; margin-top: 6px;'>\
294
  # Kết quả:\
295
  # </div>\