File size: 3,517 Bytes
bfb56e4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import streamlit as st
from datasets import load_dataset
from transformers import pipeline
import requests

# Load necessary datasets from Hugging Face
ds_natural_questions = load_dataset("google-research-datasets/natural_questions", "default")
ds_open_questions = load_dataset("launch/open_question_type")
ds_question_generator = load_dataset("iarfmoose/question_generator")
ds_jobs = load_dataset("lukebarousse/data_jobs")
ds_courses = load_dataset("azrai99/coursera-course-dataset")
universities_url = "https://www.4icu.org/top-universities-world/"

# Initialize the LLaMA model pipeline for text-to-text generation
qa_pipeline = pipeline("text2text-generation", model="llama-3.1-70b-versatile", tokenizer="llama-3.1-70b-versatile")

# Streamlit App Interface
st.title("Career Counseling Application")
st.subheader("Build Your Profile and Discover Tailored Career Recommendations")

# Sidebar for Profile Setup
st.sidebar.header("Profile Setup")
educational_background = st.sidebar.text_input("Educational Background (e.g., Degree, Major)")
interests = st.sidebar.text_input("Interests (e.g., AI, Data Science, Engineering)")
tech_skills = st.sidebar.text_area("Technical Skills (e.g., Python, SQL, Machine Learning)")
soft_skills = st.sidebar.text_area("Soft Skills (e.g., Communication, Teamwork)")

# Save profile data for session-based recommendations
profile_data = {
    "educational_background": educational_background,
    "interests": interests,
    "tech_skills": tech_skills,
    "soft_skills": soft_skills
}

if st.sidebar.button("Save Profile"):
    st.session_state.profile_data = profile_data
    st.sidebar.success("Profile saved successfully!")

# Intelligent Q&A Section
st.header("Intelligent Q&A")
question = st.text_input("Ask a career-related question:")
if question:
    answer = qa_pipeline(question)[0]["generated_text"]
    st.write("Answer:", answer)

# Career and Job Recommendations Section
st.header("Career and Job Recommendations")
if profile_data:
    job_recommendations = []
    for job in ds_jobs["train"]:
        if any(skill.lower() in job["description"].lower() for skill in tech_skills.split(',')):
            job_recommendations.append(job["title"])
    
    if job_recommendations:
        st.subheader("Job Recommendations")
        st.write("Based on your profile, here are some potential job roles:")
        for job in job_recommendations[:5]:  # Limit to top 5 job recommendations
            st.write("- ", job)
    else:
        st.write("No specific job recommendations found matching your profile.")

# Course Suggestions Section
st.header("Course Suggestions")
if profile_data:
    course_recommendations = []
    for course in ds_courses["train"]:
        if any(interest.lower() in course["title"].lower() for interest in interests.split(',')):
            course_recommendations.append(course["title"])
    
    if course_recommendations:
        st.subheader("Recommended Courses")
        st.write("Here are some courses related to your interests:")
        for course in course_recommendations[:5]:  # Limit to top 5 course recommendations
            st.write("- ", course)
    else:
        st.write("No specific courses found matching your interests.")

# University Recommendations Section
st.header("Top Universities")
st.write("For further education, you can explore the top universities worldwide:")
st.write(f"[View Top Universities Rankings]({universities_url})")

# Conclusion
st.write("Thank you for using the Career Counseling Application!")