IAMTFRMZA commited on
Commit
eebbb84
·
verified ·
1 Parent(s): 545f761
Files changed (1) hide show
  1. main.py +83 -154
main.py CHANGED
@@ -3,34 +3,37 @@ from streamlit_option_menu import option_menu
3
  import streamlit.components.v1 as components
4
  import time
5
  from model import *
6
-
7
-
8
 
9
  if 'model' not in st.session_state:
10
  st.session_state.model = 'Model 1'
11
  def update_radio2():
12
- st.session_state.model=st.session_state.radio2
 
13
  if 'genre' not in st.session_state:
14
- st.session_state.genre=3
15
  def update_num_genre():
16
- st.session_state.genre=st.session_state.num_genre
 
17
  if 'artist' not in st.session_state:
18
- st.session_state.artist=5
19
  def update_same_art():
20
- st.session_state.artist=st.session_state.same_art
 
21
  if 'model2' not in st.session_state:
22
- st.session_state.model2= 'Spotify model'
23
  def update_radio1():
24
- st.session_state.model2 =st.session_state.radio1
25
 
26
  if 'Region' not in st.session_state:
27
- st.session_state.rg="US"
28
  def update_Region():
29
- st.session_state.rg=st.session_state.Region
 
30
  if 'radio' not in st.session_state:
31
- st.session_state.feature="Playlist"
32
  def update_radio0():
33
- st.session_state.feature=st.session_state.radio
34
 
35
  if 'p_url' not in st.session_state:
36
  st.session_state.p_url = 'Example: https://open.spotify.com/playlist/37i9dQZF1DX8FwnYE6PRvL?si=06ff6b38d4124af0'
@@ -47,53 +50,52 @@ if 'a_url' not in st.session_state:
47
  def update_artist_url():
48
  st.session_state.a_url = st.session_state.artist_url
49
 
50
-
51
  def play_recomm():
52
  if 'rs' in st.session_state:
53
- del st.session_state.rs,st.session_state.err
54
  try:
55
  if len(pd.read_csv('Data/new_tracks.csv')) >= 200:
56
  with st.spinner('Updating the dataset...'):
57
- x=update_dataset()
58
  st.success('{} New tracks were added to the dataset.'.format(x))
59
  except:
60
- st.error("The dataset update failed. ")
61
  with st.spinner('Getting Recommendations...'):
62
- res,err = playlist_model(st.session_state.p_url,st.session_state.model,st.session_state.genre,st.session_state.artist)
63
- st.session_state.rs=res
64
- st.session_state.err=err
65
- if len(st.session_state.rs)>=1:
66
  if st.session_state.model == 'Model 1' or st.session_state.model == 'Model 2':
67
  st.success('Go to the Result page to view the top {} recommendations'.format(len(st.session_state.rs)))
68
  else:
69
- st.success('Go to the Result page to view the Spotify recommendations')
70
  else:
71
- st.error('Model failed. Check the log for more information.')
72
 
73
  def art_recomm():
74
  if 'rs' in st.session_state:
75
- del st.session_state.rs,st.session_state.err
76
  with st.spinner('Getting Recommendations...'):
77
- res,err = top_tracks(st.session_state.a_url,st.session_state.rg)
78
- st.session_state.rs=res
79
- st.session_state.err=err
80
- if len(st.session_state.rs)>=1:
81
  st.success("Go to the Result page to view the Artist's top tracks")
82
  else:
83
  st.error('Model failed. Check the log for more information.')
84
 
85
  def song_recomm():
86
  if 'rs' in st.session_state:
87
- del st.session_state.rs,st.session_state.err
88
  with st.spinner('Getting Recommendations...'):
89
- res,err = song_model(st.session_state.s_url,st.session_state.model,st.session_state.genre,st.session_state.artist)
90
- st.session_state.rs=res
91
- st.session_state.err=err
92
- if len(st.session_state.rs)>=1:
93
  if st.session_state.model == 'Model 1' or st.session_state.model == 'Model 2':
94
  st.success('Go to the Result page to view the top {} recommendations'.format(len(st.session_state.rs)))
95
  else:
96
- st.success('Go to the Result page to view the Spotify recommendations')
97
  else:
98
  st.error('Model failed. Check the log for more information.')
99
 
@@ -103,7 +105,6 @@ def playlist_page():
103
  playlist_uri = (st.session_state.playlist_url).split('/')[-1].split('?')[0]
