Skip to main content

基于KylinOS的AI智能匹配与能力图谱系统

Project description

人岗智能匹配与能力图谱系统

基于 KylinOS 的 AI 匹配引擎,支持员工与企业的双向智能推荐。


目录结构

v11.1/
├── server.py                 # FastAPI 应用入口 & 启动逻辑
├── core/database.py           # SQLite 连接管理(线程级复用)
├── configs/
│   ├── env.py                 # 环境变量加载(DEEPSEEK/SiliconFlow API Key)
│   └── matching_config.py     # 匹配引擎常量(候选池、嵌入维度等)
├── routers/                   # API 路由
│   ├── auth_router.py         # 注册/登录
│   ├── user_router.py         # 用户信息、简历上传
│   ├── enterprise_router.py   # 企业信息
│   ├── position_router.py     # 岗位发布/搜索/批量
│   ├── application_router.py  # 投递/状态管理
│   ├── recommendation_router.py  # 推荐接口(jobs/talent)
│   ├── match_router.py        # 匹配画像/运行/详情
│   ├── skill_router.py        # 技能图谱/差距/学习路径
│   ├── feedback_router.py     # 反馈评分
│   ├── notification_router.py # 通知(含 SSE 实时推送)
│   └── admin_router.py        # 管理端:全量训练等
├── services/
│   ├── matching/              # 三模块匹配引擎
│   │   ├── __init__.py        # MatchingEngine 组合 0.2/0.3/0.5
│   │   ├── rule_matcher.py    # 规则模块(学历/工龄/薪资/学校/年龄)
│   │   ├── semantic_matcher.py# 语义模块(经历/专业/项目/获奖/地域/职业)
│   │   └── skill_graph_matcher.py  # 图谱模块(技能/知识图谱结构)
│   ├── factors/               # 各因子评分实现
│   │   ├── base.py            # Factor / FactorRegistry 基类
│   │   ├── skill.py           # 技能匹配度(bigram F1 + 共现)
│   │   ├── education.py       # 学历层次
│   │   ├── experience.py      # 相关经历(bigram F1 + 时间衰减)
│   │   ├── years.py           # 工龄匹配
│   │   ├── salary.py          # 薪资重合度
│   │   ├── school.py          # 学校层次
│   │   ├── major.py           # 专业匹配
│   │   ├── project.py         # 项目经历
│   │   ├── award.py           # 获奖加分
│   │   ├── location.py        # 地域匹配
│   │   ├── age.py             # 年龄匹配
│   │   ├── gender.py          # 性别匹配(已禁用,weight=0)
│   │   ├── job_type.py        # 工作性质
│   │   ├── occupation.py      # 职业分类(ISCO)
│   │   └── kge_graph.py       # 知识图谱结构(匈牙利+Jaccard替代KGE)
│   ├── recommendation_service.py  # 搜索流水线(向量→BM25→SQL回退+公司多样混排)
│   ├── profile_service.py     # 用户/岗位画像加载与同步
│   ├── indexing_service.py    # ZVec + BM25 索引管理
│   ├── document_processor.py  # 语义分块
│   ├── skill_normalizer.py    # 技能归一化(ontology + embedding)
│   ├── skill_graph.py         # 技能图谱 DAG / 差距分析 / 学习路径
│   ├── skill/
│   │   └── cooccurrence.py    # 共现图构建 + LLM 补充
│   └── vector/
│       ├── __init__.py        # 统一导出
│       ├── zvec_store.py      # numpy 暴力搜索向量存储
│       ├── embed_service.py   # 嵌入 API(SiliconFlow BGE-M3)
│       └── bm25_store.py      # BM25 关键词检索
├── static/                    # 前端静态文件
│   ├── user.html              # 个人端页面
│   ├── enterprise.html        # 企业端页面
│   ├── css/user.css           # 个人端样式
│   ├── css/enterprise.css     # 企业端样式
│   └── js/user.js             # 个人端 JS
│   └── js/enterprise.js       # 企业端 JS
├── utils/
│   ├── file_parser.py         # 文件解析(DOCX/PDF/TXT)
│   ├── StructuredExtractor.py # LLM 结构化提取
│   └── SkillExtractor.py      # 技能提取
├── repositories/              # 数据访问层
│   ├── user_repo.py           # 用户数据查询
│   └── job_repo.py            # 岗位数据查询
├── schemas.py                 # Pydantic 请求/响应模型
└── databases/
    ├── app.db                 # SQLite 数据库
    └── database_schema.sql    # 数据库建表语句

启动

# 单 worker
python -m uvicorn server:app --host 0.0.0.0 --port 8000

