Categories We Write About

Build a resume analyzer using keyword matching

Here’s a Python-based implementation of a Resume Analyzer using keyword matching. This tool reads resumes (in .txt format or extracted text from PDF), matches them against a set of predefined keywords (based on job descriptions or required skills), and scores them based on relevance.

python
import os import re from typing import List, Dict class ResumeAnalyzer: def __init__(self, keywords: List[str]): self.keywords = [kw.lower() for kw in keywords] def clean_text(self, text: str) -> str: text = text.lower() text = re.sub(r'[^ws]', '', text) return text def extract_keywords(self, text: str) -> Dict[str, int]: text = self.clean_text(text) words = text.split() keyword_freq = {kw: words.count(kw) for kw in self.keywords} return keyword_freq def score_resume(self, keyword_freq: Dict[str, int]) -> int: return sum(keyword_freq.values()) def analyze_resume(self, text: str) -> Dict[str, any]: keyword_freq = self.extract_keywords(text) score = self.score_resume(keyword_freq) return { "keyword_frequency": keyword_freq, "total_score": score } # Example Usage if __name__ == "__main__": keywords = [ "python", "machine learning", "data analysis", "sql", "tensorflow", "communication", "leadership", "project management", "cloud", "aws" ] # Example resume text (normally you'd read from a file or PDF extractor) resume_text = """ Experienced data scientist with strong Python and SQL skills. Proficient in data analysis and machine learning. Worked on cloud deployment using AWS. Excellent communication and leadership abilities. """ analyzer = ResumeAnalyzer(keywords) result = analyzer.analyze_resume(resume_text) print("Resume Analysis Results:") print(f"Keyword Frequency: {result['keyword_frequency']}") print(f"Total Relevance Score: {result['total_score']}")

Features:

  • Keyword Frequency Counting: Counts how often each keyword appears.

  • Scoring: Adds up the keyword matches to generate a relevance score.

  • Extensible: You can plug in keyword lists for different job descriptions.

Extension Ideas:

  • Use PDF resume parsing with libraries like PyPDF2 or pdfplumber.

  • Integrate with NLTK or spaCy for more advanced NLP.

  • Create a simple web interface with Flask for uploading and scoring resumes.

Let me know if you want a web-based version or a feature to compare multiple resumes.

Share This Page:

Enter your email below to join The Palos Publishing Company Email List

We respect your email privacy

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Categories We Write About