104
  uri_link = 'https://open.spotify.com/embed/playlist/' + playlist_uri
105
  components.iframe(uri_link, height=300)
106
- return
107
 
108
  def song_page():
109
  st.subheader("User Song")
@@ -119,53 +120,46 @@ def artist_page():
119
  uri_link = 'https://open.spotify.com/embed/artist/' + artist_uri
120
  components.iframe(uri_link, height=80)
121
 
122
-
123
  def spr_sidebar():
124
- menu=option_menu(
125
  menu_title=None,
126
- options=['Home','Result','About','Log'],
127
- icons=['house','book','info-square','terminal'],
128
  menu_icon='cast',
129
  default_index=0,
130
  orientation='horizontal'
131
  )
132
- if menu=='Home':
133
  st.session_state.app_mode = 'Home'
134
- elif menu=='Result':
135
  st.session_state.app_mode = 'Result'
136
- elif menu=='About':
137
- st.session_state.app_mode = 'About'
138
- elif menu=='Log':
139
- st.session_state.app_mode = 'Log'
140
-
141
  def home_page():
142
- st.session_state.radio=st.session_state.feature
143
- st.session_state.radio2=st.session_state.model
144
- st.session_state.num_genre=st.session_state.genre
145
- st.session_state.same_art=st.session_state.artist
146
- st.session_state.Region=st.session_state.rg
147
 
148
-
149
  st.title('SpotifAI')
150
- col,col2,col3=st.columns([2,2,3])
151
- radio=col.radio("Feature",options=("Playlist","Song","Artist Top Tracks"),key='radio',on_change=update_radio0)
152
- if radio =="Artist Top Tracks":
153
- radio1=col2.radio("Model",options=["Spotify model"],key='radio1',on_change=update_radio1)
154
- Region=col3.selectbox("Please Choose Region",index=58,key='Region',on_change=update_Region,options=('AD', 'AR', 'AU', 'AT', 'BE', 'BO', 'BR', 'BG', 'CA', 'CL', 'CO', 'CR', 'CY', 'CZ', 'DK', 'DO', 'EC', 'SV', 'EE', 'FI', 'FR', 'DE', 'GR', 'GT', 'HN', 'HK', 'HU', 'IS', 'ID', 'IE', 'IT', 'JP', 'LV', 'LI', 'LT', 'LU', 'MY', 'MT', 'MX', 'MC', 'NL', 'NZ', 'NI', 'NO', 'PA', 'PY', 'PE', 'PH', 'PL', 'PT', 'SG', 'ES', 'SK', 'SE', 'CH', 'TW', 'TR', 'GB', 'US', 'UY'))
155
- elif radio =="Playlist" or radio =="Song" :
156
- radio2=col2.radio("Model",options=("Model 1","Model 2","Spotify Model"),key='radio2',on_change=update_radio2)
157
- if st.session_state.radio2=="Model 1" or st.session_state.radio2=="Model 2":
158
- num_genre=col3.selectbox("choose a number of genres to focus on",options=(1,2,3,4,5,6,7),index=2,key='num_genre',on_change=update_num_genre)
159
- same_art=col3.selectbox("How many recommendations by the same artist",options=(1,2,3,4,5,7,10,15),index=3,key='same_art',on_change=update_same_art)
160
-
161
 
162
  st.markdown("<br>", unsafe_allow_html=True)
163
-
164
- if radio == "Playlist" :
165
  st.session_state.playlist_url = st.session_state.p_url
166
- Url = st.text_input(label="Playlist Url",key='playlist_url',on_change=update_playlist_url)
167
  playlist_page()
168
- state =st.button('Get Recommendations')
169
  with st.expander("Here's how to find any Playlist URL in Spotify"):
170
  st.write("""
171
  - Search for Playlist on the Spotify app
@@ -173,110 +167,49 @@ def home_page():
173
  - Click "Share"
174
  - Choose "Copy link to playlist"
175
  """)
176
- st.markdown("<br>", unsafe_allow_html=True)
177
- st.image('spotify_get_playlist_url.png')
178
  if state:
179
  play_recomm()
180
- elif radio == "Song" :
181
  st.session_state.song_url = st.session_state.s_url
182
- Url = st.text_input(label="Song Url",key='song_url',on_change=update_song_url)
183
  song_page()
