Certainly! Below is a simple example of a full index page using HTML, CSS, and JavaScript. This UI allows a recruiter to upload multiple resumes (as text files or PDFs), enter a job description, and then get a list of shortlisted resumes based on basic NLP keyword matching.
For real-world usage, you'd typically have a backend service to do heavier NLP and classification work, but this demo does everything frontend only for simplicity.
Features
- Text area to input the job description.
- File input to upload multiple resumes (only .txt for simplicity here; you can extend to PDFs with a backend).
- Uses basic keyword matching with NLP preprocessing (lowercasing, simple tokenization).
- Shows shortlisted resumes with matching scores.
How to run
- Save the code below as
index.html.
- Open in a modern browser.
- Paste/upload resumes and enter job description.
- Click "Shortlist Resumes".
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Resume Shortlisting Tool</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 2rem;
background-color: #fafafa;
color: #333;
}
h1 {
text-align: center;
margin-bottom: 1.5rem;
}
label {
font-weight: bold;
display: block;
margin: 1rem 0 0.5rem 0;
}
textarea {
width: 100%;
height: 120px;
padding: 10px;
resize: vertical;
font-size: 1rem;
}
input[type="file"] {
margin-top: 8px;
}
button {
margin-top: 20px;
padding: 12px 20px;
font-size: 1rem;
cursor: pointer;
background-color: #007bff;
border: none;
color: white;
border-radius: 4px;
transition: background-color 0.3s ease;
}
button:hover {
background-color: #0056b3;
}
.results {
margin-top: 2rem;
}
.resume {
margin: 0.5rem 0;
padding: 0.75rem 1rem;
border-radius: 6px;
background-color: #e9f0ff;
border: 1px solid #c3d1ff;
}
.score {
font-weight: bold;
float: right;
background-color: #004085;
color: white;
padding: 2px 6px;
border-radius: 3px;
font-size: 0.9rem;
}
.footer {
margin-top: 4rem;
font-size: 0.85rem;
text-align: center;
color: #666;
}
</style>
</head>
<body>
<h1>Resume Shortlisting Tool</h1>
<label for="jobDesc">Job Description:</label>
<textarea id="jobDesc" placeholder="Paste the job description here..."></textarea>
<label for="resumesInput">Upload Resumes (Text files only):</label>
<input type="file" id="resumesInput" multiple accept=".txt" />
<button id="shortlistBtn">Shortlist Resumes</button>
<div class="results" id="results"></div>
<div class="footer">
<p>Simple demo using keyword matching and NLP preprocessing in browser.</p>
</div>
<script>
// Simple tokenizer: lowercase, remove punctuation, split by space
function tokenize(text) {
return text
.toLowerCase()
.replace(/[.,\/#!$%\^&\*;:{}=\-_`~()]/g, ' ')
.split(/\s+/)
.filter(Boolean);
}
// Count frequencies of tokens in an array
function getFreqMap(tokens) {
const freq = {};
tokens.forEach(t => {
freq[t] = (freq[t] || 0) + 1;
});
return freq;
}
// Compute keyword matching score between jobDesc tokens and resume tokens
// Simple scoring: count of matching keywords weighted by frequencies
function scoreResume(jobFreq, resumeFreq) {
let score = 0;
for (let word in jobFreq) {
if (resumeFreq[word]) {
score += Math.min(jobFreq[word], resumeFreq[word]);
}
}
return score;
}
// Read uploaded text files and return promises with {name, content}
function readFiles(files) {
const readers = Array.from(files).map(f => {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.onload = () => resolve({ name: f.name, content: reader.result });
reader.onerror = () => reject(`Failed to read file: ${f.name}`);
reader.readAsText(f);
});
});
return Promise.all(readers);
}
document.getElementById('shortlistBtn').addEventListener('click', async () => {
const jobDesc = document.getElementById('jobDesc').value.trim();
const files = document.getElementById('resumesInput').files;
const resultsDiv = document.getElementById('results');
resultsDiv.innerHTML = '';
if (!jobDesc) {
alert('Please enter the job description.');
return;
}
if (!files.length) {
alert('Please upload at least one resume.');
return;
}
resultsDiv.innerHTML = '<p>Processing resumes...</p>';
try {
const resumes = await readFiles(files);
const jobTokens = tokenize(jobDesc);
const jobFreq = getFreqMap(jobTokens);
// Process each resume
let scoredResumes = resumes.map(r => {
const resumeTokens = tokenize(r.content);
const resumeFreq = getFreqMap(resumeTokens);
const score = scoreResume(jobFreq, resumeFreq);
return { name: r.name, score };
});
// Filter out zero score resumes and sort descending
scoredResumes = scoredResumes.filter(r => r.score > 0);
scoredResumes.sort((a,b) => b.score - a.score);
if (scoredResumes.length === 0) {
resultsDiv.innerHTML = '<p>No resumes matched the job description keywords.</p>';
return;
}
// Display results
resultsDiv.innerHTML = `<h2>Shortlisted Resumes (${scoredResumes.length})</h2>`;
scoredResumes.forEach(r => {
const div = document.createElement('div');
div.className = 'resume';
div.innerHTML = `${r.name} <span class="score">${r.score}</span>`;
resultsDiv.appendChild(div);
});
} catch(err) {
resultsDiv.innerHTML = `<p style="color:red;">Error: ${err}</p>`;
}
});
</script>
</body>
</html>
How It Works
- The recruiter pastes a job description.
- Uploads multiple
.txt resume files.
- When clicking "Shortlist Resumes":
- The app tokenizes the job description and counts keyword frequencies.
- Each resume is tokenized similarly.
- A score is computed for each resume by counting overlapping keywords.
- Resumes with zero score are filtered out.
- Remaining resumes are sorted by score and displayed.
Notes for Improvement / Production
- Use backend parsing for PDFs, DOCX, etc.
- Use real NLP models for semantic matching.
- Add classification model (ML/DL) for better shortlisting.
- Improve UI with progress bars, drag-drop uploads.
- Integrate cloud storage for uploads and processing.
- Security and privacy considerations for sensitive data.
If you want me to help build a backend or enhance the UI with frameworks like React/Vue or add ML models, just ask!