Mhassanen commited on
Commit
f998f3c
·
verified ·
1 Parent(s): f7be14b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -12
app.py CHANGED
@@ -53,12 +53,7 @@ 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("Predicted Classes:")
57
- for i, label in enumerate(class_labels):
58
- if i == predicted_class:
59
- st.markdown(f'<div style="background-color: #ffa07a; padding: 5px;"><strong>{label}</strong></div>', unsafe_allow_html=True)
60
- else:
61
- st.markdown(f'<div>{label}</div>', unsafe_allow_html=True)
62
 
63
  elif option == "PDF":
64
  uploaded_file = st.file_uploader("Upload a PDF file", type=["pdf"])
@@ -79,9 +74,4 @@ elif option == "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.markdown(f'<div style="background-color: #ffa07a; padding: 5px;"><strong>{label}</strong></div>', unsafe_allow_html=True)
86
- else:
87
- st.markdown(f'<div>{label}</div>', unsafe_allow_html=True)
 
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
  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]}")