Mempersiapkan data input untuk rekomendasi batch - Amazon Personalize

Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.

Mempersiapkan data input untuk rekomendasi batch

Pekerjaan inferensi batch mengimpor JSON data input batch Anda dari bucket Amazon S3, menggunakan versi solusi kustom Anda untuk menghasilkan rekomendasi, lalu mengekspor rekomendasi item ke bucket Amazon S3. Sebelum Anda bisa mendapatkan rekomendasi batch, Anda harus menyiapkan dan mengunggah JSON file Anda ke bucket Amazon S3. Sebaiknya buat folder keluaran di bucket Amazon S3 atau gunakan bucket Amazon S3 keluaran terpisah. Anda kemudian dapat menjalankan beberapa pekerjaan inferensi batch menggunakan lokasi data input yang sama.

Jika Anda menggunakan filter dengan parameter placeholder, seperti$GENRE, Anda harus memberikan nilai untuk parameter dalam filterValues objek di input Anda. JSON Untuk informasi selengkapnya, lihat Memberikan nilai filter dalam input Anda JSON.

Untuk menyiapkan dan mengimpor data
  1. Format data input batch Anda tergantung pada resep Anda. Anda tidak bisa mendapatkan rekomendasi batch dengan resep Trending-Now.

    • Untuk PERSONALIZATION resep USER _ dan resep Hitung Popularitas, data masukan Anda adalah JSON file dengan daftar userIds

    • Untuk RELATED _ ITEMS resep, data masukan Anda adalah daftar itemIds

    • Untuk PERSONALIZED _ RANKING resep, data masukan Anda adalah daftaruserIds, masing-masing dipasangkan dengan koleksi itemIds

    Pisahkan setiap baris dengan baris baru. Untuk contoh data masukan, lihatContoh input dan output JSON pekerjaan inferensi batch.

  2. Unggah input Anda JSON ke folder input di bucket Amazon S3 Anda. Untuk informasi selengkapnya, lihat Mengunggah file dan folder menggunakan seret dan lepas di Panduan Pengguna Layanan Penyimpanan Sederhana Amazon

  3. Buat lokasi terpisah untuk data keluaran Anda, baik folder atau bucket Amazon S3 lainnya. Dengan membuat lokasi terpisah untuk outputJSON, Anda dapat menjalankan beberapa pekerjaan inferensi batch dengan lokasi data input yang sama.

  4. Buat pekerjaan inferensi batch. Amazon Personalize mengeluarkan rekomendasi dari versi solusi Anda ke lokasi data keluaran Anda.

Contoh input dan output JSON pekerjaan inferensi batch

Bagaimana Anda memformat data input Anda resep yang Anda gunakan. Jika Anda menggunakan filter dengan parameter placeholder, seperti$GENRE, Anda harus memberikan nilai untuk parameter dalam filterValues objek di input Anda. JSON Untuk informasi selengkapnya, lihat Memberikan nilai filter dalam input Anda JSON.

Bagian berikut mencantumkan contoh JSON input dan output yang diformat dengan benar untuk pekerjaan inferensi batch. Anda tidak bisa mendapatkan rekomendasi batch dengan resep Trending-Now.

USER_ PERSONALIZATION resep

Berikut ini menunjukkan contoh JSON input dan output yang diformat dengan benar untuk PERSONALIZATION resep USER _. Jika Anda menggunakan User-personalization-v2, setiap item yang direkomendasikan menyertakan daftar alasan mengapa item tersebut dimasukkan dalam rekomendasi. Daftar ini bisa kosong. Untuk informasi tentang kemungkinan alasan, lihatAlasan rekomendasi dengan User-Personalization-v 2.

Input

Pisahkan masing-masing userId dengan baris baru sebagai berikut.

