Skip to content

Commit ccbf849

Browse files
feat: Add tags from experiences.json to generated resumes
- Extract skills, technologies, techniques, and principles from experiences.json - Map experience entries by employer+role to add tags to resume data - Deduplicate tags while preserving order - Tags now appear in both HTML and DOCX generated resumes
1 parent 389ccd3 commit ccbf849

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

src/generate_hybrid_resume.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,38 @@ def generate_hybrid_resume(
9292
'date': cert.get('dates', '')
9393
})
9494

95+
# Add tags to experience entries from experiences.json
96+
if 'experience' in resume_data:
97+
# Create a map of experiences by employer+role for quick lookup
98+
exp_map = {}
99+
for exp in experiences:
100+
if not exp.get('id', '').startswith(('edu-', 'cert-')):
101+
key = (exp.get('employer', '').lower(), exp.get('role', '').lower())
102+
exp_map[key] = exp
103+
104+
# Add tags to matching experience entries
105+
for resume_exp in resume_data['experience']:
106+
key = (resume_exp.get('employer', '').lower(), resume_exp.get('role', '').lower())
107+
if key in exp_map:
108+
exp_entry = exp_map[key]
109+
# Combine all tag sources
110+
all_tags = []
111+
all_tags.extend(exp_entry.get('skills', []) or [])
112+
all_tags.extend(exp_entry.get('technologies', []) or [])
113+
all_tags.extend(exp_entry.get('techniques', []) or [])
114+
all_tags.extend(exp_entry.get('principles', []) or [])
115+
116+
# Remove duplicates while preserving order
117+
seen = set()
118+
unique_tags = []
119+
for tag in all_tags:
120+
if tag and tag.lower() not in seen:
121+
seen.add(tag.lower())
122+
unique_tags.append(tag)
123+
124+
if unique_tags:
125+
resume_exp['tags'] = unique_tags
126+
95127
# Step 1: Apply RAG tailoring if requested
96128
if use_rag and jd_path:
97129
print("🧠 Applying RAG-enhanced tailoring...")

0 commit comments

Comments
 (0)