184
- state =st.button('Get Recommendations')
185
  with st.expander("Here's how to find any Song URL in Spotify"):
186
  st.write("""
187
  - Search for Song on the Spotify app
188
  - Right Click on the Song you like
189
  - Click "Share"
190
- - Choose "Copy link to Song"
191
  """)
192
- st.markdown("<br>", unsafe_allow_html=True)
193
- st.image('spotify_get_song_url.png')
194
  if state:
195
  song_recomm()
196
- elif radio == "Artist Top Tracks" :
197
  st.session_state.artist_url = st.session_state.a_url
198
- Url = st.text_input(label="Artist Url",key='artist_url',on_change=update_artist_url)
199
  artist_page()
200
- state =st.button('Get Recommendations')
201
  with st.expander("Here's how to find any Artist URL in Spotify"):
202
  st.write("""
203
  - Search for Artist on the Spotify app
204
  - Right Click on the Artist you like
205
  - Click "Share"
206
- - Choose "Copy link to Artist"
207
  """)
208
- st.markdown("<br>", unsafe_allow_html=True)
209
- st.image('spotify_get_artist_url.png')
210
  if state:
211
  art_recomm()
212
-
213
- def result_page():
214
- if 'rs' not in st.session_state:
215
- st.error('Please select a model on the Home page and run Get Recommendations')
216
- else:
217
- st.success('Top {} recommendations'.format(len(st.session_state.rs)))
218
- i=0
219
- for uri in st.session_state.rs:
220
- uri_link = "https://open.spotify.com/embed/track/" + uri + "?utm_source=generator&theme=0"
221
- components.iframe(uri_link, height=80)
222
- i+=1
223
- if i%5==0:
224
- time.sleep(1)
225
- def Log_page():
226
- log=st.checkbox('Display Output', True, key='display_output')
227
- if log == True:
228
- if 'err' in st.session_state:
229
- st.write(st.session_state.err)
230
- with open('Data/streamlit.csv') as f:
231
- st.download_button('Download Dataset', f,file_name='streamlit.csv')
232
- def About_page():
233
- st.header('Development')
234
- """
235
- Check out the [repository](https://github.com/abdelrhmanelruby/Spotify-Recommendation-System) for the source code and approaches, and don't hesitate to contact me if you have any questions. I'm excited to read your review.
236
- [Github](https://github.com/abdelrhmanelruby) [Linkedin](https://www.linkedin.com/in/abdelrhmanelruby/) Email : [email protected]
237
- """
238
- st.subheader('Spotify Million Playlist Dataset')
239
- """
240
- For this project, I'm using the Million Playlist Dataset, which, as its name implies, consists of one million playlists.
241
- contains a number of songs, and some metadata is included as well, such as the name of the playlist, duration, number of songs, number of artists, etc.
242
- """
243
-
244
- """
245
- It is created by sampling playlists from the billions of playlists that Spotify users have created over the years.
246
- Playlists that meet the following criteria were selected at random:
247
- - Created by a user that resides in the United States and is at least 13 years old
248
- - Was a public playlist at the time the MPD was generated
249
- - Contains at least 5 tracks
250
- - Contains no more than 250 tracks
251
- - Contains at least 3 unique artists
252
- - Contains at least 2 unique albums
253
- - Has no local tracks (local tracks are non-Spotify tracks that a user has on their local device
254
- - Has at least one follower (not including the creator
255
- - Was created after January 1, 2010 and before December 1, 2017
256
- - Does not have an offensive title
257
- - Does not have an adult-oriented title if the playlist was created by a user under 18 years of age
258
 
259
- Information about the Dataset [here](https://www.aicrowd.com/challenges/spotify-million-playlist-dataset-challenge)
260
- """
261
- st.subheader('Audio Features Explanation')
262
- """
263
- | Variable | Description |
264
- | :----: | :---: |
265
- | Acousticness | A confidence measure from 0.0 to 1.0 of whether the track is acoustic. 1.0 represents high confidence the track is acoustic. |
266
- | Danceability | Danceability describes how suitable a track is for dancing based on a combination of musical elements including tempo, rhythm stability, beat strength, and overall regularity. A value of 0.0 is least danceable and 1.0 is most danceable. |
267
- | Energy | Energy is a measure from 0.0 to 1.0 and represents a perceptual measure of intensity and activity. Typically, energetic tracks feel fast, loud, and noisy. For example, death metal has high energy, while a Bach prelude scores low on the scale. Perceptual features contributing to this attribute include dynamic range, perceived loudness, timbre, onset rate, and general entropy. |
268
- | Instrumentalness | Predicts whether a track contains no vocals. "Ooh" and "aah" sounds are treated as instrumental in this context. Rap or spoken word tracks are clearly "vocal". The closer the instrumentalness value is to 1.0, the greater likelihood the track contains no vocal content. Values above 0.5 are intended to represent instrumental tracks, but confidence is higher as the value approaches 1.0. |
269
- | Key | The key the track is in. Integers map to pitches using standard Pitch Class notation. E.g. 0 = C, 1 = C♯/D♭, 2 = D, and so on. If no key was detected, the value is -1. |
270
- | Liveness | Detects the presence of an audience in the recording. Higher liveness values represent an increased probability that the track was performed live. A value above 0.8 provides strong likelihood that the track is live. |
271
- | Loudness | The overall loudness of a track in decibels (dB). Loudness values are averaged across the entire track and are useful for comparing relative loudness of tracks. Loudness is the quality of a sound that is the primary psychological correlate of physical strength (amplitude). Values typically range between -60 and 0 db. |
272
- | Mode | Mode indicates the modality (major or minor) of a track, the type of scale from which its melodic content is derived. Major is represented by 1 and minor is 0. |
273
- | Speechiness | Speechiness detects the presence of spoken words in a track. The more exclusively speech-like the recording (e.g. talk show, audio book, poetry), the closer to 1.0 the attribute value. Values above 0.66 describe tracks that are probably made entirely of spoken words. Values between 0.33 and 0.66 describe tracks that may contain both music and speech, either in sections or layered, including such cases as rap music. Values below 0.33 most likely represent music and other non-speech-like tracks. |
274
- | Tempo | The overall estimated tempo of a track in beats per minute (BPM). In musical terminology, tempo is the speed or pace of a given piece and derives directly from the average beat duration. |
275
- | Time Signature | An estimated time signature. The time signature (meter) is a notational convention to specify how many beats are in each bar (or measure). The time signature ranges from 3 to 7 indicating time signatures of "3/4", to "7/4". |
276
- | Valence | A measure from 0.0 to 1.0 describing the musical positiveness conveyed by a track. Tracks with high valence sound more positive (e.g. happy, cheerful, euphoric), while tracks with low valence sound more negative (e.g. sad, depressed, angry). |
277
-
278
- Information about features: [here](https://developer.spotify.com/documentation/web-api/reference/#/operations/get-audio-features)
279
- """
280
 
