5 Star 23 Fork 15

Gitee 极速下载/twitter-algorithm

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/twitter/the-algorithm
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

Pushservice

Pushservice is the main push recommendation service at Twitter used to generate recommendation-based notifications for users. It currently powers two functionalities:

  • RefreshForPushHandler: This handler determines whether to send a recommendation push to a user based on their ID. It generates the best push recommendation item and coordinates with downstream services to deliver it
  • SendHandler: This handler determines and manage whether send the push to users based on the given target user details and the provided push recommendation item

Overview

RefreshForPushHandler

RefreshForPushHandler follows these steps:

  • Building Target and checking eligibility
    • Builds a target user object based on the given user ID
    • Performs target-level filterings to determine if the target is eligible for a recommendation push
  • Fetch Candidates
    • Retrieves a list of potential candidates for the push by querying various candidate sources using the target
  • Candidate Hydration
    • Hydrates the candidate details with batch calls to different downstream services
  • Pre-rank Filtering, also called Light Filtering
    • Filters the hydrated candidates with lightweight RPC calls
  • Rank
    • Perform feature hydration for candidates and target user
    • Performs light ranking on candidates
    • Performs heavy ranking on candidates
  • Take Step, also called Heavy Filtering
    • Takes the top-ranked candidates one by one and applies heavy filtering until one candidate passes all filter steps
  • Send
    • Calls the appropriate downstream service to deliver the eligible candidate as a push and in-app notification to the target user

SendHandler

SendHandler follows these steps:

  • Building Target
    • Builds a target user object based on the given user ID
  • Candidate Hydration
    • Hydrates the candidate details with batch calls to different downstream services
  • Feature Hydration
    • Perform feature hydration for candidates and target user
  • Take Step, also called Heavy Filtering
    • Perform filterings and validation checking for the given candidate
  • Send
    • Calls the appropriate downstream service to deliver the given candidate as a push and/or in-app notification to the target user
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C/C++
1
https://gitee.com/mirrors/twitter-algorithm.git
git@gitee.com:mirrors/twitter-algorithm.git
mirrors
twitter-algorithm
twitter-algorithm
main

搜索帮助