Giter Site home page Giter Site logo

joachimjusth / the-algorithm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from twitter/the-algorithm

0.0 1.0 0.0 3.32 MB

Source code for Twitter's Recommendation Algorithm

Home Page: https://blog.twitter.com/engineering/en_us/topics/open-source/2023/twitter-recommendation-algorithm

License: GNU Affero General Public License v3.0

Shell 0.04% C++ 2.39% Python 4.66% C 0.18% Java 29.68% Scala 53.86% Rust 1.54% Thrift 1.38% CMake 0.02% Dockerfile 0.01% Starlark 6.25%

the-algorithm's Introduction

Twitter Recommendation Algorithm

The Twitter Recommendation Algorithm is a set of services and jobs that are responsible for constructing and serving the Home Timeline. For an introduction to how the algorithm works, please refer to our engineering blog. The diagram below illustrates how major services and jobs interconnect.

These are the main components of the Recommendation Algorithm included in this repository:

Type Component Description
Feature SimClusters Community detection and sparse embeddings into those communities.
TwHIN Dense knowledge graph embeddings for Users and Tweets.
trust-and-safety-models Models for detecting NSFW or abusive content.
real-graph Model to predict likelihood of a Twitter User interacting with another User.
tweepcred Page-Rank algorithm for calculating Twitter User reputation.
recos-injector Streaming event processor for building input streams for GraphJet based services.
graph-feature-service Serves graph features for a directed pair of Users (e.g. how many of User A's following liked Tweets from User B).
Candidate Source search-index Find and rank In-Network Tweets. ~50% of Tweets come from this candidate source.
cr-mixer Coordination layer for fetching Out-of-Network tweet candidates from underlying compute services.
user-tweet-entity-graph (UTEG) Maintains an in memory User to Tweet interaction graph, and finds candidates based on traversals of this graph. This is built on the GraphJet framework. Several other GraphJet based features and candidate sources are located here
follow-recommendation-service (FRS) Provides Users with recommendations for accounts to follow, and Tweets from those accounts.
Ranking light-ranker Light ranker model used by search index (Earlybird) to rank Tweets.
heavy-ranker Neural network for ranking candidate tweets. One of the main signals used to select timeline Tweets post candidate sourcing.
Tweet mixing & filtering home-mixer Main service used to construct and serve the Home Timeline. Built on product-mixer
visibility-filters Responsible for filtering Twitter content to support legal compliance, improve product quality, increase user trust, protect revenue through the use of hard-filtering, visible product treatments, and coarse-grained downranking.
timelineranker Legacy service which provides relevance-scored tweets from the Earlybird Search Index and UTEG service.
Software framework navi High performance, machine learning model serving written in Rust.
product-mixer Software framework for building feeds of content.
twml Legacy machine learning framework built on TensorFlow v1.

We include Bazel BUILD files for most components, but not a top level BUILD or WORKSPACE file.

Contributing

We invite the community to submit GitHub issues and pull requests for suggestions on improving the recommendation algorithm. We are working on tools to manage these suggestions and sync changes to our internal repository. Any security concerns or issues should be routed to our official bug bounty program through HackerOne. We hope to benefit from the collective intelligence and expertise of the global community in helping us identify issues and suggest improvements, ultimately leading to a better Twitter.

Read our blog on the open source initiative here.

the-algorithm's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.