rushankg commited on
Commit
2815635
·
1 Parent(s): 94fc387

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -26,13 +26,15 @@ def recommend(index):
26
  return list(sorted_final.keys())
27
 
28
  st.set_page_config(page_title='DiscoverCourses', page_icon=':bird:')
 
 
29
 
30
- container = st.container()
31
- container.title('DiscoverCourses')
32
 
33
- selected_course = container.selectbox('Pick a course',course_title_list)
 
34
 
35
- if container.button('Recommend by title'):
36
  output=recommend(np.where((coursedf['ref']+": "+coursedf['title']) == selected_course)[0][0])
37
  for result in output:
38
  index=np.where(coursedf['title'] == result)[0][0]
@@ -44,7 +46,7 @@ if container.button('Recommend by title'):
44
  st.markdown(link, unsafe_allow_html=True)
45
  st.divider()
46
 
47
- if container.button('Recommend by description'):
48
  index_new=np.where((coursedf['ref']+": "+coursedf['title']) == selected_course)[0][0]
49
  rec_list=course_df_new.iloc[index_new,2]
50
  for result in rec_list:
 
26
  return list(sorted_final.keys())
27
 
28
  st.set_page_config(page_title='DiscoverCourses', page_icon=':bird:')
29
+ st.title('DiscoverCourses')
30
+ st.write('© 2023 Rushank Goyal. All rights reserved.')
31
 
32
+ selected_course = st.selectbox('Pick a course',course_title_list)
 
33
 
34
+ container = st.container()
35
+ maincol1, maincol2 = container.columns([4, 1])
36
 
37
+ if maincol1.button('Recommend by title'):
38
  output=recommend(np.where((coursedf['ref']+": "+coursedf['title']) == selected_course)[0][0])
39
  for result in output:
40
  index=np.where(coursedf['title'] == result)[0][0]
 
46
  st.markdown(link, unsafe_allow_html=True)
47
  st.divider()
48
 
49
+ if maincol2.button('Recommend by description'):
50
  index_new=np.where((coursedf['ref']+": "+coursedf['title']) == selected_course)[0][0]
51
  rec_list=course_df_new.iloc[index_new,2]
52
  for result in rec_list: