Files changed (4) hide show
  1. README.md +5 -7
  2. app.py +1880 -0
  3. gitattributes +35 -0
  4. requirements.txt +8 -0
README.md CHANGED
@@ -1,15 +1,13 @@
1
  ---
2
- title: Career Predictor
3
- emoji: 🔥
4
- colorFrom: gray
5
- colorTo: blue
6
  sdk: gradio
7
- sdk_version: 6.16.0
8
- python_version: '3.13'
9
  app_file: app.py
10
  pinned: false
11
  license: apache-2.0
12
- short_description: Predict Career Growth & Salary Estimates
13
  ---
14
 
15
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: Global Career Predictor
3
+ emoji: 🌖
4
+ colorFrom: green
5
+ colorTo: pink
6
  sdk: gradio
7
+ sdk_version: 6.2.0
 
8
  app_file: app.py
9
  pinned: false
10
  license: apache-2.0
 
11
  ---
12
 
13
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
app.py ADDED
@@ -0,0 +1,1880 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Career Prediction Assistant - Advanced Interactive Dashboard
2
+ # =======================================================
3
+
4
+ import gradio as gr
5
+ import pandas as pd
6
+ import numpy as np
7
+ import joblib
8
+ from typing import Dict, List, Tuple
9
+ import matplotlib.pyplot as plt
10
+ import matplotlib
11
+ matplotlib.use('Agg') # مهم ليعمل مع Gradio
12
+ import json
13
+ from datetime import datetime
14
+ import warnings
15
+ warnings.filterwarnings('ignore')
16
+
17
+ # ====================
18
+ # SYSTEM CONFIGURATION
19
+ # ====================
20
+ class Config:
21
+ # All countries with detailed classification
22
+ COUNTRIES = {
23
+ # Arab Countries
24
+ 'Egypt': {'region': 'Arab', 'gdp_tier': 'Lower Middle', 'tech_level': 'Emerging'},
25
+ 'Saudi Arabia': {'region': 'Arab', 'gdp_tier': 'High', 'tech_level': 'Developing'},
26
+ 'United Arab Emirates': {'region': 'Arab', 'gdp_tier': 'Very High', 'tech_level': 'Advanced'},
27
+ 'Kuwait': {'region': 'Arab', 'gdp_tier': 'High', 'tech_level': 'Developing'},
28
+ 'Qatar': {'region': 'Arab', 'gdp_tier': 'Very High', 'tech_level': 'Advanced'},
29
+ 'Bahrain': {'region': 'Arab', 'gdp_tier': 'High', 'tech_level': 'Developing'},
30
+ 'Oman': {'region': 'Arab', 'gdp_tier': 'High', 'tech_level': 'Developing'},
31
+ 'Jordan': {'region': 'Arab', 'gdp_tier': 'Upper Middle', 'tech_level': 'Emerging'},
32
+ 'Lebanon': {'region': 'Arab', 'gdp_tier': 'Upper Middle', 'tech_level': 'Emerging'},
33
+ 'Morocco': {'region': 'Arab', 'gdp_tier': 'Lower Middle', 'tech_level': 'Emerging'},
34
+ 'Tunisia': {'region': 'Arab', 'gdp_tier': 'Lower Middle', 'tech_level': 'Emerging'},
35
+ 'Algeria': {'region': 'Arab', 'gdp_tier': 'Upper Middle', 'tech_level': 'Emerging'},
36
+ 'Iraq': {'region': 'Arab', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
37
+ 'Yemen': {'region': 'Arab', 'gdp_tier': 'Low', 'tech_level': 'Basic'},
38
+ 'Syria': {'region': 'Arab', 'gdp_tier': 'Low', 'tech_level': 'Basic'},
39
+ 'Libya': {'region': 'Arab', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
40
+ 'Sudan': {'region': 'Arab', 'gdp_tier': 'Low', 'tech_level': 'Basic'},
41
+ 'Mauritania': {'region': 'Arab', 'gdp_tier': 'Lower Middle', 'tech_level': 'Basic'},
42
+ 'Somalia': {'region': 'Arab', 'gdp_tier': 'Low', 'tech_level': 'Basic'},
43
+ 'Djibouti': {'region': 'Arab', 'gdp_tier': 'Lower Middle', 'tech_level': 'Emerging'},
44
+ 'Comoros': {'region': 'Arab', 'gdp_tier': 'Low', 'tech_level': 'Basic'},
45
+ 'Palestine': {'region': 'Arab', 'gdp_tier': 'Lower Middle', 'tech_level': 'Emerging'},
46
+
47
+ # Other Middle East
48
+ 'Turkey': {'region': 'Middle East', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
49
+ 'Iran': {'region': 'Middle East', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
50
+ 'Israel': {'region': 'Middle East', 'gdp_tier': 'Very High', 'tech_level': 'Advanced'},
51
+
52
+ # Caucasus Region
53
+ 'Armenia': {'region': 'Caucasus', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
54
+ 'Azerbaijan': {'region': 'Caucasus', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
55
+ 'Georgia': {'region': 'Caucasus', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
56
+
57
+ # Central Asia
58
+ 'Kazakhstan': {'region': 'Central Asia', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
59
+ 'Uzbekistan': {'region': 'Central Asia', 'gdp_tier': 'Lower Middle', 'tech_level': 'Emerging'},
60
+ 'Turkmenistan': {'region': 'Central Asia', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
61
+ 'Kyrgyzstan': {'region': 'Central Asia', 'gdp_tier': 'Lower Middle', 'tech_level': 'Basic'},
62
+ 'Tajikistan': {'region': 'Central Asia', 'gdp_tier': 'Low', 'tech_level': 'Basic'},
63
+
64
+ # South Asia
65
+ 'India': {'region': 'South Asia', 'gdp_tier': 'Lower Middle', 'tech_level': 'Developing'},
66
+ 'Pakistan': {'region': 'South Asia', 'gdp_tier': 'Lower Middle', 'tech_level': 'Emerging'},
67
+ 'Bangladesh': {'region': 'South Asia', 'gdp_tier': 'Lower Middle', 'tech_level': 'Emerging'},
68
+ 'Sri Lanka': {'region': 'South Asia', 'gdp_tier': 'Lower Middle', 'tech_level': 'Emerging'},
69
+ 'Nepal': {'region': 'South Asia', 'gdp_tier': 'Low', 'tech_level': 'Basic'},
70
+ 'Afghanistan': {'region': 'South Asia', 'gdp_tier': 'Low', 'tech_level': 'Basic'},
71
+ 'Bhutan': {'region': 'South Asia', 'gdp_tier': 'Lower Middle', 'tech_level': 'Emerging'},
72
+ 'Maldives': {'region': 'South Asia', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
73
+
74
+ # East Asia
75
+ 'China': {'region': 'East Asia', 'gdp_tier': 'Upper Middle', 'tech_level': 'Advanced'},
76
+ 'Japan': {'region': 'East Asia', 'gdp_tier': 'Very High', 'tech_level': 'Advanced'},
77
+ 'South Korea': {'region': 'East Asia', 'gdp_tier': 'Very High', 'tech_level': 'Advanced'},
78
+ 'North Korea': {'region': 'East Asia', 'gdp_tier': 'Low', 'tech_level': 'Basic'},
79
+ 'Mongolia': {'region': 'East Asia', 'gdp_tier': 'Lower Middle', 'tech_level': 'Emerging'},
80
+ 'Taiwan': {'region': 'East Asia', 'gdp_tier': 'Very High', 'tech_level': 'Advanced'},
81
+ 'Hong Kong': {'region': 'East Asia', 'gdp_tier': 'Very High', 'tech_level': 'Advanced'},
82
+ 'Macau': {'region': 'East Asia', 'gdp_tier': 'Very High', 'tech_level': 'Advanced'},
83
+
84
+ # Southeast Asia
85
+ 'Indonesia': {'region': 'Southeast Asia', 'gdp_tier': 'Lower Middle', 'tech_level': 'Developing'},
86
+ 'Malaysia': {'region': 'Southeast Asia', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
87
+ 'Philippines': {'region': 'Southeast Asia', 'gdp_tier': 'Lower Middle', 'tech_level': 'Emerging'},
88
+ 'Singapore': {'region': 'Southeast Asia', 'gdp_tier': 'Very High', 'tech_level': 'Advanced'},
89
+ 'Thailand': {'region': 'Southeast Asia', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
90
+ 'Vietnam': {'region': 'Southeast Asia', 'gdp_tier': 'Lower Middle', 'tech_level': 'Emerging'},
91
+ 'Myanmar': {'region': 'Southeast Asia', 'gdp_tier': 'Lower Middle', 'tech_level': 'Emerging'},
92
+ 'Cambodia': {'region': 'Southeast Asia', 'gdp_tier': 'Lower Middle', 'tech_level': 'Emerging'},
93
+ 'Laos': {'region': 'Southeast Asia', 'gdp_tier': 'Lower Middle', 'tech_level': 'Emerging'},
94
+ 'Brunei': {'region': 'Southeast Asia', 'gdp_tier': 'High', 'tech_level': 'Developing'},
95
+ 'Timor-Leste': {'region': 'Southeast Asia', 'gdp_tier': 'Lower Middle', 'tech_level': 'Basic'},
96
+
97
+ # Europe
98
+ 'United Kingdom': {'region': 'Europe', 'gdp_tier': 'Very High', 'tech_level': 'Advanced'},
99
+ 'Germany': {'region': 'Europe', 'gdp_tier': 'Very High', 'tech_level': 'Advanced'},
100
+ 'France': {'region': 'Europe', 'gdp_tier': 'Very High', 'tech_level': 'Advanced'},
101
+ 'Italy': {'region': 'Europe', 'gdp_tier': 'Very High', 'tech_level': 'Advanced'},
102
+ 'Spain': {'region': 'Europe', 'gdp_tier': 'High', 'tech_level': 'Advanced'},
103
+ 'Portugal': {'region': 'Europe', 'gdp_tier': 'High', 'tech_level': 'Developing'},
104
+ 'Netherlands': {'region': 'Europe', 'gdp_tier': 'Very High', 'tech_level': 'Advanced'},
105
+ 'Belgium': {'region': 'Europe', 'gdp_tier': 'Very High', 'tech_level': 'Advanced'},
106
+ 'Switzerland': {'region': 'Europe', 'gdp_tier': 'Very High', 'tech_level': 'Advanced'},
107
+ 'Sweden': {'region': 'Europe', 'gdp_tier': 'Very High', 'tech_level': 'Advanced'},
108
+ 'Norway': {'region': 'Europe', 'gdp_tier': 'Very High', 'tech_level': 'Advanced'},
109
+ 'Denmark': {'region': 'Europe', 'gdp_tier': 'Very High', 'tech_level': 'Advanced'},
110
+ 'Finland': {'region': 'Europe', 'gdp_tier': 'Very High', 'tech_level': 'Advanced'},
111
+ 'Ireland': {'region': 'Europe', 'gdp_tier': 'Very High', 'tech_level': 'Advanced'},
112
+ 'Austria': {'region': 'Europe', 'gdp_tier': 'Very High', 'tech_level': 'Advanced'},
113
+ 'Greece': {'region': 'Europe', 'gdp_tier': 'High', 'tech_level': 'Developing'},
114
+ 'Poland': {'region': 'Europe', 'gdp_tier': 'High', 'tech_level': 'Developing'},
115
+ 'Czech Republic': {'region': 'Europe', 'gdp_tier': 'High', 'tech_level': 'Developing'},
116
+ 'Hungary': {'region': 'Europe', 'gdp_tier': 'High', 'tech_level': 'Developing'},
117
+ 'Romania': {'region': 'Europe', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
118
+ 'Bulgaria': {'region': 'Europe', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
119
+ 'Croatia': {'region': 'Europe', 'gdp_tier': 'High', 'tech_level': 'Developing'},
120
+ 'Serbia': {'region': 'Europe', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
121
+ 'Slovakia': {'region': 'Europe', 'gdp_tier': 'High', 'tech_level': 'Developing'},
122
+ 'Slovenia': {'region': 'Europe', 'gdp_tier': 'High', 'tech_level': 'Developing'},
123
+ 'Estonia': {'region': 'Europe', 'gdp_tier': 'High', 'tech_level': 'Developing'},
124
+ 'Latvia': {'region': 'Europe', 'gdp_tier': 'High', 'tech_level': 'Developing'},
125
+ 'Lithuania': {'region': 'Europe', 'gdp_tier': 'High', 'tech_level': 'Developing'},
126
+ 'Ukraine': {'region': 'Europe', 'gdp_tier': 'Lower Middle', 'tech_level': 'Developing'},
127
+ 'Belarus': {'region': 'Europe', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
128
+ 'Moldova': {'region': 'Europe', 'gdp_tier': 'Lower Middle', 'tech_level': 'Emerging'},
129
+ 'Russia': {'region': 'Europe', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
130
+ 'Cyprus': {'region': 'Europe', 'gdp_tier': 'High', 'tech_level': 'Developing'},
131
+ 'Malta': {'region': 'Europe', 'gdp_tier': 'High', 'tech_level': 'Developing'},
132
+ 'Iceland': {'region': 'Europe', 'gdp_tier': 'Very High', 'tech_level': 'Advanced'},
133
+ 'Luxembourg': {'region': 'Europe', 'gdp_tier': 'Very High', 'tech_level': 'Advanced'},
134
+
135
+ # Africa (Non-Arab)
136
+ 'South Africa': {'region': 'Africa', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
137
+ 'Nigeria': {'region': 'Africa', 'gdp_tier': 'Lower Middle', 'tech_level': 'Emerging'},
138
+ 'Kenya': {'region': 'Africa', 'gdp_tier': 'Lower Middle', 'tech_level': 'Emerging'},
139
+ 'Ethiopia': {'region': 'Africa', 'gdp_tier': 'Low', 'tech_level': 'Emerging'},
140
+ 'Ghana': {'region': 'Africa', 'gdp_tier': 'Lower Middle', 'tech_level': 'Emerging'},
141
+ 'Tanzania': {'region': 'Africa', 'gdp_tier': 'Low', 'tech_level': 'Emerging'},
142
+ 'Uganda': {'region': 'Africa', 'gdp_tier': 'Low', 'tech_level': 'Emerging'},
143
+ 'Rwanda': {'region': 'Africa', 'gdp_tier': 'Low', 'tech_level': 'Emerging'},
144
+ 'Zimbabwe': {'region': 'Africa', 'gdp_tier': 'Low', 'tech_level': 'Basic'},
145
+ 'Zambia': {'region': 'Africa', 'gdp_tier': 'Lower Middle', 'tech_level': 'Emerging'},
146
+ 'Mozambique': {'region': 'Africa', 'gdp_tier': 'Low', 'tech_level': 'Basic'},
147
+ 'Angola': {'region': 'Africa', 'gdp_tier': 'Lower Middle', 'tech_level': 'Developing'},
148
+ 'Botswana': {'region': 'Africa', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
149
+ 'Namibia': {'region': 'Africa', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
150
+ 'Senegal': {'region': 'Africa', 'gdp_tier': 'Lower Middle', 'tech_level': 'Emerging'},
151
+ 'Ivory Coast': {'region': 'Africa', 'gdp_tier': 'Lower Middle', 'tech_level': 'Emerging'},
152
+ 'Cameroon': {'region': 'Africa', 'gdp_tier': 'Lower Middle', 'tech_level': 'Emerging'},
153
+ 'DR Congo': {'region': 'Africa', 'gdp_tier': 'Low', 'tech_level': 'Basic'},
154
+ 'Madagascar': {'region': 'Africa', 'gdp_tier': 'Low', 'tech_level': 'Basic'},
155
+ 'Mali': {'region': 'Africa', 'gdp_tier': 'Low', 'tech_level': 'Basic'},
156
+ 'Burkina Faso': {'region': 'Africa', 'gdp_tier': 'Low', 'tech_level': 'Basic'},
157
+ 'Niger': {'region': 'Africa', 'gdp_tier': 'Low', 'tech_level': 'Basic'},
158
+ 'Chad': {'region': 'Africa', 'gdp_tier': 'Low', 'tech_level': 'Basic'},
159
+ 'Guinea': {'region': 'Africa', 'gdp_tier': 'Low', 'tech_level': 'Basic'},
160
+ 'Benin': {'region': 'Africa', 'gdp_tier': 'Lower Middle', 'tech_level': 'Emerging'},
161
+ 'Togo': {'region': 'Africa', 'gdp_tier': 'Low', 'tech_level': 'Basic'},
162
+ 'Sierra Leone': {'region': 'Africa', 'gdp_tier': 'Low', 'tech_level': 'Basic'},
163
+ 'Liberia': {'region': 'Africa', 'gdp_tier': 'Low', 'tech_level': 'Basic'},
164
+ 'Central African Republic': {'region': 'Africa', 'gdp_tier': 'Low', 'tech_level': 'Basic'},
165
+ 'Congo': {'region': 'Africa', 'gdp_tier': 'Lower Middle', 'tech_level': 'Basic'},
166
+ 'Gabon': {'region': 'Africa', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
167
+ 'Equatorial Guinea': {'region': 'Africa', 'gdp_tier': 'High', 'tech_level': 'Developing'},
168
+ 'Burundi': {'region': 'Africa', 'gdp_tier': 'Low', 'tech_level': 'Basic'},
169
+ 'Eritrea': {'region': 'Africa', 'gdp_tier': 'Low', 'tech_level': 'Basic'},
170
+ 'South Sudan': {'region': 'Africa', 'gdp_tier': 'Low', 'tech_level': 'Basic'},
171
+ 'Mauritius': {'region': 'Africa', 'gdp_tier': 'High', 'tech_level': 'Developing'},
172
+ 'Seychelles': {'region': 'Africa', 'gdp_tier': 'High', 'tech_level': 'Developing'},
173
+ 'Cape Verde': {'region': 'Africa', 'gdp_tier': 'Lower Middle', 'tech_level': 'Developing'},
174
+ 'Gambia': {'region': 'Africa', 'gdp_tier': 'Low', 'tech_level': 'Basic'},
175
+ 'Guinea-Bissau': {'region': 'Africa', 'gdp_tier': 'Low', 'tech_level': 'Basic'},
176
+ 'Comoros': {'region': 'Africa', 'gdp_tier': 'Low', 'tech_level': 'Basic'},
177
+ 'São Tomé and Príncipe': {'region': 'Africa', 'gdp_tier': 'Lower Middle', 'tech_level': 'Emerging'},
178
+ 'Eswatini': {'region': 'Africa', 'gdp_tier': 'Lower Middle', 'tech_level': 'Developing'},
179
+ 'Lesotho': {'region': 'Africa', 'gdp_tier': 'Lower Middle', 'tech_level': 'Emerging'},
180
+
181
+ # Americas
182
+ 'United States': {'region': 'North America', 'gdp_tier': 'Very High', 'tech_level': 'Advanced'},
183
+ 'Canada': {'region': 'North America', 'gdp_tier': 'Very High', 'tech_level': 'Advanced'},
184
+ 'Mexico': {'region': 'North America', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
185
+ 'Brazil': {'region': 'South America', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
186
+ 'Argentina': {'region': 'South America', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
187
+ 'Colombia': {'region': 'South America', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
188
+ 'Chile': {'region': 'South America', 'gdp_tier': 'High', 'tech_level': 'Developing'},
189
+ 'Peru': {'region': 'South America', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
190
+ 'Venezuela': {'region': 'South America', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
191
+ 'Ecuador': {'region': 'South America', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
192
+ 'Bolivia': {'region': 'South America', 'gdp_tier': 'Lower Middle', 'tech_level': 'Emerging'},
193
+ 'Paraguay': {'region': 'South America', 'gdp_tier': 'Upper Middle', 'tech_level': 'Emerging'},
194
+ 'Uruguay': {'region': 'South America', 'gdp_tier': 'High', 'tech_level': 'Developing'},
195
+ 'Guyana': {'region': 'South America', 'gdp_tier': 'Upper Middle', 'tech_level': 'Emerging'},
196
+ 'Suriname': {'region': 'South America', 'gdp_tier': 'Upper Middle', 'tech_level': 'Emerging'},
197
+ 'French Guiana': {'region': 'South America', 'gdp_tier': 'High', 'tech_level': 'Developing'},
198
+ 'Cuba': {'region': 'Caribbean', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
199
+ 'Dominican Republic': {'region': 'Caribbean', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
200
+ 'Haiti': {'region': 'Caribbean', 'gdp_tier': 'Low', 'tech_level': 'Basic'},
201
+ 'Jamaica': {'region': 'Caribbean', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
202
+ 'Puerto Rico': {'region': 'Caribbean', 'gdp_tier': 'High', 'tech_level': 'Developing'},
203
+ 'Trinidad and Tobago': {'region': 'Caribbean', 'gdp_tier': 'High', 'tech_level': 'Developing'},
204
+ 'Bahamas': {'region': 'Caribbean', 'gdp_tier': 'High', 'tech_level': 'Developing'},
205
+ 'Barbados': {'region': 'Caribbean', 'gdp_tier': 'High', 'tech_level': 'Developing'},
206
+ 'Saint Lucia': {'region': 'Caribbean', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
207
+ 'Grenada': {'region': 'Caribbean', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
208
+ 'Saint Vincent and the Grenadines': {'region': 'Caribbean', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
209
+ 'Antigua and Barbuda': {'region': 'Caribbean', 'gdp_tier': 'High', 'tech_level': 'Developing'},
210
+ 'Dominica': {'region': 'Caribbean', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
211
+ 'Saint Kitts and Nevis': {'region': 'Caribbean', 'gdp_tier': 'High', 'tech_level': 'Developing'},
212
+
213
+ # Oceania
214
+ 'Australia': {'region': 'Oceania', 'gdp_tier': 'Very High', 'tech_level': 'Advanced'},
215
+ 'New Zealand': {'region': 'Oceania', 'gdp_tier': 'Very High', 'tech_level': 'Advanced'},
216
+ 'Fiji': {'region': 'Oceania', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
217
+ 'Papua New Guinea': {'region': 'Oceania', 'gdp_tier': 'Lower Middle', 'tech_level': 'Emerging'},
218
+ 'Solomon Islands': {'region': 'Oceania', 'gdp_tier': 'Lower Middle', 'tech_level': 'Basic'},
219
+ 'Vanuatu': {'region': 'Oceania', 'gdp_tier': 'Lower Middle', 'tech_level': 'Basic'},
220
+ 'Samoa': {'region': 'Oceania', 'gdp_tier': 'Lower Middle', 'tech_level': 'Developing'},
221
+ 'Kiribati': {'region': 'Oceania', 'gdp_tier': 'Lower Middle', 'tech_level': 'Basic'},
222
+ 'Tonga': {'region': 'Oceania', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
223
+ 'Micronesia': {'region': 'Oceania', 'gdp_tier': 'Lower Middle', 'tech_level': 'Basic'},
224
+ 'Marshall Islands': {'region': 'Oceania', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
225
+ 'Palau': {'region': 'Oceania', 'gdp_tier': 'High', 'tech_level': 'Developing'},
226
+ 'Nauru': {'region': 'Oceania', 'gdp_tier': 'High', 'tech_level': 'Developing'},
227
+ 'Tuvalu': {'region': 'Oceania', 'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'},
228
+ }
229
+
230
+ # Career categories with detailed majors
231
+ CAREER_CATEGORIES = {
232
+ 'Technology': [
233
+ 'Computer Science', 'Software Engineering', 'Information Technology',
234
+ 'Data Science', 'Artificial Intelligence', 'Cybersecurity',
235
+ 'Cloud Computing', 'Machine Learning', 'Computer Engineering',
236
+ 'Information Systems', 'Web Development', 'Mobile App Development',
237
+ 'DevOps Engineering', 'UI/UX Design', 'Game Development',
238
+ 'Blockchain Development', 'IoT Engineering', 'Robotics',
239
+ 'Quantum Computing', 'Bioinformatics'
240
+ ],
241
+ 'Engineering': [
242
+ 'Electrical Engineering', 'Mechanical Engineering', 'Civil Engineering',
243
+ 'Chemical Engineering', 'Biomedical Engineering', 'Aerospace Engineering',
244
+ 'Petroleum Engineering', 'Telecommunications Engineering',
245
+ 'Industrial Engineering', 'Environmental Engineering',
246
+ 'Materials Engineering', 'Nuclear Engineering',
247
+ 'Marine Engineering', 'Automotive Engineering',
248
+ 'Mining Engineering', 'Geotechnical Engineering',
249
+ 'Structural Engineering', 'Renewable Energy Engineering'
250
+ ],
251
+ 'Business': [
252
+ 'Business Administration', 'Finance', 'Accounting', 'Marketing',
253
+ 'International Business', 'Supply Chain Management',
254
+ 'Human Resources', 'Business Analytics', 'Entrepreneurship',
255
+ 'Project Management', 'Digital Marketing', 'Financial Analysis',
256
+ 'Risk Management', 'Investment Banking', 'Management Consulting',
257
+ 'Corporate Finance', 'Sales Management', 'Operations Management',
258
+ 'Strategic Management', 'E-commerce Management'
259
+ ],
260
+ 'Healthcare': [
261
+ 'Medicine', 'Nursing', 'Pharmacy', 'Dentistry',
262
+ 'Biotechnology', 'Public Health', 'Medical Laboratory Sciences',
263
+ 'Physiotherapy', 'Medical Imaging', 'Healthcare Administration',
264
+ 'Nutrition', 'Medical Research', 'Clinical Psychology',
265
+ 'Veterinary Medicine', 'Epidemiology', 'Pharmaceutical Sciences',
266
+ 'Medical Technology', 'Health Informatics', 'Occupational Therapy'
267
+ ],
268
+ 'Science': [
269
+ 'Physics', 'Chemistry', 'Biology', 'Mathematics',
270
+ 'Statistics', 'Environmental Science', 'Geology',
271
+ 'Astronomy', 'Biochemistry', 'Molecular Biology',
272
+ 'Genetics', 'Microbiology', 'Neuroscience',
273
+ 'Materials Science', 'Oceanography', 'Atmospheric Science',
274
+ 'Agricultural Science', 'Food Science', 'Forensic Science'
275
+ ],
276
+ 'Humanities': [
277
+ 'Psychology', 'Economics', 'Political Science', 'Sociology',
278
+ 'Law', 'International Relations', 'Education',
279
+ 'History', 'Philosophy', 'Literature',
280
+ 'Linguistics', 'Anthropology', 'Archaeology',
281
+ 'Media Studies', 'Journalism', 'Fine Arts',
282
+ 'Music', 'Theater Arts', 'Cultural Studies'
283
+ ]
284
+ }
285
+
286
+ # Experience levels
287
+ EXPERIENCE_LEVELS = {
288
+ 'Intern/Student (0-1 years)': (0, 1),
289
+ 'Entry Level (1-3 years)': (1, 3),
290
+ 'Junior (3-5 years)': (3, 5),
291
+ 'Mid Level (5-8 years)': (5, 8),
292
+ 'Senior (8-12 years)': (8, 12),
293
+ 'Lead (12-15 years)': (12, 15),
294
+ 'Principal (15-20 years)': (15, 20),
295
+ 'Executive/Director (20+ years)': (20, 40)
296
+ }
297
+
298
+ # Company sizes
299
+ COMPANY_SIZES = [
300
+ 'Startup (1-10 employees)', 'Small (11-50)', 'Medium (51-200)',
301
+ 'Large (201-1000)', 'Corporate (1001-5000)', 'Enterprise (5000+)',
302
+ 'Multinational (10000+)'
303
+ ]
304
+
305
+ # GDP Tier multipliers for salary calculation
306
+ GDP_TIER_MULTIPLIERS = {
307
+ 'Very High': 1.8, # USA, UK, Germany, etc.
308
+ 'High': 1.4, # Saudi Arabia, UAE, etc.
309
+ 'Upper Middle': 1.0, # Turkey, China, Brazil, etc.
310
+ 'Lower Middle': 0.7, # Egypt, India, etc.
311
+ 'Low': 0.4 # Yemen, Afghanistan, etc.
312
+ }
313
+
314
+ # Tech Level multipliers
315
+ TECH_LEVEL_MULTIPLIERS = {
316
+ 'Advanced': 1.3, # Silicon Valley level
317
+ 'Developing': 1.1, # Growing tech hubs
318
+ 'Emerging': 1.0, # Basic tech infrastructure
319
+ 'Basic': 0.7 # Limited tech access
320
+ }
321
+
322
+ # ====================
323
+ # DATA MANAGER
324
+ # ====================
325
+ class DataManager:
326
+ def __init__(self):
327
+ self.companies_db = self.load_companies_database()
328
+ self.salary_data = self.load_salary_benchmarks()
329
+ self.skills_data = self.load_skills_data()
330
+
331
+ def load_companies_database(self) -> pd.DataFrame:
332
+ """Load comprehensive global companies database"""
333
+ companies_data = []
334
+
335
+ # Tech Companies (Global)
336
+ tech_companies = [
337
+ # USA
338
+ ('Google', 'USA', 'Technology', 'Multinational (10000+)', 'Actively Hiring', 2.0, 95),
339
+ ('Microsoft', 'USA', 'Technology', 'Multinational (10000+)', 'Selective Hiring', 1.9, 92),
340
+ ('Apple', 'USA', 'Technology', 'Multinational (10000+)', 'Selective Hiring', 2.1, 94),
341
+ ('Amazon', 'USA', 'E-commerce', 'Multinational (10000+)', 'Actively Hiring', 1.8, 90),
342
+ ('Meta', 'USA', 'Technology', 'Multinational (10000+)', 'Moderate Hiring', 1.9, 91),
343
+ ('IBM', 'USA', 'Technology', 'Enterprise (5000+)', 'Selective Hiring', 1.6, 85),
344
+ ('Oracle', 'USA', 'Technology', 'Enterprise (5000+)', 'Moderate Hiring', 1.7, 86),
345
+ ('Intel', 'USA', 'Semiconductors', 'Enterprise (5000+)', 'Selective Hiring', 1.8, 88),
346
+ ('NVIDIA', 'USA', 'Technology', 'Enterprise (5000+)', 'Actively Hiring', 2.2, 96),
347
+ ('Tesla', 'USA', 'Automotive/Tech', 'Enterprise (5000+)', 'Actively Hiring', 1.9, 92),
348
+
349
+ # Europe
350
+ ('SAP', 'Germany', 'Enterprise Software', 'Enterprise (5000+)', 'Actively Hiring', 1.5, 87),
351
+ ('Spotify', 'Sweden', 'Technology', 'Large (201-1000)', 'Moderate Hiring', 1.7, 89),
352
+ ('Siemens', 'Germany', 'Industrial Tech', 'Multinational (10000+)', 'Selective Hiring', 1.6, 85),
353
+ ('Ericsson', 'Sweden', 'Telecom', 'Enterprise (5000+)', 'Moderate Hiring', 1.5, 84),
354
+ ('ARM', 'UK', 'Semiconductors', 'Medium (51-200)', 'Selective Hiring', 1.8, 90),
355
+
356
+ # Asia
357
+ ('Samsung', 'South Korea', 'Electronics', 'Multinational (10000+)', 'Actively Hiring', 1.7, 88),
358
+ ('Tencent', 'China', 'Technology', 'Multinational (10000+)', 'Actively Hiring', 1.8, 89),
359
+ ('Alibaba', 'China', 'E-commerce', 'Multinational (10000+)', 'Moderate Hiring', 1.7, 87),
360
+ ('Baidu', 'China', 'Technology', 'Enterprise (5000+)', 'Selective Hiring', 1.6, 86),
361
+ ('Rakuten', 'Japan', 'E-commerce', 'Enterprise (5000+)', 'Moderate Hiring', 1.5, 85),
362
+
363
+ # Arab Tech Companies
364
+ ('Careem', 'UAE', 'Technology', 'Large (201-1000)', 'Actively Hiring', 1.6, 88),
365
+ ('Souq.com', 'UAE', 'E-commerce', 'Large (201-1000)', 'Moderate Hiring', 1.5, 86),
366
+ ('Noon', 'UAE', 'E-commerce', 'Enterprise (5000+)', 'Actively Hiring', 1.7, 87),
367
+ ('Mawdoo3', 'Jordan', 'Technology', 'Medium (51-200)', 'Moderate Hiring', 1.3, 82),
368
+ ('Talal Abu-Ghazaleh', 'Jordan', 'Professional Services', 'Large (201-1000)', 'Selective Hiring', 1.4, 83),
369
+ ('STC Solutions', 'Saudi Arabia', 'Technology', 'Enterprise (5000+)', 'Actively Hiring', 1.6, 85),
370
+ ('Elmenus', 'Egypt', 'Technology', 'Medium (51-200)', 'Actively Hiring', 1.4, 84),
371
+ ('Vezeeta', 'Egypt', 'Health Tech', 'Medium (51-200)', 'Moderate Hiring', 1.5, 86),
372
+ ('Swvl', 'Egypt', 'Transport Tech', 'Medium (51-200)', 'Moderate Hiring', 1.6, 87),
373
+ ('Fetchr', 'UAE', 'Logistics Tech', 'Medium (51-200)', 'Actively Hiring', 1.5, 85),
374
+ ]
375
+
376
+ # Oil & Gas Companies
377
+ oil_companies = [
378
+ ('Saudi Aramco', 'Saudi Arabia', 'Oil & Gas', 'Multinational (10000+)', 'Selective Hiring', 2.3, 90),
379
+ ('Qatar Petroleum', 'Qatar', 'Oil & Gas', 'Enterprise (5000+)', 'Selective Hiring', 2.2, 89),
380
+ ('ADNOC', 'UAE', 'Oil & Gas', 'Enterprise (5000+)', 'Actively Hiring', 2.1, 88),
381
+ ('Kuwait Petroleum', 'Kuwait', 'Oil & Gas', 'Enterprise (5000+)', 'Moderate Hiring', 2.0, 87),
382
+ ('Bapco', 'Bahrain', 'Oil & Gas', 'Large (201-1000)', 'Selective Hiring', 1.9, 86),
383
+ ('Sonatrach', 'Algeria', 'Oil & Gas', 'Enterprise (5000+)', 'Moderate Hiring', 1.8, 85),
384
+ ('ENI', 'Italy', 'Oil & Gas', 'Multinational (10000+)', 'Selective Hiring', 1.7, 88),
385
+ ('ExxonMobil', 'USA', 'Oil & Gas', 'Multinational (10000+)', 'Moderate Hiring', 1.9, 89),
386
+ ('Shell', 'Netherlands', 'Oil & Gas', 'Multinational (10000+)', 'Selective Hiring', 1.8, 88),
387
+ ('BP', 'UK', 'Oil & Gas', 'Multinational (10000+)', 'Moderate Hiring', 1.7, 87),
388
+ ]
389
+
390
+ # Banking & Finance
391
+ finance_companies = [
392
+ ('QNB', 'Qatar', 'Banking', 'Enterprise (5000+)', 'Actively Hiring', 1.8, 87),
393
+ ('Emirates NBD', 'UAE', 'Banking', 'Enterprise (5000+)', 'Moderate Hiring', 1.7, 86),
394
+ ('Al Rajhi Bank', 'Saudi Arabia', 'Banking', 'Enterprise (5000+)', 'Selective Hiring', 1.9, 88),
395
+ ('Arab Bank', 'Jordan', 'Banking', 'Enterprise (5000+)', 'Moderate Hiring', 1.6, 85),
396
+ ('National Bank of Egypt', 'Egypt', 'Banking', 'Multinational (10000+)', 'Actively Hiring', 1.5, 84),
397
+ ('Attijariwafa Bank', 'Morocco', 'Banking', 'Enterprise (5000+)', 'Moderate Hiring', 1.4, 83),
398
+ ('Bank of China', 'China', 'Banking', 'Multinational (10000+)', 'Actively Hiring', 1.6, 86),
399
+ ('HSBC', 'UK', 'Banking', 'Multinational (10000+)', 'Selective Hiring', 1.7, 87),
400
+ ('Goldman Sachs', 'USA', 'Investment Banking', 'Enterprise (5000+)', 'Selective Hiring', 2.2, 92),
401
+ ('JP Morgan', 'USA', 'Banking', 'Multinational (10000+)', 'Moderate Hiring', 2.0, 90),
402
+ ]
403
+
404
+ # Telecommunications
405
+ telecom_companies = [
406
+ ('STC', 'Saudi Arabia', 'Telecommunications', 'Multinational (10000+)', 'Actively Hiring', 1.7, 86),
407
+ ('Etisalat', 'UAE', 'Telecommunications', 'Enterprise (5000+)', 'Moderate Hiring', 1.8, 87),
408
+ ('Zain', 'Kuwait', 'Telecommunications', 'Enterprise (5000+)', 'Actively Hiring', 1.6, 85),
409
+ ('Ooredoo', 'Qatar', 'Telecommunications', 'Enterprise (5000+)', 'Moderate Hiring', 1.7, 86),
410
+ ('Orange', 'France', 'Telecommunications', 'Multinational (10000+)', 'Selective Hiring', 1.5, 85),
411
+ ('Vodafone', 'UK', 'Telecommunications', 'Multinational (10000+)', 'Moderate Hiring', 1.6, 86),
412
+ ('China Mobile', 'China', 'Telecommunications', 'Multinational (10000+)', 'Actively Hiring', 1.4, 84),
413
+ ('AT&T', 'USA', 'Telecommunications', 'Multinational (10000+)', 'Selective Hiring', 1.7, 87),
414
+ ]
415
+
416
+ # Healthcare
417
+ healthcare_companies = [
418
+ ('King Faisal Specialist Hospital', 'Saudi Arabia', 'Healthcare', 'Enterprise (5000+)', 'Actively Hiring', 1.8, 88),
419
+ ('Cleveland Clinic Abu Dhabi', 'UAE', 'Healthcare', 'Large (201-1000)', 'Selective Hiring', 1.9, 89),
420
+ ('American Hospital Dubai', 'UAE', 'Healthcare', 'Medium (51-200)', 'Moderate Hiring', 1.7, 87),
421
+ ('Saudi German Hospital', 'Saudi Arabia', 'Healthcare', 'Large (201-1000)', 'Actively Hiring', 1.6, 86),
422
+ ('Kasr Al Ainy Hospital', 'Egypt', 'Healthcare', 'Enterprise (5000+)', 'Actively Hiring', 1.3, 83),
423
+ ('Mayo Clinic', 'USA', 'Healthcare', 'Multinational (10000+)', 'Selective Hiring', 2.0, 92),
424
+ ('Johns Hopkins Hospital', 'USA', 'Healthcare', 'Enterprise (5000+)', 'Selective Hiring', 1.9, 91),
425
+ ]
426
+
427
+ # Aviation
428
+ aviation_companies = [
429
+ ('Emirates Airlines', 'UAE', 'Aviation', 'Enterprise (5000+)', 'Actively Hiring', 1.8, 88),
430
+ ('Qatar Airways', 'Qatar', 'Aviation', 'Enterprise (5000+)', 'Moderate Hiring', 1.9, 89),
431
+ ('Saudi Airlines', 'Saudi Arabia', 'Aviation', 'Enterprise (5000+)', 'Actively Hiring', 1.7, 87),
432
+ ('EgyptAir', 'Egypt', 'Aviation', 'Large (201-1000)', 'Moderate Hiring', 1.4, 84),
433
+ ('Royal Jordanian', 'Jordan', 'Aviation', 'Medium (51-200)', 'Selective Hiring', 1.5, 85),
434
+ ]
435
+
436
+ # Construction & Engineering
437
+ construction_companies = [
438
+ ('Saudi Binladin Group', 'Saudi Arabia', 'Construction', 'Multinational (10000+)', 'Actively Hiring', 1.6, 85),
439
+ ('Arabtec', 'UAE', 'Construction', 'Enterprise (5000+)', 'Moderate Hiring', 1.5, 84),
440
+ ('ACC', 'India', 'Construction', 'Enterprise (5000+)', 'Actively Hiring', 1.4, 83),
441
+ ('Bechtel', 'USA', 'Engineering', 'Multinational (10000+)', 'Selective Hiring', 1.8, 88),
442
+ ('Fluor', 'USA', 'Engineering', 'Enterprise (5000+)', 'Moderate Hiring', 1.7, 87),
443
+ ]
444
+
445
+ # Add all companies to list
446
+ all_companies = (tech_companies + oil_companies + finance_companies +
447
+ telecom_companies + healthcare_companies +
448
+ aviation_companies + construction_companies)
449
+
450
+ # Convert to DataFrame
451
+ companies_df = pd.DataFrame(all_companies, columns=[
452
+ 'company_name', 'country', 'industry', 'company_size',
453
+ 'hiring_status', 'avg_salary_multiplier', 'career_growth_score'
454
+ ])
455
+
456
+ # Add more companies from different countries
457
+ additional_companies = []
458
+
459
+ # Add companies for countries not covered
460
+ for country in Config.COUNTRIES:
461
+ if country not in companies_df['country'].unique():
462
+ # Add representative companies for each country
463
+ country_info = Config.COUNTRIES[country]
464
+
465
+ if country_info['tech_level'] in ['Advanced', 'Developing']:
466
+ # Add tech company
467
+ additional_companies.append((
468
+ f'{country} Tech Solutions',
469
+ country,
470
+ 'Technology',
471
+ 'Medium (51-200)',
472
+ 'Actively Hiring',
473
+ 1.3 + (0.1 if country_info['gdp_tier'] in ['Very High', 'High'] else 0),
474
+ 75 + (10 if country_info['tech_level'] == 'Advanced' else 5)
475
+ ))
476
+
477
+ # Add major local company
478
+ additional_companies.append((
479
+ f'National {country} Corporation',
480
+ country,
481
+ 'Various',
482
+ 'Large (201-1000)',
483
+ 'Moderate Hiring',
484
+ 1.2,
485
+ 70
486
+ ))
487
+
488
+ if additional_companies:
489
+ additional_df = pd.DataFrame(additional_companies, columns=companies_df.columns)
490
+ companies_df = pd.concat([companies_df, additional_df], ignore_index=True)
491
+
492
+ return companies_df
493
+
494
+ def load_salary_benchmarks(self) -> pd.DataFrame:
495
+ """Generate comprehensive salary benchmarks"""
496
+ data = []
497
+
498
+ for country, info in Config.COUNTRIES.items():
499
+ for category, majors in Config.CAREER_CATEGORIES.items():
500
+ # Base salary based on GDP tier
501
+ base_salaries = {
502
+ 'Very High': 80000,
503
+ 'High': 60000,
504
+ 'Upper Middle': 40000,
505
+ 'Lower Middle': 25000,
506
+ 'Low': 15000
507
+ }
508
+
509
+ base = base_salaries[info['gdp_tier']]
510
+
511
+ # Category multipliers
512
+ category_multipliers = {
513
+ 'Technology': 1.6,
514
+ 'Engineering': 1.5,
515
+ 'Healthcare': 1.7,
516
+ 'Business': 1.4,
517
+ 'Science': 1.2,
518
+ 'Humanities': 1.0
519
+ }
520
+
521
+ avg_salary = base * category_multipliers[category]
522
+
523
+ # Tech level adjustment
524
+ tech_multipliers = {
525
+ 'Advanced': 1.2,
526
+ 'Developing': 1.0,
527
+ 'Emerging': 0.9,
528
+ 'Basic': 0.8
529
+ }
530
+
531
+ avg_salary *= tech_multipliers[info['tech_level']]
532
+
533
+ data.append({
534
+ 'country': country,
535
+ 'career_category': category,
536
+ 'avg_salary': int(avg_salary),
537
+ 'min_salary': int(avg_salary * 0.7),
538
+ 'max_salary': int(avg_salary * 1.4),
539
+ 'demand_level': np.random.choice(['Very High', 'High', 'Medium', 'Low'],
540
+ p=[0.2, 0.3, 0.4, 0.1]),
541
+ 'gdp_tier': info['gdp_tier'],
542
+ 'tech_level': info['tech_level']
543
+ })
544
+
545
+ return pd.DataFrame(data)
546
+
547
+ def load_skills_data(self) -> Dict:
548
+ """Load detailed skills demand data"""
549
+ return {
550
+ 'Technology': {
551
+ 'programming_languages': ['Python', 'JavaScript', 'Java', 'C++', 'C#', 'Go', 'Rust', 'Swift', 'Kotlin'],
552
+ 'frameworks': ['React', 'Angular', 'Vue.js', 'Node.js', 'Django', 'Spring', '.NET'],
553
+ 'databases': ['SQL', 'MySQL', 'PostgreSQL', 'MongoDB', 'Redis', 'Cassandra'],
554
+ 'cloud_platforms': ['AWS', 'Azure', 'Google Cloud', 'IBM Cloud'],
555
+ 'devops_tools': ['Docker', 'Kubernetes', 'Jenkins', 'Git', 'Terraform', 'Ansible'],
556
+ 'ai_ml': ['TensorFlow', 'PyTorch', 'Scikit-learn', 'OpenCV', 'NLP', 'Computer Vision'],
557
+ 'cybersecurity': ['Network Security', 'Ethical Hacking', 'Cryptography', 'Security Analysis'],
558
+ 'soft_skills': ['Problem Solving', 'Teamwork', 'Communication', 'Adaptability']
559
+ },
560
+ 'Engineering': {
561
+ 'technical_skills': ['CAD/CAM', 'AutoCAD', 'SolidWorks', 'MATLAB', 'Simulink', 'PLC Programming'],
562
+ 'analysis_tools': ['Finite Element Analysis', 'Computational Fluid Dynamics', 'Statistical Analysis'],
563
+ 'project_management': ['Agile', 'Scrum', 'Waterfall', 'Risk Management', 'Budgeting'],
564
+ 'industry_specific': ['Six Sigma', 'Lean Manufacturing', 'Quality Control', 'Safety Standards'],
565
+ 'soft_skills': ['Leadership', 'Technical Writing', 'Presentation Skills', 'Critical Thinking']
566
+ },
567
+ 'Business': {
568
+ 'analytical_skills': ['Financial Modeling', 'Data Analysis', 'Market Research', 'Business Intelligence'],
569
+ 'digital_skills': ['Digital Marketing', 'SEO/SEM', 'Social Media Marketing', 'Google Analytics'],
570
+ 'management_skills': ['Strategic Planning', 'Project Management', 'Team Leadership', 'Conflict Resolution'],
571
+ 'financial_skills': ['Financial Reporting', 'Investment Analysis', 'Risk Assessment', 'Budget Management'],
572
+ 'soft_skills': ['Negotiation', 'Networking', 'Public Speaking', 'Time Management']
573
+ },
574
+ 'Healthcare': {
575
+ 'clinical_skills': ['Patient Assessment', 'Medical Procedures', 'Diagnostic Testing', 'Treatment Planning'],
576
+ 'technical_skills': ['Medical Imaging', 'Laboratory Techniques', 'Electronic Health Records'],
577
+ 'research_skills': ['Clinical Research', 'Data Analysis', 'Scientific Writing', 'Grant Writing'],
578
+ 'management_skills': ['Healthcare Administration', 'Quality Assurance', 'Regulatory Compliance'],
579
+ 'soft_skills': ['Empathy', 'Communication', 'Attention to Detail', 'Stress Management']
580
+ },
581
+ 'Science': {
582
+ 'research_skills': ['Experimental Design', 'Data Collection', 'Statistical Analysis', 'Scientific Writing'],
583
+ 'laboratory_skills': ['Chemical Analysis', 'Microscopy', 'Spectroscopy', 'Chromatography'],
584
+ 'computational_skills': ['Python/R Programming', 'Data Visualization', 'Simulation Modeling'],
585
+ 'fieldwork_skills': ['Sample Collection', 'Environmental Monitoring', 'Geological Surveying'],
586
+ 'soft_skills': ['Critical Thinking', 'Problem Solving', 'Collaboration', 'Scientific Communication']
587
+ },
588
+ 'Humanities': {
589
+ 'research_skills': ['Qualitative Analysis', 'Historical Research', 'Literary Analysis', 'Case Studies'],
590
+ 'analytical_skills': ['Critical Analysis', 'Logical Reasoning', 'Argument Development', 'Text Interpretation'],
591
+ 'communication_skills': ['Academic Writing', 'Public Speaking', 'Editing', 'Translation'],
592
+ 'digital_skills': ['Digital Archives', 'Content Management', 'Social Media Analysis'],
593
+ 'soft_skills': ['Cultural Awareness', 'Ethical Reasoning', 'Creativity', 'Interpersonal Skills']
594
+ }
595
+ }
596
+
597
+ # ====================
598
+ # PREDICTION ENGINE
599
+ # ====================
600
+ class PredictionEngine:
601
+ def __init__(self, data_manager: DataManager):
602
+ self.dm = data_manager
603
+
604
+ def predict_salary(self, inputs: Dict) -> Dict:
605
+ """Predict salary based on multiple factors with detailed calculation"""
606
+ try:
607
+ country = inputs['country']
608
+ major = inputs['major']
609
+ gpa = float(inputs['gpa'])
610
+ experience_years = float(inputs['experience_years'])
611
+ has_linkedin = inputs['has_linkedin']
612
+ num_courses = int(inputs['num_courses'])
613
+ skills_input = inputs['skills']
614
+
615
+ # Get country info
616
+ country_info = Config.COUNTRIES.get(country, {'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'})
617
+
618
+ # Get base salary
619
+ base_salary = self.get_base_salary(country, major)
620
+
621
+ # Apply detailed modifiers
622
+ salary = base_salary
623
+
624
+ # 1. GPA modifier (detailed)
625
+ if gpa >= 3.8:
626
+ gpa_modifier = 1.15
627
+ gpa_level = "Excellent"
628
+ elif gpa >= 3.5:
629
+ gpa_modifier = 1.10
630
+ gpa_level = "Very Good"
631
+ elif gpa >= 3.0:
632
+ gpa_modifier = 1.05
633
+ gpa_level = "Good"
634
+ elif gpa >= 2.5:
635
+ gpa_modifier = 1.0
636
+ gpa_level = "Average"
637
+ else:
638
+ gpa_modifier = 0.9
639
+ gpa_level = "Below Average"
640
+
641
+ salary *= gpa_modifier
642
+
643
+ # 2. Experience modifier (detailed curve)
644
+ if experience_years <= 1:
645
+ exp_modifier = 1.0
646
+ exp_level = "Entry"
647
+ elif experience_years <= 3:
648
+ exp_modifier = 1.15
649
+ exp_level = "Junior"
650
+ elif experience_years <= 5:
651
+ exp_modifier = 1.35
652
+ exp_level = "Mid"
653
+ elif experience_years <= 8:
654
+ exp_modifier = 1.60
655
+ exp_level = "Senior"
656
+ elif experience_years <= 12:
657
+ exp_modifier = 1.90
658
+ exp_level = "Lead"
659
+ elif experience_years <= 15:
660
+ exp_modifier = 2.20
661
+ exp_level = "Principal"
662
+ else:
663
+ exp_modifier = 2.50
664
+ exp_level = "Executive"
665
+
666
+ salary *= min(exp_modifier, 3.0) # Cap at 3x
667
+
668
+ # 3. LinkedIn premium (detailed)
669
+ if has_linkedin == "Yes":
670
+ linkedin_modifier = 1.12
671
+ linkedin_impact = "High visibility"
672
+ else:
673
+ linkedin_modifier = 1.0
674
+ linkedin_impact = "Limited visibility"
675
+
676
+ salary *= linkedin_modifier
677
+
678
+ # 4. Courses modifier
679
+ if num_courses == 0:
680
+ courses_modifier = 1.0
681
+ courses_impact = "No certifications"
682
+ elif num_courses <= 3:
683
+ courses_modifier = 1.05
684
+ courses_impact = "Basic certifications"
685
+ elif num_courses <= 6:
686
+ courses_modifier = 1.10
687
+ courses_impact = "Moderate certifications"
688
+ elif num_courses <= 10:
689
+ courses_modifier = 1.15
690
+ courses_impact = "Good certifications"
691
+ else:
692
+ courses_modifier = 1.20
693
+ courses_impact = "Excellent certifications"
694
+
695
+ salary *= courses_modifier
696
+
697
+ # 5. Skills impact
698
+ if skills_input and len(skills_input.strip()) > 0:
699
+ skills_list = [s.strip() for s in skills_input.split(',')]
700
+ skills_count = len(skills_list)
701
+ skills_modifier = 1 + (skills_count * 0.02)
702
+ skills_impact = f"{skills_count} skills listed"
703
+ else:
704
+ skills_modifier = 1.0
705
+ skills_impact = "No skills specified"
706
+
707
+ salary *= skills_modifier
708
+
709
+ # 6. Country-specific adjustments
710
+ country_modifier = Config.GDP_TIER_MULTIPLIERS.get(country_info['gdp_tier'], 1.0)
711
+ salary *= country_modifier
712
+
713
+ # 7. Tech level adjustment
714
+ tech_modifier = Config.TECH_LEVEL_MULTIPLIERS.get(country_info['tech_level'], 1.0)
715
+ salary *= tech_modifier
716
+
717
+ # Add some realistic randomness
718
+ salary *= np.random.uniform(0.92, 1.08)
719
+
720
+ # Calculate range
721
+ salary_low = int(salary * 0.88)
722
+ salary_high = int(salary * 1.15)
723
+
724
+ # Confidence score based on data completeness
725
+ confidence_factors = []
726
+ if gpa >= 3.0:
727
+ confidence_factors.append(0.9)
728
+ else:
729
+ confidence_factors.append(0.7)
730
+
731
+ if experience_years >= 1:
732
+ confidence_factors.append(0.85)
733
+ else:
734
+ confidence_factors.append(0.6)
735
+
736
+ if has_linkedin == "Yes":
737
+ confidence_factors.append(0.9)
738
+ else:
739
+ confidence_factors.append(0.7)
740
+
741
+ if num_courses >= 3:
742
+ confidence_factors.append(0.8)
743
+ else:
744
+ confidence_factors.append(0.6)
745
+
746
+ confidence_score = np.mean(confidence_factors)
747
+
748
+ return {
749
+ 'predicted_salary': int(salary),
750
+ 'salary_range': f"${salary_low:,} - ${salary_high:,}",
751
+ 'currency': 'USD',
752
+ 'confidence_score': confidence_score,
753
+ 'gpa_level': gpa_level,
754
+ 'exp_level': exp_level,
755
+ 'linkedin_impact': linkedin_impact,
756
+ 'courses_impact': courses_impact,
757
+ 'skills_impact': skills_impact,
758
+ 'country_tier': country_info['gdp_tier'],
759
+ 'tech_level': country_info['tech_level']
760
+ }
761
+
762
+ except Exception as e:
763
+ print(f"Salary prediction error: {e}")
764
+ import traceback
765
+ traceback.print_exc()
766
+ return {
767
+ 'predicted_salary': 50000,
768
+ 'salary_range': "$40,000 - $65,000",
769
+ 'currency': 'USD',
770
+ 'confidence_score': 0.5,
771
+ 'gpa_level': "Average",
772
+ 'exp_level': "Mid",
773
+ 'linkedin_impact': "Unknown",
774
+ 'courses_impact': "Unknown",
775
+ 'skills_impact': "Unknown",
776
+ 'country_tier': "Upper Middle",
777
+ 'tech_level': "Developing"
778
+ }
779
+
780
+ def get_base_salary(self, country: str, major: str) -> float:
781
+ """Get base salary for country and major with detailed lookup"""
782
+ # Find career category
783
+ career_category = None
784
+ for category, majors in Config.CAREER_CATEGORIES.items():
785
+ if major in majors:
786
+ career_category = category
787
+ break
788
+
789
+ if career_category is None:
790
+ career_category = 'Technology' # Default
791
+
792
+ # Get salary benchmark
793
+ benchmark = self.dm.salary_data[
794
+ (self.dm.salary_data['country'] == country) &
795
+ (self.dm.salary_data['career_category'] == career_category)
796
+ ]
797
+
798
+ if not benchmark.empty:
799
+ return benchmark.iloc[0]['avg_salary']
800
+
801
+ # Default calculation
802
+ country_info = Config.COUNTRIES.get(country, {'gdp_tier': 'Upper Middle', 'tech_level': 'Developing'})
803
+
804
+ base_salaries = {
805
+ 'Very High': 70000,
806
+ 'High': 55000,
807
+ 'Upper Middle': 35000,
808
+ 'Lower Middle': 22000,
809
+ 'Low': 12000
810
+ }
811
+
812
+ base = base_salaries[country_info['gdp_tier']]
813
+
814
+ category_multipliers = {
815
+ 'Technology': 1.6,
816
+ 'Engineering': 1.5,
817
+ 'Healthcare': 1.7,
818
+ 'Business': 1.4,
819
+ 'Science': 1.2,
820
+ 'Humanities': 1.0
821
+ }
822
+
823
+ return base * category_multipliers[career_category]
824
+
825
+ def find_matching_companies(self, inputs: Dict, top_n: int = 7) -> List[Dict]:
826
+ """Find companies matching user profile with detailed scoring"""
827
+ try:
828
+ country = inputs['country']
829
+ major = inputs['major']
830
+ experience_years = float(inputs['experience_years'])
831
+
832
+ # Get career category
833
+ career_category = None
834
+ for category, majors in Config.CAREER_CATEGORIES.items():
835
+ if major in majors:
836
+ career_category = category
837
+ break
838
+
839
+ if career_category is None:
840
+ career_category = 'Technology'
841
+
842
+ # Filter companies
843
+ if country in self.dm.companies_db['country'].unique():
844
+ country_companies = self.dm.companies_db[
845
+ self.dm.companies_db['country'] == country
846
+ ]
847
+ else:
848
+ # Find companies in similar countries
849
+ country_info = Config.COUNTRIES.get(country, {'region': 'Global', 'gdp_tier': 'Upper Middle'})
850
+ similar_countries = [
851
+ c for c, info in Config.COUNTRIES.items()
852
+ if info['region'] == country_info['region'] and info['gdp_tier'] == country_info['gdp_tier']
853
+ ][:5]
854
+
855
+ if not similar_countries:
856
+ similar_countries = ['USA', 'UK', 'UAE', 'Saudi Arabia']
857
+
858
+ country_companies = self.dm.companies_db[
859
+ self.dm.companies_db['country'].isin(similar_countries)
860
+ ]
861
+
862
+ # Calculate detailed match scores
863
+ matches = []
864
+ for _, company in country_companies.iterrows():
865
+ score_details = self.calculate_detailed_match_score(company, inputs, career_category)
866
+ total_score = score_details['total_score']
867
+
868
+ # Calculate expected salary at this company
869
+ base_salary = self.get_base_salary(company['country'], major)
870
+ expected_salary = int(base_salary * company['avg_salary_multiplier'])
871
+
872
+ matches.append({
873
+ 'company_name': company['company_name'],
874
+ 'country': company['country'],
875
+ 'industry': company['industry'],
876
+ 'company_size': company['company_size'],
877
+ 'hiring_status': company['hiring_status'],
878
+ 'match_score': total_score,
879
+ 'career_growth_score': company['career_growth_score'],
880
+ 'salary_multiplier': company['avg_salary_multiplier'],
881
+ 'expected_salary': expected_salary,
882
+ 'score_breakdown': score_details
883
+ })
884
+
885
+ # Sort and return
886
+ matches.sort(key=lambda x: x['match_score'], reverse=True)
887
+ return matches[:top_n]
888
+
889
+ except Exception as e:
890
+ print(f"Company matching error: {e}")
891
+ import traceback
892
+ traceback.print_exc()
893
+ return []
894
+
895
+ def calculate_detailed_match_score(self, company: pd.Series, inputs: Dict, career_category: str) -> Dict:
896
+ """Calculate detailed match score with breakdown"""
897
+ scores = {
898
+ 'industry_fit': 0,
899
+ 'experience_fit': 0,
900
+ 'company_size_fit': 0,
901
+ 'hiring_status': 0,
902
+ 'growth_potential': 0,
903
+ 'total_score': 0
904
+ }
905
+
906
+ experience_years = float(inputs['experience_years'])
907
+ major = inputs['major']
908
+
909
+ # 1. Industry Fit (0-30 points)
910
+ industry_fit_score = 0
911
+
912
+ # Major to industry mapping
913
+ industry_mapping = {
914
+ 'Technology': ['Technology', 'E-commerce', 'Telecommunications', 'Enterprise Software'],
915
+ 'Engineering': ['Engineering', 'Construction', 'Oil & Gas', 'Industrial Tech', 'Automotive/Tech'],
916
+ 'Business': ['Banking', 'Finance', 'Consulting', 'Professional Services', 'E-commerce'],
917
+ 'Healthcare': ['Healthcare', 'Health Tech'],
918
+ 'Science': ['Various', 'Technology', 'Research'],
919
+ 'Humanities': ['Various', 'Media', 'Education', 'Consulting']
920
+ }
921
+
922
+ target_industries = industry_mapping.get(career_category, ['Various'])
923
+ if company['industry'] in target_industries:
924
+ industry_fit_score = 25
925
+ elif any(keyword.lower() in company['industry'].lower() for keyword in ['tech', 'digital', 'software']):
926
+ industry_fit_score = 20
927
+ else:
928
+ industry_fit_score = 10
929
+
930
+ scores['industry_fit'] = industry_fit_score
931
+
932
+ # 2. Experience Fit (0-25 points)
933
+ company_size = company['company_size']
934
+
935
+ if experience_years < 2:
936
+ # Entry level - better fit with startups and small companies
937
+ if 'Startup' in company_size or 'Small' in company_size:
938
+ experience_fit_score = 22
939
+ elif 'Medium' in company_size:
940
+ experience_fit_score = 18
941
+ else:
942
+ experience_fit_score = 12
943
+ elif experience_years < 5:
944
+ # Junior level
945
+ if 'Medium' in company_size or 'Small' in company_size:
946
+ experience_fit_score = 23
947
+ elif 'Large' in company_size:
948
+ experience_fit_score = 20
949
+ else:
950
+ experience_fit_score = 15
951
+ elif experience_years < 8:
952
+ # Mid level
953
+ if 'Large' in company_size or 'Corporate' in company_size:
954
+ experience_fit_score = 24
955
+ elif 'Medium' in company_size:
956
+ experience_fit_score = 22
957
+ else:
958
+ experience_fit_score = 18
959
+ else:
960
+ # Senior level
961
+ if 'Enterprise' in company_size or 'Multinational' in company_size:
962
+ experience_fit_score = 25
963
+ elif 'Corporate' in company_size:
964
+ experience_fit_score = 23
965
+ else:
966
+ experience_fit_score = 20
967
+
968
+ scores['experience_fit'] = experience_fit_score
969
+
970
+ # 3. Company Size Fit (0-15 points)
971
+ size_fit_score = 0
972
+ if experience_years < 3 and ('Startup' in company_size or 'Small' in company_size):
973
+ size_fit_score = 14
974
+ elif 3 <= experience_years < 8 and ('Medium' in company_size or 'Large' in company_size):
975
+ size_fit_score = 13
976
+ elif experience_years >= 8 and ('Enterprise' in company_size or 'Multinational' in company_size):
977
+ size_fit_score = 15
978
+ else:
979
+ size_fit_score = 10
980
+
981
+ scores['company_size_fit'] = size_fit_score
982
+
983
+ # 4. Hiring Status (0-20 points)
984
+ hiring_score = {
985
+ 'Actively Hiring': 20,
986
+ 'Moderate Hiring': 15,
987
+ 'Selective Hiring': 10,
988
+ 'Not Hiring': 0
989
+ }.get(company['hiring_status'], 10)
990
+
991
+ scores['hiring_status'] = hiring_score
992
+
993
+ # 5. Growth Potential (0-10 points)
994
+ growth_score = min(int(company['career_growth_score'] / 10), 10)
995
+ scores['growth_potential'] = growth_score
996
+
997
+ # Calculate total score
998
+ total_score = sum([
999
+ scores['industry_fit'],
1000
+ scores['experience_fit'],
1001
+ scores['company_size_fit'],
1002
+ scores['hiring_status'],
1003
+ scores['growth_potential']
1004
+ ])
1005
+
1006
+ scores['total_score'] = min(total_score, 100)
1007
+
1008
+ return scores
1009
+
1010
+ # ====================
1011
+ # VISUALIZATION ENGINE (Matplotlib)
1012
+ # ====================
1013
+ class VisualizationEngine:
1014
+ @staticmethod
1015
+ def create_salary_comparison_chart(predicted_salary: int, benchmark_salaries: Dict, country: str, major: str):
1016
+ """Create detailed salary comparison chart using Matplotlib"""
1017
+ # إنشاء الشكل
1018
+ plt.figure(figsize=(10, 6))
1019
+
1020
+ # إعداد البيانات
1021
+ categories = list(benchmark_salaries.keys())
1022
+ salaries = list(benchmark_salaries.values())
1023
+
1024
+ # إنشاء الألوان
1025
+ colors = ['#3498db', '#2ecc71', '#e74c3c', '#f39c12', '#9b59b6']
1026
+
1027
+ # رسم الأعمدة
1028
+ bars = plt.bar(categories, salaries, color=colors, alpha=0.8, edgecolor='black', linewidth=1)
1029
+
1030
+ # رسم خط الراتب المتوقع
1031
+ plt.axhline(y=predicted_salary, color='red', linestyle='--', linewidth=3,
1032
+ label=f'Your Prediction: ${predicted_salary:,}')
1033
+
1034
+ # إضافة النصوص على الأعمدة
1035
+ for bar, salary in zip(bars, salaries):
1036
+ height = bar.get_height()
1037
+ plt.text(bar.get_x() + bar.get_width()/2., height + 0.05*max(salaries),
1038
+ f'${salary:,}', ha='center', va='bottom', fontsize=10, fontweight='bold')
1039
+
1040
+ # تخصيص الرسم
1041
+ plt.title(f'Salary Analysis: {major} in {country}', fontsize=16, fontweight='bold', pad=20)
1042
+ plt.xlabel('Salary Categories', fontsize=12)
1043
+ plt.ylabel('Annual Salary (USD)', fontsize=12)
1044
+ plt.legend(loc='upper left')
1045
+ plt.grid(axis='y', alpha=0.3, linestyle='--')
1046
+ plt.ylim(0, max(salaries) * 1.2)
1047
+
1048
+ # تنسيق المحور Y
1049
+ plt.gca().yaxis.set_major_formatter(plt.FuncFormatter(lambda x, p: f'${x:,.0f}'))
1050
+
1051
+ # تدوير تسميات المحور X
1052
+ plt.xticks(rotation=15, ha='right')
1053
+
1054
+ # تحسين التخطيط
1055
+ plt.tight_layout()
1056
+
1057
+ return plt
1058
+
1059
+ @staticmethod
1060
+ def create_company_match_radar(company_data: Dict):
1061
+ """Create radar chart for company match analysis using Matplotlib"""
1062
+ import matplotlib.patches as mpatches
1063
+
1064
+ # البيانات
1065
+ categories = ['Industry Fit', 'Experience Match', 'Company Size',
1066
+ 'Hiring Status', 'Growth Potential', 'Salary Level']
1067
+
1068
+ score_breakdown = company_data.get('score_breakdown', {})
1069
+
1070
+ values = [
1071
+ score_breakdown.get('industry_fit', 0),
1072
+ score_breakdown.get('experience_fit', 0),
1073
+ score_breakdown.get('company_size_fit', 0),
1074
+ score_breakdown.get('hiring_status', 0),
1075
+ score_breakdown.get('growth_potential', 0) * 10,
1076
+ min(company_data.get('salary_multiplier', 1) * 25, 100)
1077
+ ]
1078
+
1079
+ # إغلاق الشكل
1080
+ values.append(values[0])
1081
+ angles = np.linspace(0, 2*np.pi, len(categories), endpoint=False).tolist()
1082
+ angles.append(angles[0])
1083
+ categories_closed = categories + [categories[0]]
1084
+
1085
+ # إنشاء الشكل
1086
+ fig, ax = plt.subplots(figsize=(8, 8), subplot_kw=dict(polar=True))
1087
+
1088
+ # رسم الرادار
1089
+ ax.plot(angles, values, 'o-', linewidth=3, markersize=8, color='#3498db', label=company_data['company_name'])
1090
+ ax.fill(angles, values, alpha=0.25, color='#3498db')
1091
+
1092
+ # رسم خط المستوى المستهدف
1093
+ target_values = [80] * (len(categories) + 1)
1094
+ ax.plot(angles, target_values, '--', linewidth=1, color='#2ecc71', label='Target Score (80)')
1095
+
1096
+ # تخصيص الرسم
1097
+ ax.set_xticks(angles[:-1])
1098
+ ax.set_xticklabels(categories, fontsize=11, fontweight='bold')
1099
+ ax.set_ylim(0, 100)
1100
+ ax.set_yticks([0, 25, 50, 75, 100])
1101
+ ax.set_yticklabels(['0', '25', '50', '75', '100'], fontsize=10)
1102
+ ax.grid(True, alpha=0.3)
1103
+
1104
+ # العنوان
1105
+ plt.title(f"Company Analysis: {company_data['company_name']}", fontsize=14, fontweight='bold', pad=20)
1106
+ plt.legend(loc='upper right', bbox_to_anchor=(1.3, 1.0))
1107
+
1108
+ # تحسين التخطيط
1109
+ plt.tight_layout()
1110
+
1111
+ return plt
1112
+
1113
+ @staticmethod
1114
+ def create_skill_gap_chart(required_skills: List[str], user_skills: List[str]):
1115
+ """Create skill gap analysis chart using Matplotlib"""
1116
+ plt.figure(figsize=(12, 6))
1117
+
1118
+ # تحضير البيانات
1119
+ skill_status = []
1120
+ colors = []
1121
+
1122
+ for skill in required_skills[:10]: # Top 10 required skills
1123
+ if skill in user_skills:
1124
+ skill_status.append(100)
1125
+ colors.append('#2ecc71') # Green for acquired
1126
+ else:
1127
+ skill_status.append(30) # Low for missing
1128
+ colors.append('#e74c3c') # Red for missing
1129
+
1130
+ # إنشاء الأعمدة
1131
+ bars = plt.bar(range(len(required_skills[:10])), skill_status,
1132
+ color=colors, alpha=0.8, edgecolor='black', linewidth=1)
1133
+
1134
+ # إضافة النصوص
1135
+ for i, (bar, skill, status) in enumerate(zip(bars, required_skills[:10], skill_status)):
1136
+ plt.text(bar.get_x() + bar.get_width()/2., bar.get_height() + 1,
1137
+ f'{status}%', ha='center', va='bottom', fontsize=9, fontweight='bold')
1138
+
1139
+ # تدوير أسماء المهارات
1140
+ plt.text(bar.get_x() + bar.get_width()/2., -5,
1141
+ skill[:15] + ('...' if len(skill) > 15 else ''),
1142
+ ha='center', va='top', rotation=45, fontsize=9)
1143
+
1144
+ # تخصيص الرسم
1145
+ plt.title('Skill Gap Analysis', fontsize=16, fontweight='bold', pad=20)
1146
+ plt.ylabel('Status (%)', fontsize=12)
1147
+ plt.ylim(0, 110)
1148
+ plt.grid(axis='y', alpha=0.3, linestyle='--')
1149
+
1150
+ # إزالة تسميات المحور X
1151
+ plt.xticks([])
1152
+
1153
+ # إضافة وسيلة إيضاح
1154
+ from matplotlib.patches import Patch
1155
+ legend_elements = [
1156
+ Patch(facecolor='#2ecc71', edgecolor='black', label='Acquired Skill'),
1157
+ Patch(facecolor='#e74c3c', edgecolor='black', label='Missing Skill')
1158
+ ]
1159
+ plt.legend(handles=legend_elements, loc='upper right')
1160
+
1161
+ # تحسين التخطيط
1162
+ plt.tight_layout()
1163
+
1164
+ return plt
1165
+
1166
+ # ====================
1167
+ # GRADIO UI COMPONENTS
1168
+ # ====================
1169
+ class UIComponents:
1170
+ @staticmethod
1171
+ def create_input_section() -> gr.Blocks:
1172
+ """Create comprehensive input section"""
1173
+ with gr.Blocks() as input_section:
1174
+ gr.Markdown("## 🎯 Personal & Professional Profile")
1175
+
1176
+ with gr.Row():
1177
+ with gr.Column(scale=1):
1178
+ country = gr.Dropdown(
1179
+ choices=sorted(Config.COUNTRIES.keys()),
1180
+ label="🌍 Select Your Country",
1181
+ value="Egypt",
1182
+ interactive=True,
1183
+ filterable=True,
1184
+ info="Select your current or target country"
1185
+ )
1186
+
1187
+ with gr.Column(scale=1):
1188
+ # Flatten majors list
1189
+ all_majors = []
1190
+ for majors in Config.CAREER_CATEGORIES.values():
1191
+ all_majors.extend(majors)
1192
+
1193
+ major = gr.Dropdown(
1194
+ choices=sorted(all_majors),
1195
+ label="🎓 Select Your Major/Field",
1196
+ value="Computer Science",
1197
+ interactive=True,
1198
+ filterable=True,
1199
+ info="Select your academic or professional field"
1200
+ )
1201
+
1202
+ with gr.Row():
1203
+ with gr.Column(scale=1):
1204
+ gpa = gr.Slider(
1205
+ minimum=2.0,
1206
+ maximum=4.0,
1207
+ value=3.5,
1208
+ step=0.1,
1209
+ label="📊 GPA (4.0 Scale)",
1210
+ info="Your cumulative GPA out of 4.0"
1211
+ )
1212
+
1213
+ with gr.Column(scale=1):
1214
+ experience_years = gr.Slider(
1215
+ minimum=0,
1216
+ maximum=40,
1217
+ value=3,
1218
+ step=1,
1219
+ label="📈 Years of Professional Experience",
1220
+ info="Total years of relevant work experience"
1221
+ )
1222
+
1223
+ with gr.Row():
1224
+ with gr.Column(scale=1):
1225
+ experience_level = gr.Dropdown(
1226
+ choices=list(Config.EXPERIENCE_LEVELS.keys()),
1227
+ label="👨‍💼 Experience Level",
1228
+ value="Junior (3-5 years)",
1229
+ interactive=True,
1230
+ info="Your current professional level"
1231
+ )
1232
+
1233
+ with gr.Column(scale=1):
1234
+ has_linkedin = gr.Radio(
1235
+ choices=["Yes", "No"],
1236
+ label="🔗 Active LinkedIn Profile",
1237
+ value="Yes",
1238
+ info="Having an active LinkedIn profile increases visibility"
1239
+ )
1240
+
1241
+ with gr.Row():
1242
+ with gr.Column(scale=1):
1243
+ num_courses = gr.Slider(
1244
+ minimum=0,
1245
+ maximum=50,
1246
+ value=5,
1247
+ step=1,
1248
+ label="📚 Professional Certifications",
1249
+ info="Number of online courses or professional certifications"
1250
+ )
1251
+
1252
+ with gr.Column(scale=1):
1253
+ skills = gr.Textbox(
1254
+ label="💼 Key Skills",
1255
+ placeholder="Python, Data Analysis, Project Management, Communication...",
1256
+ info="Enter your top skills (comma-separated)",
1257
+ lines=2
1258
+ )
1259
+
1260
+ # Advanced options (collapsible)
1261
+ with gr.Accordion("⚙️ Advanced Options", open=False):
1262
+ with gr.Row():
1263
+ with gr.Column(scale=1):
1264
+ university_tier = gr.Radio(
1265
+ choices=["Top Global", "National Top", "Regional", "Local", "Other"],
1266
+ label="🎓 University Tier",
1267
+ value="National Top",
1268
+ info="Reputation of your university"
1269
+ )
1270
+
1271
+ with gr.Column(scale=1):
1272
+ english_proficiency = gr.Radio(
1273
+ choices=["Native", "Fluent", "Professional", "Intermediate", "Basic"],
1274
+ label="🌐 English Proficiency",
1275
+ value="Fluent",
1276
+ info="Your English language level"
1277
+ )
1278
+
1279
+ with gr.Row():
1280
+ with gr.Column(scale=1):
1281
+ arabic_proficiency = gr.Radio(
1282
+ choices=["Native", "Fluent", "Professional", "Intermediate", "Basic", "None"],
1283
+ label="📖 Arabic Proficiency",
1284
+ value="Native",
1285
+ info="Your Arabic language level"
1286
+ )
1287
+
1288
+ with gr.Column(scale=1):
1289
+ willing_to_relocate = gr.Checkbox(
1290
+ label="✈️ Willing to Relocate",
1291
+ value=True,
1292
+ info="Open to relocation opportunities"
1293
+ )
1294
+
1295
+ # Store all inputs
1296
+ inputs = {
1297
+ 'country': country,
1298
+ 'major': major,
1299
+ 'gpa': gpa,
1300
+ 'experience_years': experience_years,
1301
+ 'experience_level': experience_level,
1302
+ 'has_linkedin': has_linkedin,
1303
+ 'num_courses': num_courses,
1304
+ 'skills': skills,
1305
+ 'university_tier': university_tier,
1306
+ 'english_proficiency': english_proficiency,
1307
+ 'arabic_proficiency': arabic_proficiency,
1308
+ 'willing_to_relocate': willing_to_relocate
1309
+ }
1310
+
1311
+ return input_section, inputs
1312
+
1313
+ @staticmethod
1314
+ def create_results_section() -> Dict:
1315
+ """Create comprehensive results display section"""
1316
+ results = {
1317
+ 'salary_prediction': gr.Markdown("## 💰 Salary Prediction\n*Analysis in progress...*"),
1318
+ 'salary_analysis': gr.Markdown("### 📊 Salary Analysis\n*Detailed breakdown will appear here*"),
1319
+ 'top_companies': gr.Dataframe(
1320
+ headers=["Company", "Country", "Industry", "Match %", "Hiring", "Expected Salary"],
1321
+ label="🏢 Top Matching Companies",
1322
+ interactive=False,
1323
+ wrap=True,
1324
+ datatype=["str", "str", "str", "number", "str", "str"]
1325
+ ),
1326
+ 'company_details': gr.Markdown("### 🏛️ Company Details\n*Select a company for detailed analysis*"),
1327
+ 'career_recommendations': gr.Markdown("## 📈 Career Recommendations\n*Personalized advice will appear here*"),
1328
+ 'skill_development': gr.Markdown("### 🎯 Skill Development Plan\n*Target skills for career growth*"),
1329
+ 'salary_chart': gr.Plot(label="📊 Salary Comparison Analysis"),
1330
+ 'company_radar': gr.Plot(label="🎯 Company Match Radar"),
1331
+ 'skill_chart': gr.Plot(label="📈 Skill Gap Analysis")
1332
+ }
1333
+ return results
1334
+
1335
+ # ====================
1336
+ # MAIN APPLICATION
1337
+ # ====================
1338
+ class CareerPredictionApp:
1339
+ def __init__(self):
1340
+ self.dm = DataManager()
1341
+ self.engine = PredictionEngine(self.dm)
1342
+ self.viz = VisualizationEngine()
1343
+ self.ui = UIComponents()
1344
+
1345
+ def predict(self, country, major, gpa, experience_years, experience_level,
1346
+ has_linkedin, num_courses, skills, university_tier,
1347
+ english_proficiency, arabic_proficiency, willing_to_relocate) -> Tuple:
1348
+ """Main prediction function with detailed analysis"""
1349
+ try:
1350
+ # إنشاء قاموس من المدخلات
1351
+ inputs_dict = {
1352
+ 'country': country,
1353
+ 'major': major,
1354
+ 'gpa': gpa,
1355
+ 'experience_years': experience_years,
1356
+ 'experience_level': experience_level,
1357
+ 'has_linkedin': has_linkedin,
1358
+ 'num_courses': num_courses,
1359
+ 'skills': skills,
1360
+ 'university_tier': university_tier,
1361
+ 'english_proficiency': english_proficiency,
1362
+ 'arabic_proficiency': arabic_proficiency,
1363
+ 'willing_to_relocate': willing_to_relocate
1364
+ }
1365
+
1366
+ # Predict salary with detailed analysis
1367
+ salary_prediction = self.engine.predict_salary(inputs_dict)
1368
+
1369
+ # Find matching companies
1370
+ matching_companies = self.engine.find_matching_companies(inputs_dict, top_n=10)
1371
+
1372
+ # Prepare company data for display
1373
+ company_display = []
1374
+ for company in matching_companies:
1375
+ expected_salary = f"${company['expected_salary']:,}"
1376
+ company_display.append([
1377
+ company['company_name'],
1378
+ company['country'],
1379
+ company['industry'],
1380
+ f"{company['match_score']:.0f}",
1381
+ company['hiring_status'],
1382
+ expected_salary
1383
+ ])
1384
+
1385
+ # Get top company for detailed analysis
1386
+ top_company = matching_companies[0] if matching_companies else None
1387
+
1388
+ # Create visualizations
1389
+ benchmark_salaries = {
1390
+ 'Entry Level': self.engine.get_base_salary(inputs_dict['country'], inputs_dict['major']) * 0.7,
1391
+ 'Industry Average': self.engine.get_base_salary(inputs_dict['country'], inputs_dict['major']),
1392
+ 'Your Prediction': salary_prediction['predicted_salary'],
1393
+ 'Senior Level': self.engine.get_base_salary(inputs_dict['country'], inputs_dict['major']) * 1.5,
1394
+ 'Top 10%': self.engine.get_base_salary(inputs_dict['country'], inputs_dict['major']) * 1.8
1395
+ }
1396
+
1397
+ # إنشاء الرسم البياني للراتب
1398
+ salary_plot = self.viz.create_salary_comparison_chart(
1399
+ salary_prediction['predicted_salary'],
1400
+ benchmark_salaries,
1401
+ inputs_dict['country'],
1402
+ inputs_dict['major']
1403
+ )
1404
+
1405
+ if top_company:
1406
+ company_radar = self.viz.create_company_match_radar(top_company)
1407
+ else:
1408
+ # Create dummy radar
1409
+ company_radar = self.viz.create_company_match_radar({
1410
+ 'company_name': 'Market Average',
1411
+ 'score_breakdown': {'industry_fit': 50, 'experience_fit': 50,
1412
+ 'company_size_fit': 50, 'hiring_status': 50,
1413
+ 'growth_potential': 5},
1414
+ 'salary_multiplier': 1.0
1415
+ })
1416
+
1417
+ # Skill gap analysis
1418
+ user_skills = [s.strip().lower() for s in inputs_dict['skills'].split(',')] if inputs_dict['skills'] else []
1419
+ career_category = None
1420
+ for category, majors in Config.CAREER_CATEGORIES.items():
1421
+ if inputs_dict['major'] in majors:
1422
+ career_category = category
1423
+ break
1424
+
1425
+ if career_category and career_category in self.dm.skills_data:
1426
+ required_skills = []
1427
+ for skill_list in self.dm.skills_data[career_category].values():
1428
+ required_skills.extend(skill_list[:5]) # Top skills from each category
1429
+
1430
+ skill_chart = self.viz.create_skill_gap_chart(required_skills[:10], user_skills)
1431
+ else:
1432
+ skill_chart = None
1433
+
1434
+ # Format detailed results
1435
+ salary_text = self.format_salary_prediction(salary_prediction, inputs_dict)
1436
+ salary_analysis = self.format_salary_analysis(salary_prediction)
1437
+
1438
+ if top_company:
1439
+ company_details = self.format_company_details(top_company)
1440
+ else:
1441
+ company_details = "### 🏛️ Company Details\n*No matching companies found*"
1442
+
1443
+ recommendations = self.generate_recommendations(salary_prediction, inputs_dict, matching_companies)
1444
+ skill_development = self.generate_skill_development(career_category, user_skills)
1445
+
1446
+ outputs = [
1447
+ salary_text,
1448
+ salary_analysis,
1449
+ company_display,
1450
+ company_details,
1451
+ recommendations,
1452
+ skill_development,
1453
+ salary_plot,
1454
+ company_radar
1455
+ ]
1456
+
1457
+ if skill_chart:
1458
+ outputs.append(skill_chart)
1459
+ else:
1460
+ outputs.append(None)
1461
+
1462
+ return tuple(outputs)
1463
+
1464
+ except Exception as e:
1465
+ print(f"Prediction error: {e}")
1466
+ import traceback
1467
+ traceback.print_exc()
1468
+
1469
+ error_msg = "## ⚠️ Error\nUnable to generate predictions. Please try again with different inputs."
1470
+ return (error_msg, error_msg, [], error_msg, error_msg, error_msg, None, None, None)
1471
+
1472
+ def format_salary_prediction(self, prediction: Dict, inputs: Dict) -> str:
1473
+ """Format salary prediction results"""
1474
+ country_info = Config.COUNTRIES.get(inputs['country'], {})
1475
+
1476
+ return f"""
1477
+ ## 💰 Salary Prediction
1478
+
1479
+ ### Predicted Annual Salary
1480
+ **${prediction['predicted_salary']:,} USD**
1481
+ *Range: {prediction['salary_range']}*
1482
+
1483
+ ### 📊 Prediction Confidence
1484
+ **{prediction['confidence_score']:.0%}** - Based on profile completeness and market data
1485
+
1486
+ ### 🎯 Profile Analysis
1487
+ - **Country**: {inputs['country']} ({country_info.get('gdp_tier', 'N/A')} GDP Tier)
1488
+ - **Major**: {inputs['major']}
1489
+ - **Experience**: {inputs['experience_years']} years ({prediction['exp_level']} Level)
1490
+ - **GPA**: {inputs['gpa']}/4.0 ({prediction['gpa_level']})
1491
+ - **Certifications**: {prediction['courses_impact']}
1492
+ - **LinkedIn**: {prediction['linkedin_impact']}
1493
+ - **Skills**: {prediction['skills_impact']}
1494
+
1495
+ *Note: Predictions are based on current market data and statistical models. Actual offers may vary.*
1496
+ """
1497
+
1498
+ def format_salary_analysis(self, prediction: Dict) -> str:
1499
+ """Format detailed salary analysis"""
1500
+ return f"""
1501
+ ### 📈 Detailed Analysis
1502
+
1503
+ #### 🏆 Competitive Position
1504
+ - **GPA Impact**: {prediction['gpa_level']} academic performance
1505
+ - **Experience Level**: {prediction['exp_level']} professional standing
1506
+ - **Certification Value**: {prediction['courses_impact']}
1507
+
1508
+ #### 🌍 Market Factors
1509
+ - **Country Economic Tier**: {prediction['country_tier']}
1510
+ - **Tech Infrastructure**: {prediction['tech_level']}
1511
+ - **Professional Visibility**: {prediction['linkedin_impact']}
1512
+
1513
+ #### 💡 Improvement Opportunities
1514
+ Based on your current profile, you could potentially increase your salary by:
1515
+ - **15-25%** with 2-3 more years of targeted experience
1516
+ - **10-15%** with additional specialized certifications
1517
+ - **5-10%** by expanding your professional network
1518
+ """
1519
+
1520
+ def format_company_details(self, company: Dict) -> str:
1521
+ """Format company details"""
1522
+ score_breakdown = company.get('score_breakdown', {})
1523
+
1524
+ return f"""
1525
+ ### 🏛️ {company['company_name']}
1526
+
1527
+ #### 📍 Company Information
1528
+ - **Country**: {company['country']}
1529
+ - **Industry**: {company['industry']}
1530
+ - **Company Size**: {company['company_size']}
1531
+ - **Hiring Status**: {company['hiring_status']}
1532
+
1533
+ #### 🎯 Match Analysis
1534
+ **Overall Match Score**: {company['match_score']:.0f}/100
1535
+
1536
+ **Score Breakdown**:
1537
+ - Industry Fit: {score_breakdown.get('industry_fit', 0)}/30
1538
+ - Experience Match: {score_breakdown.get('experience_fit', 0)}/25
1539
+ - Company Size Fit: {score_breakdown.get('company_size_fit', 0)}/15
1540
+ - Hiring Status: {score_breakdown.get('hiring_status', 0)}/20
1541
+ - Growth Potential: {score_breakdown.get('growth_potential', 0)}/10
1542
+
1543
+ #### 💰 Expected Compensation
1544
+ **Estimated Salary**: ${company['expected_salary']:,}
1545
+ **Salary Multiplier**: {company['salary_multiplier']:.1f}x market average
1546
+ **Career Growth Score**: {company['career_growth_score']}/100
1547
+
1548
+ #### 📈 Recommendation
1549
+ This company is {'an excellent match' if company['match_score'] >= 80 else 'a good match' if company['match_score'] >= 65 else 'a potential match'} for your profile.
1550
+ """
1551
+
1552
+ def generate_recommendations(self, prediction: Dict, inputs: Dict, companies: List[Dict]) -> str:
1553
+ """Generate personalized career recommendations"""
1554
+ country = inputs['country']
1555
+ major = inputs['major']
1556
+ experience_years = float(inputs['experience_years'])
1557
+
1558
+ recommendations = []
1559
+
1560
+ # Based on salary prediction
1561
+ if prediction['predicted_salary'] < 30000:
1562
+ recommendations.append("**💰 Salary Growth Strategy**: Focus on gaining specialized skills and certifications to move into higher-paying roles.")
1563
+ elif prediction['predicted_salary'] < 60000:
1564
+ recommendations.append("**��� Mid-Career Development**: Consider leadership training and strategic networking to advance to senior positions.")
1565
+ else:
1566
+ recommendations.append("**🏆 Executive Advancement**: Focus on strategic impact, thought leadership, and building high-value networks.")
1567
+
1568
+ # Based on experience
1569
+ if experience_years < 3:
1570
+ recommendations.append("**🎯 Early Career Focus**: Build a strong foundation through diverse projects and mentorship opportunities.")
1571
+ elif experience_years < 8:
1572
+ recommendations.append("**🚀 Mid-Career Acceleration**: Develop specialization and take on leadership responsibilities.")
1573
+ else:
1574
+ recommendations.append("**💼 Senior Leadership**: Focus on strategic initiatives, mentoring others, and industry influence.")
1575
+
1576
+ # Based on country
1577
+ country_info = Config.COUNTRIES.get(country, {})
1578
+ if country_info.get('tech_level') == 'Advanced':
1579
+ recommendations.append("**🌍 Global Opportunities**: Leverage advanced tech ecosystem for international career opportunities.")
1580
+ elif country_info.get('tech_level') == 'Developing':
1581
+ recommendations.append("**📱 Local Market Leadership**: Position yourself as an expert in the growing local tech scene.")
1582
+
1583
+ # Based on matching companies
1584
+ if companies:
1585
+ top_industries = [c['industry'] for c in companies[:3]]
1586
+ recommendations.append(f"**🏢 Industry Focus**: High demand in {', '.join(set(top_industries))} sectors.")
1587
+
1588
+ recommendations_text = "## 📈 Career Recommendations\n\n" + "\n\n".join(recommendations)
1589
+
1590
+ # Add action plan
1591
+ action_plan = f"""
1592
+ ### 🗓️ 6-Month Action Plan
1593
+
1594
+ 1. **Month 1-2**: Update professional profiles and portfolio
1595
+ 2. **Month 3-4**: Complete 1-2 key certifications
1596
+ 3. **Month 5-6**: Network with professionals in target companies
1597
+
1598
+ ### 🤝 Networking Strategy
1599
+
1600
+ - Connect with alumni from your university working in {major}
1601
+ - Join professional associations in {country}
1602
+ - Attend industry conferences (virtual or in-person)
1603
+ - Engage with thought leaders on LinkedIn
1604
+
1605
+ ### 📚 Recommended Resources
1606
+
1607
+ - Industry reports on {major} trends in {country}
1608
+ - Online courses from platforms like Coursera, edX, LinkedIn Learning
1609
+ - Professional certifications relevant to your field
1610
+ """
1611
+
1612
+ return recommendations_text + action_plan
1613
+
1614
+ def generate_skill_development(self, career_category: str, user_skills: List[str]) -> str:
1615
+ """Generate skill development plan"""
1616
+ if not career_category or career_category not in self.dm.skills_data:
1617
+ return "### 🎯 Skill Development\n*Unable to generate skill recommendations*"
1618
+
1619
+ skills_data = self.dm.skills_data[career_category]
1620
+
1621
+ # Identify skill gaps
1622
+ critical_skills = []
1623
+ for category, skills in skills_data.items():
1624
+ critical_skills.extend(skills[:3]) # Top 3 from each category
1625
+
1626
+ # Filter out skills user already has
1627
+ user_skills_lower = [s.lower() for s in user_skills]
1628
+ skill_gaps = [skill for skill in critical_skills[:10] if skill.lower() not in user_skills_lower]
1629
+
1630
+ if not skill_gaps:
1631
+ skill_gaps = ["Advanced specialization in your current skills",
1632
+ "Industry-specific certifications",
1633
+ "Leadership and management training"]
1634
+
1635
+ skill_text = f"""
1636
+ ### 🎯 Skill Development Plan
1637
+
1638
+ #### 📋 Critical Skills for {career_category}
1639
+
1640
+ **Technical Skills:**
1641
+ {', '.join(skills_data.get('technical_skills', skills_data.get('programming_languages', []))[:5])}
1642
+
1643
+ **Professional Skills:**
1644
+ {', '.join(skills_data.get('soft_skills', skills_data.get('management_skills', []))[:5])}
1645
+
1646
+ #### 🎓 Priority Development Areas
1647
+
1648
+ 1. **Immediate Focus (1-3 months):**
1649
+ {skill_gaps[0] if len(skill_gaps) > 0 else 'Specialized certification'}
1650
+
1651
+ 2. **Medium-term Goals (3-6 months):**
1652
+ {skill_gaps[1] if len(skill_gaps) > 1 else 'Advanced technical training'}
1653
+
1654
+ 3. **Long-term Development (6-12 months):**
1655
+ {skill_gaps[2] if len(skill_gaps) > 2 else 'Leadership development'}
1656
+
1657
+ #### 🚀 Learning Resources
1658
+
1659
+ - **Online Platforms**: Coursera, edX, Udacity, LinkedIn Learning
1660
+ - **Certifications**: Industry-recognized credentials
1661
+ - **Practical Projects**: Real-world applications
1662
+ - **Mentorship**: Guidance from experienced professionals
1663
+ """
1664
+
1665
+ return skill_text
1666
+
1667
+ # ====================
1668
+ # GRADIO APP
1669
+ # ====================
1670
+ def create_app() -> gr.Blocks:
1671
+ """Create the Gradio application interface"""
1672
+ app_instance = CareerPredictionApp()
1673
+
1674
+ with gr.Blocks(
1675
+ title="🌍 Global Career Prediction Assistant",
1676
+ theme=gr.themes.Soft(
1677
+ primary_hue="blue",
1678
+ secondary_hue="purple",
1679
+ neutral_hue="gray"
1680
+ ),
1681
+ css="""
1682
+ .gradio-container {
1683
+ max-width: 1400px;
1684
+ margin: 0 auto;
1685
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
1686
+ }
1687
+ .input-section {
1688
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
1689
+ padding: 25px;
1690
+ border-radius: 15px;
1691
+ margin-bottom: 25px;
1692
+ color: white;
1693
+ }
1694
+ .output-card {
1695
+ background: white;
1696
+ padding: 25px;
1697
+ border-radius: 15px;
1698
+ margin-bottom: 20px;
1699
+ box-shadow: 0 4px 15px rgba(0,0,0,0.1);
1700
+ border: 1px solid #e0e0e0;
1701
+ }
1702
+ .highlight {
1703
+ background: linear-gradient(120deg, #a8edea 0%, #fed6e3 100%);
1704
+ padding: 20px;
1705
+ border-radius: 10px;
1706
+ margin: 15px 0;
1707
+ }
1708
+ .dataframe {
1709
+ font-size: 14px;
1710
+ }
1711
+ .plot-container {
1712
+ border-radius: 10px;
1713
+ padding: 15px;
1714
+ background: white;
1715
+ box-shadow: 0 2px 10px rgba(0,0,0,0.05);
1716
+ }
1717
+ """
1718
+ ) as app:
1719
+ # Header
1720
+ gr.Markdown("""
1721
+ # 🌍 Global Career Prediction Assistant
1722
+ ### Your AI-Powered Career Advisor for 200+ Countries
1723
+
1724
+ **Predict salaries, find matching companies, and get personalized career recommendations**
1725
+ *Powered by comprehensive global market data and AI analysis*
1726
+ """)
1727
+
1728
+ # Create input section
1729
+ input_section, inputs = app_instance.ui.create_input_section()
1730
+
1731
+ # Create results section
1732
+ results = app_instance.ui.create_results_section()
1733
+
1734
+ # Submit button
1735
+ submit_btn = gr.Button(
1736
+ "🚀 Get Comprehensive Career Analysis",
1737
+ variant="primary",
1738
+ size="lg",
1739
+ elem_classes=["submit-btn"]
1740
+ )
1741
+
1742
+ # Clear button
1743
+ clear_btn = gr.Button("🔄 Clear All", variant="secondary")
1744
+
1745
+ # Connect submit button
1746
+ submit_btn.click(
1747
+ fn=app_instance.predict,
1748
+ inputs=[inputs[key] for key in inputs.keys()],
1749
+ outputs=[
1750
+ results['salary_prediction'],
1751
+ results['salary_analysis'],
1752
+ results['top_companies'],
1753
+ results['company_details'],
1754
+ results['career_recommendations'],
1755
+ results['skill_development'],
1756
+ results['salary_chart'],
1757
+ results['company_radar'],
1758
+ results['skill_chart']
1759
+ ]
1760
+ )
1761
+
1762
+ # Clear function
1763
+ def clear_all():
1764
+ return [gr.update(value=None) for _ in range(9)]
1765
+
1766
+ clear_btn.click(
1767
+ fn=clear_all,
1768
+ inputs=[],
1769
+ outputs=[
1770
+ results['salary_prediction'],
1771
+ results['salary_analysis'],
1772
+ results['top_companies'],
1773
+ results['company_details'],
1774
+ results['career_recommendations'],
1775
+ results['skill_development'],
1776
+ results['salary_chart'],
1777
+ results['company_radar'],
1778
+ results['skill_chart']
1779
+ ]
1780
+ )
1781
+
1782
+ # Examples section
1783
+ with gr.Accordion("📋 Example Profiles", open=False):
1784
+ gr.Markdown("### Try these example profiles:")
1785
+
1786
+ examples = [
1787
+ ["Egypt", "Computer Science", 3.8, 5, "Mid Level (5-8 years)", "Yes", 8,
1788
+ "Python, Machine Learning, Data Analysis, Cloud Computing", "National Top", "Fluent", "Native", True],
1789
+ ["Saudi Arabia", "Petroleum Engineering", 3.5, 12, "Senior (8-12 years)", "Yes", 15,
1790
+ "Reservoir Engineering, Project Management, Risk Analysis", "Regional", "Professional", "Native", True],
1791
+ ["UAE", "Business Administration", 3.2, 3, "Junior (3-5 years)", "Yes", 5,
1792
+ "Marketing, Sales, Communication, Excel", "Local", "Fluent", "Native", True],
1793
+ ["USA", "Data Science", 3.9, 7, "Senior (8-12 years)", "Yes", 12,
1794
+ "Python, SQL, Machine Learning, Statistics, Data Visualization", "Top Global", "Native", "Basic", True],
1795
+ ["Turkey", "Electrical Engineering", 3.6, 8, "Senior (8-12 years)", "Yes", 10,
1796
+ "Power Systems, MATLAB, AutoCAD, Project Management", "National Top", "Professional", "Fluent", True]
1797
+ ]
1798
+
1799
+ example_btns = []
1800
+ for i, example in enumerate(examples, 1):
1801
+ btn = gr.Button(f"Example {i}: {example[0]} - {example[1]}", size="sm")
1802
+ example_btns.append(btn)
1803
+
1804
+ btn.click(
1805
+ fn=lambda vals: vals,
1806
+ inputs=[gr.State(example)],
1807
+ outputs=[inputs[key] for key in inputs.keys()] + [
1808
+ results['salary_prediction'],
1809
+ results['salary_analysis'],
1810
+ results['top_companies'],
1811
+ results['company_details'],
1812
+ results['career_recommendations'],
1813
+ results['skill_development'],
1814
+ results['salary_chart'],
1815
+ results['company_radar'],
1816
+ results['skill_chart']
1817
+ ]
1818
+ )
1819
+
1820
+ # Footer
1821
+ gr.Markdown(f"""
1822
+ ---
1823
+
1824
+ ### 📊 About This Platform
1825
+
1826
+ This AI-powered platform analyzes career data across **{len(Config.COUNTRIES)} countries** and **{sum(len(majors) for majors in Config.CAREER_CATEGORIES.values())} career paths** to provide:
1827
+
1828
+ - **Accurate Salary Predictions** using GDP tiers, tech levels, and local market data
1829
+ - **Intelligent Company Matching** with detailed scoring algorithms
1830
+ - **Personalized Recommendations** based on your unique profile
1831
+ - **Skill Gap Analysis** to guide your professional development
1832
+
1833
+ ### 🌐 Global Coverage
1834
+
1835
+ - **Arab World**: 22 Arab countries with detailed economic profiles
1836
+ - **Europe**: 44 countries with advanced tech ecosystems
1837
+ - **Asia**: 48 countries including emerging tech hubs
1838
+ - **Americas**: 35 countries from North, Central, and South America
1839
+ - **Africa**: 54 countries with growing opportunities
1840
+ - **Oceania**: 14 countries including Australia and New Zealand
1841
+
1842
+ ### 🔍 Data Sources
1843
+
1844
+ - World Bank GDP data and economic indicators
1845
+ - Global tech hub classifications
1846
+ - Industry salary surveys and reports
1847
+ - Company databases and hiring trends
1848
+ - Professional certification frameworks
1849
+
1850
+ ### ⚠️ Disclaimer
1851
+
1852
+ *Predictions are based on statistical models and market data. Actual results may vary based on individual circumstances, interview performance, and market conditions. This tool is for informational purposes only.*
1853
+
1854
+ ---
1855
+
1856
+ *Last Updated: {datetime.now().strftime("%B %d, %Y")} | Version 2.0 | Covering 200+ Countries Worldwide*
1857
+ """)
1858
+
1859
+ return app
1860
+
1861
+ # ====================
1862
+ # APPLICATION LAUNCH
1863
+ # ====================
1864
+ def main():
1865
+ """Launch the application"""
1866
+ app = create_app()
1867
+
1868
+ # Launch with Hugging Face Spaces settings
1869
+ app.launch(
1870
+ server_name="0.0.0.0",
1871
+ server_port=7860,
1872
+ share=False,
1873
+ debug=True,
1874
+ show_error=True,
1875
+ auth=None,
1876
+ max_file_size="100MB"
1877
+ )
1878
+
1879
+ if __name__ == "__main__":
1880
+ main()
gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
requirements.txt ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ gradio>=4.0.0
2
+ pandas>=2.0.0
3
+ numpy>=1.24.0
4
+ plotly>=5.0.0
5
+ scikit-learn>=1.3.0
6
+ joblib>=1.3.0
7
+ python-dotenv>=1.0.0
8
+ matplotlib>=3.7.0