Skip to content

Feat: Add multi-interest support to Recommender Engine 1172#1190

Open
desireddymohithreddy0925 wants to merge 3 commits into
komalharshita:mainfrom
desireddymohithreddy0925:feat/issue-1172-multi-interest-support
Open

Feat: Add multi-interest support to Recommender Engine 1172#1190
desireddymohithreddy0925 wants to merge 3 commits into
komalharshita:mainfrom
desireddymohithreddy0925:feat/issue-1172-multi-interest-support

Conversation

@desireddymohithreddy0925

Copy link
Copy Markdown

Summary

This PR introduces multi-interest support to the Recommender Engine, addressing #1172. Previously, the application restricted users to selecting a single area of interest, which limited personalization for users with cross-disciplinary goals (e.g., "Web" and "Data"). This update modifies the frontend form to allow multi-selection, updates the frontend JavaScript to submit an array of selected interests, and refactors the backend (main_routes.py and recommender.py) to process and score against multiple interests.

Related Issue

Closes #1172

Type of Change

  • Bug fix — resolves a broken behaviour
  • Feature — adds new functionality
  • Data — adds new projects to data/projects.json
  • Documentation — updates docs, README, or code comments only
  • Style — CSS or visual changes only, no logic change
  • Refactor — restructures code without changing behaviour
  • Test — adds or updates tests

What Was Changed

File Change made
src/templates/index.html Added the multiple attribute to the interest <select> element.
src/static/script.js Updated form submission logic to extract and send an array of selected options for the interest field instead of a single string. Also updated client-side validation logic to check selectedOptions.length.
src/routes/main_routes.py Updated payload parsing to accept interest as either a string or a list, normalizing it to a list before passing it to the recommendation engine.
src/utils/recommender.py Updated _user_text(), validate_recommendation_inputs(), and score_single_project() to handle interest as a list. The scoring algorithm now awards the interest bonus if any of the user's selected interests match the project's interest.

How to Test This PR

  1. Clone this branch: git checkout feat/issue-1172-multi-interest-support
  2. Install dependencies: pip install -r requirements.txt
  3. Run the app: python app.py
  4. On the frontend form, select multiple interests (e.g., using Cmd/Ctrl + click to select "Web" and "Data").
  5. Submit the form and verify that the backend successfully processes the request and recommends projects matching either of the selected interests.
  6. Run the tests: python tests/test_basic.py (or pytest tests/test_basic.py)

Expected test output:

27 passed, 0 failed out of 27 tests

Test Results

============================= test session starts ==============================
platform darwin -- Python 3.x.x, pytest-x.x.x, pluggy-x.x.x
rootdir: /Users/desireddymohithreddy/GSSOC2026DevPath/DevPathMRD
collected 27 items                                                             

tests/test_basic.py ...........................                          [100%]

============================== 27 passed in 0.12s ==============================

Self-Review Checklist

  • I have read CONTRIBUTING.md and followed all guidelines
  • My branch name follows the convention: feat/, fix/, docs/, data/, style/, test/
  • I have run python tests/test_basic.py and all 27 tests pass
  • I have run flake8 . locally and there are no errors
  • I have not introduced any print() or console.log() debug statements
  • Every new function I wrote has a docstring
  • I have not modified files outside the scope of the linked issue
  • If I changed the UI, I tested it at 375px (mobile) and 1280px (desktop)
  • If I added a project to the dataset, it has all required JSON fields

Notes for Reviewer

None

@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel.

A member of the Team first needs to authorize it.

@komalharshita komalharshita left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thank you for your contribution to DevPath and for the time and effort you've invested in implementing multi-interest support for the recommender engine!

I reviewed the changes, and this is a meaningful enhancement that makes recommendations much more flexible for users with multiple interests. I appreciate the updates across both the frontend and backend to support this functionality.

However, I have a few requests before this PR can be merged:

Requested Changes

  1. Resolve merge conflicts

    • This PR currently has merge conflicts with the latest main branch. Please rebase/merge the latest changes and resolve all conflicts before requesting another review.
  2. Review the "no projects available" logic

    • The backend now checks:

      if any(interest_has_no_projects(i) for i in interest):

      This means the API will return "No projects available" if any one of the selected interests has no projects, even if the remaining selected interests do have valid recommendations.

      I believe the expected behavior should be to continue recommending projects from the interests that do have matching projects. Please verify whether this condition should instead only return an empty response when all selected interests have no available projects.

  3. Expand testing details

    • Please include examples covering:
      • Single interest (backward compatibility)
      • Multiple interests with overlapping recommendations
      • Multiple interests where one category has no projects
      • Multiple interests where none have projects
      • Empty selection
  4. Update the PR description

    • Since this changes API behavior and frontend form submission, please include more implementation details and ensure the PR follows the complete GSSoC PR template.

Thank you again for contributing to DevPath! Once these points are addressed and the merge conflicts are resolved, I'd be happy to review the updated version.

@komalharshita komalharshita added enhancement New feature or request need review Further information is requested level:beginner quality:clean labels Jul 19, 2026
@desireddymohithreddy0925

Copy link
Copy Markdown
Author

@komalharshita done mam

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Multi-interest support in the Recommender Engine

2 participants