281
  def main():
282
  spr_sidebar()
@@ -284,10 +217,6 @@ def main():
284
  home_page()
285
  if st.session_state.app_mode == 'Result':
286
  result_page()
287
- if st.session_state.app_mode == 'About' :
288
- About_page()
289
- if st.session_state.app_mode == 'Log':
290
- Log_page()
291
- # Run main()
292
  if __name__ == '__main__':
293
- main()
 
3
  import streamlit.components.v1 as components
4
  import time
5
  from model import *
6
+ import pandas as pd # Make sure to import pandas if you're using it
 
7
 
8
  if 'model' not in st.session_state:
9
  st.session_state.model = 'Model 1'
10
  def update_radio2():
11
+ st.session_state.model = st.session_state.radio2
12
+
13
  if 'genre' not in st.session_state:
14
+ st.session_state.genre = 3
15
  def update_num_genre():
16
+ st.session_state.genre = st.session_state.num_genre
17
+
18
  if 'artist' not in st.session_state:
19
+ st.session_state.artist = 5
20
  def update_same_art():
21
+ st.session_state.artist = st.session_state.same_art
22
+
23
  if 'model2' not in st.session_state:
24
+ st.session_state.model2 = 'Spotify model'
25
  def update_radio1():
26
+ st.session_state.model2 = st.session_state.radio1
27
 
28
  if 'Region' not in st.session_state:
29
+ st.session_state.rg = "US"
30
  def update_Region():
31
+ st.session_state.rg = st.session_state.Region
32
+
33
  if 'radio' not in st.session_state:
34
+ st.session_state.feature = "Playlist"
35
  def update_radio0():
36
+ st.session_state.feature = st.session_state.radio
37
 
38
  if 'p_url' not in st.session_state:
