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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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
"""
skill_extractor.py (Production v5.0 - BTech All Roles)
-------------------------------------------------------
Advanced Resume Skill Extractor:
- Covers ALL common BTech career roles
- Regex-based extraction (word-boundary safe)
- Role-wise organized skill database
- Smart normalization + inferred skills
- Clean & deduplicated output
"""

import re


# ─────────────────────────────────────────────
# πŸ”Ή SKILLS DATABASE β€” BTech ALL ROLES
# ─────────────────────────────────────────────

SKILLS_LIST = [

    # ── 1. SOFTWARE DEVELOPMENT ───────────────
    "python", "java", "javascript", "typescript", "c", "c++", "c#",
    "ruby", "php", "swift", "kotlin", "go", "rust", "scala", "r", "matlab",
    "html", "css", "react", "react.js", "next.js", "angular", "vue",
    "redux", "tailwind css", "framer motion",
    "node.js", "nodejs", "express", "express.js",
    "django", "flask", "fastapi", "spring boot",
    "rest api", "rest apis", "websockets", "graphql",
    "jwt", "oauth", "authentication", "authorization",
    "mvc", "state management", "api design",
    "prisma", "mongoose",
    "vercel", "netlify",
    "frontend development", "backend development", "full stack", "web development",

    # ── 2. DATA SCIENCE / ML / AI ─────────────
    "machine learning", "deep learning", "data science", "data analysis",
    "tensorflow", "pytorch", "keras", "scikit-learn",
    "pandas", "numpy", "matplotlib", "seaborn", "scipy",
    "nlp", "natural language processing", "computer vision",
    "opencv", "hugging face", "llm", "generative ai", "prompt engineering",
    "feature engineering", "model deployment", "mlops",
    "regression", "classification", "clustering", "neural network",
    "random forest", "xgboost", "time series",
    "artificial intelligence", "chatgpt", "copilot",

    # ── 3. DATA ENGINEERING / ANALYTICS ───────
    "sql", "mysql", "postgresql", "mongodb", "redis", "firebase",
    "oracle", "sqlite", "dynamodb", "cassandra",
    "power bi", "tableau", "excel", "google sheets",
    "etl", "data pipeline", "apache spark", "hadoop", "kafka",
    "airflow", "dbt", "snowflake", "bigquery", "data warehouse",
    "data visualization", "business intelligence",

    # ── 4. DEVOPS / CLOUD ─────────────────────
    "aws", "azure", "gcp", "docker", "kubernetes", "jenkins",
    "terraform", "ansible", "ci/cd", "linux", "bash", "shell scripting",
    "git", "github", "gitlab", "bitbucket",
    "nginx", "apache", "load balancing", "microservices",
    "serverless", "lambda", "cloud computing",

    # ── 5. CYBERSECURITY ──────────────────────
    "network security", "ethical hacking", "penetration testing",
    "kali linux", "metasploit", "wireshark", "nmap", "burp suite",
    "cryptography", "ssl", "tls", "firewall", "ids", "ips",
    "siem", "soc", "vulnerability assessment", "owasp",
    "digital forensics", "malware analysis", "incident response",
    "information security", "cyber security",

    # ── 6. EMBEDDED SYSTEMS / IOT ─────────────
    "embedded c", "arduino", "raspberry pi", "stm32", "esp32",
    "rtos", "freertos", "uart", "spi", "i2c", "can bus",
    "iot", "mqtt", "zigbee", "bluetooth", "wifi module",
    "pcb design", "kicad", "altium", "proteus", "multisim",
    "microcontroller", "microprocessor", "fpga", "vhdl", "verilog",
    "signal processing", "sensor integration",

    # ── 7. VLSI / CHIP DESIGN ─────────────────
    "vlsi", "verilog", "vhdl", "system verilog",
    "cadence", "synopsys", "mentor graphics",
    "rtl design", "synthesis", "sta", "place and route",
    "digital design", "analog design", "asic", "soc design",
    "dft", "timing analysis", "power analysis",

    # ── 8. MECHANICAL ENGINEERING ─────────────
    "autocad", "solidworks", "catia", "ansys", "creo",
    "fusion 360", "3d printing", "additive manufacturing",
    "cad", "cam", "cfd", "fea", "finite element analysis",
    "manufacturing processes", "cnc machining",
    "thermodynamics", "fluid mechanics", "heat transfer",
    "robotics", "automation", "plc", "scada", "hmi",
    "lean manufacturing", "six sigma", "quality control",

    # ── 9. CIVIL ENGINEERING ──────────────────
    "autocad civil", "staad pro", "etabs", "revit", "primavera",
    "ms project", "civil 3d",
    "structural analysis", "structural design", "rcc design",
    "surveying", "gis", "remote sensing", "arcgis",
    "construction management", "project planning",
    "soil mechanics", "geotechnical", "foundation design",
    "highway design", "transportation engineering",
    "water supply", "sanitation", "irrigation",

    # ── 10. ELECTRICAL ENGINEERING ────────────
    "power systems", "power electronics", "circuit design",
    "matlab simulink", "pspice", "ltspice", "labview",
    "electric vehicles", "battery management system",
    "solar energy", "wind energy", "renewable energy",
    "transformer", "motor drives", "inverter", "rectifier",
    "control systems", "pid controller",
    "high voltage", "switchgear", "protection relay",
    "smart grid", "energy audit",

    # ── 11. ELECTRONICS & COMMUNICATION ───────
    "signal processing", "dsp", "image processing",
    "communication systems", "wireless communication",
    "5g", "lte", "antenna design", "rf design",
    "hfss", "cst", "ads",
    "optical fiber", "photonics",
    "digital electronics", "analog electronics",
    "oscilloscope", "logic analyzer",

    # ── 12. ROBOTICS / AUTOMATION ─────────────
    "ros", "ros2", "gazebo", "slam", "path planning",
    "sensor fusion", "robotic arm", "drone", "uav",
    "autonomous systems", "control theory", "motion planning",
    "industrial automation", "plc programming",

    # ── 13. PRODUCT MANAGEMENT (Tech) ─────────
    "product roadmap", "user stories", "agile", "scrum", "kanban",
    "jira", "confluence", "notion", "trello",
    "wireframing", "prototyping", "figma", "balsamiq",
    "market research", "competitive analysis",
    "a/b testing", "product analytics", "kpi tracking",
    "stakeholder management", "go to market",

    # ── 14. UI/UX DESIGN ──────────────────────
    "figma", "adobe xd", "sketch", "invision",
    "photoshop", "illustrator", "after effects",
    "user research", "usability testing",
    "design thinking", "information architecture",
    "interaction design", "visual design", "typography",
    "color theory", "responsive design", "accessibility",

    # ── 15. BUSINESS ANALYST / CONSULTING ─────
    "requirement gathering", "brd", "frd", "use case",
    "uml", "flowchart", "process mapping", "gap analysis",
    "business analysis", "functional testing", "uat",

    # ── 16. TESTING / QA ──────────────────────
    "manual testing", "automation testing", "selenium",
    "cypress", "playwright", "jest", "pytest",
    "test cases", "test plan", "bug tracking",
    "api testing", "postman", "jmeter", "load testing",
    "performance testing", "regression testing",
    "black box testing", "white box testing",

    # ── 17. GAME DEVELOPMENT ──────────────────
    "unity", "unreal engine", "godot",
    "game design", "level design", "3d modeling",
    "blender", "maya", "3ds max",
    "ar", "vr", "mixed reality", "xr",
    "physics simulation", "shader programming",

    # ── 18. BLOCKCHAIN ────────────────────────
    "blockchain", "solidity", "ethereum", "web3.js", "ethers.js",
    "smart contracts", "nft", "defi", "hyperledger",
    "cryptocurrency", "metamask", "truffle", "hardhat",
    "ipfs", "decentralized applications", "dapps",

    # ── 19. SOFT SKILLS ───────────────────────
    "communication", "leadership", "teamwork", "problem solving",
    "project management", "critical thinking",
    "time management", "presentation", "collaboration",
    "analytical thinking", "attention to detail",

    # ── 20. MOBILE DEVELOPMENT ────────────────
    "react native", "flutter", "dart", "swiftui", "jetpack compose",
    "android development", "ios development", "mobile development",
    "xcode", "android studio", "expo",

    # ── 21. DATA / MODERN TOOLS ───────────────
    "streamlit", "gradio", "langchain", "llamaindex", "pinecone",
    "chromadb", "weaviate", "vector database", "rag",
    "data lake", "lakehouse", "delta lake", "databricks",
    "looker", "metabase", "superset",

    # ── 22. CLOUD CERTIFICATIONS & SERVICES ───
    "aws lambda", "s3", "ec2", "ecs", "eks", "cloudfront",
    "azure devops", "azure functions", "cosmos db",
    "google cloud functions", "cloud run", "vertex ai",
    "heroku", "railway", "render", "fly.io",

    # ── 23. API & ARCHITECTURE ────────────────
    "grpc", "soap", "swagger", "openapi",
    "event driven", "message queue", "rabbitmq",
    "design patterns", "solid principles", "clean architecture",
    "domain driven design", "system design",

    # ── 24. VERSION CONTROL & CI/CD ──────────
    "github actions", "circleci", "travis ci", "argo cd",
    "helm", "prometheus", "grafana", "elk stack",
    "datadog", "new relic", "splunk",
]


