Keyword Analyzer
KeywordAnalyzer
Analyzer for matching keywords between job descriptions and resumes.
Uses multiple matching strategies: 1. Exact token matching (case-insensitive, normalized) 2. Fuzzy string matching (partial ratio >= 80%) 3. Semantic similarity (if semantic_matcher is provided, threshold >= 0.7)
Attributes:
| Name | Type | Description |
|---|---|---|
semantic_matcher |
Optional semantic matcher for ML-powered similarity. If provided, enables semantic keyword matching in addition to exact and fuzzy matching. |
Example
# Basic analyzer (exact + fuzzy matching only)
analyzer = KeywordAnalyzer()
# With semantic matching
from at_scorer.ml import SemanticMatcher, EmbeddingModel
model = EmbeddingModel()
matcher = SemanticMatcher(model)
analyzer = KeywordAnalyzer(semantic_matcher=matcher)
score, matched, missing = analyzer.analyze(resume_text, keywords)
Initialize the keyword analyzer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
semantic_matcher
|
SemanticMatcher | None
|
Optional semantic matcher for ML-powered similarity. If None, only exact and fuzzy matching will be used. |
None
|
Source code in at_scorer/analyzers/keyword.py
Functions
analyze
Analyze keyword matches between resume text and job keywords.
Matches keywords using multiple strategies: - Exact token matching (normalized, case-insensitive) - Fuzzy string matching (partial ratio >= 80%) - Semantic similarity (if semantic_matcher available, threshold >= 0.7)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
resume_text
|
str
|
The full text content of the resume. |
required |
keywords
|
Iterable[str]
|
Iterable of keywords from the job description to match. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float, list[str], list[str]]
|
Tuple containing: - score: Float between 0.0 and 1.0 representing the ratio of matched keywords to total keywords. - matched_keywords: List of keywords that were successfully matched. - missing_keywords: List of keywords that were not found. |