Skip to content

Education Analyzer

EducationAnalyzer

EducationAnalyzer(semantic_matcher=None)

Analyzer for education requirement matching.

Matches education entries against required degree, understanding degree hierarchy (e.g., Master's satisfies Bachelor's requirement). Uses semantic matching when exact degree names don't match.

Attributes:

Name Type Description
semantic_matcher

Optional semantic matcher for degree name matching.

Example
analyzer = EducationAnalyzer(semantic_matcher=matcher)
score = analyzer.analyze(education_entries, required_degree="Bachelor's degree")

Initialize the education analyzer.

Parameters:

Name Type Description Default
semantic_matcher SemanticMatcher | None

Optional semantic matcher for degree matching.

None
Source code in at_scorer/analyzers/education.py
def __init__(self, semantic_matcher: SemanticMatcher | None = None):
    """Initialize the education analyzer.

    Args:
        semantic_matcher: Optional semantic matcher for degree matching.
    """
    self.semantic_matcher = semantic_matcher

Functions

analyze
analyze(education, required_degree)

Analyze education entries against required degree.

Checks if any education entry meets or exceeds the required degree level. Higher degrees satisfy lower degree requirements.

Parameters:

Name Type Description Default
education list[EducationEntry]

List of education entries from resume.

required
required_degree str | None

Required degree level (e.g., "Bachelor's degree").

required

Returns:

Type Description
float

Score between 0.0 and 1.0: - 1.0 if requirement is met or exceeded - 0.0 if no education found - Partial score based on degree hierarchy if close match

Source code in at_scorer/analyzers/education.py
def analyze(self, education: list[EducationEntry], required_degree: str | None) -> float:
    """Analyze education entries against required degree.

    Checks if any education entry meets or exceeds the required degree level.
    Higher degrees satisfy lower degree requirements.

    Args:
        education: List of education entries from resume.
        required_degree: Required degree level (e.g., "Bachelor's degree").

    Returns:
        Score between 0.0 and 1.0:
            - 1.0 if requirement is met or exceeded
            - 0.0 if no education found
            - Partial score based on degree hierarchy if close match
    """
    if not required_degree:
        return 1.0 if education else 0.0
    required_rank = _degree_rank(required_degree)
    if required_rank == -1:
        return 0.5
    best = -1
    for edu in education:
        rank = _degree_rank(edu.degree)
        best = max(best, rank)
        if rank >= required_rank:
            return 1.0
        if self.semantic_matcher and edu.degree:
            score = self.semantic_matcher.similarity(edu.degree, required_degree)
            best = max(best, int(score * len(DEGREE_ORDER)))
    if best == -1:
        return 0.0
    return min(1.0, (best + 1) / (required_rank + 1))