-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSimple Career Path Advisor.py
145 lines (122 loc) · 5.99 KB
/
Simple Career Path Advisor.py
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
import tkinter as tk
from tkinter import messagebox
class CareerPathExpertSystem:
def __init__(self):
self.knowledge_base = []
self.inference_engine = InferenceEngine()
def add_rule(self, rule):
self.knowledge_base.append(rule)
def suggest_career(self, profile):
return self.inference_engine.evaluate(self.knowledge_base, profile)
class Rule:
def __init__(self, conditions, career, roadmap, weight=1):
self.conditions = conditions
self.career = career
self.roadmap = roadmap
self.weight = weight
def match_score(self, profile):
score = 0
total_weight = 0
for trait, expected in self.conditions.items():
total_weight += self.weight
if profile.get(trait) == expected:
score += self.weight
return score / total_weight if total_weight > 0 else 0
class InferenceEngine:
def evaluate(self, knowledge_base, profile):
best_match = None
highest_score = 0
for rule in knowledge_base:
score = rule.match_score(profile)
if score > highest_score:
highest_score = score
best_match = rule
if best_match:
return f"Suggested Career: {best_match.career}\nRoadmap: {best_match.roadmap}"
return "No suitable career path could be suggested."
class CareerAdvisorGUI:
def __init__(self, root, expert_system):
self.root = root
self.root.title("CareerPathAdvisor: Comprehensive Career Guidance")
self.expert_system = expert_system
# Define GUI Elements
self.interests_label = tk.Label(root, text="Select your Interest:")
self.interests_label.grid(row=0, column=0)
self.interests_var = tk.StringVar(value="technology")
self.interests_dropdown = tk.OptionMenu(root, self.interests_var, "technology", "creativity", "social impact", "business", "science")
self.interests_dropdown.grid(row=0, column=1)
self.skills_label = tk.Label(root, text="Select your Key Skill:")
self.skills_label.grid(row=1, column=0)
self.skills_var = tk.StringVar(value="analytical")
self.skills_dropdown = tk.OptionMenu(root, self.skills_var, "analytical", "communication", "leadership", "technical", "management")
self.skills_dropdown.grid(row=1, column=1)
self.values_label = tk.Label(root, text="Select your Core Value:")
self.values_label.grid(row=2, column=0)
self.values_var = tk.StringVar(value="innovation")
self.values_dropdown = tk.OptionMenu(root, self.values_var, "innovation", "autonomy", "helping others", "stability", "challenge")
self.values_dropdown.grid(row=2, column=1)
self.personality_label = tk.Label(root, text="Select your Personality:")
self.personality_label.grid(row=3, column=0)
self.personality_var = tk.StringVar(value="logical")
self.personality_dropdown = tk.OptionMenu(root, self.personality_var, "logical", "artistic", "empathetic", "strategic", "practical")
self.personality_dropdown.grid(row=3, column=1)
self.education_label = tk.Label(root, text="Select your Education Level:")
self.education_label.grid(row=4, column=0)
self.education_var = tk.StringVar(value="Computer Science")
self.education_dropdown = tk.OptionMenu(root, self.education_var, "Computer Science", "Fine Arts", "Sociology", "Business", "Biology")
self.education_dropdown.grid(row=4, column=1)
self.submit_button = tk.Button(root, text="Get Career Suggestion", command=self.get_suggestion)
self.submit_button.grid(row=5, column=0, columnspan=2)
def get_suggestion(self):
profile = {
"interest": self.interests_var.get(),
"skill": self.skills_var.get(),
"value": self.values_var.get(),
"personality": self.personality_var.get(),
"education": self.education_var.get()
}
suggestion = self.expert_system.suggest_career(profile)
messagebox.showinfo("Career Suggestion", suggestion)
# Define comprehensive career rules
rule1 = Rule(
{"interest": "technology", "skill": "analytical", "value": "innovation", "personality": "logical", "education": "Computer Science"},
"Data Science",
"Earn a degree in Data Science, learn machine learning algorithms, build a portfolio, apply for data science roles.",
weight=3
)
rule2 = Rule(
{"interest": "creativity", "skill": "communication", "value": "autonomy", "personality": "artistic", "education": "Fine Arts"},
"Graphic Design",
"Earn a degree in Graphic Design, master design software, create a portfolio, freelance or join a design firm.",
weight=3
)
rule3 = Rule(
{"interest": "social impact", "skill": "leadership", "value": "helping others", "personality": "empathetic", "education": "Sociology"},
"Non-Profit Management",
"Earn a degree in Non-Profit Management, gain experience in leadership roles, network with other professionals in the field.",
weight=3
)
rule4 = Rule(
{"interest": "business", "skill": "management", "value": "stability", "personality": "strategic", "education": "Business"},
"Business Management",
"Earn a degree in Business Administration, develop leadership skills, gain experience in managerial roles, aim for executive positions.",
weight=3
)
rule5 = Rule(
{"interest": "science", "skill": "technical", "value": "challenge", "personality": "practical", "education": "Biology"},
"Biotechnology",
"Earn a degree in Biotechnology, gain laboratory experience, focus on innovation in the biotech industry, pursue research roles.",
weight=3
)
# Create an instance of the expert system
career_advisor = CareerPathExpertSystem()
# Add rules to the system
career_advisor.add_rule(rule1)
career_advisor.add_rule(rule2)
career_advisor.add_rule(rule3)
career_advisor.add_rule(rule4)
career_advisor.add_rule(rule5)
# Create the GUI
root = tk.Tk()
app = CareerAdvisorGUI(root, career_advisor)
root.mainloop()