Skip to content

Refa: Resume parsing module (architectural optimizations based on SmartResume Pipeline) - #13255

Merged
yingfeng merged 26 commits into
infiniflow:mainfrom
yaowei520:feature-resume-aron
Mar 2, 2026
Merged

yingfeng merged 26 commits into
infiniflow:mainfrom
yaowei520:feature-resume-aron

Conversation

@yaowei520

Copy link
Copy Markdown
Contributor

Core optimizations (refer to arXiv:2510.09722):

  1. PDF text fusion: Metadata + OCR dual-path extraction and fusion

  2. Page-aware reconstruction: YOLOv10 page segmentation + hierarchical sorting + line number indexing

  3. Parallel task decomposition: Basic information/work experience/educational background three-way parallel LLM extraction

  4. Index pointer mechanism: LLM returns a range of line numbers instead of generating the full text, reducing the illusion of full text.

@dosubot dosubot Bot added size:XXL This PR changes 1000+ lines, ignoring generated files. 💞 feature Feature request, pull request that fullfill a new feature. labels Feb 27, 2026
@yaowei520

Copy link
Copy Markdown
Contributor Author

@dosu 麻烦审核下代码

@yaowei520 yaowei520 changed the title Resume parsing module (architectural optimizations based on SmartResume Pipeline) refa: Resume parsing module (architectural optimizations based on SmartResume Pipeline) Feb 27, 2026
@dosubot

dosubot Bot commented Feb 27, 2026

Copy link
Copy Markdown

感谢提交这个 PR!由于我无法直接访问 PR #13255 的具体代码变更,我基于现有的简历解析模块进行了对比分析。

架构对比

你提出的优化与现有实现对比:

特性 现有实现 建议状态
PDF文本融合 (Metadata + OCR双路) pdf_parser.py 使用 XGBoost 模型融合 需确认是否集成到简历管道
YOLOv10页面分割 已有 LayoutRecognizer4YOLOv10 ✅ 可复用
并行任务分解 仅PDF级别并行 🆕 新功能
行号索引机制 未实现 🆕 新功能

建议审查要点

  1. 接口标准化 - 现有简历解析器使用 chunk() 函数,与其他解析器的 __call__ 接口不一致,建议统一

  2. 配置管理 - 现有代码中远程服务 URL 是硬编码的,建议使用环境变量配置

  3. 超时处理 - 现有的基于 SIGALRM 的超时在 Windows 上不兼容,建议改用 asyncio.wait_for()

  4. 异常处理 - 建议添加更具体的异常类型,避免静默捕获所有异常


由于我无法直接查看 PR 中的具体代码变更,能否请你分享 PR 中主要修改的文件列表?这样我可以提供更有针对性的审查意见。

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@yingfeng yingfeng added the ci Continue Integration label Feb 27, 2026
@yingfeng
yingfeng marked this pull request as draft February 27, 2026 05:24
@yingfeng
yingfeng marked this pull request as ready for review February 27, 2026 05:24
@dosubot dosubot Bot added the 🌈 python Pull requests that update Python code label Feb 27, 2026
@codecov

codecov Bot commented Feb 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 47.18%. Comparing base (7e0dd90) to head (ceeb090).
⚠️ Report is 18 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13255      +/-   ##
==========================================
- Coverage   49.89%   47.18%   -2.71%     
==========================================
  Files          44       44              
  Lines        9738     9748      +10     
  Branches      110      110              
==========================================
- Hits         4859     4600     -259     
- Misses       4871     5135     +264     
- Partials        8       13       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yaowei520

yaowei520 commented Feb 27, 2026 •

Copy link
Copy Markdown
Contributor Author
  1. 切分效果
image
  1. 检索效果
image

@dosu 可以看下效果

@dosubot

dosubot Bot commented Feb 27, 2026

Copy link
Copy Markdown

感谢分享截图!从你展示的效果来看:

