Lecture 25: Project Practice - HR Intelligent Assistant Development Implementation

Implement core functions of the HR Intelligent Assistant, including resume parsing, attendance management, and salary calculation.

1. Project Structure

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
hr_assistant/
├── __init__.py
├── main.py # Entry point
├── config.py # Configuration
├── models/ # Data models
│ ├── __init__.py
│ ├── resume.py # Resume model
│ ├── attendance.py # Attendance model
│ └── employee.py # Employee model
├── services/ # Business services
│ ├── __init__.py
│ ├── resume_service.py
│ ├── attendance_service.py
│ └── payroll_service.py
├── utils/ # Utility functions
│ ├── __init__.py
│ ├── db.py
│ └── excel.py
└── templates/ # Templates
├── payroll_template.xlsx
└── attendance_template.xlsx

2. Core Code Implementation

2.1 Resume Parsing Service

# services/resume_service.py
from typing import Dict, List
import re

class ResumeService:
    """Resume service"""

    def __init__(self, ocr_service, nlp_service, db):
        self.ocr = ocr_service
        self.nlp = nlp_service
        self.db = db

    def parse_resume(self, file_path: str) -> Dict:
        """Parse resume"""
        # 1. Extract text
        text = self._extract_text(file_path)

        # 2. Parse basic information
        basic_info = self._parse_basic_info(text)

        # 3. Parse education experience
        education = self._parse_education(text)

        # 4. Parse work experience
        experience = self._parse_experience(text)

        # 5. Extract skills
        skills = self._extract_skills(text)

        resume_data = {
            **basic_info,
            'education': education,
            'experience': experience,
            'skills': skills,
            'raw_text': text
        }


## 🎓 AI 编程实战课程

想系统学习 AI 编程?程序员晚枫的 **AI 编程实战课** 帮你从零上手!

- 👉 **课程报名**:[点击这里报名,前3讲免费试听](https://r7up9.xetslk.com/s/1uP5YW)
- 👉 **免费试看**:[B站免费试看前3讲,先看看适不适合自己](https://www.bilibili.com/cheese/play/ss982042944)