You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+7-7
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
# Twitter Recommendation Algorithm
1
+
# Twitter's Recommendation Algorithm
2
2
3
-
The Twitter Recommendation Algorithm is a set of services and jobs that are responsible for constructing and serving the
3
+
Twitter's Recommendation Algorithm is a set of services and jobs that are responsible for constructing and serving the
4
4
Home Timeline. For an introduction to how the algorithm works, please refer to our [engineering blog](https://blog.twitter.com/engineering/en_us/topics/open-source/2023/twitter-recommendation-algorithm). The
5
5
diagram below illustrates how major services and jobs interconnect.
6
6
@@ -13,24 +13,24 @@ These are the main components of the Recommendation Algorithm included in this r
13
13
| Feature |[SimClusters](src/scala/com/twitter/simclusters_v2/README.md)| Community detection and sparse embeddings into those communities. |
14
14
||[TwHIN](https://github.com/twitter/the-algorithm-ml/blob/main/projects/twhin/README.md)| Dense knowledge graph embeddings for Users and Tweets. |
15
15
||[trust-and-safety-models](trust_and_safety_models/README.md)| Models for detecting NSFW or abusive content. |
16
-
||[real-graph](src/scala/com/twitter/interaction_graph/README.md)| Model to predict likelihood of a Twitter User interacting with another User. |
16
+
||[real-graph](src/scala/com/twitter/interaction_graph/README.md)| Model to predict the likelihood of a Twitter User interacting with another User. |
17
17
||[tweepcred](src/scala/com/twitter/graph/batch/job/tweepcred/README)| Page-Rank algorithm for calculating Twitter User reputation. |
18
18
||[recos-injector](recos-injector/README.md)| Streaming event processor for building input streams for [GraphJet](https://github.com/twitter/GraphJet) based services. |
19
19
||[graph-feature-service](graph-feature-service/README.md)| Serves graph features for a directed pair of Users (e.g. how many of User A's following liked Tweets from User B). |
20
20
| Candidate Source |[search-index](src/java/com/twitter/search/README.md)| Find and rank In-Network Tweets. ~50% of Tweets come from this candidate source. |
21
21
||[cr-mixer](cr-mixer/README.md)| Coordination layer for fetching Out-of-Network tweet candidates from underlying compute services. |
22
-
||[user-tweet-entity-graph](src/scala/com/twitter/recos/user_tweet_entity_graph/README.md) (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](https://github.com/twitter/GraphJet) framework. Several other GraphJet based features and candidate sources are located [here](src/scala/com/twitter/recos)|
22
+
||[user-tweet-entity-graph](src/scala/com/twitter/recos/user_tweet_entity_graph/README.md) (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](https://github.com/twitter/GraphJet) framework. Several other GraphJet based features and candidate sources are located [here](src/scala/com/twitter/recos).|
23
23
||[follow-recommendation-service](follow-recommendations-service/README.md) (FRS)| Provides Users with recommendations for accounts to follow, and Tweets from those accounts. |
24
-
| Ranking |[light-ranker](src/python/twitter/deepbird/projects/timelines/scripts/models/earlybird/README.md)| Light ranker model used by search index (Earlybird) to rank Tweets. |
24
+
| Ranking |[light-ranker](src/python/twitter/deepbird/projects/timelines/scripts/models/earlybird/README.md)| Light Ranker model used by search index (Earlybird) to rank Tweets. |
25
25
||[heavy-ranker](https://github.com/twitter/the-algorithm-ml/blob/main/projects/home/recap/README.md)| Neural network for ranking candidate tweets. One of the main signals used to select timeline Tweets post candidate sourcing. |
26
-
| Tweet mixing & filtering |[home-mixer](home-mixer/README.md)| Main service used to construct and serve the Home Timeline. Built on [product-mixer](product-mixer/README.md)|
26
+
| Tweet mixing & filtering |[home-mixer](home-mixer/README.md)| Main service used to construct and serve the Home Timeline. Built on [product-mixer](product-mixer/README.md).|
27
27
||[visibility-filters](visibilitylib/README.md)| 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. |
28
28
||[timelineranker](timelineranker/README.md)| Legacy service which provides relevance-scored tweets from the Earlybird Search Index and UTEG service. |
29
29
| Software framework |[navi](navi/navi/README.md)| High performance, machine learning model serving written in Rust. |
30
30
||[product-mixer](product-mixer/README.md)| Software framework for building feeds of content. |
31
31
||[twml](twml/README.md)| Legacy machine learning framework built on TensorFlow v1. |
32
32
33
-
We include Bazel BUILD files for most components, but not a toplevel BUILD or WORKSPACE file.
33
+
We include Bazel BUILD files for most components, but not a top-level BUILD or WORKSPACE file.
Copy file name to clipboardexpand all lines: cr-mixer/README.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,6 @@
2
2
3
3
CR-Mixer is a candidate generation service proposed as part of the Personalization Strategy vision for Twitter. Its aim is to speed up the iteration and development of candidate generation and light ranking. The service acts as a lightweight coordinating layer that delegates candidate generation tasks to underlying compute services. It focuses on Twitter's candidate generation use cases and offers a centralized platform for fetching, mixing, and managing candidate sources and light rankers. The overarching goal is to increase the speed and ease of testing and developing candidate generation pipelines, ultimately delivering more value to Twitter users.
4
4
5
-
CR-Mixer act as a configurator and delegator, providing abstractions for the challenging parts of candidate generation and handling performance issues. It will offer a 1-stop-shop for fetching and mixing candidate sources, a managed and shared performant platform, a light ranking layer, a common filtering layer, a version control system, a co-owned feature switch set, and peripheral tooling.
5
+
CR-Mixer acts as a configurator and delegator, providing abstractions for the challenging parts of candidate generation and handling performance issues. It will offer a 1-stop-shop for fetching and mixing candidate sources, a managed and shared performant platform, a light ranking layer, a common filtering layer, a version control system, a co-owned feature switch set, and peripheral tooling.
6
6
7
-
CR-Mixer's pipeline consists of 4 steps: source signal extraction, candidate generation, filtering, and ranking. It also provides peripheral tooling like scribing, debugging, and monitoring. The service fetches source signals externally from stores like UserProfileService and RealGraph, calls external candidate generation services, and caches results. Filters are applied for deduping and pre-ranking, and a light ranking step follows.
7
+
CR-Mixer's pipeline consists of 4 steps: source signal extraction, candidate generation, filtering, and ranking. It also provides peripheral tooling like scribing, debugging, and monitoring. The service fetches source signals externally from stores like UserProfileService and RealGraph, calls external candidate generation services, and caches results. Filters are applied for deduping and pre-ranking, and a light ranking step follows.
Recos-Injector is a streaming event processor for building input streams for GraphJet based services.
3
-
It is general purpose in that it consumes arbitrary incoming event stream (e.x. Fav, RT, Follow, client_events, etc), applies
4
-
filtering, combines and publishes cleaned up events to corresponding GraphJet services.
5
-
Each GraphJet based service subscribes to a dedicated Kafka topic. Recos-Injector enables a GraphJet based service to consume any
6
-
event it wants
1
+
# Recos-Injector
7
2
8
-
## How to run recos-injector-server tests
3
+
Recos-Injector is a streaming event processor used to build input streams for GraphJet-based services. It is a general-purpose tool that consumes arbitrary incoming event streams (e.g., Fav, RT, Follow, client_events, etc.), applies filtering, and combines and publishes cleaned up events to corresponding GraphJet services. Each GraphJet-based service subscribes to a dedicated Kafka topic, and Recos-Injector enables GraphJet-based services to consume any event they want.
9
4
10
-
Tests can be run by using this command from your project's root directory:
5
+
## How to run Recos-Injector server tests
6
+
7
+
You can run tests by using the following command from your project's root directory:
11
8
12
9
$ bazel build recos-injector/...
13
10
$ bazel test recos-injector/...
@@ -28,17 +25,16 @@ terminal:
28
25
$ curl -s localhost:9990/admin/ping
29
26
pong
30
27
31
-
Run `curl -s localhost:9990/admin` to see a list of all of the available admin
32
-
endpoints.
28
+
Run `curl -s localhost:9990/admin` to see a list of all available admin endpoints.
33
29
34
-
## Querying recos-injector-server from a Scala console
30
+
## Querying Recos-Injector server from a Scala console
35
31
36
-
RecosInjector does not have a thrift endpoint. It reads Event Bus and Kafka queues and writes to recos_injector kafka.
32
+
Recos-Injector does not have a Thrift endpoint. Instead, it reads Event Bus and Kafka queues and writes to the Recos-Injector Kafka.
37
33
38
34
## Generating a package for deployment
39
35
40
-
To package your service into a zip for deployment:
36
+
To package your service into a zip file for deployment, run:
Copy file name to clipboardexpand all lines: simclusters-ann/README.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ SimClusters from the Linear Algebra Perspective discussed the difference between
15
15
However, calculating the cosine similarity between two Tweets is pretty expensive in Tweet candidate generation. In TWISTLY, we scan at most 15,000 (6 source tweets * 25 clusters * 100 tweets per clusters) tweet candidates for every Home Timeline request. The traditional algorithm needs to make API calls to fetch 15,000 tweet SimCluster embeddings. Consider that we need to process over 6,000 RPS, it’s hard to support by the existing infrastructure.
0 commit comments