切分效果 - 看起来页面分割和层级排序正常工作,内容被正确识别和组织。

检索效果 - 检索结果显示了相关匹配,说明索引机制在正常运作。

整体效果看起来不错!几个问题想确认一下:

  1. 性能方面 - 三路并行 LLM 提取相比原来的串行方式,处理时间大约提升多少?
  2. 准确性 - 行号索引机制(LLM 返回行号范围而非全文)在减少幻觉方面的效果如何?有没有对比测试数据?
  3. 测试覆盖 - 这个效果是基于中文简历还是英文简历?PDF 还是其他格式?

如果方便的话,能否补充一些性能对比数据或准确率指标?这对评估 SmartResume Pipeline 的优化效果会很有帮助。

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@yaowei520

Copy link
Copy Markdown
Contributor Author

@dosu
image

感谢分享截图!从你展示的效果来看:

切分效果 - 看起来页面分割和层级排序正常工作,内容被正确识别和组织。

检索效果 - 检索结果显示了相关匹配,说明索引机制在正常运作。

整体效果看起来不错!几个问题想确认一下:

  1. 性能方面 - 三路并行 LLM 提取相比原来的串行方式,处理时间大约提升多少?
  2. 准确性 - 行号索引机制(LLM 返回行号范围而非全文)在减少幻觉方面的效果如何?有没有对比测试数据?
  3. 测试覆盖 - 这个效果是基于中文简历还是英文简历?PDF 还是其他格式?

如果方便的话,能否补充一些性能对比数据或准确率指标?这对评估 SmartResume Pipeline 的优化效果会很有帮助。

@dosu 这个是测试结果
image

@dosubot

dosubot Bot commented Feb 27, 2026

Copy link
Copy Markdown

感谢提供详细的测试数据!这个基于正则表达式(无 LLM)的测试结果很有参考价值。

测试数据总结:

  • 测试样本:42份简历(34 PDF + 4 DOCX + 4 DOC)
  • PDF 平均提取耗时:2.37s
  • DOCX/DOC:几乎瞬时
  • Chunk 结构校验:全部通过 ✅

字段提取准确率:

字段 提取率 评估
姓名 100% 🟢 优秀
学校 83% 🟢 良好
手机/邮箱 81% 🟢 良好
公司 79% 🟡 可接受
性别 69% 🟡 可接受
职位 60% 🟠 需提升
工作年限 40% 🔴 较低
最高学历/技能 0% 🔴 待实现

核心指标:姓名+手机组合准确率 81%,对于纯正则方案来说是不错的基线。

建议:

  1. 工作年限、最高学历、技能这三个字段提取率较低,这些正是 PR 描述中提到的"三路并行 LLM 提取"可以发挥作用的地方
  2. 如果能补充一组启用 LLM 提取后的对比数据,会更清晰地展示优化效果

整体来看,正则基线方案的性能很好(2.37s/PDF),核心字段覆盖合理。期待看到 LLM 辅助提取的对比结果!

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@yingfeng

Copy link
Copy Markdown
Member

Thanks for the contribution, please remove Chinese characters from comments/logs
Regarding to the prompts as well as variable names, could you please deliver a multilingual solution where the field variables and prompts specifically designed for Chinese resumes are placed in a Chinese-specific template?

@yaowei520

Copy link
Copy Markdown
Contributor Author

Thanks for the contribution, please remove Chinese characters from comments/logs Regarding to the prompts as well as variable names, could you please deliver a multilingual solution where the field variables and prompts specifically designed for Chinese resumes are placed in a Chinese-specific template?

I will deal with it.

- Rewrite resume extraction pipeline with structured LLM-based parsing
  for basic info, education, work experience and project experience
- Add 3-layer text denoising pipeline inspired by SmartResume:
  Unicode whitespace normalization, random string filtering (tiktoken-based),
  and stricter source text validation
