Adityaganesh commited on
Commit
f52a7f0
·
verified ·
1 Parent(s): fb20dee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -18
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 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
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