39
  st.session_state.p_url = 'Example: https://open.spotify.com/playlist/37i9dQZF1DX8FwnYE6PRvL?si=06ff6b38d4124af0'
 
50
  def update_artist_url():
51
  st.session_state.a_url = st.session_state.artist_url
52
 
 
53
  def play_recomm():
54
  if 'rs' in st.session_state:
55
+ del st.session_state.rs, st.session_state.err
56
  try:
57
  if len(pd.read_csv('Data/new_tracks.csv')) >= 200:
58
  with st.spinner('Updating the dataset...'):
59
+ x = update_dataset()
60
  st.success('{} New tracks were added to the dataset.'.format(x))
61
  except:
62
+ st.error("The dataset update failed.")
63
  with st.spinner('Getting Recommendations...'):
64
+ res, err = playlist_model(st.session_state.p_url, st.session_state.model, st.session_state.genre, st.session_state.artist)
65
+ st.session_state.rs = res
66
+ st.session_state.err = err
67
+ if len(st.session_state.rs) >= 1:
68
  if st.session_state.model == 'Model 1' or st.session_state.model == 'Model 2':
69
  st.success('Go to the Result page to view the top {} recommendations'.format(len(st.session_state.rs)))
70
  else:
71
+ st.success('Go to the Result page to view the Spotify recommendations')
72
  else:
73
+ st.error('Model failed. Check the log for more information.')
74
 
75
  def art_recomm():
76
  if 'rs' in st.session_state:
77
+ del st.session_state.rs, st.session_state.err
78
  with st.spinner('Getting Recommendations...'):
79
+ res, err = top_tracks(st.session_state.a_url, st.session_state.rg)
80
+ st.session_state.rs = res
81
+ st.session_state.err = err
82
+ if len(st.session_state.rs) >= 1:
83
  st.success("Go to the Result page to view the Artist's top tracks")
84
  else:
85
  st.error('Model failed. Check the log for more information.')
86
 
87
  def song_recomm():
88
  if 'rs' in st.session_state:
89
+ del st.session_state.rs, st.session_state.err
90
  with st.spinner('Getting Recommendations...'):
91
+ res, err = song_model(st.session_state.s_url, st.session_state.model, st.session_state.genre, st.session_state.artist)
92
+ st.session_state.rs = res
93
+ st.session_state.err = err
94
+ if len(st.session_state.rs) >= 1:
95
  if st.session_state.model == 'Model 1' or st.session_state.model == 'Model 2':
96
  st.success('Go to the Result page to view the top {} recommendations'.format(len(st.session_state.rs)))
97
  else:
98
+ st.success('Go to the Result page to view the Spotify recommendations')
99
  else:
100
  st.error('Model failed. Check the log for more information.')
101
 
 
105
  playlist_uri = (st.session_state.playlist_url).split('/')[-1].split('?')[0]
106
  uri_link = 'https://open.spotify.com/embed/playlist/' + playlist_uri
107
  components.iframe(uri_link, height=300)
 
108
 
109
  def song_page():
110
  st.subheader("User Song")
 
120
  uri_link = 'https://open.spotify.com/embed/artist/' + artist_uri
121
  components.iframe(uri_link, height=80)
122
 
 
123
  def spr_sidebar():
124
+ menu = option_menu(
125
  menu_title=None,
126
+ options=['Home', 'Result'], # Removed 'About' and 'Log'
127
+ icons=['house', 'book'],
128
  menu_icon='cast',
129
  default_index=0,
130
  orientation='horizontal'
131
  )
132
+ if menu == 'Home':
133
  st.session_state.app_mode = 'Home'
134
+ elif menu == 'Result':
135
  st.session_state.app_mode = 'Result'
136
+
 
 
 
 
137
  def home_page():
138
+ st.session_state.radio = st.session_state.feature
139
+ st.session_state.radio2 = st.session_state.model
140
+ st.session_state.num_genre = st.session_state.genre
141
+ st.session_state.same_art = st.session_state.artist
142
+ st.session_state.Region = st.session_state.rg
143
 
 
144
  st.title('SpotifAI')
