Duy-Anh Dang commited on
Commit
c661d94
·
1 Parent(s): c410c07

write bottome text

Browse files
Files changed (1) hide show
  1. app.py +30 -36
app.py CHANGED
@@ -212,13 +212,6 @@ with st.expander('Adjust your tone intensities for your preference: '):
212
 
213
  Loxz_recom_box = st.checkbox('Select Loxz Recommended Tones for Optimal Output')
214
 
215
- chart_position = st.empty()
216
- chart_position2 = st.empty()
217
-
218
- with chart_position.container():
219
- WHITE_SPACE(10)
220
- with chart_position2.container():
221
- WHITE_SPACE(10)
222
  if st.button('Generate Predictions'):
223
 
224
  start_time = time.time()
@@ -253,41 +246,42 @@ if st.button('Generate Predictions'):
253
  y=['Joyful', 'Confident', 'Urgent', 'Friendly', 'Optimistic', 'Analytical', 'Casual'],
254
  orientation='h')
255
  )
256
- with chart_position.container():
257
- st.plotly_chart(fig1, use_container_width=True)
258
 
259
  #if((best_target!=0) and (pred<best_target)):
260
  if Loxz_recom_box == True:
261
  recommended_changes=(best_target_tones)
262
  change=best_target-pred
263
  #recommend(tones,recommended_changes,change,target)
264
- with chart_position2.container():
265
- fig2 = go.Figure()
266
- fig2.add_trace(go.Bar(
267
- y=tone_labels,
268
- x=recommended_changes,
269
- name='Recommend changes',
270
- orientation='h',
271
- text=np.round(recommended_changes,3),
272
- width=.5,
273
- marker=dict(
274
- color='#e60f00',
275
- line=dict(color='rgba(58, 71, 80, 1.0)', width=1)))
276
- )
277
- fig2.update_traces(textfont_size=18, textposition="outside", cliponaxis=False)
278
- if target == 'Revenue_Per_Email':
279
- out = f"${round(change,2)}"
280
- st.write("The output will be between the range " + str(round(lower,2)) + ' and ' + str(round(upper,2)))
281
- st.write("The Predicted "+str(target) +" is "+ str(round(pred,2)))
282
- else:
283
- out = f"{round(change,2)*100}%"
284
- st.write("The output will be between the range " + str(round(lower,2) * 100) + ' and ' + str(round(upper,2) *100))
285
- st.write("The Predicted "+str(target) +" is "+ str(round(pred,2)*100))
286
- fig2.update_layout(title_text=f'The following Changes will yield a {out} increase in {target}')
287
-
288
- st.plotly_chart(fig2, use_container_width=True)
289
- #FunctionsModelSA_V1.corrections(best_target_tones,test_predictions))
290
 
291
- placeholder.empty()
 
 
 
292
 
 
 
293
 
 
212
 
213
  Loxz_recom_box = st.checkbox('Select Loxz Recommended Tones for Optimal Output')
214
 
 
 
 
 
 
 
 
215
  if st.button('Generate Predictions'):
216
 
217
  start_time = time.time()
 
246
  y=['Joyful', 'Confident', 'Urgent', 'Friendly', 'Optimistic', 'Analytical', 'Casual'],
247
  orientation='h')
248
  )
249
+
250
+ st.plotly_chart(fig1, use_container_width=True)
251
 
252
  #if((best_target!=0) and (pred<best_target)):
253
  if Loxz_recom_box == True:
254
  recommended_changes=(best_target_tones)
255
  change=best_target-pred
256
  #recommend(tones,recommended_changes,change,target)
257
+ fig2 = go.Figure()
258
+ fig2.add_trace(go.Bar(
259
+ y=tone_labels,
260
+ x=recommended_changes,
261
+ name='Recommend changes',
262
+ orientation='h',
263
+ text=np.round(recommended_changes,3),
264
+ width=.5,
265
+ marker=dict(
266
+ color='#e60f00',
267
+ line=dict(color='rgba(58, 71, 80, 1.0)', width=1)))
268
+ )
269
+ fig2.update_traces(textfont_size=18, textposition="outside", cliponaxis=False)
270
+ if target == 'Revenue_Per_Email':
271
+ out = f"${round(change,2)}"
272
+ st.write("The output will be between the range " + str(round(lower,2)) + ' and ' + str(round(upper,2)))
273
+ st.write("The Predicted "+str(target) +" is "+ str(round(pred,2)))
274
+ else:
275
+ out = f"{round(change,2)*100}%"
276
+ st.write("The output will be between the range " + str(round(lower,2) * 100) + ' and ' + str(round(upper,2) *100))
277
+ st.write("The Predicted "+str(target) +" is "+ str(round(pred,2)*100))
278
+ fig2.update_layout(title_text=f'The following Changes will yield a {out} increase in {target}')
 
 
 
 
279
 
280
+ st.plotly_chart(fig2, use_container_width=True)
281
+ #FunctionsModelSA_V1.corrections(best_target_tones,test_predictions))
282
+
283
+ placeholder.empty()
284
 
285
+ WHITE_SPACE(10)
286
+ st.write('hi')
287