47 lines
1.3 KiB
Python
47 lines
1.3 KiB
Python
from __future__ import annotations
|
|
|
|
from typing import Any, Dict
|
|
|
|
from tg_resume_db.extract.parse import (
|
|
extract_contacts,
|
|
extract_name_guess,
|
|
extract_remote,
|
|
extract_english,
|
|
extract_roles_skills,
|
|
extract_salary,
|
|
extract_location_best_effort,
|
|
extract_experience_years,
|
|
)
|
|
|
|
|
|
def parse_resume(clean_text: str, sections: Dict[str, str] | None = None) -> Dict[str, Any]:
|
|
text = clean_text or ""
|
|
|
|
contacts_raw = extract_contacts(text)
|
|
name = extract_name_guess(text)
|
|
remote = extract_remote(text)
|
|
english = extract_english(text)
|
|
roles, skills = extract_roles_skills(text)
|
|
location = extract_location_best_effort(text)
|
|
exp_years, exp_years_eng, exp_conf, exp_dbg = extract_experience_years(text)
|
|
sal_min, sal_max, sal_conf, sal_dbg = extract_salary(text)
|
|
|
|
return {
|
|
"name": name,
|
|
"contacts_raw": contacts_raw,
|
|
"remote": remote,
|
|
"english": english,
|
|
"roles": roles,
|
|
"skills": skills,
|
|
"location": location,
|
|
"exp_years": exp_years,
|
|
"exp_years_eng": exp_years_eng,
|
|
"exp_conf": exp_conf,
|
|
"exp_dbg": exp_dbg,
|
|
"salary_min": sal_min,
|
|
"salary_max": sal_max,
|
|
"salary_conf": sal_conf,
|
|
"salary_dbg": sal_dbg,
|
|
"parse_method": "generic_heur",
|
|
}
|