145
+ col, col2, col3 = st.columns([2, 2, 3])
146
+ radio = col.radio("Feature", options=("Playlist", "Song", "Artist Top Tracks"), key='radio', on_change=update_radio0)
147
+ if radio == "Artist Top Tracks":
148
+ radio1 = col2.radio("Model", options=["Spotify model"], key='radio1', on_change=update_radio1)
149
+ Region = col3.selectbox("Please Choose Region", index=58, key='Region', on_change=update_Region, options=('AD', 'AR', 'AU', 'AT', 'BE', 'BO', 'BR', 'BG', 'CA', 'CL', 'CO', 'CR', 'CY', 'CZ', 'DK', 'DO', 'EC', 'SV', 'EE', 'FI', 'FR', 'DE', 'GR', 'GT', 'HN', 'HK', 'HU', 'IS', 'ID', 'IE', 'IT', 'JP', 'LV', 'LI', 'LT', 'LU', 'MY', 'MT', 'MX', 'MC', 'NL', 'NZ', 'NI', 'NO', 'PA', 'PY', 'PE', 'PH', 'PL', 'PT', 'SG', 'ES', 'SK', 'SE', 'CH', 'TW', 'TR', 'GB', 'US', 'UY'))
150
+ elif radio == "Playlist" or radio == "Song":
151
+ radio2 = col2.radio("Model", options=("Model 1", "Model 2", "Spotify Model"), key='radio2', on_change=update_radio2)
152
+ if st.session_state.radio2 == "Model 1" or st.session_state.radio2 == "Model 2":
153
+ num_genre = col3.selectbox("choose a number of genres to focus on", options=(1, 2, 3, 4, 5, 6, 7), index=2, key='num_genre', on_change=update_num_genre)
154
+ same_art = col3.selectbox("How many recommendations by the same artist", options=(1, 2, 3, 4, 5, 7, 10, 15), index=3, key='same_art', on_change=update_same_art)
 
155
 
156
  st.markdown("<br>", unsafe_allow_html=True)
157
+
158
+ if radio == "Playlist":
159
  st.session_state.playlist_url = st.session_state.p_url
160
+ Url = st.text_input(label="Playlist Url", key='playlist_url', on_change=update_playlist_url)
161
  playlist_page()
162
+ state = st.button('Get Recommendations')
163
  with st.expander("Here's how to find any Playlist URL in Spotify"):
164
  st.write("""
165
  - Search for Playlist on the Spotify app
 
167
  - Click "Share"
168
  - Choose "Copy link to playlist"
169
  """)
 
 
170
  if state:
171
  play_recomm()
172
+ elif radio == "Song":
173
  st.session_state.song_url = st.session_state.s_url
174
+ Url = st.text_input(label="Song Url", key='song_url', on_change=update_song_url)
175
  song_page()
176
+ state = st.button('Get Recommendations')
177
  with st.expander("Here's how to find any Song URL in Spotify"):
178
  st.write("""
179
  - Search for Song on the Spotify app
180
  - Right Click on the Song you like
181
  - Click "Share"
182
+ - Choose "Copy link to song"
183
  """)
 
 
184
  if state:
185
  song_recomm()
186
+ elif radio == "Artist Top Tracks":
187
  st.session_state.artist_url = st.session_state.a_url
188
+ Url = st.text_input(label="Artist Url", key='artist_url', on_change=update_artist_url)
189
  artist_page()
190
+ state = st.button('Get Recommendations')
191
  with st.expander("Here's how to find any Artist URL in Spotify"):
192
  st.write("""
193
  - Search for Artist on the Spotify app
194
  - Right Click on the Artist you like
195
  - Click "Share"
196
+ - Choose "Copy link to artist"
197
  """)
 
 
198
  if state:
199
  art_recomm()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
200
 
201
+ def result_page():
202
+ if 'rs' in st.session_state:
203
+ df = st.session_state.rs
204
+ if st.session_state.radio == "Playlist":
205
+ st.subheader("Playlist Recommendations")
206
+ elif st.session_state.radio == "Song":
207
+ st.subheader("Song Recommendations")
208
+ elif st.session_state.radio == "Artist Top Tracks":
209
+ st.subheader("Artist Top Tracks Recommendations")
210
+ else:
211
+ st.subheader("Recommendations")
212
+ st.dataframe(df)
 
 
 
 
 
 
 
 
 
213
 
214
  def main():
215
  spr_sidebar()
 
217
  home_page()
218
  if st.session_state.app_mode == 'Result':
219
  result_page()
220
+
 
 
 
 
221
  if __name__ == '__main__':
222
+ main()