Update app.py
Browse files
app.py
CHANGED
|
@@ -51,27 +51,26 @@ def predict_category(text):
|
|
| 51 |
category_idx = np.argmax(prediction, axis=1)[0]
|
| 52 |
return label_encoder.inverse_transform([category_idx])[0]
|
| 53 |
|
| 54 |
-
# Streamlit UI with
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
</style>
|
| 69 |
-
'''
|
| 70 |
-
|
| 71 |
-
st.markdown(page_bg_img, unsafe_allow_html=True)
|
| 72 |
|
| 73 |
st.title("News Classification App")
|
| 74 |
|
|
|
|
|
|
|
|
|
|
| 75 |
# User input
|
| 76 |
user_text = st.text_area("Enter your news content for classification.")
|
| 77 |
|
|
|
|
| 51 |
category_idx = np.argmax(prediction, axis=1)[0]
|
| 52 |
return label_encoder.inverse_transform([category_idx])[0]
|
| 53 |
|
| 54 |
+
# Streamlit UI with Background Image
|
| 55 |
+
st.markdown(
|
| 56 |
+
"""
|
| 57 |
+
<style>
|
| 58 |
+
.stApp {
|
| 59 |
+
background-image: url("https://your-image-hosting-url.com/news-image-2.jpg");
|
| 60 |
+
background-size: cover;
|
| 61 |
+
background-position: center;
|
| 62 |
+
background-repeat: no-repeat;
|
| 63 |
+
}
|
| 64 |
+
</style>
|
| 65 |
+
""",
|
| 66 |
+
unsafe_allow_html=True
|
| 67 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
|
| 69 |
st.title("News Classification App")
|
| 70 |
|
| 71 |
+
# Display local image instead (if needed)
|
| 72 |
+
st.image("News image 2", use_column_width=True)
|
| 73 |
+
|
| 74 |
# User input
|
| 75 |
user_text = st.text_area("Enter your news content for classification.")
|
| 76 |
|