rushankg commited on
Commit
17d7d2e
·
1 Parent(s): 0686ed2

Upload 3 files

Browse files
Files changed (3) hide show
  1. app.py +29 -0
  2. cosine_scores.pkl +3 -0
  3. course_df.pkl +3 -0
app.py ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import pickle
3
+ import pandas as pd
4
+
5
+ cosine_scores = pickle.load(open('cosine_scores.pkl','rb'))
6
+ coursedf = pd.DataFrame(pickle.load(open('course_df.pkl','rb')))
7
+
8
+ course_title_list = courses['title'].to_list()
9
+
10
+ def get_random_course():
11
+ row=courses.sample(1)
12
+ return row['ref'], row['title']
13
+
14
+ def recommend(coursename):
15
+ pairs = {}
16
+
17
+ for i in range(len(coursedf)):
18
+ pairs[coursedf.iloc[i,1]]=cosine_scores[index][i]
19
+
20
+ sorttemp = sorted(pairs.items(), key=lambda x:x[1], reverse=True)
21
+ sorted_final = dict(sorttemp[1:31])
22
+
23
+ return list(sorted_final.keys())
24
+
25
+
26
+ st.set_page_config(page_title='DiscoverCourses', page_icon=':book:')
27
+ st.title('DiscoverCourses')
28
+
29
+ selected_course = st.selectbox('Please select a course',course_title_list)
cosine_scores.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f49c97656d3c2df641600b5560c9c6059dbb388c528b35a5d1d2822df4736d28
3
+ size 258438192
course_df.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a547aaaf1a76a586376e442fa355afc0a3d86ad44b32b3f85e0b4b37d7e1104a
3
+ size 4718547