Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VectorFeatureSchema is not yet implemented in AnalyticsPayload #1121

Closed
winev52 opened this issue Sep 9, 2023 · 0 comments · Fixed by #1232
Closed

VectorFeatureSchema is not yet implemented in AnalyticsPayload #1121

winev52 opened this issue Sep 9, 2023 · 0 comments · Fixed by #1232

Comments

@winev52
Copy link

winev52 commented Sep 9, 2023

Hello, I tried to add item embedding as vector feature according to the document, but it failed at the validation step when running the validate command. The error is:

scala.MatchError: VectorFeatureSchema(product_embedding,item.product_embedding,Some(List(VectorReducer(384))),ItemScopeType,None,None) (of class ai.metarank.feature.NumVectorFeature$VectorFeatureSchema)
	at ai.metarank.model.AnalyticsPayload$.$anonfun$apply$2(AnalyticsPayload.scala:126)
	at scala.collection.immutable.List.map(List.scala:250)
	at ai.metarank.model.AnalyticsPayload$.apply(AnalyticsPayload.scala:126)
	at ai.metarank.main.Main$.$anonfun$run$14(Main.scala:59)

It seems that in AnalyticsPayload, there is no feature map for vector feature schema:

usedFeatures = config.features.map {
        case f: RateFeatureSchema            => UsedFeature(f.name, "rate")
        case f: BooleanFeatureSchema         => UsedFeature(f.name, "boolean")
        case f: FieldMatchSchema             => UsedFeature(f.name, "field_match")
        case f: InteractedWithSchema         => UsedFeature(f.name, "interacted_with")
        case f: InteractionCountSchema       => UsedFeature(f.name, "interaction_count")
        case f: ItemAgeSchema                => UsedFeature(f.name, "item_age")
        case f: LocalDateTimeSchema          => UsedFeature(f.name, "local_time")
        case f: NumberFeatureSchema          => UsedFeature(f.name, "number")
        case f: RefererSchema                => UsedFeature(f.name, "referer")
        case f: RelevancySchema              => UsedFeature(f.name, "relevancy")
        case f: StringFeatureSchema          => UsedFeature(f.name, "string")
        case f: UserAgentSchema              => UsedFeature(f.name, "ua")
        case f: WindowInteractionCountSchema => UsedFeature(f.name, "window_count")
        case f: WordCountSchema              => UsedFeature(f.name, "word_count")
        case f: PositionFeatureSchema        => UsedFeature(f.name, "position")
        case f: RandomFeatureSchema          => UsedFeature(f.name, "random")
        case f: DiversitySchema              => UsedFeature(f.name, "diversity")
        case f: FieldMatchBiencoderSchema    => UsedFeature(f.name, "field_match.bi-encoder")
        case f: FieldMatchCrossEncoderSchema => UsedFeature(f.name, "field_match.cross-encoder")
      },

How do I resolve this error and use vector feature for metaranl model?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant