# Resume-Analysis **Repository Path**: harvest0623/Resume-Analysis ## Basic Information - **Project Name**: Resume-Analysis - **Description**: AI 赋能的智能简历分析系统 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-04-13 - **Last Updated**: 2026-05-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 🤖📄 智能简历分析系统 [React](https://react.dev/) [Vite](https://vitejs.dev/) [TypeScript](https://www.typescriptlang.org/) [TailwindCSS](https://tailwindcss.com/) [Flask](https://flask.palletsprojects.com/) [Python](https://python.org/) [React Router](https://reactrouter.com/) [Framer Motion](https://framer.com/motion/) [Recharts](https://recharts.org/) **本项目使用:** [React](https://react.dev/) [TypeScript](https://www.typescriptlang.org/) [Vite](https://vitejs.dev/) [TailwindCSS](https://tailwindcss.com/) [Flask](https://flask.palletsprojects.com/) [Python](https://python.org/) [React Router](https://reactrouter.com/) [Framer Motion](https://framer.com/motion/) [Recharts](https://recharts.org/) [Zustand](https://zustand-demo.pmnd.rs/) [Lucide React](https://lucide.dev/) [React Dropzone](https://react-dropzone.js.org/) > **一个功能强大的智能简历分析系统**,帮助招聘人员快速筛选和分析大量简历。支持 **Coze AI 工作流** 深度分析,自动解析 PDF 简历,提取关键信息,并利用 AI 模型进行评分和关键词匹配,提升招聘效率。 ## ✨ 项目亮点 ### 🧠 智能简历分析 - **PDF 自动解析** - 支持 PDF 格式简历上传和解析 - 自动提取个人信息(姓名、电话、邮箱、地址) - 识别求职意向和期望薪资 - 分析工作年限和学历背景 - 智能识别技能标签 - **AI 智能评分** - 支持 **Coze AI 工作流** 和规则引擎双模式 - 多维度评分系统(技能、经验、学历) - 综合评分算法,权重自动计算 - 详细的 AI 分析报告和改进建议 - 可视化评分图表展示 - **简历对比功能** - 支持两份简历并排对比 - 高亮差异和优势 - 智能推荐建议 - 可视化评分对比图表 ### 🔍 岗位匹配系统 - **智能匹配算法** - 输入岗位描述和技能要求 - 自动匹配历史简历 - 计算匹配度评分 - 按匹配度排序展示 - 显示匹配亮点 - **历史记录管理** - 保存所有分析过的简历 - 搜索和筛选功能 - 卡片式展示 - 批量管理操作 ### 🎨 现代前端设计 - **专业 UI 设计** - 蓝色系科技感主题 - 流畅的动画效果 - 响应式布局 - 直观的数据可视化 - 卡片式设计风格 - **用户体验优化** - 拖拽上传文件 - 实时加载反馈 - 清晰的操作流程 - 移动端适配 - 友好的错误提示 ### 🏗️ 完整架构 - **前后端分离** - 前端:React + TypeScript + Vite - 后端:Flask + Python - RESTful API 设计 - 支持跨域请求 - **模块化设计** - 前端:组件化开发 - 后端:模块化架构 - 易于维护和扩展 - 代码结构清晰 ## 🚀 功能特性 - **🧠 智能简历分析**:上传 PDF 简历,自动解析并 AI 多维度评分 - **⚖️ 简历比较功能**:对比两份简历的各项指标,高亮差异和优势 - **🎯 岗位匹配系统**:输入岗位要求,自动匹配候选人并计算匹配度 - **📚 历史记录管理**:保存所有分析过的简历,支持搜索和筛选 - **📊 数据可视化**:评分图表和对比展示,直观呈现分析结果 - **📱 响应式设计**:完美适配桌面和移动设备 - **📤 拖拽上传**:支持文件拖拽和点击上传,操作便捷 - **⚡ 实时反馈**:加载状态和错误提示,提升用户体验 ## 🛠️ 技术栈 ### 前端 (Frontend) | 技术 | 版本 | 用途 | |------|------|------| | React | 18.3.1 | 现代 UI 框架,函数式组件 + Hooks | | TypeScript | 5.8.3 | 类型安全的开发体验 | | Vite | 6.3.5 | 极速构建与热重载 | | TailwindCSS | 3.4.17 | 实用优先的 CSS 框架 | | React Router | 7.3.0 | 前端路由管理 | | Zustand | 5.0.3 | 轻量级状态管理 | | Framer Motion | 11.11.10 | 流畅的动画效果 | | Recharts | 2.10.4 | 数据可视化图表 | | Lucide React | 0.511.0 | 现代化图标库 | | React Dropzone | 14.2.9 | 文件上传组件 | ### 后端 (Backend) | 技术 | 版本 | 用途 | |------|------|------| | Flask | 3.0.0 | Python Web 框架 | | Flask CORS | 4.0.0 | 跨域请求支持 | | PyPDF2 | 3.0.1 | PDF 解析 | | PDFPlumber | 0.10.3 | PDF 文本提取 | | Python Dotenv | 1.0.0 | 环境变量管理 | | Requests | 2.31.0 | HTTP 请求库(Coze API 调用) | ### AI 集成 | 服务 | 用途 | |------|------| | **Coze AI** | 智能简历分析、深度内容理解、评分建议生成 | ## 📁 项目结构 ```plaintext D:\Coding\Resume-Analysis\ ├── frontend/ # 前端项目 │ ├── src/ │ │ ├── components/ # 可复用组件 │ │ │ ├── Navbar.tsx # 导航栏组件 │ │ │ ├── ResumeUploader.tsx # 文件上传组件 │ │ │ ├── ResumeCard.tsx # 简历卡片组件 │ │ │ └── ScoreChart.tsx # 评分图表组件 │ │ ├── pages/ # 页面组件 │ │ │ ├── Home.tsx # 首页 │ │ │ ├── Analyze.tsx # 简历分析 │ │ │ ├── Compare.tsx # 简历比较 │ │ │ ├── History.tsx # 历史记录 │ │ │ └── Match.tsx # 岗位匹配 │ │ ├── store/ # 状态管理 │ │ │ └── resumeStore.ts # 简历状态管理 │ │ ├── types/ # TypeScript 类型 │ │ │ └── resume.ts # 简历相关类型定义 │ │ ├── utils/ # 工具函数 │ │ │ └── api.ts # API 接口封装 │ │ ├── App.tsx # 主应用组件 │ │ ├── main.tsx # 入口文件 │ │ └── index.css # 全局样式 │ ├── public/ # 静态资源 │ │ └── favicon.svg # 网站图标 │ ├── package.json # 前端依赖配置 │ ├── vite.config.ts # Vite 配置 │ ├── tsconfig.json # TypeScript 配置 │ ├── tailwind.config.js # Tailwind 配置 │ └── postcss.config.js # PostCSS 配置 │ ├── backend/ # 后端项目 │ ├── src/ │ │ ├── parser/ # PDF 解析模块 │ │ │ ├── pdf_parser.py # PDF 解析器 │ │ │ └── text_extractor.py # 文本提取器 │ │ ├── analyzer/ # 分析模块 │ │ │ ├── resume_analyzer.py # 规则引擎简历分析器 │ │ │ ├── coze_analyzer.py # Coze AI 分析器 │ │ │ └── matcher.py # 岗位匹配器 │ │ ├── storage/ # 存储模块 │ │ │ └── history_store.py # 历史记录存储 │ │ ├── app.py # Flask 主应用 │ │ └── __init__.py # 包初始化 │ ├── uploads/ # 上传文件存储 │ └── requirements.txt # Python 依赖配置 │ ├── .trae/documents/ # 项目文档 │ ├── prd.md # 产品需求文档 │ └── arch.md # 技术架构文档 ├── README.md # 项目说明 └── .gitignore # Git 忽略文件 ``` ## 🏃 快速开始 ### 环境要求 - Node.js >= 18.0.0 - Python >= 3.9.0 - npm >= 9.0.0 - pip >= 20.0.0 ### 1. 项目准备 确保您已经将项目文件复制到本地目录: ```bash git clone https://github.com/harvest0623/Resume-Analysis.git cd Resume-Analysis ``` ### 2. 安装依赖 #### 前端依赖 ```bash # 进入前端目录 cd frontend # 安装依赖 npm install ``` #### 后端依赖 ```bash # 进入后端目录 cd backend # 安装依赖 pip install -r requirements.txt ``` ### 3. 配置 Coze AI(可选但推荐) 在使用 Coze AI 分析功能之前,需要配置 Coze 工作流: 1. **创建 Coze 工作流** - 在 [Coze 平台](https://coze.cn/) 创建一个简历分析工作流 - 工作流输入参数:`resume_text`(简历文本)、`basic_info`(包含 name、phone、email) - 工作流输出参数:`overall_score`、`skills_score`、`experience_score`、`education_score`、`analysis`、`suggestions` ![alt text](image.png) 2. **配置环境变量** ```bash cd backend cp .env.example .env ``` 编辑 `.env` 文件,填入您的 Coze API 密钥和工作流 URL: ```env COZE_API_KEY=your_coze_api_key_here COZE_WORKFLOW_URL=https://your-workflow-url.coze.site/run ``` ### 4. 启动服务 #### 启动后端服务 ```bash # 在 backend 目录下 cd src python app.py ``` **预期输出**: ``` * Serving Flask app 'app' * Debug mode: on * Running on http://127.0.0.1:5000/ * Press CTRL+C to quit ``` #### 启动前端服务 ```bash # 在 frontend 目录下 npm run dev ``` **预期输出**: ``` VITE v6.4.2 dev server running at: > Local: http://localhost:5173/ > Network: use --host to expose > press h to show help ``` ### 5. 访问应用 在浏览器中打开:**http://localhost:5173** ### 6. 构建生产版本 #### 前端构建 ```bash # 在 frontend 目录下 npm run build ``` #### 后端构建 后端无需构建,直接部署即可。 ## 🔍 核心实现原理 ### 1. PDF 解析与文本提取 **后端 - PDF 解析** ```python # backend/src/parser/pdf_parser.py import pdfplumber class PDFParser: def __init__(self, pdf_path: str): self.pdf_path = pdf_path self.text = "" self.lines = [] def extract_text(self) -> str: try: with pdfplumber.open(self.pdf_path) as pdf: for page in pdf.pages: self.text += page.extract_text() or "" self.lines.extend(page.extract_text().split("\n") if page.extract_text() else []) return self.text except Exception as e: print(f"Error parsing PDF: {e}") return "" ``` **后端 - 文本提取** ```python # backend/src/parser/text_extractor.py import re class TextExtractor: def extract_name(self) -> str: name_patterns = [ r'^[\u4e00-\u9fa5]{2,4}\s*$', r'姓名[::]\s*([\u4e00-\u9fa5]{2,4})', ] for pattern in name_patterns: for line in self.lines[:10]: match = re.search(pattern, line.strip()) if match: return match.group(1) if len(match.groups()) > 0 else line.strip() return "未知姓名" def extract_phone(self) -> str: phone_pattern = r'1[3-9]\d{9}' match = re.search(phone_pattern, self.text) return match.group() if match else "未知电话" def extract_email(self) -> str: email_pattern = r'[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}' match = re.search(email_pattern, self.text) return match.group() if match else "未知邮箱" ``` ### 2. AI 评分算法 **后端 - 简历分析器** ```python # backend/src/analyzer/resume_analyzer.py class ResumeAnalyzer: def calculate_skill_score(self) -> int: skills = self.data.get('skills', []) if not skills or skills[0] == '未检测到技能': return 40 skill_count = len(skills) base_score = min(skill_count * 8, 80) premium_skills = ['Python', 'Java', 'JavaScript', 'TypeScript', 'React'] premium_count = sum(1 for skill in skills if skill in premium_skills) bonus = min(premium_count * 5, 20) return min(base_score + bonus, 100) def calculate_overall_score(self, skill_score, experience_score, education_score): weights = { 'skills': 0.4, 'experience': 0.35, 'education': 0.25 } overall = ( skill_score * weights['skills'] + experience_score * weights['experience'] + education_score * weights['education'] ) return round(overall) ``` ### 3. 前端状态管理 **前端 - Zustand 状态管理** ```typescript // frontend/src/store/resumeStore.ts import { create } from "zustand"; import { ResumeData } from "@/types/resume"; interface ResumeStore { resumes: ResumeData[]; currentResume: ResumeData | null; loading: boolean; error: string | null; setResumes: (resumes: ResumeData[]) => void; setCurrentResume: (resume: ResumeData | null) => void; addResume: (resume: ResumeData) => void; removeResume: (id: string) => void; setLoading: (loading: boolean) => void; setError: (error: string | null) => void; clearError: () => void; } export const useResumeStore = create((set) => ({ resumes: [], currentResume: null, loading: false, error: null, setResumes: (resumes) => set({ resumes }), setCurrentResume: (resume) => set({ currentResume: resume }), addResume: (resume) => set((state) => ({ resumes: [resume, ...state.resumes], })), removeResume: (id) => set((state) => ({ resumes: state.resumes.filter((r) => r.id !== id), })), setLoading: (loading) => set({ loading }), setError: (error) => set({ error }), clearError: () => set({ error: null }), })); ``` ### 4. API 接口设计 **前端 - API 封装** ```typescript // frontend/src/utils/api.ts import { ResumeData } from "@/types/resume"; const API_BASE = import.meta.env.VITE_API_BASE || "http://localhost:5000/api"; export const api = { async uploadResume(file: File): Promise<{ id: string; filename: string; status: string }> { const formData = new FormData(); formData.append("file", file); const response = await fetch(`${API_BASE}/resume/upload`, { method: "POST", body: formData, }); if (!response.ok) { const error = await response.json(); throw new Error(error.error || "Upload failed"); } return response.json(); }, async analyzeResume(id: string, filename: string): Promise { const response = await fetch(`${API_BASE}/resume/analyze`, { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ id, filename }), }); if (!response.ok) { const error = await response.json(); throw new Error(error.error || "Analysis failed"); } return response.json(); }, }; ``` ## 🎨 设计特色 ### 1. 专业配色方案 - **主色调**: 深蓝 #1e3a5f,科技感与专业感 - **辅助色**: 青绿色 #10b981(成功/高分) - **警告色**: 橙黄色 #f59e0b(中等) - **危险色**: 红色 #ef4444(低分) - **中性色**: 灰色系列,确保文本可读性 ### 2. 现代化 UI 设计 - **卡片式布局**: 清晰的视觉层次 - **流畅动画**: Framer Motion 实现优雅过渡 - **响应式设计**: 完美适配桌面和移动设备 - **数据可视化**: Recharts 提供直观图表 - **微交互**: 悬停效果、加载动画 ### 3. 用户体验优化 - **拖拽上传**: 支持文件拖拽和点击上传 - **实时反馈**: 加载状态和错误提示 - **清晰导航**: 直观的页面导航 - **搜索筛选**: 快速查找历史简历 - **批量操作**: 高效管理简历 ## 🔧 配置与部署 ### 环境变量 **前端可选配置 `.env` 文件**: ```env VITE_API_BASE=http://localhost:5000/api ``` **后端配置**: - 端口默认:5000 - 上传文件最大大小:16MB - 文件存储路径:`backend/uploads/` ### 生产部署 #### 前端构建 ```bash cd frontend npm run build ``` 构建产物位于 `frontend/dist/` 目录,可部署到任何静态网站托管服务。 #### 后端部署 - **阿里云 Serverless**:部署到函数计算 FC - **容器部署**:使用 Docker 容器化 - **传统部署**:部署到 VPS 或云服务器 ## 📦 依赖说明 ### 前端依赖 - **React** & **React DOM**:现代 UI 框架核心 - **TypeScript**:类型安全的开发体验 - **Vite**:极速构建与热重载 - **TailwindCSS**:实用优先的 CSS 框架 - **React Router**:前端路由管理 - **Zustand**:轻量级状态管理 - **Framer Motion**:流畅的动画效果 - **Recharts**:数据可视化图表 - **Lucide React**:现代化图标库 - **React Dropzone**:文件上传组件 ### 后端依赖 - **Flask**:Python Web 框架 - **Flask CORS**:跨域请求支持 - **PyPDF2**:PDF 解析 - **PDFPlumber**:PDF 文本提取 - **Python Dotenv**:环境变量管理 ## 📝 注意事项 - **端口占用**:确保 5000 端口未被占用 - **文件大小**:支持最大 16MB 的 PDF 文件 - **依赖安装**:确保 Python 依赖安装成功 - **网络连接**:前端需要连接后端服务 - **安全提示**:生产环境请配置适当的安全措施 ## 🤝 贡献指南 1. Fork 本仓库 2. 创建特性分支:`git checkout -b feature/YourFeature` 3. 提交更改:`git commit -m 'Add some YourFeature'` 4. 推送到分支:`git push origin feature/YourFeature` 5. 开启 Pull Request ## 📄 许可证 本项目采用 MIT 许可证,详见 [LICENSE](LICENSE) 文件。 ## 📞 联系方式 - GitHub Issues: [提交问题](https://github.com/harvest0623/Resume-Analysis/issues) - 邮箱:3367741939@qq.com or harvest060523@gmail.com **如果这个项目对你有帮助,欢迎给一个 ⭐ Star!** --- **🌟 感谢使用智能简历分析系统!** 希望它能帮助您更高效地进行招聘工作。如有任何问题或建议,欢迎反馈。