-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProject_working.html
More file actions
545 lines (476 loc) Β· 19.2 KB
/
Project_working.html
File metadata and controls
545 lines (476 loc) Β· 19.2 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
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
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cold Email Generator - Demo</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
line-height: 1.6;
color: #333;
background: #ced0d1;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
.header {
text-align: center;
margin-bottom: 40px;
padding: 40px 0;
background: linear-gradient(135deg, #f53434 0%, #aa6ea8 100%);
color: white;
border-radius: 12px;
}
.header h1 {
font-size: 2.5rem;
margin-bottom: 10px;
}
.header p {
font-size: 1.2rem;
opacity: 0.9;
}
.section {
background: white;
margin: 30px 0;
padding: 30px;
border-radius: 12px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.section h2 {
color: #2c3e50;
margin-bottom: 20px;
font-size: 1.8rem;
border-bottom: 3px solid #3498db;
padding-bottom: 10px;
}
.workflow {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 20px;
margin: 20px 0;
}
.workflow-step {
background: #f8f9fa;
padding: 20px;
border-radius: 8px;
border-left: 4px solid #3498db;
position: relative;
}
.workflow-step::before {
content: attr(data-step);
position: absolute;
top: -10px;
left: -10px;
background: #3498db;
color: white;
width: 30px;
height: 30px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
font-size: 14px;
}
.workflow-step h3 {
margin-bottom: 10px;
color: #2c3e50;
}
.tech-stack {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin: 20px 0;
}
.tech-badge {
background: #e3f2fd;
color: #1976d2;
padding: 8px 16px;
border-radius: 20px;
font-size: 14px;
font-weight: 500;
}
.demo-interface {
background: #f8f9fa;
border: 2px dashed #ddd;
border-radius: 8px;
padding: 20px;
margin: 20px 0;
text-align: center;
}
.input-demo {
background: white;
border: 1px solid #ddd;
border-radius: 4px;
padding: 12px;
margin: 10px;
width: 300px;
max-width: 100%;
}
.btn-demo {
background: #3498db;
color: white;
border: none;
padding: 12px 24px;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
margin: 10px;
}
.btn-demo:hover {
background: #2980b9;
}
.email-output {
background: #fff;
border: 1px solid #ddd;
border-radius: 8px;
padding: 20px;
margin: 20px 0;
font-family: 'Courier New', monospace;
white-space: pre-line;
}
.process-flow {
display: flex;
align-items: center;
justify-content: space-between;
margin: 20px 0;
flex-wrap: wrap;
}
.process-step {
background: #3498db;
color: white;
padding: 15px 20px;
border-radius: 8px;
text-align: center;
flex: 1;
margin: 5px;
min-width: 150px;
}
.arrow {
font-size: 24px;
color: #3498db;
margin: 0 10px;
}
.code-block {
background: #2d3748;
color: #e2e8f0;
padding: 20px;
border-radius: 8px;
overflow-x: auto;
font-family: 'Courier New', monospace;
font-size: 14px;
margin: 15px 0;
}
.highlight {
background: #fff3cd;
padding: 15px;
border-left: 4px solid #ffc107;
margin: 15px 0;
border-radius: 4px;
}
@media (max-width: 768px) {
.header h1 {
font-size: 2rem;
}
.process-flow {
flex-direction: column;
}
.arrow {
transform: rotate(90deg);
}
}
</style>
</head>
<body>
<div class="container">
<!-- Header -->
<div class="header">
<h1>Cold Email Generator</h1>
<p>AI-Powered Business Outreach for Service Companies</p>
</div>
<!-- Project Overview -->
<div class="section">
<h2>π― Project Overview</h2>
<p>The Cold Email Generator is an intelligent tool designed specifically for service companies to automate and personalize their business outreach efforts. By leveraging advanced AI technologies, it extracts job listings from company career pages and generates highly targeted cold emails that match specific job requirements with relevant service offerings.</p>
<div class="tech-stack">
<span class="tech-badge">Llama 3.1 LLM</span>
<span class="tech-badge">Groq</span>
<span class="tech-badge">LangChain</span>
<span class="tech-badge">Streamlit</span>
<span class="tech-badge">ChromaDB</span>
<span class="tech-badge">Python</span>
</div>
</div>
<!-- How It Works -->
<div class="section">
<h2>β‘ How It Works</h2>
<div class="demo-interface">
<h3>Live Demo Interface</h3>
<input type="text" class="input-demo" placeholder="Enter company career page URL" value="https://jobs.nike.com/careers">
<br>
<button class="btn-demo" onclick="simulateProcess()">Extract Jobs & Generate Emails</button>
<div id="demo-status" style="margin-top: 15px; font-style: italic; color: #666;"></div>
</div>
<div class="process-flow">
<div class="process-step">URL Input</div>
<div class="arrow">β</div>
<div class="process-step">Web Scraping</div>
<div class="arrow">β</div>
<div class="process-step">Job Extraction</div>
<div class="arrow">β</div>
<div class="process-step">Resume Matching</div>
<div class="arrow">β</div>
<div class="process-step">Email Generation</div>
</div>
</div>
<!-- Technical Workflow -->
<div class="section">
<h2>π§ Technical Workflow Deep Dive</h2>
<div class="workflow">
<div class="workflow-step" data-step="1">
<h3>Data Extraction Layer</h3>
<p><strong>Web Scraping Engine:</strong> Uses BeautifulSoup4 and Selenium to extract job postings from career pages. Handles dynamic content loading and JavaScript-rendered pages.</p>
<div class="code-block">
# Web scraping implementation
from selenium import webdriver
from bs4 import BeautifulSoup
import requests
def extract_jobs(url):
driver = webdriver.Chrome()
driver.get(url)
html = driver.page_source
soup = BeautifulSoup(html, 'html.parser')
return parse_job_listings(soup)</div>
</div>
<div class="workflow-step" data-step="2">
<h3>Job Parsing & Structuring</h3>
<p><strong>LangChain Integration:</strong> Processes raw HTML content to extract structured job data including titles, requirements, descriptions, and company information.</p>
<div class="code-block">
# Job parsing with LangChain
from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain.schema import Document
def structure_job_data(raw_jobs):
structured_jobs = []
for job in raw_jobs:
job_doc = Document(
page_content=job['description'],
metadata={
'title': job['title'],
'requirements': job['requirements'],
'company': job['company']
}
)
structured_jobs.append(job_doc)
return structured_jobs</div>
</div>
<div class="workflow-step" data-step="3">
<h3>Vector Database Storage</h3>
<p><strong>ChromaDB Integration:</strong> Converts job descriptions into embeddings and stores them in a vector database for semantic similarity matching.</p>
<div class="code-block">
# ChromaDB vector storage
import chromadb
from langchain.vectorstores import Chroma
from langchain.embeddings import HuggingFaceEmbeddings
def store_in_vectordb(job_documents):
embeddings = HuggingFaceEmbeddings()
vectorstore = Chroma.from_documents(
documents=job_documents,
embedding=embeddings,
persist_directory="./job_vectors"
)
return vectorstore</div>
</div>
<div class="workflow-step" data-step="4">
<h3>Resume Portfolio Matching</h3>
<p><strong>Semantic Search:</strong> Matches job requirements with relevant portfolios/resumes using cosine similarity. Identifies best-fit candidates for each position.</p>
<div class="code-block">
# Resume matching algorithm
def match_resumes_to_jobs(job_embeddings, resume_portfolio):
matches = []
for job in job_embeddings:
similar_resumes = vectorstore.similarity_search(
job.page_content,
k=3,
filter={'skills': job.metadata['requirements']}
)
matches.append({
'job': job,
'matched_resumes': similar_resumes
})
return matches</div>
</div>
<div class="workflow-step" data-step="5">
<h3>AI Email Generation</h3>
<p><strong>Llama 3.1 via Groq:</strong> Generates personalized cold emails using the matched job-resume pairs. Creates contextually relevant content with specific value propositions.</p>
<div class="code-block">
# Email generation with Llama 3.1
from groq import Groq
def generate_cold_email(job_match, company_info):
client = Groq(api_key="your-groq-api-key")
prompt = f"""
Generate a professional cold email for:
Job: {job_match['job'].metadata['title']}
Company: {company_info['name']}
Matched Resume: {job_match['matched_resumes'][0]}
Focus on specific value propositions and relevance.
"""
response = client.chat.completions.create(
messages=[{"role": "user", "content": prompt}],
model="llama3-70b-8192"
)
return response.choices[0].message.content</div>
</div>
<div class="workflow-step" data-step="6">
<h3>Output Delivery</h3>
<p><strong>Streamlit Interface:</strong> Presents generated emails in an intuitive web interface with editing capabilities, export options, and campaign management features.</p>
<div class="code-block">
# Streamlit interface
import streamlit as st
def display_generated_emails(emails):
st.title("Generated Cold Emails")
for i, email in enumerate(emails):
with st.expander(f"Email {i+1}: {email['subject']}"):
st.text_area("Email Content", email['content'])
if st.button(f"Export Email {i+1}"):
export_email(email)</div>
</div>
</div>
</div>
<!-- Complete Example -->
<div class="section">
<h2>π§ Complete Example</h2>
<div class="highlight">
<strong>Scenario:</strong> A web development agency wants to reach out to Nike for their Senior Frontend Developer position
</div>
<h3>Input Data:</h3>
<div class="code-block">
Job Title: Senior Frontend Developer
Company: Nike
Requirements: React, TypeScript, 5+ years experience, E-commerce
Location: Portland, OR
Posted: 2 days ago
Matched Resume: John Smith - Frontend Specialist
- 6 years React development
- E-commerce platform expertise
- TypeScript proficiency
- Portfolio: 15+ successful projects</div>
<h3>Generated Cold Email:</h3>
<div class="email-output">Subject: Enhancing Nike's Frontend Development with Proven E-commerce Expertise
Dear Nike Hiring Team,
I noticed your recent posting for a Senior Frontend Developer position and wanted to reach out regarding our specialized frontend development services.
Our team has extensive experience in the exact technologies you're seeking:
β’ **React & TypeScript Mastery**: Our lead developer, John Smith, brings 6+ years of React development experience with deep TypeScript expertise
β’ **E-commerce Specialization**: We've successfully delivered 15+ e-commerce platforms, understanding the unique challenges of high-traffic retail environments
β’ **Performance Focus**: Our solutions consistently achieve 95+ PageSpeed scores, crucial for conversion optimization
Given Nike's position as a global e-commerce leader, we understand the critical importance of:
- Seamless user experiences across devices
- Fast loading times for product catalogs
- Scalable architecture for traffic spikes during launches
**Value Proposition**: Instead of the typical 3-6 month hiring and onboarding process, we can provide immediate frontend development support while you find the perfect full-time candidate.
**Recent Success**: We recently helped [Similar Company] reduce their product page load time by 40%, resulting in a 15% increase in conversions.
Would you be open to a brief 15-minute call to discuss how our frontend expertise could support Nike's immediate development needs?
Best regards,
[Your Name]
[Company Name]
[Contact Information]
P.S. I've attached our portfolio showcasing similar e-commerce projects that might interest your team.</div>
<h3>Email Analytics:</h3>
<div class="code-block">
Personalization Score: 92/100
Relevance Match: 89/100
Professional Tone: 95/100
Call-to-Action Strength: 88/100
Key Matching Elements:
β Technology stack alignment (React, TypeScript)
β Industry experience (E-commerce)
β Seniority level match (6+ years vs 5+ required)
β Location consideration (Remote-friendly)
β Portfolio relevance (15+ projects)</div>
</div>
<!-- Technical Architecture -->
<div class="section">
<h2>ποΈ System Architecture</h2>
<div class="process-flow">
<div class="process-step">Streamlit Frontend</div>
<div class="arrow">β</div>
<div class="process-step">LangChain Processing</div>
<div class="arrow">β</div>
<div class="process-step">ChromaDB Vector Store</div>
<div class="arrow">β</div>
<div class="process-step">Groq + Llama 3.1</div>
</div>
<h3>Data Flow:</h3>
<div class="workflow">
<div class="workflow-step" data-step="A">
<h3>Input Processing</h3>
<p>Career page URLs β Web scraper β Raw HTML β Job parser β Structured data</p>
</div>
<div class="workflow-step" data-step="B">
<h3>Vector Processing</h3>
<p>Job descriptions β Embeddings β ChromaDB storage β Similarity search β Resume matching</p>
</div>
<div class="workflow-step" data-step="C">
<h3>Email Generation</h3>
<p>Matched pairs β Prompt engineering β Llama 3.1 β Generated emails β Quality scoring</p>
</div>
<div class="workflow-step" data-step="D">
<h3>Output Delivery</h3>
<p>Email content β Streamlit interface β User review β Export/Send β Campaign tracking</p>
</div>
</div>
</div>
<!-- Key Features -->
<div class="section">
<h2>π Key Features</h2>
<div class="workflow">
<div class="workflow-step" data-step="β‘">
<h3>Intelligent Matching</h3>
<p>Uses vector similarity to match job requirements with portfolio skills, ensuring highly relevant email content and improved response rates.</p>
</div>
<div class="workflow-step" data-step="π―">
<h3>Dynamic Personalization</h3>
<p>Each email is uniquely crafted based on specific job requirements, company culture, and matched candidate profiles.</p>
</div>
<div class="workflow-step" data-step="β±οΈ">
<h3>Batch Processing</h3>
<p>Process multiple job listings simultaneously, generating dozens of targeted emails in minutes rather than hours.</p>
</div>
<div class="workflow-step" data-step="π">
<h3>Quality Scoring</h3>
<p>Built-in analytics rate email quality, relevance, and personalization level to optimize outreach effectiveness.</p>
</div>
</div>
</div>
</div>
<script>
function simulateProcess() {
const statusDiv = document.getElementById('demo-status');
const steps = [
'Connecting to career page...',
'Extracting job listings...',
'Processing job descriptions...',
'Matching with resume portfolio...',
'Generating personalized emails...',
'β
Generated 12 targeted cold emails!'
];
let currentStep = 0;
const interval = setInterval(() => {
statusDiv.textContent = steps[currentStep];
statusDiv.style.color = currentStep === steps.length - 1 ? '#28a745' : '#007bff';
currentStep++;
if (currentStep >= steps.length) {
clearInterval(interval);
}
}, 1500);
}
</script>
</body>
</html>