mirror of
https://github.com/twitter/the-algorithm.git
synced 2024-06-13 22:58:54 +02:00
![twitter-team](/assets/img/avatar_default.png)
Please note we have force-pushed a new initial commit in order to remove some publicly-available Twitter user information. Note that this process may be required in the future.
33 lines
1.5 KiB
Scala
33 lines
1.5 KiB
Scala
package com.twitter.product_mixer.core.pipeline.scoring
|
|
|
|
import com.twitter.product_mixer.core.functional_component.scorer.ScoredCandidateResult
|
|
import com.twitter.product_mixer.core.model.common.UniversalNoun
|
|
import com.twitter.product_mixer.core.model.common.identifier.ScoringPipelineIdentifier
|
|
import com.twitter.product_mixer.core.model.common.presentation.ItemCandidateWithDetails
|
|
import com.twitter.product_mixer.core.pipeline.Pipeline
|
|
import com.twitter.product_mixer.core.pipeline.PipelineQuery
|
|
import com.twitter.stitch.Arrow
|
|
|
|
/**
|
|
* A Scoring Pipeline
|
|
*
|
|
* This is an abstract class, as we only construct these via the [[ScoringPipelineBuilder]].
|
|
*
|
|
* A [[ScoringPipeline]] is capable of pre-filtering candidates for scoring, performing the scoring
|
|
* then running selection heuristics (ranking, dropping, etc) based off of the score.
|
|
* @tparam Query the domain model for the query or request
|
|
* @tparam Candidate the domain model for the candidate being scored
|
|
*/
|
|
abstract class ScoringPipeline[-Query <: PipelineQuery, Candidate <: UniversalNoun[Any]]
|
|
extends Pipeline[ScoringPipeline.Inputs[Query], Seq[ScoredCandidateResult[Candidate]]] {
|
|
override private[core] val config: ScoringPipelineConfig[Query, Candidate]
|
|
override val arrow: Arrow[ScoringPipeline.Inputs[Query], ScoringPipelineResult[Candidate]]
|
|
override val identifier: ScoringPipelineIdentifier
|
|
}
|
|
|
|
object ScoringPipeline {
|
|
case class Inputs[+Query <: PipelineQuery](
|
|
query: Query,
|
|
candidates: Seq[ItemCandidateWithDetails])
|
|
}
|