the-algorithm/home-mixer/server/src/main/scala/com/twitter/home_mixer/model/ContentFeatures.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

97 lines
2.1 KiB
Scala

package com.twitter.home_mixer.model
import com.twitter.escherbird.{thriftscala => esb}
import com.twitter.tweetypie.{thriftscala => tp}
object ContentFeatures {
val Empty: ContentFeatures = ContentFeatures(
0.toShort,
false,
0.toShort,
0.toShort,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None
)
}
case class ContentFeatures(
length: Short,
hasQuestion: Boolean,
numCaps: Short,
numWhiteSpaces: Short,
numNewlines: Option[Short],
videoDurationMs: Option[Int],
bitRate: Option[Int],
aspectRatioNum: Option[Short],
aspectRatioDen: Option[Short],
widths: Option[Seq[Short]],
heights: Option[Seq[Short]],
resizeMethods: Option[Seq[Short]],
numMediaTags: Option[Short],
mediaTagScreenNames: Option[Seq[String]],
emojiTokens: Option[Set[String]],
emoticonTokens: Option[Set[String]],
faceAreas: Option[Seq[Int]],
dominantColorRed: Option[Short],
dominantColorBlue: Option[Short],
dominantColorGreen: Option[Short],
numColors: Option[Short],
stickerIds: Option[Seq[Long]],
mediaOriginProviders: Option[Seq[String]],
isManaged: Option[Boolean],
is360: Option[Boolean],
viewCount: Option[Long],
isMonetizable: Option[Boolean],
isEmbeddable: Option[Boolean],
hasSelectedPreviewImage: Option[Boolean],
hasTitle: Option[Boolean],
hasDescription: Option[Boolean],
hasVisitSiteCallToAction: Option[Boolean],
hasAppInstallCallToAction: Option[Boolean],
hasWatchNowCallToAction: Option[Boolean],
media: Option[Seq[tp.MediaEntity]],
dominantColorPercentage: Option[Double],
posUnigrams: Option[Set[String]],
posBigrams: Option[Set[String]],
semanticCoreAnnotations: Option[Seq[esb.TweetEntityAnnotation]],
selfThreadMetadata: Option[tp.SelfThreadMetadata],
tokens: Option[Seq[String]],
conversationControl: Option[tp.ConversationControl],
)