Phaneendrabayi commited on
Commit
c6a669d
Β·
verified Β·
1 Parent(s): 7a37be3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -53,10 +53,19 @@ if st.button("πŸš€ Predict Tags"):
53
  predicted_tags = mlb.inverse_transform(y_pred_bin)
54
 
55
  # Show tags
 
56
  st.subheader("πŸ“Œ Predicted Tags:")
57
  if predicted_tags and predicted_tags[0]:
 
58
  for tag in predicted_tags[0]:
59
- st.markdown(f"<span style='color:white; background-color:#4CAF50; padding:6px 12px; border-radius:15px; margin:4px; display:inline-block;'>{tag}</span>", unsafe_allow_html=True)
 
 
 
 
 
 
 
60
  else:
61
  st.info("πŸ€” The model couldn't find relevant tags for the input.")
62
 
 
53
  predicted_tags = mlb.inverse_transform(y_pred_bin)
54
 
55
  # Show tags
56
+ # Show predicted tags
57
  st.subheader("πŸ“Œ Predicted Tags:")
58
  if predicted_tags and predicted_tags[0]:
59
+ tag_string = ", ".join(predicted_tags[0])
60
  for tag in predicted_tags[0]:
61
+ st.markdown(
62
+ f"<span style='color:white; background-color:#4CAF50; padding:6px 12px; border-radius:15px; margin:4px; display:inline-block;'>{tag}</span>",
63
+ unsafe_allow_html=True
64
+ )
65
+
66
+ # Copyable tag box
67
+ st.markdown("#### πŸ“‹ Copy Tags")
68
+ st.code(tag_string, language='text') # This is auto-copyable in Streamlit
69
  else:
70
  st.info("πŸ€” The model couldn't find relevant tags for the input.")
71