{"id":15146008,"url":"https://github.com/keivanipchihagh/multi-stage-two-tower-recommender","last_synced_at":"2026-01-30T20:03:55.995Z","repository":{"id":255881936,"uuid":"847305575","full_name":"keivanipchihagh/multi-stage-two-tower-recommender","owner":"keivanipchihagh","description":"A Movie Recommender System using YouTube's Two-Tower Architecture built with TFRS+TFR and served with FastAPI","archived":false,"fork":false,"pushed_at":"2024-09-07T14:46:52.000Z","size":20329,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-13T08:49:40.967Z","etag":null,"topics":["information-retrieval","keras","listwise","movielens","movielens-movie-recommendation","pairwise","pointwise","python","ranking","ranking-system","recommendation-engine","recommender-system","retrieval","tensorflow","tensorflow-recommenders","tfrs","two-tower-neural-networks","youtube","youtube-recommender"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/keivanipchihagh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-25T12:56:56.000Z","updated_at":"2025-04-28T18:23:26.000Z","dependencies_parsed_at":"2024-09-07T17:20:22.457Z","dependency_job_id":"aa53356a-004a-4b61-9386-b38d3a597286","html_url":"https://github.com/keivanipchihagh/multi-stage-two-tower-recommender","commit_stats":null,"previous_names":["keivanipchihagh/multi-stage-two-tower-recommender"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/keivanipchihagh/multi-stage-two-tower-recommender","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keivanipchihagh%2Fmulti-stage-two-tower-recommender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keivanipchihagh%2Fmulti-stage-two-tower-recommender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keivanipchihagh%2Fmulti-stage-two-tower-recommender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keivanipchihagh%2Fmulti-stage-two-tower-recommender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keivanipchihagh","download_url":"https://codeload.github.com/keivanipchihagh/multi-stage-two-tower-recommender/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keivanipchihagh%2Fmulti-stage-two-tower-recommender/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28918235,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T19:10:10.838Z","status":"ssl_error","status_checked_at":"2026-01-30T19:06:40.573Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["information-retrieval","keras","listwise","movielens","movielens-movie-recommendation","pairwise","pointwise","python","ranking","ranking-system","recommendation-engine","recommender-system","retrieval","tensorflow","tensorflow-recommenders","tfrs","two-tower-neural-networks","youtube","youtube-recommender"],"created_at":"2024-09-26T12:00:33.732Z","updated_at":"2026-01-30T20:03:55.975Z","avatar_url":"https://github.com/keivanipchihagh.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Multi-Stage Two-Tower Recommender\nA multi-stage movie recommendation system using YouTube's Tow-Tower architecture.\n\n## Getting Started\n### Installation\nTo set up the virtual environment and install the necessary dependencies, run the following command:\n```bash\nmake install\n```\nThis will ensure your environment is prepared with all required packages, ready to run the project.\n\n### Usage\nRun the [test.py](test.py) for a quick start.\n\n## Dataset\nDifferent versions of the [MovieLens](https://grouplens.org/datasets/movielens/) dataset are used for both training and evaluation purposes. Due to significant data redundancy in the original datasets, I created the script [dataset.py](scripts/dataset.py) to generate separate files for movies, users, and ratings, effectively eliminating duplication and reducing the overal size of each datasets along side feature engineering and feature selection for the task. This is most similar to the data at hand in a production environment.\n\n### Feature Selection\n- Retained all features from the original dataset, except for `raw_user_age`, which is only available in the `100k` version of the dataset.\n- Removed `user_occupation_text` since `user_occupation_label` was derived from it, making it redundant.\n\n### Feature Engineering\n- Most of the `movie_title` values in the dataset include their release years in parentheses, which were extracted and treated as a separate feature. For movies without a listed release year, the corresponding values are left as `NaN`.\n- Converted the `user_gender` feature from boolean values to integer representations.\n\n## Project Structure\n- [data/](data) - Directory for storing *100k* and *1m* versions of the [Movielense](https://grouplens.org/datasets/movielens/) dataset.\n- [src/](src) - Contains the core implementation, including model definitions, architecture, and api functions.\n- [scripts/](scripts) - Useful scripts.\n\n## 🖇References\n**Videos**\n- [Building recommendation systems with TensorFlow](https://www.youtube.com/playlist?list=PLQY2H8rRoyvy2MiyUBz5RWZr5MPFkV3qz)\n\n**Papers**\n- [Deep Neural Networks for YouTube Recommendations](https://research.google.com/pubs/archive/45530.pdf)\n\n**Libraries**\n- [Tensorflow Ranking (TFR)](https://github.com/tensorflow/ranking)\n- [TensorFlow Recommenders (TFRS)](https://github.com/tensorflow/recommenders)\n\n**Codes**\n- [xei/recommender-system-tutorial](https://github.com/xei/recommender-system-tutorial)\n\n## Contributions\nContributions are welcome and greatly appreciated! If you have an idea for improvement, or if you find a bug, feel free to contribute by opening an [issue](https://github.com/keivanipchihagh/multi-stage-two-tower-recommender/issues) or a [pull request](https://github.com/keivanipchihagh/multi-stage-two-tower-recommender/pulls).\n\n## License\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeivanipchihagh%2Fmulti-stage-two-tower-recommender","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeivanipchihagh%2Fmulti-stage-two-tower-recommender","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeivanipchihagh%2Fmulti-stage-two-tower-recommender/lists"}