# 多 worker(推荐,需 4GB 内存)
python -m uvicorn server:app --host 0.0.0.0 --port 8000 --workers 4

首次启动会自动创建数据库表、填充示例数据。访问:

页面 地址
登录 http://localhost:8000/
个人端 http://localhost:8000/user?uuid=xxx&token=xxx
企业端 http://localhost:8000/enterprise?uuid=xxx&token=xxx
API 文档 http://localhost:8000/docs

匹配权重体系

模块间权重

规则模块 (0.2)
  学历层次 ×0.22 → 有效 0.044
  工龄匹配 ×0.22 → 有效 0.044
  薪资重合 ×0.28 → 有效 0.056
  学校层次 ×0.17 → 有效 0.034
  年龄匹配 ×0.11 → 有效 0.022

语义模块 (0.3)
  相关经历 ×0.25 → 有效 0.075
  专业匹配 ×0.15 → 有效 0.045
  项目经历 ×0.20 → 有效 0.060
  获奖加分 ×0.10 → 有效 0.030
  地域匹配 ×0.15 → 有效 0.045
  工作性质 ×0.05 → 有效 0.015
  职业分类 ×0.10 → 有效 0.030

图谱模块 (0.5)
  技能匹配度 ×0.50 → 有效 0.250
  知识图谱结构 ×0.50 → 有效 0.250

硬条件(不通过直接过滤)

学历、性别、年龄、工作性质、工作年限、薪资期望 — 六项硬条件不满足直接跳过,不参与评分。


搜索流水线

请求进入
  ↓
向量搜索(ZVec numpy 暴力搜 + BM25 混合)
  ↓
候选不足?→ BM25 二次搜索
  ↓
候选仍不足?→ SQL 回退(扫描全部活跃数据)
  ↓
对每个候选项执行硬条件过滤 + engine.compute() 评分
  ↓
按总分降序排序
  ↓
公司多样性混排(避免单一公司霸榜)
  ↓
返回 top_k

关键技术选型

组件 方案 说明
向量搜索 numpy 暴力(无 FAISS) 当前数据量小,无需近似索引
嵌入模型 SiliconFlow BGE-M3(API) 1024 维,文本/代码混合
LLM DeepSeek v4 Flash(API) 简历解析、技能关系补充
匹配算法 匈牙利 O(n³) + bigram F1 纯 Python 实现,无 scipy
数据库 SQLite(WAL 模式) 单机部署,零运维
认证 JWT(PyJWT + bcrypt) 无状态 token

因子评分算法

因子 算法
技能匹配度 bigram F1 + 共现图 Jaccard + 前置覆盖率
学历层次 EDUCATION_LEVEL 映射 + 差值衰减
相关经历 bigram F1 × 时间衰减权重
工龄匹配 中位数距离衰减
薪资重合度 期望与岗位薪资的交叠比
学校层次 JSON 学校分级(最高 4 级)
专业匹配 嵌入余弦相似度(major→job text)
地域匹配 居住地与岗位地点的子串匹配
年龄匹配 距离期望中位数衰减

环境变量

创建 .env 文件在项目根目录:

DEEPSEEK_API_KEY=sk-your-key-here
变量 说明 默认值
DEEPSEEK_API_KEY DeepSeek / SiliconFlow API Key 必填
SILICONFLOW_API_KEY SiliconFlow 专用 Key 同 DEEPSEEK_API_KEY

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

job_talent_match-13.7.0.tar.gz (2.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

job_talent_match-13.7.0-py3-none-any.whl (2.8 MB view details)

Uploaded Python 3

File details

Details for the file job_talent_match-13.7.0.tar.gz.

File metadata

  • Download URL: job_talent_match-13.7.0.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.5

File hashes

Hashes for job_talent_match-13.7.0.tar.gz
Algorithm Hash digest
SHA256 6dfa628e62befb113ff94bcd1d60e9fb3005436668811cd8165e603eab1b2353
MD5 a61d227d656521d93fce1536c8a31959
BLAKE2b-256 eeba8b17b61a71c6269576b1481ca690aa69cc3c777aad4a44e8ed0919562b79

See more details on using hashes here.

File details

Details for the file job_talent_match-13.7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for job_talent_match-13.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 63732ef01ca96fe69ad8ffd6cf4e7d975b1cae0e3858046b55fed349c904a23c
MD5 e5609b7135ec05c5c16b8d3688d9bec7
BLAKE2b-256 36aa6537bd09d32ef64c33d1227b7890cbf8ff2d9d23991c82b1a5187e470e01

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page