Repository navigation
Expand file tree
/
Copy pathtest_complete_workflow.py
More file actions
75 lines (58 loc) · 3.16 KB
/
Copy pathtest_complete_workflow.py
File metadata and controls
75 lines (58 loc) · 3.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/usr/bin/env python3
"""
Test the complete AI job matching workflow
"""
from simple_job_search import SimpleJobSearch
import os
def test_complete_workflow():
searcher = SimpleJobSearch()
print("🧪 Testing Complete AI Job Matching Workflow")
print("=" * 60)
# Test 1: Resume parsing and job title extraction
print("\n1️⃣ Testing Resume Parsing & Job Title Extraction")
print("-" * 50)
resume_file = 'sample_resume.docx'
if os.path.exists(resume_file):
resume_data = searcher.parse_resume(resume_file)
print(f"✅ Resume parsed: {len(resume_data['skills'])} skills, {resume_data['experience_years']} years exp")
# Test job title extraction
extracted_title = searcher.extract_job_title_from_resume(resume_data)
print(f"🤖 Auto-extracted job title: '{extracted_title}'")
# Test 2: Job search with AI matching
print(f"\n2️⃣ Testing Job Search with AI Matching")
print("-" * 50)
jobs = searcher.search_jobs(extracted_title, "India")
print(f"📋 Found {len(jobs)} jobs")
# Apply AI matching
matched_jobs = searcher.rank_jobs_by_resume(jobs, resume_data)
print(f"🤖 Applied AI matching and ranking")
# Show top 3 matches
print(f"\n🏆 Top 3 Job Matches:")
for i, job in enumerate(matched_jobs[:3], 1):
match_score = job.get('match_score', 0)
match_category = job.get('match_category', 'No Match')
skills_match = job.get('match_breakdown', {}).get('skills', {})
print(f"\n{i}. {job['title']} at {job['company']}")
print(f" Match: {match_score}% ({match_category})")
print(f" Skills: {skills_match.get('matched_count', 0)}/{skills_match.get('total_job_skills', 0)} matching")
if skills_match.get('matching'):
print(f" ✅ You have: {', '.join(skills_match['matching'][:5])}")
if skills_match.get('missing'):
print(f" ❌ Missing: {', '.join(skills_match['missing'][:3])}")
# Test 3: Low fit jobs (should still be shown)
print(f"\n3️⃣ Testing Low Fit Jobs (Always Show)")
print("-" * 50)
low_fit_jobs = [job for job in matched_jobs if job.get('match_score', 0) < 40]
print(f"📊 Jobs with <40% match: {len(low_fit_jobs)}")
print(f"✅ All jobs shown regardless of match score")
# Test 4: Sample jobs fallback
print(f"\n4️⃣ Testing Sample Jobs Fallback")
print("-" * 50)
sample_jobs = searcher.get_sample_jobs_for_title("Machine Learning Engineer", "Bangalore")
print(f"🎯 Generated {len(sample_jobs)} sample jobs")
print(f"📝 Sample job: {sample_jobs[0]['title']} at {sample_jobs[0]['company']}")
print(f"🛠️ Skills: {', '.join(sample_jobs[0]['skills'][:5])}")
else:
print(f"❌ Sample resume not found. Run 'python test_resume_sample.py' first.")
if __name__ == "__main__":
test_complete_workflow()