{"userId": "4638"} {"userId": "663"} {"userId": "3384"} ...
Output
{"input":{"userId":"4638"},"output":{"recommendedItems":["63992","115149","110102","148626","148888","31685","102445","69526","92535","143355","62374","7451","56171","122882","66097","91542","142488","139385","40583","71530","39292","111360","34048","47099","135137"],"scores":[0.0152238,0.0069081,0.0068222,0.006394,0.0059746,0.0055851,0.0049357,0.0044644,0.0042968,0.004015,0.0038805,0.0037476,0.0036563,0.0036178,0.00341,0.0033467,0.0033258,0.0032454,0.0032076,0.0031996,0.0029558,0.0029021,0.0029007,0.0028837,0.0028316]},"error":null} {"input":{"userId":"663"},"output":{"recommendedItems":["368","377","25","780","1610","648","1270","6","165","1196","1097","300","1183","608","104","474","736","293","141","2987","1265","2716","223","733","2028"],"scores":[0.0406197,0.0372557,0.0254077,0.0151975,0.014991,0.0127175,0.0124547,0.0116712,0.0091098,0.0085492,0.0079035,0.0078995,0.0075598,0.0074876,0.0072006,0.0071775,0.0068923,0.0066552,0.0066232,0.0062504,0.0062386,0.0061121,0.0060942,0.0060781,0.0059263]},"error":null} {"input":{"userId":"3384"},"output":{"recommendedItems":["597","21","223","2144","208","2424","594","595","920","104","520","367","2081","39","1035","2054","160","1370","48","1092","158","2671","500","474","1907"],"scores":[0.0241061,0.0119394,0.0118012,0.010662,0.0086972,0.0079428,0.0073218,0.0071438,0.0069602,0.0056961,0.0055999,0.005577,0.0054387,0.0051787,0.0051412,0.0050493,0.0047126,0.0045393,0.0042159,0.0042098,0.004205,0.0042029,0.0040778,0.0038897,0.0038809]},"error":null} ...

Berikut ini menunjukkan contoh JSON input dan output yang diformat dengan benar untuk resep Popularity-Count. Anda tidak bisa mendapatkan rekomendasi batch dengan resep Trending-Now.

Input

Pisahkan masing-masing userId dengan baris baru sebagai berikut.

{"userId": "12"} {"userId": "105"} {"userId": "41"} ...
Output
{"input": {"userId": "12"}, "output": {"recommendedItems": ["105", "106", "441"]}} {"input": {"userId": "105"}, "output": {"recommendedItems": ["105", "106", "441"]}} {"input": {"userId": "41"}, "output": {"recommendedItems": ["105", "106", "441"]}} ...

PERSONALIZED_ RANKING resep

Berikut ini menunjukkan contoh JSON input dan output yang diformat dengan benar untuk PERSONALIZED _ RANKING resep.

Input

Pisahkan masing-masing userId dan daftar itemIds yang akan diberi peringkat dengan baris baru sebagai berikut.

{"userId": "891", "itemList": ["27", "886", "101"]} {"userId": "445", "itemList": ["527", "55", "901"]} {"userId": "71", "itemList": ["27", "351", "101"]} ...
Output
{"input":{"userId":"891","itemList":["27","886","101"]},"output":{"recommendedItems":["27","101","886"],"scores":[0.48421,0.28133,0.23446]}} {"input":{"userId":"445","itemList":["527","55","901"]},"output":{"recommendedItems":["901","527","55"],"scores":[0.46972,0.31011,0.22017]}} {"input":{"userId":"71","itemList":["29","351","199"]},"output":{"recommendedItems":["351","29","199"],"scores":[0.68937,0.24829,0.06232]}} ...

Berikut ini menunjukkan contoh JSON input dan output yang diformat dengan benar untuk RELATED _ ITEMS resep.

Input

Pisahkan masing-masing itemId dengan baris baru sebagai berikut.

{"itemId": "105"} {"itemId": "106"} {"itemId": "441"} ...
Output
{"input": {"itemId": "105"}, "output": {"recommendedItems": ["106", "107", "49"]}} {"input": {"itemId": "106"}, "output": {"recommendedItems": ["105", "107", "49"]}} {"input": {"itemId": "441"}, "output": {"recommendedItems": ["2", "442", "435"]}} ...

Berikut ini menunjukkan contoh JSON input dan output yang diformat dengan benar untuk resep Similar-Items dengan tema.

Input

Pisahkan masing-masing itemId dengan baris baru sebagai berikut.

{"itemId": "40"} {"itemId": "43"} ...
Output
{"input":{"itemId":"40"},"output":{"recommendedItems":["36","50","44","22","21","29","3","1","2","39"],"theme":"Movies with a strong female lead","itemsThemeRelevanceScores":[0.19994527,0.183059963,0.17478035,0.1618133,0.1574806,0.15468733,0.1499242,0.14353688,0.13531424,0.10291852]}} {"input":{"itemId":"43"},"output":{"recommendedItems":["50","21","36","3","17","2","39","1","10","5"],"theme":"The best movies of 1995","itemsThemeRelevanceScores":[0.184988,0.1795761,0.11143453,0.0989443,0.08258403,0.07952615,0.07115086,0.0621634,-0.138913,-0.188913]}} ...