# ─────────────────────────────────────────────
# πŸ”₯ SKILL NORMALIZATION MAP
# ─────────────────────────────────────────────

SKILL_MAP = {
    # Variations
    "react":      ["react.js"],
    "node.js":    ["nodejs"],
    "express":    ["express.js"],
    "rest api":   ["rest apis"],
    "html":       ["html5"],
    "css":        ["css3"],

    # Software Dev
    "full stack":              ["mern", "fullstack", "mean"],
    "authentication":          ["jwt", "oauth", "auth"],
    "frontend development":    ["react", "next.js", "angular", "vue", "html", "css"],
    "backend development":     ["node.js", "express", "django", "flask", "fastapi", "spring boot"],
    "version control":         ["git", "github", "gitlab"],
    "database management":     ["sql", "mysql", "postgresql", "mongodb", "redis", "firebase"],

    # AI / ML
    "deep learning":           ["tensorflow", "keras", "pytorch"],
    "data science":            ["pandas", "numpy", "data analysis", "machine learning"],
    "nlp":                     ["llm", "natural language processing", "text classification", "tokenization", "hugging face"],
    "machine learning":        ["ml", "scikit-learn", "model training", "regression", "classification", "xgboost"],
    "artificial intelligence": ["ai", "neural network", "deep learning", "machine learning", "generative ai"],
    "computer vision":         ["image recognition", "object detection", "opencv", "cnn"],
    "mlops":                   ["model deployment", "mlflow", "kubeflow"],
    "seaborn":                 ["matplotlib"],
    "classification":          ["classify", "classification", "predict", "model training"],

    # DevOps / Cloud
    "devops":                  ["ci/cd", "docker", "kubernetes", "jenkins", "terraform", "ansible"],
    "cloud computing":         ["aws", "azure", "gcp", "serverless", "lambda"],

    # Security
    "cyber security":          ["ethical hacking", "penetration testing", "network security", "owasp"],
    "ethical hacking":         ["kali linux", "metasploit", "burp suite", "nmap"],

    # Embedded / IoT
    "iot":                     ["mqtt", "arduino", "raspberry pi", "esp32", "zigbee"],
    "embedded systems":        ["embedded c", "rtos", "microcontroller", "stm32", "esp32"],

    # VLSI
    "vlsi":                    ["verilog", "vhdl", "system verilog", "rtl design", "asic"],

    # Mechanical
    "cad":                     ["autocad", "solidworks", "catia", "creo", "fusion 360"],
    "simulation":              ["ansys", "fea", "cfd", "matlab simulink"],
    "automation":              ["plc", "scada", "hmi", "industrial automation"],
    "lean manufacturing":      ["six sigma", "quality control", "kaizen"],

    # Civil
    "structural design":       ["staad pro", "etabs", "rcc design"],
    "gis":                     ["arcgis", "remote sensing", "civil 3d"],

    # Electrical
    "power electronics":       ["inverter", "rectifier", "motor drives", "battery management system"],
    "renewable energy":        ["solar energy", "wind energy", "electric vehicles"],
    "control systems":         ["pid controller", "matlab simulink", "labview"],

    # Robotics
    "robotics":                ["ros", "ros2", "slam", "path planning", "robotic arm", "drone"],

    # Testing
    "automation testing":      ["selenium", "cypress", "playwright", "jest", "pytest"],
    "api testing":             ["postman", "jmeter"],

    # Game Dev
    "game development":        ["unity", "unreal engine", "godot", "game design"],
    "3d modeling":             ["blender", "maya", "3ds max"],
    "vr":                      ["virtual reality", "oculus", "steamvr"],
    "ar":                      ["augmented reality", "arkit", "arcore"],

    # Blockchain
    "blockchain":              ["solidity", "ethereum", "smart contracts", "web3.js", "dapps"],

    # Data / Analytics
    "business intelligence":   ["power bi", "tableau", "data visualization"],
    "data pipeline":           ["apache spark", "kafka", "airflow", "etl"],
    "data warehouse":          ["snowflake", "bigquery", "redshift"],

    # Mobile
    "mobile development":      ["react native", "flutter", "android development", "ios development"],
    "android development":     ["kotlin", "jetpack compose", "android studio"],
    "ios development":         ["swift", "swiftui", "xcode"],

    # Modern AI/Data
    "rag":                     ["langchain", "llamaindex", "vector database", "chromadb", "pinecone"],
    "generative ai":           ["llm", "chatgpt", "copilot", "prompt engineering", "rag", "langchain"],

    # Product / Design
    "agile":                   ["scrum", "kanban", "jira", "sprint"],
    "ui/ux":                   ["figma", "adobe xd", "wireframing", "prototyping", "user research"],

     # Soft skills
    "collaboration": ["collaborated", "teamwork", "team", "worked with"],

     # Feature engineering
    "feature engineering": [
        "data preprocessing",
        "data cleaning",
        "feature extraction",
        "data transformation"
    ],

    # Teamwork
    "teamwork": [
        "team",
        "collaborated",
        "community",
        "worked with",
        "coordinated"
    ],

    # Analytical thinking
    "analytical thinking": [
        "data analysis",
        "problem solving",
        "analysis",
        "model training"
    ]
}


