Skip to content

yaoruiquan/Resume-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI 智能简历分析系统

Python FastAPI Streamlit License

AI 驱动的简历分析系统,自动解析 PDF 简历,提取关键信息,并利用大语言模型与岗位需求进行匹配评分。

功能特性

  • PDF 简历解析 - 支持多页 PDF 简历文本提取
  • 关键信息提取 - AI 自动提取姓名、联系方式、教育背景、工作经历等
  • 岗位匹配评分 - 计算简历与岗位描述的匹配度
  • Redis 缓存 - 相同简历避免重复分析
  • RESTful API - 便于与其他系统集成

系统架构

┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│  Streamlit  │────▶│  FastAPI    │────▶│   LLM API   │
│  前端界面   │     │  后端服务   │     │  (通义千问) │
└─────────────┘     └──────┬──────┘     └─────────────┘
                          │
                    ┌─────▼─────┐
                    │   Redis   │
                    │   缓存    │
                    └───────────┘

项目结构

.
├── backend/                  # FastAPI 后端
│   ├── app/
│   │   ├── api/            # API 接口
│   │   ├── core/           # 配置与 Redis
│   │   ├── schemas/        # Pydantic 模型
│   │   ├── services/       # 业务逻辑
│   │   └── main.py         # 应用入口
│   ├── .env.example        # 环境变量示例
│   ├── Dockerfile          # Docker 镜像
│   ├── s.yaml              # Serverless Devs 配置
│   └── requirements.txt
│
├── frontend/                # Streamlit 前端
│   ├── .streamlit/         # Streamlit 配置
│   ├── app.py              # 主应用
│   └── requirements.txt
│
├── install.sh               # Linux/Mac 安装脚本
├── install.bat              # Windows 安装脚本
├── .gitignore
├── LICENSE
└── README.md

快速开始

前置条件

  • Python 3.11+
  • Docker(用于部署)
  • 阿里云账号:
    • 函数计算 FC
    • KVStore Redis
    • DashScope(通义千问 API)

后端(本地开发)

# 1. 进入后端目录
cd backend

# 2. 创建虚拟环境
python -m venv venv

# 3. 激活虚拟环境
# Linux/Mac:
source venv/bin/activate
# Windows:
venv\Scripts\activate

# 4. 安装依赖
pip install -r requirements.txt

# 5. 配置环境变量
cp .env.example .env
# 编辑 .env 填入你的配置

# 6. 本地运行
python -m app.main
# 服务启动于 http://localhost:8000

前端(本地开发)

# 1. 进入前端目录
cd frontend

# 2. 创建虚拟环境
python -m venv venv

# 3. 激活虚拟环境
source venv/bin/activate  # Linux/Mac
venv\Scripts\activate     # Windows

# 4. 安装依赖
pip install -r requirements.txt

# 5. 运行 Streamlit
streamlit run app.py
# 打开 http://localhost:8501

一键安装

# Linux/Mac
chmod +x install.sh
./install.sh

# Windows
install.bat

API 接口

上传并分析简历

curl -X POST "https://your-fc-endpoint.aliyuncs.com/api/v1/resume/upload" \
  -F "file=@resume.pdf" \
  -F "job_description=要求3年以上Python开发经验..."

响应示例

{
  "data": {
    "resume_info": {
      "name": "张三",
      "phone": "13800138000",
      "email": "zhangsan@example.com",
      "job_intention": "Python开发工程师",
      "expected_salary": "20K-30K",
      "work_years": "5年",
      "education": "本科"
    },
    "match_result": {
      "skill_match_rate": 85,
      "experience_relevance": 90,
      "overall_score": 87,
      "matched_skills": ["Python", "FastAPI", "Redis"],
      "missing_skills": ["Docker"],
      "recommendation": "推荐进入面试环节"
    }
  },
  "cached": false
}

部署指南

构建并推送 Docker 镜像

cd backend

# 构建镜像
docker build -t your-dockerhub/resume-backend:latest .

# 推送到 Docker Hub
docker push your-dockerhub/resume-backend:latest

部署到阿里云 FC

# 1. 修改 s.yaml 中的镜像地址

# 2. 使用 Serverless Devs 部署
s deploy

# 3. 在 FC 控制台配置环境变量

部署前端

方案一:Streamlit Community Cloud

  • 推送到 GitHub
  • 连接到 streamlit.io

方案二:Docker 部署

docker run -p 8501:8501 your-dockerhub/resume-frontend:latest

环境变量

变量名 说明 必填
DASHSCOPE_API_KEY 阿里云通义千问 API Key
REDIS_HOST Redis 服务器地址
REDIS_PORT Redis 端口(默认:6379)
REDIS_PASSWORD Redis 密码
REDIS_DB Redis 数据库编号(默认:0)

技术栈

  • 后端:FastAPI、PyMuPDF、Redis、DashScope
  • 前端:Streamlit
  • 部署:阿里云函数计算 FC(Custom Container)、Serverless Devs

开源协议

MIT License - 详见 LICENSE

About

在招聘流程中,快速筛选和分析大量简历是一项耗时的工作。你的任务是构建一个后端服务,能够自动解析上传的简历(PDF 格式),提取关键信息,并利用 AI 模型对简历进行评分和关键词匹配,帮助招聘者快速筛选候选人。

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors