Mhassanen commited on
Commit
82ce13f
·
verified ·
1 Parent(s): fa69787

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -2
app.py CHANGED
@@ -53,7 +53,12 @@ if option == "Text":
53
  predicted_class = predict_class(combined_text)
54
  if predicted_class is not None:
55
  class_labels = ["Level 1", "Level 2", "Level 3", "Level 4"]
56
- st.text(f"Predicted Class: {class_labels[predicted_class]}")
 
 
 
 
 
57
 
58
  elif option == "PDF":
59
  uploaded_file = st.file_uploader("Upload a PDF file", type=["pdf"])
@@ -74,4 +79,9 @@ elif option == "PDF":
74
  predicted_class = predict_class(file_text)
75
  if predicted_class is not None:
76
  class_labels = ["Level 1", "Level 2", "Level 3", "Level 4"]
77
- st.text(f"Predicted Class: {class_labels[predicted_class]}")
 
 
 
 
 
 
53
  predicted_class = predict_class(combined_text)
54
  if predicted_class is not None:
55
  class_labels = ["Level 1", "Level 2", "Level 3", "Level 4"]
56
+ st.text("Predicted Classes:")
57
+ for i, label in enumerate(class_labels):
58
+ if i == predicted_class:
59
+ st.text(f"[**{label}**]")
60
+ else:
61
+ st.text(label)
62
 
63
  elif option == "PDF":
64
  uploaded_file = st.file_uploader("Upload a PDF file", type=["pdf"])
 
79
  predicted_class = predict_class(file_text)
80
  if predicted_class is not None:
81
  class_labels = ["Level 1", "Level 2", "Level 3", "Level 4"]
82
+ st.text("Predicted Classes:")
83
+ for i, label in enumerate(class_labels):
84
+ if i == predicted_class:
85
+ st.text(f"[**{label}**]")
86
+ else:
87
+ st.text(label)