- Add i18n support with separate Chinese/English prompt templates
  (resume_basic_info, resume_education, resume_work_exp, resume_project_exp,
  resume_system) under rag/prompts/
- Improve chunk construction: group related fields into semantic chunks
  (basic info, education, skills, work overview), redundantly embed
  identity fields for retrieval, and assign logical ordering coordinates
- Fix work experience year calculation, resume sorting, and table handling
- Remove unused parameters (lines, line_positions) from _build_chunk_document
- Clean up redundant code
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Feb 28, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Feb 28, 2026
@yingfeng
yingfeng requested a review from yongtenglei February 28, 2026 10:57
@yaowei520

Copy link
Copy Markdown
Contributor Author

@dosu 重新触发单元测试,数据库连接失败

@dosubot

dosubot Bot commented Mar 1, 2026

Copy link
Copy Markdown

抱歉,我没有权限触发 CI/CD 流水线或重新运行单元测试。

数据库连接失败通常是 CI 环境的临时问题。你可以尝试:

  1. 推送一个空提交来重新触发 CI:

    git commit --allow-empty -m "ci: retrigger tests"
    git push
  2. 或者请维护者 @yingfeng 帮忙手动重新运行失败的测试任务

如果问题持续出现,可能需要检查 CI 配置中的数据库连接设置。

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@yaowei520

Copy link
Copy Markdown
Contributor Author

@yingfeng 帮忙手动重新运行失败的测试任务

@yingfeng

yingfeng commented Mar 1, 2026

Copy link
Copy Markdown
Member

@yingfeng 帮忙手动重新运行失败的测试任务

CI机器有问题,修复后手动运行

yingfeng and others added 3 commits March 2, 2026 10:47
…n\nAdopt SmartResume's blackout approach for OCR text fusion:\n- Add _blackout_text_regions() to paint over metadata-extracted text\n areas on page images before OCR processing\n- Modify _extract_ocr_text() to accept meta_blocks and apply blackout\n before running OCR, so OCR only recognizes content metadata missed\n- Simplify _fuse_text_blocks() by removing IoU overlap calculation,\n since blackout eliminates duplication at source\n- Add SmartResume as submodule for reference\n\nThis approach is more reliable than post-hoc IoU deduplication because\nit prevents OCR from re-recognizing already extracted text regions,\navoiding partial overlap and threshold sensitivity issues.
@yaowei520

Copy link
Copy Markdown
Contributor Author

@dosu

一、总体指标

指标 数值
成功率 42/42 (100%)
姓名准确率 (GT样本=39) 38/39 (97.4%)
平均耗时 7.68s
P50 耗时 7.45s
P90 耗时 11.37s
最大耗时 21.87s
总耗时 322.4s

二、字段提取率

字段 键名 提取数 提取率 核心
姓名 name_kwd 42 100.0% ★
电话 phone_kwd 35 83.3% ★
邮箱 email_tks 34 81.0%
性别 gender_kwd 34 81.0%
年龄 age_int 34 81.0%
工作年限 work_exp_flt 41 97.6% ★
最近公司 corporation_name_tks 41 97.6%
公司列表 corp_nm_tks 41 97.6% ★
学校列表 school_name_tks 36 85.7% ★
最高学历 highest_degree_kwd 41 97.6% ★
学历列表 degree_kwd 41 97.6%
职位列表 position_name_tks 41 97.6%
专业 major_tks 38 90.5%
技能列表 skill_tks 37 88.1%
工作描述 work_desc_tks 38 90.5%
项目列表 project_tks 40 95.2%
自我评价 self_evaluation_tks 28 66.7%

@dosubot

dosubot Bot commented Mar 2, 2026

Copy link
Copy Markdown

这个测试结果相比之前的纯正则方案有显著提升!🎉

关键对比(正则 → LLM辅助):

字段 正则方案 LLM辅助 提升
工作年限 40% 97.6% +57.6%
最高学历 0% 97.6% +97.6%
技能列表 0% 88.1% +88.1%
职位列表 60% 97.6% +37.6%
公司列表 79% 97.6% +18.6%

