AliHaider0343 commited on
Commit
adece70
·
1 Parent(s): e4bc2b6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -69,9 +69,12 @@ threshold = st.slider("Threshold", min_value=0.0, max_value=1.0, step=0.01, valu
69
  if sentence:
70
  processed_sentence = preprocess_query(sentence)
71
  results = predict_aspects(processed_sentence, threshold)
72
- if len(results)>0:
73
  st.write("Predicted Aspects:")
 
74
  for aspect, percentage in results.items():
75
- st.write(f"- {aspect}: {percentage}%")
 
76
  else:
77
  st.write("No aspects above the threshold.")
 
 
69
  if sentence:
70
  processed_sentence = preprocess_query(sentence)
71
  results = predict_aspects(processed_sentence, threshold)
72
+ if len(results) > 0:
73
  st.write("Predicted Aspects:")
74
+ table_data = [["Aspect", "Probability"]]
75
  for aspect, percentage in results.items():
76
+ table_data.append([aspect, f"{percentage}%"])
77
+ st.table(table_data)
78
  else:
79
  st.write("No aspects above the threshold.")
80
+