Feat: Add multi-interest support to Recommender Engine 1172#1190
Conversation
|
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
left a comment
There was a problem hiding this comment.
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
-
Resolve merge conflicts
- This PR currently has merge conflicts with the latest
mainbranch. Please rebase/merge the latest changes and resolve all conflicts before requesting another review.
- This PR currently has merge conflicts with the latest
-
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.
-
-
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
- Please include examples covering:
-
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 done mam |
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.pyandrecommender.py) to process and score against multiple interests.Related Issue
Closes #1172
Type of Change
data/projects.jsonWhat Was Changed
src/templates/index.htmlmultipleattribute to theinterest<select>element.src/static/script.jsselectedOptions.length.src/routes/main_routes.pyinterestas either a string or a list, normalizing it to a list before passing it to the recommendation engine.src/utils/recommender.py_user_text(),validate_recommendation_inputs(), andscore_single_project()to handleinterestas 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
git checkout feat/issue-1172-multi-interest-supportpip install -r requirements.txtpython app.pypython tests/test_basic.py(orpytest tests/test_basic.py)Expected test output:
Test Results
Self-Review Checklist
feat/,fix/,docs/,data/,style/,test/python tests/test_basic.pyand all 27 tests passflake8 .locally and there are no errorsprint()orconsole.log()debug statementsNotes for Reviewer
None