# ─────────────────────────────────────────────
# πŸ”Ή EDUCATION KEYWORDS
# ─────────────────────────────────────────────

EDUCATION_KEYWORDS = [
    "bachelor", "master", "phd", "doctorate", "diploma",
    "b.tech", "m.tech", "b.sc", "m.sc", "b.e", "m.e",
    "bca", "mca", "bba", "mba", "b.com", "m.com",
    "university", "college", "institute", "school",
    "computer science", "information technology",
    "engineering", "mathematics", "physics", "chemistry",
    "electronics", "electrical", "mechanical", "civil",
    "degree", "graduation", "post graduation", "certification",
    "12th", "10th", "higher secondary", "secondary",
    "iit", "nit", "iiit", "bits", "vit", "lpu", "amity",
    "cgpa", "gpa", "percentage", "aggregate",
    "coursework", "specialization", "minor", "major",
    "data science", "artificial intelligence",
    "biotechnology", "biomedical", "chemical engineering",
    "aerospace", "automobile", "industrial engineering",
]


# ─────────────────────────────────────────────
# πŸ”Ή EXPERIENCE KEYWORDS
# ─────────────────────────────────────────────

EXPERIENCE_KEYWORDS = [
    "experience", "years of experience", "worked at", "working at",
    "intern", "internship", "fresher", "junior", "senior",
    "lead", "manager", "director", "team lead",
    "full time", "part time", "freelance", "contract",
    "responsibilities", "achievements", "projects",
    "developed", "implemented", "designed", "managed",
    "built", "created", "maintained", "optimized",
    "deployed", "architected", "collaborated", "researched",
    "analyzed", "tested", "automated", "integrated",
    "mentored", "supervised", "coordinated", "delivered",
    "contributed", "spearheaded", "launched", "scaled",
    "improved", "reduced", "increased", "streamlined",
    "training", "workshop", "hackathon", "open source",
    "startup", "company", "organization", "firm",
    "software engineer", "data analyst", "web developer",
    "ml engineer", "devops engineer", "full stack developer",
]


