Adityaganesh commited on
Commit
7d8a652
·
verified ·
1 Parent(s): 7f875d5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -5
app.py CHANGED
@@ -9,7 +9,7 @@ from nltk.tokenize import word_tokenize
9
  from nltk.corpus import stopwords
10
  from nltk.stem import WordNetLemmatizer
11
  # Download necessary resources
12
- nltk.download('punkt_tab')
13
  nltk.download('stopwords')
14
  nltk.download('wordnet')
15
 
@@ -28,20 +28,26 @@ def set_background(image_path):
28
 
29
  bg_image_style = f"""
30
  <style>
31
- .stApp {{
 
 
 
 
 
 
32
  background-image: url("data:image/png;base64,{encoded_img}");
33
- background-size: 100% 100%;
34
  background-repeat: no-repeat;
35
- background-attachment: fixed;
36
  background-position: center;
37
  filter: blur(6px); /* 60% blur effect */
 
38
  }}
39
  </style>
40
  """
41
  st.markdown(bg_image_style, unsafe_allow_html=True)
42
 
43
  # Update the image path
44
- set_background("Images/News image 1.png") # Ensure the image is in the correct folder
45
 
46
  # Initialize stopwords and lemmatizer
47
  stop_words = set(stopwords.words('english')).union({"pm"})
 
9
  from nltk.corpus import stopwords
10
  from nltk.stem import WordNetLemmatizer
11
  # Download necessary resources
12
+ nltk.download('punkt')
13
  nltk.download('stopwords')
14
  nltk.download('wordnet')
15
 
 
28
 
29
  bg_image_style = f"""
30
  <style>
31
+ .stApp::before {{
32
+ content: "";
33
+ position: fixed;
34
+ top: 0;
35
+ left: 0;
36
+ width: 100%;
37
+ height: 100%;
38
  background-image: url("data:image/png;base64,{encoded_img}");
39
+ background-size: cover;
40
  background-repeat: no-repeat;
 
41
  background-position: center;
42
  filter: blur(6px); /* 60% blur effect */
43
+ z-index: -1;
44
  }}
45
  </style>
46
  """
47
  st.markdown(bg_image_style, unsafe_allow_html=True)
48
 
49
  # Update the image path
50
+ set_background("page/News image 2.png") # Ensure the image is in the correct folder
51
 
52
  # Initialize stopwords and lemmatizer
53
  stop_words = set(stopwords.words('english')).union({"pm"})