Update app.py
Browse files
app.py
CHANGED
|
@@ -11,7 +11,7 @@ from nltk.corpus import stopwords
|
|
| 11 |
from tensorflow.keras.preprocessing.sequence import pad_sequences
|
| 12 |
|
| 13 |
# Ensure necessary downloads
|
| 14 |
-
nltk.download('
|
| 15 |
nltk.download('stopwords')
|
| 16 |
nltk.download('wordnet')
|
| 17 |
|
|
@@ -51,7 +51,7 @@ def predict_category(text):
|
|
| 51 |
category_idx = np.argmax(prediction, axis=1)[0]
|
| 52 |
return label_encoder.inverse_transform([category_idx])[0]
|
| 53 |
|
| 54 |
-
# ✅ Set Background Image
|
| 55 |
image_path = "News image 2.png" # Ensure this image is inside the app directory
|
| 56 |
|
| 57 |
page_bg_img = f"""
|
|
@@ -59,13 +59,6 @@ page_bg_img = f"""
|
|
| 59 |
.stApp {{
|
| 60 |
background: url('{image_path}') no-repeat center center fixed;
|
| 61 |
background-size: cover;
|
| 62 |
-
filter: blur(8px); /* Adjust blur level */
|
| 63 |
-
}}
|
| 64 |
-
|
| 65 |
-
.st-emotion-cache-10trblm {{
|
| 66 |
-
background: rgba(255, 255, 255, 0.8); /* Makes content readable */
|
| 67 |
-
padding: 20px;
|
| 68 |
-
border-radius: 10px;
|
| 69 |
}}
|
| 70 |
</style>
|
| 71 |
"""
|
|
|
|
| 11 |
from tensorflow.keras.preprocessing.sequence import pad_sequences
|
| 12 |
|
| 13 |
# Ensure necessary downloads
|
| 14 |
+
nltk.download('punkt')
|
| 15 |
nltk.download('stopwords')
|
| 16 |
nltk.download('wordnet')
|
| 17 |
|
|
|
|
| 51 |
category_idx = np.argmax(prediction, axis=1)[0]
|
| 52 |
return label_encoder.inverse_transform([category_idx])[0]
|
| 53 |
|
| 54 |
+
# ✅ Set Background Image
|
| 55 |
image_path = "News image 2.png" # Ensure this image is inside the app directory
|
| 56 |
|
| 57 |
page_bg_img = f"""
|
|
|
|
| 59 |
.stApp {{
|
| 60 |
background: url('{image_path}') no-repeat center center fixed;
|
| 61 |
background-size: cover;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
}}
|
| 63 |
</style>
|
| 64 |
"""
|