Skip to content

Fix: (resume) Cross-verify project experience and work experience, and remove duplicate text - #13323

Merged
yingfeng merged 3 commits into
infiniflow:mainfrom
yaowei520:hotfix-fix-resume-aron
Mar 3, 2026
Merged

yingfeng merged 3 commits into
infiniflow:mainfrom
yaowei520:hotfix-fix-resume-aron

Conversation

@yaowei520

@yaowei520 yaowei520 commented Mar 2, 2026 •

Copy link
Copy Markdown
Contributor

Cross-verify project experience and work experience, and remove duplicate text

…en a resume embeds project details within work experience sections\n(no separate "Project Experience" block), the LLM extracts the same\ntext into both work_desc_tks and project_desc_tks, producing duplicate\nchunks in the knowledge base.\n\nAdd Phase 3.5 cross-dedup in _postprocess_resume:\n- Substring containment check between normalized texts\n- Token-level overlap ratio threshold (>70%) as fallback\n- Sync project_tks list when removing duplicated entrie
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. 🐞 bug Something isn't working, pull request that fix bug. labels Mar 2, 2026
@yaowei520 yaowei520 changed the title fix(resume): deduplicate project_desc_tks against work_desc_tks\n\nWh… fix: (resume) 对项目经验以及工作经验进行交叉验证,并去除重复文本 Mar 2, 2026
@yingfeng

yingfeng commented Mar 2, 2026

Copy link
Copy Markdown
Member

Thank you. We are committed to building an international development community. Please ensure that all messages in the PR do not contain any Chinese characters.

@yaowei520 yaowei520 changed the title fix: (resume) 对项目经验以及工作经验进行交叉验证,并去除重复文本 Fix: (resume) Cross-verify project experience and work experience, and remove duplicate text Mar 2, 2026
@yaowei520

Copy link
Copy Markdown
Contributor Author

Thank you. We are committed to building an international development community. Please ensure that all messages in the PR do not contain any Chinese characters.

pleae review

@yingfeng yingfeng added the ci Continue Integration label Mar 2, 2026
@yingfeng
yingfeng marked this pull request as draft March 2, 2026 14:58
@yingfeng
yingfeng marked this pull request as ready for review March 2, 2026 14:58
@codecov

codecov Bot commented Mar 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 47.18%. Comparing base (4f09b3e) to head (f9ad1aa).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13323      +/-   ##
==========================================
- Coverage   49.18%   47.18%   -2.01%     
==========================================
  Files          44       44              
  Lines        9749     9749              
  Branches      110      110              
==========================================
- Hits         4795     4600     -195     
- Misses       4946     5136     +190     
- 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Improves resume post-processing to reduce duplicated chunks by cross-deduplicating overlapping “work experience” and “project experience” description entries.

Changes:

  • Adds a new post-processing phase (Phase 3.5) to remove project_desc_tks entries that heavily overlap with work_desc_tks.
  • Attempts overlap detection via normalized substring containment and a token-overlap ratio heuristic.
  • Optionally updates project_tks alongside filtered project descriptions.
Comments suppressed due to low confidence (1)

rag/app/resume.py:1922

  • proj_tokens is recomputed inside the inner loop for every norm_work even though it only depends on the current proj_desc. Similarly, work_tokens is recomputed for each project. Precomputing these token sets once per project/work description will reduce unnecessary work when there are many entries.
                # Token-level overlap ratio
                proj_tokens = set(norm_proj.split())
                work_tokens = set(norm_work.split())
                if proj_tokens and work_tokens:

Comment thread rag/app/resume.py Outdated
Comment on lines +1919 to +1925
# Token-level overlap ratio
proj_tokens = set(norm_proj.split())
work_tokens = set(norm_work.split())
if proj_tokens and work_tokens:
overlap = len(proj_tokens & work_tokens)
ratio = overlap / min(len(proj_tokens), len(work_tokens))
if ratio > 0.7:

Copilot AI Mar 3, 2026

Copy link

Choose a reason for hiding this comment

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

The token-overlap check uses _normalize_for_comparison(), which removes all whitespace (including spaces/newlines). As a result norm_proj.split() / norm_work.split() will almost always produce a single-token set, so the overlap ratio degenerates to an exact-string match and won’t catch partial overlaps as intended. Consider tokenizing from a normalization that preserves word boundaries (e.g., NFKC + lowercase + collapse whitespace) or using a regex-based tokenizer on the original text for this overlap calculation.

Copilot uses AI. Check for mistakes.
Comment thread rag/app/resume.py Outdated
Comment on lines +1936 to +1937
if deduped_project_names:
resume["project_tks"] = deduped_project_names

Copilot AI Mar 3, 2026

Copy link

Choose a reason for hiding this comment

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

project_desc_tks is filtered by index here, but project_tks is only updated when deduped_project_names is non-empty. If all project descriptions are removed (or a description is skipped via continue when norm_proj is empty), project_desc_tks can become empty while project_tks remains with the old entries, causing name/description misalignment later when building chunks (prefixing project_desc_tks with project_tks[idx]). Update project_tks consistently whenever descriptions are removed/skipped (even if the resulting list is empty), and ensure skipping an empty description also removes its corresponding name when present.

Suggested change
if deduped_project_names:
resume["project_tks"] = deduped_project_names
# Always update project_tks to stay aligned with project_desc_tks,
# even when all descriptions have been filtered out.
resume["project_tks"] = deduped_project_names

Copilot uses AI. Check for mistakes.
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Mar 3, 2026
@yaowei520

Copy link
Copy Markdown
Contributor Author

@copilot code review[agent]
评论本次提交

@yaowei520

Copy link
Copy Markdown
Contributor Author

@yingfeng 使用 tiktoken 做 token-shingle 的“重复率”(Jaccard)进行了优化

@yingfeng
yingfeng merged commit 48755a3 into infiniflow:main Mar 3, 2026
1 of 2 checks passed
guptas6est pushed a commit to Nordix/ragflow that referenced this pull request Mar 5, 2026
…d remove duplicate text (infiniflow#13323)

Cross-verify project experience and work experience, and remove
duplicate text

---------

Co-authored-by: Aron.Yao <[email protected]>
Co-authored-by: Aron.Yao <[email protected]>
writinwaters pushed a commit to writinwaters/ragflow that referenced this pull request Apr 10, 2026
…d remove duplicate text (infiniflow#13323)

Cross-verify project experience and work experience, and remove
duplicate text

---------

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

Cross-verify project experience and work experience, and remove
duplicate text

---------

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

Labels

🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration 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