Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import streamlit as st
|
2 |
-
import pandas as pd
|
3 |
from datasets import load_dataset
|
|
|
4 |
from transformers import pipeline
|
5 |
|
6 |
# Constants
|
@@ -67,6 +67,9 @@ if "profile_data" in st.session_state:
|
|
67 |
if any(skill.lower() in job_skills.lower() for skill in st.session_state.profile_data["tech_skills"].split(",")):
|
68 |
job_recommendations.append(job.get("job_title", "Unknown Job Title"))
|
69 |
|
|
|
|
|
|
|
70 |
if job_recommendations:
|
71 |
st.subheader("Job Recommendations")
|
72 |
st.write("Based on your profile, here are some potential job roles:")
|
@@ -79,15 +82,18 @@ if "profile_data" in st.session_state:
|
|
79 |
st.header("Course Suggestions")
|
80 |
if "profile_data" in st.session_state:
|
81 |
course_recommendations = [
|
82 |
-
course.get("
|
83 |
-
if any(interest.lower() in course.get("
|
84 |
]
|
85 |
|
86 |
course_recommendations.extend([
|
87 |
-
row["
|
88 |
-
if any(interest.lower() in row["
|
89 |
])
|
90 |
|
|
|
|
|
|
|
91 |
if course_recommendations:
|
92 |
st.subheader("Recommended Courses")
|
93 |
st.write("Here are some courses related to your interests:")
|
|
|
1 |
import streamlit as st
|
|
|
2 |
from datasets import load_dataset
|
3 |
+
import pandas as pd
|
4 |
from transformers import pipeline
|
5 |
|
6 |
# Constants
|
|
|
67 |
if any(skill.lower() in job_skills.lower() for skill in st.session_state.profile_data["tech_skills"].split(",")):
|
68 |
job_recommendations.append(job.get("job_title", "Unknown Job Title"))
|
69 |
|
70 |
+
# Remove duplicates by converting the list to a set and back to a list
|
71 |
+
job_recommendations = list(set(job_recommendations))
|
72 |
+
|
73 |
if job_recommendations:
|
74 |
st.subheader("Job Recommendations")
|
75 |
st.write("Based on your profile, here are some potential job roles:")
|
|
|
82 |
st.header("Course Suggestions")
|
83 |
if "profile_data" in st.session_state:
|
84 |
course_recommendations = [
|
85 |
+
course.get("Course Name", "Unknown Course Title") for course in ds_courses["train"]
|
86 |
+
if any(interest.lower() in course.get("Course Name", "").lower() for interest in st.session_state.profile_data["interests"].split(","))
|
87 |
]
|
88 |
|
89 |
course_recommendations.extend([
|
90 |
+
row["Course Name"] for _, row in ds_custom_courses.iterrows()
|
91 |
+
if any(interest.lower() in row["Course Name"].lower() for interest in st.session_state.profile_data["interests"].split(","))
|
92 |
])
|
93 |
|
94 |
+
# Remove duplicates from course recommendations
|
95 |
+
course_recommendations = list(set(course_recommendations))
|
96 |
+
|
97 |
if course_recommendations:
|
98 |
st.subheader("Recommended Courses")
|
99 |
st.write("Here are some courses related to your interests:")
|