mirror of
https://github.com/twitter/the-algorithm.git
synced 2024-06-01 08:48:46 +02:00
Delete follow-recommendations-service/thrift/src/main/thrift directory
This commit is contained in:
parent
18fff3df34
commit
e0cae815f2
|
@ -1,21 +0,0 @@
|
|||
create_thrift_libraries(
|
||||
base_name = "thrift",
|
||||
sources = ["*.thrift"],
|
||||
platform = "java8",
|
||||
tags = ["bazel-compatible"],
|
||||
dependency_roots = [
|
||||
"finatra-internal/thrift/src/main/thrift",
|
||||
"follow-recommendations-service/thrift/src/main/thrift/logging:thrift",
|
||||
"product-mixer/core/src/main/thrift/com/twitter/product_mixer/core:thrift",
|
||||
"src/thrift/com/twitter/ads/adserver:adserver_common",
|
||||
"src/thrift/com/twitter/ml/api:data",
|
||||
"src/thrift/com/twitter/suggests/controller_data",
|
||||
],
|
||||
generate_languages = [
|
||||
"java",
|
||||
"scala",
|
||||
"strato",
|
||||
],
|
||||
provides_java_name = "follow-recommendations-java",
|
||||
provides_scala_name = "follow-recommendations-scala",
|
||||
)
|
|
@ -1,42 +0,0 @@
|
|||
namespace java com.twitter.follow_recommendations.thriftjava
|
||||
#@namespace scala com.twitter.follow_recommendations.thriftscala
|
||||
#@namespace strato com.twitter.follow_recommendations
|
||||
|
||||
struct Header {
|
||||
1: required Title title
|
||||
}
|
||||
|
||||
struct Title {
|
||||
1: required string text
|
||||
}
|
||||
|
||||
struct Footer {
|
||||
1: optional Action action
|
||||
}
|
||||
|
||||
struct Action {
|
||||
1: required string text
|
||||
2: required string actionURL
|
||||
}
|
||||
|
||||
struct UserList {
|
||||
1: required bool userBioEnabled
|
||||
2: required bool userBioTruncated
|
||||
3: optional i64 userBioMaxLines
|
||||
4: optional FeedbackAction feedbackAction
|
||||
}
|
||||
|
||||
struct Carousel {
|
||||
1: optional FeedbackAction feedbackAction
|
||||
}
|
||||
|
||||
union WTFPresentation {
|
||||
1: UserList userBioList
|
||||
2: Carousel carousel
|
||||
}
|
||||
|
||||
struct DismissUserId {}
|
||||
|
||||
union FeedbackAction {
|
||||
1: DismissUserId dismissUserId
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
namespace java com.twitter.follow_recommendations.thriftjava
|
||||
#@namespace scala com.twitter.follow_recommendations.thriftscala
|
||||
#@namespace strato com.twitter.follow_recommendations
|
||||
|
||||
// Caller/Client level specific context (e.g, user id/guest id/app id).
|
||||
struct ClientContext {
|
||||
1: optional i64 userId(personalDataType='UserId')
|
||||
2: optional i64 guestId(personalDataType='GuestId')
|
||||
3: optional i64 appId(personalDataType='AppId')
|
||||
4: optional string ipAddress(personalDataType='IpAddress')
|
||||
5: optional string userAgent(personalDataType='UserAgent')
|
||||
6: optional string countryCode(personalDataType='InferredCountry')
|
||||
7: optional string languageCode(personalDataType='InferredLanguage')
|
||||
9: optional bool isTwoffice(personalDataType='InferredLocation')
|
||||
10: optional set<string> userRoles
|
||||
11: optional string deviceId(personalDataType='DeviceId')
|
||||
12: optional i64 guestIdAds(personalDataType='GuestId')
|
||||
13: optional i64 guestIdMarketing(personalDataType='GuestId')
|
||||
}(hasPersonalData='true')
|
|
@ -1,73 +0,0 @@
|
|||
namespace java com.twitter.follow_recommendations.thriftjava
|
||||
#@namespace scala com.twitter.follow_recommendations.thriftscala
|
||||
#@namespace strato com.twitter.follow_recommendation
|
||||
|
||||
// These are broken into their own union
|
||||
// because we can have features that are
|
||||
// complex flavors of these (such as Seq)
|
||||
union PrimitiveFeatureValue {
|
||||
1: i32 intValue
|
||||
2: i64 longValue
|
||||
3: string strValue
|
||||
4: bool boolValue
|
||||
}
|
||||
|
||||
union FeatureValue {
|
||||
1: PrimitiveFeatureValue primitiveValue
|
||||
}
|
||||
|
||||
struct DebugParams {
|
||||
1: optional map<string, FeatureValue> featureOverrides
|
||||
2: optional i64 randomizationSeed
|
||||
3: optional bool includeDebugInfoInResults
|
||||
4: optional bool doNotLog
|
||||
}
|
||||
|
||||
enum DebugCandidateSourceIdentifier {
|
||||
UTT_INTERESTS_RELATED_USERS_SOURCE = 0
|
||||
UTT_PRODUCER_EXPANSION_SOURCE = 1
|
||||
UTT_SEED_ACCOUNT_SOURCE = 2
|
||||
BYF_USER_FOLLOW_CLUSTER_SIMS_SOURCE = 3
|
||||
BYF_USER_FOLLOW_CLUSTER_SOURCE = 4
|
||||
USER_FOLLOW_CLUSTER_SOURCE = 5
|
||||
RECENT_SEARCH_BASED_SOURCE = 6
|
||||
PEOPLE_ACTIVITY_RECENT_ENGAGEMENT_SOURCE = 7
|
||||
PEOPLE_ACTIVITY_RECENT_ENGAGEMENT_SIMS_SOURCE = 8,
|
||||
REVERSE_PHONE_BOOK_SOURCE = 9,
|
||||
REVERSE_EMAIL_BOOK_SOURCE = 10,
|
||||
SIMS_DEBUG_STORE = 11,
|
||||
UTT_PRODUCER_ONLINE_MBCG_SOURCE = 12,
|
||||
BONUS_FOLLOW_CONDITIONAL_ENGAGEMENT_STORE = 13,
|
||||
// 14 (BONUS_FOLLOW_PMI_STORE) was deleted as it's not used anymore
|
||||
FOLLOW2VEC_NEAREST_NEIGHBORS_STORE = 15,
|
||||
OFFLINE_STP = 16,
|
||||
OFFLINE_STP_BIG = 17,
|
||||
OFFLINE_MUTUAL_FOLLOW_EXPANSION = 18,
|
||||
REPEATED_PROFILE_VISITS = 19,
|
||||
TIME_DECAY_FOLLOW2VEC_NEAREST_NEIGHBORS_STORE = 20,
|
||||
LINEAR_REGRESSION_FOLLOW2VEC_NEAREST_NEIGHBORS_STORE = 21,
|
||||
REAL_GRAPH_EXPANSION_SOURCE = 22,
|
||||
RELATABLE_ACCOUNTS_BY_INTEREST = 23,
|
||||
EMAIL_TWEET_CLICK = 24,
|
||||
GOOD_TWEET_CLICK_ENGAGEMENTS = 25,
|
||||
ENGAGED_FOLLOWER_RATIO = 26,
|
||||
TWEET_SHARE_ENGAGEMENTS = 27,
|
||||
BULK_FRIEND_FOLLOWS = 28,
|
||||
REAL_GRAPH_OON_V2_SOURCE = 30,
|
||||
CROWD_SEARCH_ACCOUNTS = 31,
|
||||
POP_GEOHASH = 32,
|
||||
POP_COUNTRY = 33,
|
||||
POP_COUNTRY_BACKFILL = 34,
|
||||
TWEET_SHARER_TO_SHARE_RECIPIENT_ENGAGEMENTS = 35,
|
||||
TWEET_AUTHOR_TO_SHARE_RECIPIENT_ENGAGEMENTS = 36,
|
||||
BULK_FRIEND_FOLLOWS_NEW_USER = 37,
|
||||
ONLINE_STP_EPSCORER = 38,
|
||||
ORGANIC_FOLLOW_ACCOUNTS = 39,
|
||||
NUX_LO_HISTORY = 40,
|
||||
TRAFFIC_ATTRIBUTION_ACCOUNTS = 41,
|
||||
ONLINE_STP_RAW_ADDRESS_BOOK = 42,
|
||||
POP_GEOHASH_QUALITY_FOLLOW = 43,
|
||||
NOTIFICATION_ENGAGEMENT = 44,
|
||||
EFR_BY_WORLDWIDE_PICTURE_PRODUCER = 45,
|
||||
POP_GEOHASH_REAL_GRAPH = 46,
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
include "flows.thrift"
|
||||
include "recently_engaged_user_id.thrift"
|
||||
|
||||
namespace java com.twitter.follow_recommendations.thriftjava
|
||||
#@namespace scala com.twitter.follow_recommendations.thriftscala
|
||||
#@namespace strato com.twitter.follow_recommendations
|
||||
|
||||
struct Profile {
|
||||
1: required i64 profileId(personalDataType='UserId')
|
||||
}(hasPersonalData='true')
|
||||
|
||||
struct Search {
|
||||
1: required string searchQuery(personalDataType='SearchQuery')
|
||||
}(hasPersonalData='true')
|
||||
|
||||
struct Rux {
|
||||
1: required i64 focalAuthorId(personalDataType='UserId')
|
||||
}(hasPersonalData='true')
|
||||
|
||||
struct Topic {
|
||||
1: required i64 topicId(personalDataType = 'TopicFollow')
|
||||
}(hasPersonalData='true')
|
||||
|
||||
struct ReactiveFollow {
|
||||
1: required list<i64> followedUserIds(personalDataType='UserId')
|
||||
}(hasPersonalData='true')
|
||||
|
||||
struct NuxInterests {
|
||||
1: optional flows.FlowContext flowContext // set for recommendation inside an interactive flow
|
||||
2: optional list<i64> uttInterestIds // if provided, we use these interestIds for generating candidates instead of for example fetching user selected interests
|
||||
}(hasPersonalData='true')
|
||||
|
||||
struct AdCampaignTarget {
|
||||
1: required list<i64> similarToUserIds(personalDataType='UserId')
|
||||
}(hasPersonalData='true')
|
||||
|
||||
struct ConnectTab {
|
||||
1: required list<i64> byfSeedUserIds(personalDataType='UserId')
|
||||
2: required list<i64> similarToUserIds(personalDataType='UserId')
|
||||
3: required list<recently_engaged_user_id.RecentlyEngagedUserId> recentlyEngagedUserIds
|
||||
}(hasPersonalData='true')
|
||||
|
||||
struct SimilarToUser {
|
||||
1: required i64 similarToUserId(personalDataType='UserId')
|
||||
}(hasPersonalData='true')
|
||||
|
||||
struct PostNuxFollowTask {
|
||||
1: optional flows.FlowContext flowContext // set for recommendation inside an interactive flow
|
||||
}(hasPersonalData='true')
|
||||
|
||||
union DisplayContext {
|
||||
1: Profile profile
|
||||
2: Search search
|
||||
3: Rux rux
|
||||
4: Topic topic
|
||||
5: ReactiveFollow reactiveFollow
|
||||
6: NuxInterests nuxInterests
|
||||
7: AdCampaignTarget adCampaignTarget
|
||||
8: ConnectTab connectTab
|
||||
9: SimilarToUser similarToUser
|
||||
10: PostNuxFollowTask postNuxFollowTask
|
||||
}(hasPersonalData='true')
|
|
@ -1,55 +0,0 @@
|
|||
namespace java com.twitter.follow_recommendations.thriftjava
|
||||
#@namespace scala com.twitter.follow_recommendations.thriftscala
|
||||
#@namespace strato com.twitter.follow_recommendations
|
||||
|
||||
enum DisplayLocation {
|
||||
SIDEBAR = 0
|
||||
PROFILE_SIDEBAR = 2
|
||||
CLUSTER_FOLLOW = 7
|
||||
NEW_USER_SARUS_BACKFILL = 12
|
||||
PROFILE_DEVICE_FOLLOW = 23
|
||||
RECOS_BACKFILL = 32
|
||||
HOME_TIMELINE = 39 # HOME_TIMELINE_WTF in Hermit
|
||||
PROFILE_TOP_FOLLOWING = 42
|
||||
PROFILE_TOP_FOLLOWERS = 43
|
||||
PEOPLE_PLUS_PLUS = 47
|
||||
EXPLORE_TAB = 57
|
||||
MagicRecs = 59 # Account recommendation in notification
|
||||
AB_UPLOAD_INJECTION = 60
|
||||
/**
|
||||
* To prevent setting 2 display locations with the same index in FRS.
|
||||
*
|
||||
* The display location should be added to the following files:
|
||||
* - follow-recommendations-service/thrift/src/main/thrift/display_location.thrift
|
||||
* - follow-recommendations-service/thrift/src/main/thrift/logging/display_location.thrift
|
||||
* - follow-recommendations-service/common/src/main/scala/com/twitter/follow_recommendations/common/models/DisplayLocation.scala
|
||||
*/
|
||||
CAMPAIGN_FORM = 61
|
||||
RUX_LANDING_PAGE = 62
|
||||
PROFILE_BONUS_FOLLOW = 63
|
||||
ELECTION_EXPLORE_WTF = 64
|
||||
HTL_BONUS_FOLLOW = 65
|
||||
TOPIC_LANDING_PAGE_HEADER = 66
|
||||
NUX_PYMK = 67
|
||||
NUX_INTERESTS = 68
|
||||
REACTIVE_FOLLOW = 69
|
||||
RUX_PYMK = 70
|
||||
INDIA_COVID19_CURATED_ACCOUNTS_WTF = 71
|
||||
NUX_TOPIC_BONUS_FOLLOW = 72
|
||||
TWEET_NOTIFICATION_RECS = 73
|
||||
HTL_SPACE_HOSTS = 74
|
||||
POST_NUX_FOLLOW_TASK = 75
|
||||
TOPIC_LANDING_PAGE = 76
|
||||
USER_TYPEAHEAD_PREFETCH = 77
|
||||
HOME_TIMELINE_RELATABLE_ACCOUNTS = 78
|
||||
NUX_GEO_CATEGORY = 79
|
||||
NUX_INTERESTS_CATEGORY = 80
|
||||
NUX_PYMK_CATEGORY = 81
|
||||
TOP_ARTICLES = 82
|
||||
HOME_TIMELINE_TWEET_RECS = 83
|
||||
HTL_BULK_FRIEND_FOLLOWS = 84
|
||||
NUX_AUTO_FOLLOW = 85
|
||||
SEARCH_BONUS_FOLLOW = 86
|
||||
CONTENT_RECOMMENDER = 87
|
||||
HOME_TIMELINE_REVERSE_CHRON = 88
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
namespace java com.twitter.follow_recommendations.thriftjava
|
||||
#@namespace scala com.twitter.follow_recommendations.thriftscala
|
||||
#@namespace strato com.twitter.follow_recommendations
|
||||
|
||||
enum EngagementType {
|
||||
Click = 0
|
||||
Like = 1
|
||||
Mention = 2
|
||||
Retweet = 3
|
||||
ProfileView = 4
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
/*
|
||||
* This file defines additional thrift objects that should be specified in FRS request for context of recommendation, specifically the previous recommendations / new interactions in an interactive flow (series of follow steps). These typically are sent from OCF
|
||||
*/
|
||||
|
||||
namespace java com.twitter.follow_recommendations.thriftjava
|
||||
#@namespace scala com.twitter.follow_recommendations.thriftscala
|
||||
#@namespace strato com.twitter.follow_recommendations
|
||||
|
||||
struct FlowRecommendation {
|
||||
1: required i64 userId(personalDataType='UserId')
|
||||
}(hasPersonalData='true')
|
||||
|
||||
struct RecommendationStep {
|
||||
1: required list<FlowRecommendation> recommendations
|
||||
2: required set<i64> followedUserIds(personalDataType='UserId')
|
||||
}(hasPersonalData='true')
|
||||
|
||||
struct FlowContext {
|
||||
1: required list<RecommendationStep> steps
|
||||
}(hasPersonalData='true')
|
|
@ -1,100 +0,0 @@
|
|||
namespace java com.twitter.follow_recommendations.thriftjava
|
||||
#@namespace scala com.twitter.follow_recommendations.thriftscala
|
||||
#@namespace strato com.twitter.follow_recommendations
|
||||
|
||||
include "assembler.thrift"
|
||||
include "client_context.thrift"
|
||||
include "debug.thrift"
|
||||
include "display_context.thrift"
|
||||
include "display_location.thrift"
|
||||
include "recommendations.thrift"
|
||||
include "recently_engaged_user_id.thrift"
|
||||
|
||||
include "finatra-thrift/finatra_thrift_exceptions.thrift"
|
||||
include "com/twitter/product_mixer/core/pipeline_execution_result.thrift"
|
||||
|
||||
struct RecommendationRequest {
|
||||
1: required client_context.ClientContext clientContext
|
||||
2: required display_location.DisplayLocation displayLocation
|
||||
3: optional display_context.DisplayContext displayContext
|
||||
// Max results to return
|
||||
4: optional i32 maxResults
|
||||
// Cursor to continue returning results if any
|
||||
5: optional string cursor
|
||||
// IDs of Content to exclude from recommendations
|
||||
6: optional list<i64> excludedIds(personalDataType='UserId')
|
||||
// Whether to also get promoted content
|
||||
7: optional bool fetchPromotedContent
|
||||
8: optional debug.DebugParams debugParams
|
||||
9: optional string userLocationState(personalDataType='InferredLocation')
|
||||
}(hasPersonalData='true')
|
||||
|
||||
|
||||
struct RecommendationResponse {
|
||||
1: required list<recommendations.Recommendation> recommendations
|
||||
}(hasPersonalData='true')
|
||||
|
||||
// for scoring a list of candidates, while logging hydrated features
|
||||
struct ScoringUserRequest {
|
||||
1: required client_context.ClientContext clientContext
|
||||
2: required display_location.DisplayLocation displayLocation
|
||||
3: required list<recommendations.UserRecommendation> candidates
|
||||
4: optional debug.DebugParams debugParams
|
||||
}(hasPersonalData='true')
|
||||
|
||||
struct ScoringUserResponse {
|
||||
1: required list<recommendations.UserRecommendation> candidates // empty for now
|
||||
}(hasPersonalData='true')
|
||||
|
||||
// for getting the list of candidates generated by a single candidate source
|
||||
struct DebugCandidateSourceRequest {
|
||||
1: required client_context.ClientContext clientContext
|
||||
2: required debug.DebugCandidateSourceIdentifier candidateSource
|
||||
3: optional list<i64> uttInterestIds
|
||||
4: optional debug.DebugParams debugParams
|
||||
5: optional list<i64> recentlyFollowedUserIds
|
||||
6: optional list<recently_engaged_user_id.RecentlyEngagedUserId> recentlyEngagedUserIds
|
||||
7: optional list<i64> byfSeedUserIds
|
||||
8: optional list<i64> similarToUserIds
|
||||
9: required bool applySgsPredicate
|
||||
10: optional i32 maxResults
|
||||
}(hasPersonalData='true')
|
||||
|
||||
service FollowRecommendationsThriftService {
|
||||
RecommendationResponse getRecommendations(1: RecommendationRequest request) throws (
|
||||
1: finatra_thrift_exceptions.ServerError serverError,
|
||||
2: finatra_thrift_exceptions.UnknownClientIdError unknownClientIdError,
|
||||
3: finatra_thrift_exceptions.NoClientIdError noClientIdError
|
||||
)
|
||||
RecommendationDisplayResponse getRecommendationDisplayResponse(1: RecommendationRequest request) throws (
|
||||
1: finatra_thrift_exceptions.ServerError serverError,
|
||||
2: finatra_thrift_exceptions.UnknownClientIdError unknownClientIdError,
|
||||
3: finatra_thrift_exceptions.NoClientIdError noClientIdError
|
||||
)
|
||||
// temporary endpoint for feature hydration and logging for data collection.
|
||||
ScoringUserResponse scoreUserCandidates(1: ScoringUserRequest request) throws (
|
||||
1: finatra_thrift_exceptions.ServerError serverError,
|
||||
2: finatra_thrift_exceptions.UnknownClientIdError unknownClientIdError,
|
||||
3: finatra_thrift_exceptions.NoClientIdError noClientIdError
|
||||
)
|
||||
// Debug endpoint for getting recommendations of a single candidate source. We can remove this endpoint when ProMix provide this functionality and we integrate with it.
|
||||
RecommendationResponse debugCandidateSource(1: DebugCandidateSourceRequest request) throws (
|
||||
1: finatra_thrift_exceptions.ServerError serverError,
|
||||
2: finatra_thrift_exceptions.UnknownClientIdError unknownClientIdError,
|
||||
3: finatra_thrift_exceptions.NoClientIdError noClientIdError
|
||||
)
|
||||
|
||||
// Get the full execution log for a pipeline (used by our debugging tools)
|
||||
pipeline_execution_result.PipelineExecutionResult executePipeline(1: RecommendationRequest request) throws (
|
||||
1: finatra_thrift_exceptions.ServerError serverError,
|
||||
2: finatra_thrift_exceptions.UnknownClientIdError unknownClientIdError,
|
||||
3: finatra_thrift_exceptions.NoClientIdError noClientIdError
|
||||
)
|
||||
}
|
||||
|
||||
struct RecommendationDisplayResponse {
|
||||
1: required list<recommendations.HydratedRecommendation> hydratedRecommendation
|
||||
2: optional assembler.Header header
|
||||
3: optional assembler.Footer footer
|
||||
4: optional assembler.WTFPresentation wtfPresentation
|
||||
}(hasPersonalData='true')
|
|
@ -1,9 +0,0 @@
|
|||
namespace java com.twitter.follow_recommendations.thriftjava
|
||||
#@namespace scala com.twitter.follow_recommendations.thriftscala
|
||||
#@namespace strato com.twitter.follow_recommendations
|
||||
|
||||
// struct used for storing the history of computing and serving of recommendations to a user
|
||||
struct FollowRecommendationsServingHistory {
|
||||
1: required i64 lastComputationTimeMs (personalDataType = 'PrivateTimestamp')
|
||||
2: required i64 lastServingTimeMs (personalDataType = 'PrivateTimestamp')
|
||||
}(persisted='true', hasPersonalData='true')
|
|
@ -1,18 +0,0 @@
|
|||
create_thrift_libraries(
|
||||
base_name = "thrift",
|
||||
sources = ["*.thrift"],
|
||||
platform = "java8",
|
||||
tags = ["bazel-compatible"],
|
||||
dependency_roots = [
|
||||
"src/thrift/com/twitter/ads/adserver:adserver_common",
|
||||
"src/thrift/com/twitter/ml/api:data",
|
||||
"src/thrift/com/twitter/suggests/controller_data",
|
||||
],
|
||||
generate_languages = [
|
||||
"java",
|
||||
"scala",
|
||||
"strato",
|
||||
],
|
||||
provides_java_name = "follow-recommendations-logging-java",
|
||||
provides_scala_name = "follow-recommendations-logging-scala",
|
||||
)
|
|
@ -1,14 +0,0 @@
|
|||
namespace java com.twitter.follow_recommendations.logging.thriftjava
|
||||
#@namespace scala com.twitter.follow_recommendations.logging.thriftscala
|
||||
#@namespace strato com.twitter.follow_recommendations.logging
|
||||
|
||||
// Offline equal of ClientContext
|
||||
struct OfflineClientContext {
|
||||
1: optional i64 userId(personalDataType='UserId')
|
||||
2: optional i64 guestId(personalDataType='GuestId')
|
||||
3: optional i64 appId(personalDataType='AppId')
|
||||
4: optional string countryCode(personalDataType='InferredCountry')
|
||||
5: optional string languageCode(personalDataType='InferredLanguage')
|
||||
6: optional i64 guestIdAds(personalDataType='GuestId')
|
||||
7: optional i64 guestIdMarketing(personalDataType='GuestId')
|
||||
}(persisted='true', hasPersonalData='true')
|
|
@ -1,8 +0,0 @@
|
|||
namespace java com.twitter.follow_recommendations.logging.thriftjava
|
||||
#@namespace scala com.twitter.follow_recommendations.logging.thriftscala
|
||||
#@namespace strato com.twitter.follow_recommendation.logging
|
||||
|
||||
// subset of DebugParams
|
||||
struct OfflineDebugParams {
|
||||
1: optional i64 randomizationSeed // track if the request was randomly ranked or not
|
||||
}(persisted='true', hasPersonalData='false')
|
|
@ -1,66 +0,0 @@
|
|||
include "logging/flows.thrift"
|
||||
include "logging/recently_engaged_user_id.thrift"
|
||||
|
||||
namespace java com.twitter.follow_recommendations.logging.thriftjava
|
||||
#@namespace scala com.twitter.follow_recommendations.logging.thriftscala
|
||||
#@namespace strato com.twitter.follow_recommendations.logging
|
||||
|
||||
// Offline equal of Profile DisplayContext
|
||||
struct OfflineProfile {
|
||||
1: required i64 profileId(personalDataType='UserId')
|
||||
}(persisted='true', hasPersonalData='true')
|
||||
|
||||
// Offline equal of Search DisplayContext
|
||||
struct OfflineSearch {
|
||||
1: required string searchQuery(personalDataType='SearchQuery')
|
||||
}(persisted='true', hasPersonalData='true')
|
||||
|
||||
// Offline equal of Rux Landing Page DisplayContext
|
||||
struct OfflineRux {
|
||||
1: required i64 focalAuthorId(personalDataType="UserId")
|
||||
}(persisted='true', hasPersonalData='true')
|
||||
|
||||
// Offline equal of Topic DisplayContext
|
||||
struct OfflineTopic {
|
||||
1: required i64 topicId(personalDataType = 'TopicFollow')
|
||||
}(persisted='true', hasPersonalData='true')
|
||||
|
||||
struct OfflineReactiveFollow {
|
||||
1: required list<i64> followedUserIds(personalDataType='UserId')
|
||||
}(persisted='true', hasPersonalData='true')
|
||||
|
||||
struct OfflineNuxInterests {
|
||||
1: optional flows.OfflineFlowContext flowContext // set for recommendation inside an interactive flow
|
||||
}(persisted='true', hasPersonalData='true')
|
||||
|
||||
struct OfflineAdCampaignTarget {
|
||||
1: required list<i64> similarToUserIds(personalDataType='UserId')
|
||||
}(persisted='true', hasPersonalData='true')
|
||||
|
||||
struct OfflineConnectTab {
|
||||
1: required list<i64> byfSeedUserIds(personalDataType='UserId')
|
||||
2: required list<i64> similarToUserIds(personalDataType='UserId')
|
||||
3: required list<recently_engaged_user_id.RecentlyEngagedUserId> recentlyEngagedUserIds
|
||||
}(persisted='true', hasPersonalData='true')
|
||||
|
||||
struct OfflineSimilarToUser {
|
||||
1: required i64 similarToUserId(personalDataType='UserId')
|
||||
}(persisted='true', hasPersonalData='true')
|
||||
|
||||
struct OfflinePostNuxFollowTask {
|
||||
1: optional flows.OfflineFlowContext flowContext // set for recommendation inside an interactive flow
|
||||
}(persisted='true', hasPersonalData='true')
|
||||
|
||||
// Offline equal of DisplayContext
|
||||
union OfflineDisplayContext {
|
||||
1: OfflineProfile profile
|
||||
2: OfflineSearch search
|
||||
3: OfflineRux rux
|
||||
4: OfflineTopic topic
|
||||
5: OfflineReactiveFollow reactiveFollow
|
||||
6: OfflineNuxInterests nuxInterests
|
||||
7: OfflineAdCampaignTarget adCampaignTarget
|
||||
8: OfflineConnectTab connectTab
|
||||
9: OfflineSimilarToUser similarToUser
|
||||
10: OfflinePostNuxFollowTask postNuxFollowTask
|
||||
}(persisted='true', hasPersonalData='true')
|
|
@ -1,55 +0,0 @@
|
|||
namespace java com.twitter.follow_recommendations.logging.thriftjava
|
||||
#@namespace scala com.twitter.follow_recommendations.logging.thriftscala
|
||||
#@namespace strato com.twitter.follow_recommendations.logging
|
||||
|
||||
/**
|
||||
* Make sure you add the new DL to the following files and redeploy our attribution jobs
|
||||
* - follow-recommendations-service/thrift/src/main/thrift/display_location.thrift
|
||||
* - follow-recommendations-service/thrift/src/main/thrift/logging/display_location.thrift
|
||||
* - follow-recommendations-service/common/src/main/scala/com/twitter/follow_recommendations/common/models/DisplayLocation.scala
|
||||
*/
|
||||
|
||||
// Offline equal of DisplayLocation
|
||||
enum OfflineDisplayLocation {
|
||||
SIDEBAR = 0
|
||||
PROFILE_SIDEBAR = 2
|
||||
CLUSTER_FOLLOW = 7
|
||||
NEW_USER_SARUS_BACKFILL = 12
|
||||
PROFILE_DEVICE_FOLLOW = 23
|
||||
RECOS_BACKFILL = 32
|
||||
HOME_TIMELINE = 39
|
||||
PROFILE_TOP_FOLLOWING = 42
|
||||
PROFILE_TOP_FOLLOWERS = 43
|
||||
PEOPLE_PLUS_PLUS = 47
|
||||
EXPLORE_TAB = 57
|
||||
MagicRecs = 59
|
||||
AB_UPLOAD_INJECTION = 60
|
||||
CAMPAIGN_FORM = 61
|
||||
RUX_LANDING_PAGE = 62
|
||||
PROFILE_BONUS_FOLLOW = 63
|
||||
ELECTION_EXPLORE_WTF = 64
|
||||
HTL_BONUS_FOLLOW = 65
|
||||
TOPIC_LANDING_PAGE_HEADER = 66
|
||||
NUX_PYMK = 67
|
||||
NUX_INTERESTS = 68
|
||||
REACTIVE_FOLLOW = 69
|
||||
RUX_PYMK = 70
|
||||
INDIA_COVID19_CURATED_ACCOUNTS_WTF=71
|
||||
NUX_TOPIC_BONUS_FOLLOW = 72
|
||||
TWEET_NOTIFICATION_RECS = 73
|
||||
HTL_SPACE_HOSTS = 74
|
||||
POST_NUX_FOLLOW_TASK = 75
|
||||
TOPIC_LANDING_PAGE = 76
|
||||
USER_TYPEAHEAD_PREFETCH = 77
|
||||
HOME_TIMELINE_RELATABLE_ACCOUNTS = 78
|
||||
NUX_GEO_CATEGORY = 79
|
||||
NUX_INTERESTS_CATEGORY = 80
|
||||
NUX_PYMK_CATEGORY = 81
|
||||
TOP_ARTICLES = 82
|
||||
HOME_TIMELINE_TWEET_RECS = 83
|
||||
HTL_BULK_FRIEND_FOLLOWS = 84
|
||||
NUX_AUTO_FOLLOW = 85
|
||||
SEARCH_BONUS_FOLLOW = 86
|
||||
CONTENT_RECOMMENDER = 87
|
||||
HOME_TIMELINE_REVERSE_CHRON = 88
|
||||
}(persisted='true')
|
|
@ -1,11 +0,0 @@
|
|||
namespace java com.twitter.follow_recommendations.logging.thriftjava
|
||||
#@namespace scala com.twitter.follow_recommendations.logging.thriftscala
|
||||
#@namespace strato com.twitter.follow_recommendations.logging
|
||||
|
||||
enum EngagementType {
|
||||
Click = 0
|
||||
Like = 1
|
||||
Mention = 2
|
||||
Retweet = 3
|
||||
ProfileView = 4
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
namespace java com.twitter.follow_recommendations.logging.thriftjava
|
||||
#@namespace scala com.twitter.follow_recommendations.logging.thriftscala
|
||||
#@namespace strato com.twitter.follow_recommendations.logging
|
||||
|
||||
struct OfflineFlowRecommendation {
|
||||
1: required i64 userId(personalDataType='UserId')
|
||||
}(persisted='true', hasPersonalData='true')
|
||||
|
||||
struct OfflineRecommendationStep {
|
||||
1: required list<OfflineFlowRecommendation> recommendations
|
||||
2: required set<i64> followedUserIds(personalDataType='UserId')
|
||||
}(persisted='true', hasPersonalData='true')
|
||||
|
||||
struct OfflineFlowContext {
|
||||
1: required list<OfflineRecommendationStep> steps
|
||||
}(persisted='true', hasPersonalData='true')
|
|
@ -1,72 +0,0 @@
|
|||
namespace java com.twitter.follow_recommendations.logging.thriftjava
|
||||
#@namespace scala com.twitter.follow_recommendations.logging.thriftscala
|
||||
#@namespace strato com.twitter.follow_recommendations.logging
|
||||
|
||||
include "client_context.thrift"
|
||||
include "debug.thrift"
|
||||
include "display_context.thrift"
|
||||
include "display_location.thrift"
|
||||
include "recommendations.thrift"
|
||||
|
||||
struct OfflineRecommendationRequest {
|
||||
1: required client_context.OfflineClientContext clientContext
|
||||
2: required display_location.OfflineDisplayLocation displayLocation
|
||||
3: optional display_context.OfflineDisplayContext displayContext
|
||||
4: optional i32 maxResults
|
||||
5: optional string cursor
|
||||
6: optional list<i64> excludedIds(personalDataType='UserId')
|
||||
7: optional bool fetchPromotedContent
|
||||
8: optional debug.OfflineDebugParams debugParams
|
||||
}(persisted='true', hasPersonalData='true')
|
||||
|
||||
struct OfflineRecommendationResponse {
|
||||
1: required list<recommendations.OfflineRecommendation> recommendations
|
||||
}(persisted='true', hasPersonalData='true')
|
||||
|
||||
struct RecommendationLog {
|
||||
1: required OfflineRecommendationRequest request
|
||||
2: required OfflineRecommendationResponse response
|
||||
3: required i64 timestampMs
|
||||
}(persisted='true', hasPersonalData='true')
|
||||
|
||||
struct OfflineScoringUserRequest {
|
||||
1: required client_context.OfflineClientContext clientContext
|
||||
2: required display_location.OfflineDisplayLocation displayLocation
|
||||
3: required list<recommendations.OfflineUserRecommendation> candidates
|
||||
}(persisted='true', hasPersonalData='true')
|
||||
|
||||
struct OfflineScoringUserResponse {
|
||||
1: required list<recommendations.OfflineUserRecommendation> candidates
|
||||
}(persisted='true', hasPersonalData='true')
|
||||
|
||||
struct ScoredUsersLog {
|
||||
1: required OfflineScoringUserRequest request
|
||||
2: required OfflineScoringUserResponse response
|
||||
3: required i64 timestampMs
|
||||
}(persisted='true', hasPersonalData='true')
|
||||
|
||||
struct OfflineRecommendationFlowUserMetadata {
|
||||
1: optional i32 userSignupAge(personalDataType = 'AgeOfAccount')
|
||||
2: optional string userState(personalDataType = 'UserState')
|
||||
}(persisted='true', hasPersonalData='true')
|
||||
|
||||
struct OfflineRecommendationFlowSignals {
|
||||
1: optional string countryCode(personalDataType='InferredCountry')
|
||||
}(persisted='true', hasPersonalData='true')
|
||||
|
||||
struct OfflineRecommendationFlowCandidateSourceCandidates {
|
||||
1: required string candidateSourceName
|
||||
2: required list<i64> candidateUserIds(personalDataType='UserId')
|
||||
3: optional list<double> candidateUserScores
|
||||
}(persisted='true', hasPersonalData='true')
|
||||
|
||||
struct RecommendationFlowLog {
|
||||
1: required client_context.OfflineClientContext clientContext
|
||||
2: optional OfflineRecommendationFlowUserMetadata userMetadata
|
||||
3: optional OfflineRecommendationFlowSignals signals
|
||||
4: required i64 timestampMs
|
||||
5: required string recommendationFlowIdentifier
|
||||
6: optional list<OfflineRecommendationFlowCandidateSourceCandidates> filteredCandidates
|
||||
7: optional list<OfflineRecommendationFlowCandidateSourceCandidates> rankedCandidates
|
||||
8: optional list<OfflineRecommendationFlowCandidateSourceCandidates> truncatedCandidates
|
||||
}(persisted='true', hasPersonalData='true')
|
|
@ -1,62 +0,0 @@
|
|||
namespace java com.twitter.follow_recommendations.logging.thriftjava
|
||||
#@namespace scala com.twitter.follow_recommendations.logging.thriftscala
|
||||
#@namespace strato com.twitter.follow_recommendations.logging
|
||||
|
||||
// Proof based on Follow relationship
|
||||
struct FollowProof {
|
||||
1: required list<i64> userIds(personalDataType='UserId')
|
||||
2: required i32 numIds(personalDataType='CountOfFollowersAndFollowees')
|
||||
}(persisted='true', hasPersonalData='true')
|
||||
|
||||
// Similar to userIds in the context (e.g. profileId)
|
||||
struct SimilarToProof {
|
||||
1: required list<i64> userIds(personalDataType='UserId')
|
||||
}(persisted='true', hasPersonalData='true')
|
||||
|
||||
// Proof based on geo location
|
||||
struct PopularInGeoProof {
|
||||
1: required string location(personalDataType='InferredLocation')
|
||||
}(persisted='true', hasPersonalData='true')
|
||||
|
||||
// Proof based on ttt interest
|
||||
struct TttInterestProof {
|
||||
1: required i64 interestId(personalDataType='ProvidedInterests')
|
||||
2: required string interestDisplayName(personalDataType='ProvidedInterests')
|
||||
}(persisted='true', hasPersonalData='true')
|
||||
|
||||
// Proof based on topics
|
||||
struct TopicProof {
|
||||
1: required i64 topicId(personalDataType='ProvidedInterests')
|
||||
}(persisted='true', hasPersonalData='true')
|
||||
|
||||
// Proof based on custom interest / search queries
|
||||
struct CustomInterestProof {
|
||||
1: required string customerInterest(personalDataType='SearchQuery')
|
||||
}(persisted='true', hasPersonalData='true')
|
||||
|
||||
// Proof based on tweet authors
|
||||
struct TweetsAuthorProof {
|
||||
1: required list<i64> tweetIds(personalDataType='TweetId')
|
||||
}(persisted='true', hasPersonalData='true')
|
||||
|
||||
// Proof candidate is of device follow type
|
||||
struct DeviceFollowProof {
|
||||
1: required bool isDeviceFollow(personalDataType='OtherDeviceInfo')
|
||||
}(persisted='true', hasPersonalData='true')
|
||||
|
||||
// Account level proof that should be attached to each candidate
|
||||
struct AccountProof {
|
||||
1: optional FollowProof followProof
|
||||
2: optional SimilarToProof similarToProof
|
||||
3: optional PopularInGeoProof popularInGeoProof
|
||||
4: optional TttInterestProof tttInterestProof
|
||||
5: optional TopicProof topicProof
|
||||
6: optional CustomInterestProof customInterestProof
|
||||
7: optional TweetsAuthorProof tweetsAuthorProof
|
||||
8: optional DeviceFollowProof deviceFollowProof
|
||||
|
||||
}(persisted='true', hasPersonalData='true')
|
||||
|
||||
struct Reason {
|
||||
1: optional AccountProof accountProof
|
||||
}(persisted='true', hasPersonalData='true')
|
|
@ -1,10 +0,0 @@
|
|||
namespace java com.twitter.follow_recommendations.logging.thriftjava
|
||||
#@namespace scala com.twitter.follow_recommendations.logging.thriftscala
|
||||
#@namespace strato com.twitter.follow_recommendations.logging
|
||||
|
||||
include "engagementType.thrift"
|
||||
|
||||
struct RecentlyEngagedUserId {
|
||||
1: required i64 id(personalDataType='UserId')
|
||||
2: required engagementType.EngagementType engagementType
|
||||
}(persisted='true', hasPersonalData='true')
|
|
@ -1,26 +0,0 @@
|
|||
namespace java com.twitter.follow_recommendations.logging.thriftjava
|
||||
#@namespace scala com.twitter.follow_recommendations.logging.thriftscala
|
||||
#@namespace strato com.twitter.follow_recommendations.logging
|
||||
|
||||
include "com/twitter/ads/adserver/adserver_common.thrift"
|
||||
include "reasons.thrift"
|
||||
include "tracking.thrift"
|
||||
include "scoring.thrift"
|
||||
|
||||
// Offline equal of UserRecommendation
|
||||
struct OfflineUserRecommendation {
|
||||
1: required i64 userId(personalDataType='UserId')
|
||||
// reason for this suggestions, eg: social context
|
||||
2: optional reasons.Reason reason
|
||||
// present if it is a promoted account
|
||||
3: optional adserver_common.AdImpression adImpression
|
||||
// tracking token (unserialized) for attribution
|
||||
4: optional tracking.TrackingToken trackingToken
|
||||
// scoring details
|
||||
5: optional scoring.ScoringDetails scoringDetails
|
||||
}(persisted='true', hasPersonalData='true')
|
||||
|
||||
// Offline equal of Recommendation
|
||||
union OfflineRecommendation {
|
||||
1: OfflineUserRecommendation user
|
||||
}(persisted='true', hasPersonalData='true')
|
|
@ -1,38 +0,0 @@
|
|||
namespace java com.twitter.follow_recommendations.logging.thriftjava
|
||||
#@namespace scala com.twitter.follow_recommendations.logging.thriftscala
|
||||
#@namespace strato com.twitter.follow_recommendations.logging
|
||||
|
||||
include "com/twitter/ml/api/data.thrift"
|
||||
|
||||
struct CandidateSourceDetails {
|
||||
1: optional map<string, double> candidateSourceScores
|
||||
2: optional i32 primarySource
|
||||
}(persisted='true', hasPersonalData='false')
|
||||
|
||||
struct Score {
|
||||
1: required double value
|
||||
2: optional string rankerId
|
||||
3: optional string scoreType
|
||||
}(persisted='true', hasPersonalData='false') // scoring and ranking info per ranking stage
|
||||
|
||||
// Contains (1) the ML-based heavy ranker and score (2) scores and rankers in producer experiment framework
|
||||
struct Scores {
|
||||
1: required list<Score> scores
|
||||
2: optional string selectedRankerId
|
||||
3: required bool isInProducerScoringExperiment
|
||||
}(persisted='true', hasPersonalData='false')
|
||||
|
||||
struct RankingInfo {
|
||||
1: optional Scores scores
|
||||
2: optional i32 rank
|
||||
}(persisted='true', hasPersonalData='false')
|
||||
|
||||
// this encapsulates all information related to the ranking process from generation to scoring
|
||||
struct ScoringDetails {
|
||||
1: optional CandidateSourceDetails candidateSourceDetails
|
||||
2: optional double score // The ML-based heavy ranker score
|
||||
3: optional data.DataRecord dataRecord
|
||||
4: optional list<string> rankerIds // all ranker ids, including (1) ML-based heavy ranker (2) non-ML adhoc rankers
|
||||
5: optional map<string, RankingInfo> infoPerRankingStage // scoring and ranking info per ranking stage
|
||||
}(persisted='true', hasPersonalData='true')
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
namespace java com.twitter.follow_recommendations.logging.thriftjava
|
||||
#@namespace scala com.twitter.follow_recommendations.logging.thriftscala
|
||||
#@namespace strato com.twitter.follow_recommendations.logging
|
||||
|
||||
include "com/twitter/suggests/controller_data/controller_data.thrift"
|
||||
include "display_location.thrift"
|
||||
|
||||
struct TrackingToken {
|
||||
// trace-id of the request
|
||||
1: required i64 sessionId (personalDataType='SessionId')
|
||||
2: optional display_location.OfflineDisplayLocation displayLocation
|
||||
// 64-bit encoded binary attributes of our recommendation
|
||||
3: optional controller_data.ControllerData controllerData
|
||||
// WTF Algorithm Id (backward compatibility)
|
||||
4: optional i32 algoId
|
||||
}(persisted='true', hasPersonalData='true')
|
|
@ -1,61 +0,0 @@
|
|||
namespace java com.twitter.follow_recommendations.thriftjava
|
||||
#@namespace scala com.twitter.follow_recommendations.thriftscala
|
||||
#@namespace strato com.twitter.follow_recommendations
|
||||
|
||||
// Proof based on Follow relationship
|
||||
struct FollowProof {
|
||||
1: required list<i64> userIds(personalDataType='UserId')
|
||||
2: required i32 numIds(personalDataType='CountOfFollowersAndFollowees')
|
||||
}(hasPersonalData='true')
|
||||
|
||||
// Similar to userIds in the context (e.g. profileId)
|
||||
struct SimilarToProof {
|
||||
1: required list<i64> userIds(personalDataType='UserId')
|
||||
}(hasPersonalData='true')
|
||||
|
||||
// Proof based on geo location
|
||||
struct PopularInGeoProof {
|
||||
1: required string location(personalDataType='InferredLocation')
|
||||
}(hasPersonalData='true')
|
||||
|
||||
// Proof based on ttt interest
|
||||
struct TttInterestProof {
|
||||
1: required i64 interestId(personalDataType='ProvidedInterests')
|
||||
2: required string interestDisplayName(personalDataType='ProvidedInterests')
|
||||
}(hasPersonalData='true')
|
||||
|
||||
// Proof based on topics
|
||||
struct TopicProof {
|
||||
1: required i64 topicId(personalDataType='ProvidedInterests')
|
||||
}(hasPersonalData='true')
|
||||
|
||||
// Proof based on custom interest / search queries
|
||||
struct CustomInterestProof {
|
||||
1: required string query(personalDataType='SearchQuery')
|
||||
}(hasPersonalData='true')
|
||||
|
||||
// Proof based on tweet authors
|
||||
struct TweetsAuthorProof {
|
||||
1: required list<i64> tweetIds(personalDataType='TweetId')
|
||||
}(hasPersonalData='true')
|
||||
|
||||
// Proof candidate is of device follow type
|
||||
struct DeviceFollowProof {
|
||||
1: required bool isDeviceFollow(personalDataType='OtherDeviceInfo')
|
||||
}(hasPersonalData='true')
|
||||
|
||||
// Account level proof that should be attached to each candidate
|
||||
struct AccountProof {
|
||||
1: optional FollowProof followProof
|
||||
2: optional SimilarToProof similarToProof
|
||||
3: optional PopularInGeoProof popularInGeoProof
|
||||
4: optional TttInterestProof tttInterestProof
|
||||
5: optional TopicProof topicProof
|
||||
6: optional CustomInterestProof customInterestProof
|
||||
7: optional TweetsAuthorProof tweetsAuthorProof
|
||||
8: optional DeviceFollowProof deviceFollowProof
|
||||
}(hasPersonalData='true')
|
||||
|
||||
struct Reason {
|
||||
1: optional AccountProof accountProof
|
||||
}(hasPersonalData='true')
|
|
@ -1,10 +0,0 @@
|
|||
namespace java com.twitter.follow_recommendations.thriftjava
|
||||
#@namespace scala com.twitter.follow_recommendations.thriftscala
|
||||
#@namespace strato com.twitter.follow_recommendations
|
||||
|
||||
include "engagementType.thrift"
|
||||
|
||||
struct RecentlyEngagedUserId {
|
||||
1: required i64 id(personalDataType='UserId')
|
||||
2: required engagementType.EngagementType engagementType
|
||||
}(persisted='true', hasPersonalData='true')
|
|
@ -1,40 +0,0 @@
|
|||
namespace java com.twitter.follow_recommendations.thriftjava
|
||||
#@namespace scala com.twitter.follow_recommendations.thriftscala
|
||||
#@namespace strato com.twitter.follow_recommendations
|
||||
|
||||
include "com/twitter/ads/adserver/adserver_common.thrift"
|
||||
include "debug.thrift"
|
||||
include "reasons.thrift"
|
||||
include "scoring.thrift"
|
||||
|
||||
struct UserRecommendation {
|
||||
1: required i64 userId(personalDataType='UserId')
|
||||
// reason for this suggestions, eg: social context
|
||||
2: optional reasons.Reason reason
|
||||
// present if it is a promoted account
|
||||
3: optional adserver_common.AdImpression adImpression
|
||||
// tracking token for attribution
|
||||
4: optional string trackingInfo
|
||||
// scoring details
|
||||
5: optional scoring.ScoringDetails scoringDetails
|
||||
6: optional string recommendationFlowIdentifier
|
||||
// FeatureSwitch overrides for candidates:
|
||||
7: optional map<string, debug.FeatureValue> featureOverrides
|
||||
}(hasPersonalData='true')
|
||||
|
||||
union Recommendation {
|
||||
1: UserRecommendation user
|
||||
}(hasPersonalData='true')
|
||||
|
||||
struct HydratedUserRecommendation {
|
||||
1: required i64 userId(personalDataType='UserId')
|
||||
2: optional string socialProof
|
||||
// present if it is a promoted account, used by clients for determining ad impression
|
||||
3: optional adserver_common.AdImpression adImpression
|
||||
// tracking token for attribution
|
||||
4: optional string trackingInfo
|
||||
}(hasPersonalData='true')
|
||||
|
||||
union HydratedRecommendation {
|
||||
1: HydratedUserRecommendation hydratedUserRecommendation
|
||||
}
|
|
@ -1,49 +0,0 @@
|
|||
namespace java com.twitter.follow_recommendations.thriftjava
|
||||
#@namespace scala com.twitter.follow_recommendations.thriftscala
|
||||
#@namespace strato com.twitter.follow_recommendations
|
||||
|
||||
include "com/twitter/ml/api/data.thrift"
|
||||
|
||||
struct CandidateSourceDetails {
|
||||
1: optional map<string, double> candidateSourceScores
|
||||
2: optional i32 primarySource
|
||||
3: optional map<string, i32> candidateSourceRanks
|
||||
}(hasPersonalData='false')
|
||||
|
||||
struct Score {
|
||||
1: required double value
|
||||
2: optional string rankerId
|
||||
3: optional string scoreType
|
||||
}(hasPersonalData='false')
|
||||
|
||||
// Contains (1) the ML-based heavy ranker and score (2) scores and rankers in producer experiment framework
|
||||
struct Scores {
|
||||
1: required list<Score> scores
|
||||
2: optional string selectedRankerId
|
||||
3: required bool isInProducerScoringExperiment
|
||||
}(hasPersonalData='false')
|
||||
|
||||
struct RankingInfo {
|
||||
1: optional Scores scores
|
||||
2: optional i32 rank
|
||||
}(hasPersonalData='false')
|
||||
|
||||
// this encapsulates all information related to the ranking process from generation to scoring
|
||||
struct ScoringDetails {
|
||||
1: optional CandidateSourceDetails candidateSourceDetails
|
||||
2: optional double score
|
||||
3: optional data.DataRecord dataRecord
|
||||
4: optional list<string> rankerIds
|
||||
5: optional DebugDataRecord debugDataRecord // this field is not logged as it's only used for debugging
|
||||
6: optional map<string, RankingInfo> infoPerRankingStage // scoring and ranking info per ranking stage
|
||||
}(hasPersonalData='true')
|
||||
|
||||
// exactly the same as a data record, except that we store the feature name instead of the id
|
||||
struct DebugDataRecord {
|
||||
1: optional set<string> binaryFeatures; // stores BINARY features
|
||||
2: optional map<string, double> continuousFeatures; // stores CONTINUOUS features
|
||||
3: optional map<string, i64> discreteFeatures; // stores DISCRETE features
|
||||
4: optional map<string, string> stringFeatures; // stores STRING features
|
||||
5: optional map<string, set<string>> sparseBinaryFeatures; // stores sparse BINARY features
|
||||
6: optional map<string, map<string, double>> sparseContinuousFeatures; // sparse CONTINUOUS features
|
||||
}(hasPersonalData='true')
|
|
@ -1,17 +0,0 @@
|
|||
namespace java com.twitter.follow_recommendations.thriftjava
|
||||
#@namespace scala com.twitter.follow_recommendations.thriftscala
|
||||
#@namespace strato com.twitter.follow_recommendations
|
||||
|
||||
include "com/twitter/suggests/controller_data/controller_data.thrift"
|
||||
include "display_location.thrift"
|
||||
|
||||
// struct used for tracking/attribution purposes in our offline pipelines
|
||||
struct TrackingToken {
|
||||
// trace-id of the request
|
||||
1: required i64 sessionId (personalDataType='SessionId')
|
||||
2: optional display_location.DisplayLocation displayLocation
|
||||
// 64-bit encoded binary attributes of our recommendation
|
||||
3: optional controller_data.ControllerData controllerData
|
||||
// WTF Algorithm Id (backward compatibility)
|
||||
4: optional i32 algoId
|
||||
}(hasPersonalData='true')
|
Loading…
Reference in New Issue
Block a user