# ─────────────────────────────────────────────
# πŸ”Ή HELPER FUNCTION
# ─────────────────────────────────────────────

def _match(keyword: str, text: str) -> bool:
    """Word-boundary safe keyword match."""
    pattern = r"(?<![a-z0-9])" + re.escape(keyword.lower()) + r"(?![a-z0-9])"
    return bool(re.search(pattern, text))


# ─────────────────────────────────────────────
# πŸ”Ή SKILL EXTRACTION
# ─────────────────────────────────────────────

def extract_skills(text: str) -> list[str]:
    """
    Extract skills from resume text using regex keyword matching.

    Args:
        text (str): Cleaned resume text.

    Returns:
        list[str]: Skills found in the text.
    """
    text_lower = text.lower()
    return [skill for skill in SKILLS_LIST if _match(skill, text_lower)]


# ─────────────────────────────────────────────
# πŸ”₯ NORMALIZATION
# ─────────────────────────────────────────────

def normalize_skills(skills: list[str], text: str) -> list[str]:
    """
    Infer higher-level skills from related keywords found in text.
    Example: "tensorflow" found β†’ "deep learning" automatically added.

    Args:
        skills (list[str]): Already extracted raw skills.
        text (str): Original resume text.

    Returns:
        list[str]: Expanded, deduplicated, sorted skill list.
    """
    normalized = set(skills)
    text_lower = text.lower()

    for main_skill, related_keywords in SKILL_MAP.items():
        for keyword in related_keywords:
            if _match(keyword, text_lower):
                normalized.add(main_skill)
                break

    return sorted(normalized)


