Update app.py
Browse files
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(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
|