DevPath icon indicating copy to clipboard operation
DevPath copied to clipboard

[Bug]: Duplicate skills inflate recommendation score — parse_skills() doesn't deduplicate

Open sujitsingh8 opened this issue 6 months ago • 7 comments

What happened?

parse_skills() in recommender.py doesn't remove duplicate skills. If a user enters the same skill multiple times (like "python, python, python"), each copy is counted as a separate match in score_single_project, multiplying the skill score. This lets a project's score be inflated just by repeating a skill, which distorts the ranking. Also "py" and "python" both normalize to "python" but are still counted as two separate skills.

Steps to reproduce

  1. Call get_recommendations("python", "Beginner", "Web", "Low") and note the scores
  2. Call get_recommendations("python,python,python", "Beginner", "Web", "Low")
  3. The repeated skill multiplies the score (a single match gives 8, three copies give 14)
  4. parse_skills("python, python, py") returns ["python","python","python"] instead of ["python"]

Expected behaviour

Duplicate skills should be counted only once. parse_skills() should return a deduplicated list so repeating a skill can't inflate the recommendation score or change the ranking.

Area of the app affected

Recommendation results

Python version

3.14

Operating system

Windows 11

Relevant error output or logs

No error thrown — silent ranking bug. parse_skills("python, python, py") returns ['python', 'python', 'python'].

Before submitting

  • [x] I searched existing issues and this has not been reported before.
  • [x] I can reproduce this bug consistently with the steps above.
  • [x] I am running the latest version of the main branch.

sujitsingh8 avatar May 31 '26 05:05 sujitsingh8

Hi @komalharshita! I'd love to take this one.

I've looked at the bug — parse_skills() splits and normalizes the input but doesn't deduplicate, so repeated entries like "python, python, python" all pass through and inflate the score in score_single_project().

The fix is straightforward: after normalizing each skill, convert to a set before returning, so both exact duplicates and aliases that normalize to the same string are deduplicated in one step.

I'll also add tests covering duplicate input and alias normalization to make sure the fix holds.

Could you please assign issue #710 to me? Happy to open a PR shortly after.

varsha-lab2028 avatar May 31 '26 08:05 varsha-lab2028

Hi @komalharshita I'm a GSSoC 2026 contributor interested in working on this issue. If it's still available and not already assigned, could you please assign it to me? Thank you!

/assign

aasheeshhh avatar May 31 '26 14:05 aasheeshhh

I would like to work on this issue. Could you please assign it to me? I can add deduplication to parse_skills() to prevent inflated recommendation scores.

anshul23102 avatar Jun 02 '26 17:06 anshul23102

/assign GSSoC

Hi @komalharshita I want to work on this under GSSoC 2026 if it is available assign it to me.

Thank you

kareena0229 avatar Jun 05 '26 07:06 kareena0229

/assign

GAURAV7820 avatar Jun 30 '26 12:06 GAURAV7820

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions!

github-actions[bot] avatar Nov 20 '26 08:11 github-actions[bot]

This issue was closed because it has been inactive for an extended period. If this issue is still relevant, feel free to reopen it or create a new one.

github-actions[bot] avatar Nov 27 '26 09:11 github-actions[bot]