# ─────────────────────────────────────────────
# πŸ”Ή EDUCATION
# ─────────────────────────────────────────────

def extract_education(text: str) -> list[str]:
    """
    Find education-related keywords in resume text.

    Args:
        text (str): Cleaned resume text.

    Returns:
        list[str]: Education keywords found.
    """
    text_lower = text.lower()
    return list(set([kw for kw in EDUCATION_KEYWORDS if _match(kw, text_lower)]))


# ─────────────────────────────────────────────
# πŸ”Ή EXPERIENCE
# ─────────────────────────────────────────────

def extract_experience(text: str) -> list[str]:
    """
    Find experience-related keywords in resume text.

    Args:
        text (str): Cleaned resume text.

    Returns:
        list[str]: Experience indicators found.
    """
    text_lower = text.lower()
    return list(set([kw for kw in EXPERIENCE_KEYWORDS if _match(kw, text_lower)]))


# ─────────────────────────────────────────────
# πŸ”Ή MAIN PIPELINE
# ─────────────────────────────────────────────

def extract_all(text: str) -> dict:
    """
    Full extraction pipeline:
      1. Extract raw skills via regex
      2. Normalize using SKILL_MAP inference
      3. Extract education and experience

    Args:
        text (str): Cleaned resume text.

    Returns:
        dict: {
            "skills": [...],
            "education": [...],
            "experience": [...]
        }
    """
    raw_skills = extract_skills(text)
    final_skills = normalize_skills(raw_skills, text)

    return {
        "skills": final_skills,
        "education": extract_education(text),
        "experience": extract_experience(text),
    }