Read output json files | Batch Recommendations Inference Job

0

After created a Batch inference job to get Batch Recommendation I cannot figure it out how to delivery recommendation to my application (React Native) from file stored on S3 Bucket.

已提問 2 年前檢視次數 376 次
1 個回答
2

It sounds like you're trying to query batch inference results in a real-time web application... Which is a little surprising as wouldn't a Personalize "Campaign" for real-time inference seem like a better fit here? In that case you'd be able to call the GetRecommendations API or similar for a user ID on-demand.

But assuming you have a use case that does require batch Personalize inference and real-time querying:

In general (as shown in the examples here in the developer guide), Personalize batch inference results are in JSON-Lines format: Each file being a newline-separated list of JSON objects.

It's possible to use S3 Select to query a subset of records directly from an object in S3 (examples here). You could also consider Amazon Athena (e.g. blog post here) for querying across multiple sharded files.

However, depending on your usage profile and latency requirements, you may want to index the batch job results into some kind of database for retrieval instead of querying the batch files each time. For example, DynamoDB could give very fast performance for indexing and querying recommendations by user ID. You could consider AWS Glue to implement this ETL from S3 to DynamoDB/database in a serverless but scalable way.

Finally, regardless of whether you're using a direct S3 API or a database (or a Personalize real-time campaign), your application client will need some IAM-linked authentication to demonstrate it's allowed to access your data. This might be with Amazon Cognito or some other approach. the personalization-apis sample shows several options proxying through API Gateway.

AWS
專家
Alex_T
已回答 2 年前
  • Hi, @Alex_T. Thank you for your answer. I'll try each possibilities.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南