yuvaranianandhan24 commited on
Commit
5f312de
โ€ข
1 Parent(s): c71c202

Upload 9 files

Browse files
Files changed (9) hide show
  1. app.py +49 -0
  2. course_list.pkl +3 -0
  3. courses.pkl +3 -0
  4. image2.png +0 -0
  5. image3.png +0 -0
  6. images.png +0 -0
  7. pages/recommend.py +74 -0
  8. requirements.txt +1 -0
  9. similarity.pkl +3 -0
app.py ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from streamlit_extras.switch_page_button import switch_page
3
+ from streamlit_extras.let_it_rain import rain
4
+ from PIL import Image
5
+
6
+
7
+
8
+ st.set_page_config(page_title="CRS",page_icon = "๐Ÿซฐ")
9
+
10
+
11
+
12
+
13
+
14
+ st.markdown("<h1 style='text-align: Left ; color: white;'> COURSE RECOMMENDATION SYSTEM </h1>", unsafe_allow_html=True)
15
+ st.markdown("<h4 style='text-align: center ; color: violet;'> Discover a plethora of courses at your fingertips!</h4>", unsafe_allow_html=True)
16
+
17
+
18
+ #To load image
19
+ img = Image.open(r'C:\Users\Yuva\.vscode\Streamlit dev\images.png')
20
+ image_bytes = img.resize((700,400))
21
+
22
+
23
+ co_1, co_2, co_3 = st.columns(3)
24
+ with co_1:
25
+ st.image(image_bytes, use_column_width=False)
26
+
27
+
28
+
29
+
30
+ # Raining Emoji
31
+
32
+ rain(
33
+ emoji="๐Ÿ•ฎ",
34
+ font_size=50, # the size of emoji
35
+ falling_speed=3, # speed of raining
36
+ animation_length="infinite", # for how much time the animation will happen
37
+ )
38
+
39
+
40
+ #sc = st.sidebar.columns(2)
41
+ #sc[0].image(r'C:\Users\Yuva\.vscode\Streamlit dev\images.png', width=150)
42
+ #sc[1].write(" ")
43
+
44
+
45
+
46
+ st.subheader(":blue[Discover your perfect course - click here to explore! :point_down:]")
47
+ want_to_contribute = st.button("click here")
48
+ if want_to_contribute:
49
+ switch_page("recommend")
course_list.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cd0eda18efee611fec1c91f6e47b792c5c57ef885f82bdc67c0bd556989a76ff
3
+ size 7164481
courses.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e3535b7b79e169b19e051f54bd7384bdec4ad4366d95e6b03b4cb2f477bb4616
3
+ size 7090898
image2.png ADDED
image3.png ADDED
images.png ADDED
pages/recommend.py ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import pickle
3
+ import streamlit as st
4
+ from streamlit_extras.let_it_rain import rain
5
+
6
+ import numpy as np
7
+ import pandas as pd
8
+
9
+
10
+
11
+ # <==== Code starts here ====>
12
+
13
+ courses_list = pickle.load(open('courses.pkl','rb'))
14
+ similarity = pickle.load(open('similarity.pkl','rb'))
15
+
16
+ rain(
17
+ emoji="๐Ÿ•ฎ",
18
+ font_size=30, # the size of emoji
19
+ falling_speed=6, # speed of raining
20
+ animation_length= 2, # for how much time the animation will happen
21
+ )
22
+
23
+ def recommend(course):
24
+ index = courses_list[courses_list['course_name'] == course].index[0]
25
+ dist1 = (similarity[index])
26
+ distances = sorted(list(enumerate(dist1)), reverse=True, key=lambda x: x[1])
27
+ dist = pd.DataFrame(dist1)
28
+
29
+ for i in distances[1:5]:
30
+ st.write("Name of the Course :memo: : ", courses_list.iloc[i[0]].course_name.upper())
31
+ st.write("Course URL :link: : ", courses_list.iloc[i[0]].course_url)
32
+ st.write("Platform :medal: : ", courses_list.iloc[i[0]].Platform.upper())
33
+ #st.write("Score :large_blue_diamond: : ", dist.iloc[i[0]].to_string(index = False))
34
+ st.write ("Reason for Recommendation (SKILLS YOU MAY GET) : ")
35
+ st.write(courses_list.iloc[i[0]].Skills)
36
+ st.write("-"* 90)
37
+
38
+
39
+
40
+ def main():
41
+
42
+ # To write title
43
+
44
+ st.markdown("<h5 style = 'text-align: Left; color: white;'>Hello! I'm here to help you find the perfect course over 5000 courses from dataset. Let's get Started !๐Ÿ™‚</h5>",unsafe_allow_html=True)
45
+ st.markdown("<h5 style='text-align: Left ; color: blue;'> What field or topic are you interested in? </h5>", unsafe_allow_html=True)
46
+
47
+ course_list = courses_list['course_name'].values
48
+ selected_course = st.selectbox("Select here :point_down:",
49
+
50
+ courses_list
51
+ )
52
+
53
+ if st.button(' Recommend '):
54
+ st.success("Recommending courses similar to " + selected_course)
55
+ recommend(selected_course)
56
+
57
+
58
+ if __name__ == "__main__":
59
+ main()
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ streamlit_extras
similarity.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:289d215dc8e9c437360bcbbebaf2484e589cecc91f95044f12ce5d24fd3b9aba
3
+ size 141658275