Update app.py
Browse files
app.py
CHANGED
|
@@ -51,7 +51,25 @@ 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
st.title("News Classification App")
|
| 56 |
|
| 57 |
# User input
|
|
|
|
| 51 |
category_idx = np.argmax(prediction, axis=1)[0]
|
| 52 |
return label_encoder.inverse_transform([category_idx])[0]
|
| 53 |
|
| 54 |
+
# Streamlit UI with Custom Background
|
| 55 |
+
page_bg_img = '''
|
| 56 |
+
<style>
|
| 57 |
+
body {
|
| 58 |
+
background-image: url("News image 2");
|
| 59 |
+
background-size: cover;
|
| 60 |
+
background-position: center;
|
| 61 |
+
background-repeat: no-repeat;
|
| 62 |
+
}
|
| 63 |
+
.stApp {
|
| 64 |
+
background: rgba(255, 255, 255, 0.8);
|
| 65 |
+
padding: 20px;
|
| 66 |
+
border-radius: 10px;
|
| 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
|