the-algorithm/ann/src/main/scala/com/twitter/ann/common/EmbeddingProducer.scala
twitter-team ef4c5eb65e Twitter Recommendation Algorithm
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.
2023-03-31 17:36:31 -05:00

14 lines
464 B
Scala

package com.twitter.ann.common
import com.twitter.stitch.Stitch
trait EmbeddingProducer[T] {
/**
* Produce an embedding from type T. Implementations of this could do a lookup from an id to an
* embedding. Or they could run a deep model on features that output and embedding.
* @return An embedding Stitch. See go/stitch for details on how to use the Stitch API.
*/
def produceEmbedding(input: T): Stitch[Option[EmbeddingType.EmbeddingVector]]
}