亮点:

  • ✅ 100% 成功率(42/42)
  • ✅ 核心字段(姓名+电话+工作年限+学历+公司+学校)提取率均 >83%
  • ✅ 之前无法提取的「最高学历」和「技能」字段现在达到 88%+

性能方面:

  • 平均 7.68s,P90 为 11.37s,对于包含 LLM 调用的复杂提取来说是合理的
  • 相比之前纯正则的 2.37s 有所增加,但准确率提升显著,是合理的权衡

整体来看,SmartResume Pipeline 的优化效果非常明显,特别是在复杂语义字段的提取上。期待 CI 修复后的测试通过!

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@yaowei520

Copy link
Copy Markdown
Contributor Author

@yongtenglei 是否还有其他问题,目前已经针对不同的字段识别以及切分进行了批量测试

@yongtenglei yongtenglei left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @yaowei520

Thank you for your contribution. This looks excellent to me.

Cheers.

@yingfeng yingfeng changed the title refa: Resume parsing module (architectural optimizations based on SmartResume Pipeline) Refa: Resume parsing module (architectural optimizations based on SmartResume Pipeline) Mar 2, 2026
@yingfeng
yingfeng merged commit f8c91e8 into infiniflow:main Mar 2, 2026
1 check passed
guptas6est pushed a commit to Nordix/ragflow that referenced this pull request Mar 5, 2026
…rtResume Pipeline) (infiniflow#13255)

Core optimizations (refer to arXiv:2510.09722):

1. PDF text fusion: Metadata + OCR dual-path extraction and fusion

2. Page-aware reconstruction: YOLOv10 page segmentation + hierarchical
sorting + line number indexing

3. Parallel task decomposition: Basic information/work
experience/educational background three-way parallel LLM extraction

4. Index pointer mechanism: LLM returns a range of line numbers instead
of generating the full text, reducing the illusion of full text.

---------

Co-authored-by: Aron.Yao <[email protected]>
Co-authored-by: Aron.Yao <[email protected]>
Co-authored-by: Yingfeng <[email protected]>
writinwaters pushed a commit to writinwaters/ragflow that referenced this pull request Apr 10, 2026
…rtResume Pipeline) (infiniflow#13255)

Core optimizations (refer to arXiv:2510.09722):

1. PDF text fusion: Metadata + OCR dual-path extraction and fusion

2. Page-aware reconstruction: YOLOv10 page segmentation + hierarchical
sorting + line number indexing

3. Parallel task decomposition: Basic information/work
experience/educational background three-way parallel LLM extraction

4. Index pointer mechanism: LLM returns a range of line numbers instead
of generating the full text, reducing the illusion of full text.

---------

Co-authored-by: Aron.Yao <[email protected]>
Co-authored-by: Aron.Yao <[email protected]>
Co-authored-by: Yingfeng <[email protected]>
JasleenKaurSethi pushed a commit to stackhpc/ragflow that referenced this pull request Apr 28, 2026
…rtResume Pipeline) (infiniflow#13255)

Core optimizations (refer to arXiv:2510.09722):

1. PDF text fusion: Metadata + OCR dual-path extraction and fusion

2. Page-aware reconstruction: YOLOv10 page segmentation + hierarchical
sorting + line number indexing

3. Parallel task decomposition: Basic information/work
experience/educational background three-way parallel LLM extraction

4. Index pointer mechanism: LLM returns a range of line numbers instead
of generating the full text, reducing the illusion of full text.

---------

Co-authored-by: Aron.Yao <[email protected]>
Co-authored-by: Aron.Yao <[email protected]>
Co-authored-by: Yingfeng <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration 💞 feature Feature request, pull request that fullfill a new feature. lgtm This PR has been approved by a maintainer 🌈 python Pull requests that update Python code size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants