├── requirements.txt ├── .gitignore ├── LICENSE ├── samples ├── batch-input-user-personalization-20201105-161225.json ├── batch-input-similar-items-20201106-042152.json ├── similar-items-demo-output.txt ├── user-personalization-demo-output.txt ├── batch-input-personalized-ranking-20201106-044648.json ├── batch-output-similar-items-20201106-042152.json ├── ranking-demo-output.txt ├── batch-output-user-personalization-20201105-161225.json └── batch-output-personalized-ranking-20201106-044648.json ├── shared.py ├── movielens-similar-items-demo.py ├── movielens-user-personalization-demo.py ├── movielens-create-batch-input-demo.py ├── movielens-ranking-demo.py └── README.md /requirements.txt: -------------------------------------------------------------------------------- 1 | boto3 2 | pandas 3 | tabulate -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__ 2 | env/ 3 | *.csv 4 | *.json 5 | *.json.out 6 | !samples/** -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 10 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 11 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 12 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 13 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 14 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | -------------------------------------------------------------------------------- /samples/batch-input-user-personalization-20201105-161225.json: -------------------------------------------------------------------------------- 1 | {"userId": "581"} 2 | {"userId": "100"} 3 | {"userId": "169"} 4 | {"userId": "284"} 5 | {"userId": "591"} 6 | {"userId": "341"} 7 | {"userId": "568"} 8 | {"userId": "553"} 9 | {"userId": "483"} 10 | {"userId": "585"} 11 | {"userId": "468"} 12 | {"userId": "309"} 13 | {"userId": "26"} 14 | {"userId": "253"} 15 | {"userId": "538"} 16 | {"userId": "30"} 17 | {"userId": "149"} 18 | {"userId": "64"} 19 | {"userId": "435"} 20 | {"userId": "315"} 21 | {"userId": "96"} 22 | {"userId": "573"} 23 | {"userId": "385"} 24 | {"userId": "517"} 25 | {"userId": "40"} 26 | {"userId": "166"} 27 | {"userId": "503"} 28 | {"userId": "230"} 29 | {"userId": "144"} 30 | {"userId": "19"} 31 | {"userId": "25"} 32 | {"userId": "543"} 33 | {"userId": "398"} 34 | {"userId": "102"} 35 | {"userId": "451"} 36 | {"userId": "24"} 37 | {"userId": "323"} 38 | {"userId": "570"} 39 | {"userId": "344"} 40 | {"userId": "366"} 41 | {"userId": "352"} 42 | {"userId": "132"} 43 | {"userId": "47"} 44 | {"userId": "117"} 45 | {"userId": "53"} 46 | {"userId": "77"} 47 | {"userId": "560"} 48 | {"userId": "511"} 49 | {"userId": "265"} 50 | {"userId": "550"} 51 | -------------------------------------------------------------------------------- /samples/batch-input-similar-items-20201106-042152.json: -------------------------------------------------------------------------------- 1 | {"itemId": "75341"} 2 | {"itemId": "127194"} 3 | {"itemId": "44238"} 4 | {"itemId": "8167"} 5 | {"itemId": "169982"} 6 | {"itemId": "362"} 7 | {"itemId": "2178"} 8 | {"itemId": "109282"} 9 | {"itemId": "78959"} 10 | {"itemId": "6954"} 11 | {"itemId": "26225"} 12 | {"itemId": "8827"} 13 | {"itemId": "728"} 14 | {"itemId": "6145"} 15 | {"itemId": "7321"} 16 | {"itemId": "8596"} 17 | {"itemId": "102407"} 18 | {"itemId": "4478"} 19 | {"itemId": "4226"} 20 | {"itemId": "124484"} 21 | {"itemId": "6721"} 22 | {"itemId": "1647"} 23 | {"itemId": "4397"} 24 | {"itemId": "605"} 25 | {"itemId": "74545"} 26 | {"itemId": "102165"} 27 | {"itemId": "48322"} 28 | {"itemId": "7713"} 29 | {"itemId": "8933"} 30 | {"itemId": "1437"} 31 | {"itemId": "2978"} 32 | {"itemId": "84240"} 33 | {"itemId": "107408"} 34 | {"itemId": "263"} 35 | {"itemId": "2478"} 36 | {"itemId": "7190"} 37 | {"itemId": "2605"} 38 | {"itemId": "86548"} 39 | {"itemId": "66943"} 40 | {"itemId": "143472"} 41 | {"itemId": "4337"} 42 | {"itemId": "85295"} 43 | {"itemId": "179813"} 44 | {"itemId": "2001"} 45 | {"itemId": "198"} 46 | {"itemId": "48877"} 47 | {"itemId": "2586"} 48 | {"itemId": "4002"} 49 | {"itemId": "2245"} 50 | {"itemId": "594"} 51 | -------------------------------------------------------------------------------- /shared.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | from datetime import datetime 3 | import locale 4 | 5 | locale.setlocale(locale.LC_ALL, '') 6 | 7 | interactions_df = None 8 | movies_df = None 9 | 10 | def load_interactions(): 11 | print('Loading interaction data...') 12 | global interactions_df 13 | interactions_df = pd.read_csv('interactions.csv') 14 | print(f'Successfully loaded {interactions_df.shape[0]:n} interactions') 15 | 16 | def load_movies(): 17 | print('Loading movie data...') 18 | global movies_df 19 | movies_df = pd.read_csv('movies.csv', encoding='latin-1', dtype={'movieId': 'object', 'title': 'str', 'genres': 'str'}, index_col=0) 20 | print(f'Successfully loaded {movies_df.shape[0]:n} movies') 21 | 22 | def lookup_movie_title_and_genres(item_id): 23 | movie = movies_df.loc[int(item_id)] 24 | return movie['title'], movie['genres'] 25 | 26 | def get_random_user_ids(num = 1): 27 | user_ids_df = pd.DataFrame(interactions_df['USER_ID'].unique()) 28 | users = user_ids_df.sample(num) 29 | return users.index.tolist() 30 | 31 | def get_random_movie_ids(num = 1): 32 | random_movies = movies_df.sample(num) 33 | return random_movies.index.tolist() 34 | 35 | def get_interactions_for_user(user_id): 36 | user_interactions_df = interactions_df.loc[interactions_df['USER_ID'] == int(user_id)] 37 | user_interactions_df = user_interactions_df.drop_duplicates(subset=['ITEM_ID']) 38 | user_interactions_df = user_interactions_df.sort_values(by='TIMESTAMP', ascending=False) 39 | user_interactions_df['TITLE'] = user_interactions_df.apply(lambda row: lookup_movie_title_and_genres(row['ITEM_ID'])[0], axis=1) 40 | user_interactions_df['GENRES'] = user_interactions_df.apply(lambda row: lookup_movie_title_and_genres(row['ITEM_ID'])[1], axis=1) 41 | user_interactions_df['DATE'] = user_interactions_df.apply(lambda row: datetime.utcfromtimestamp(int(row['TIMESTAMP'])), axis=1) 42 | return user_interactions_df.drop(['USER_ID', 'TIMESTAMP'], axis=1) 43 | 44 | def expand_genres(df): 45 | parsed_genres = [] 46 | for genres in df['GENRES'].tolist(): 47 | parsed_genres.extend(genres.split('|')) 48 | 49 | genres_df = pd.DataFrame(parsed_genres) 50 | genres_df.columns = ['GENRE'] 51 | return genres_df 52 | 53 | def get_popular_genres(df, top_n = 20): 54 | genres_df = expand_genres(df) 55 | top_df = genres_df.value_counts().rename_axis('unique_values').reset_index(name='counts') 56 | return top_df.head(top_n) 57 | -------------------------------------------------------------------------------- /samples/similar-items-demo-output.txt: -------------------------------------------------------------------------------- 1 | Loading movie data... 2 | Successfully loaded 9,742 movies 3 | Loading interaction data... 4 | Successfully loaded 158,371 interactions 5 | 6 | ************ ITEM INFO *************** 7 | No item_id provided so randomly selecting a user from the interactions dataset 8 | item_id: 5746 9 | Title: Galaxy of Terror (Quest) (1981) 10 | Genres: Action|Horror|Mystery|Sci-Fi 11 | 12 | ************ ITEM RECOMMENDATIONS *************** 13 | +---------+--------------------------------------------------------------------------+----------------------------------+ 14 | | ITEM_ID | TITLE | GENRES | 15 | +---------+--------------------------------------------------------------------------+----------------------------------+ 16 | | 70946 | Troll 2 (1990) | Fantasy|Horror | 17 | | 5181 | Hangar 18 (1980) | Action|Sci-Fi|Thriller | 18 | | 6835 | Alien Contamination (1980) | Action|Horror|Sci-Fi | 19 | | 7991 | Death Race 2000 (1975) | Action|Sci-Fi | 20 | | 7899 | Master of the Flying Guillotine (Du bi quan wang da po xue di zi) (1975) | Action | 21 | | 5764 | Looker (1981) | Drama|Horror|Sci-Fi|Thriller | 22 | | 2851 | Saturn 3 (1980) | Adventure|Sci-Fi|Thriller | 23 | | 26409 | Clonus Horror, The (1979) | Horror|Sci-Fi | 24 | | 5919 | Android (1982) | Sci-Fi | 25 | | 4518 | The Lair of the White Worm (1988) | Comedy|Horror | 26 | | 3024 | Piranha (1978) | Horror|Sci-Fi | 27 | | 1587 | Conan the Barbarian (1982) | Action|Adventure|Fantasy | 28 | | 849 | Escape from L.A. (1996) | Action|Adventure|Sci-Fi|Thriller | 29 | | 1275 | Highlander (1986) | Action|Adventure|Fantasy | 30 | | 3703 | Road Warrior, The (Mad Max 2) (1981) | Action|Adventure|Sci-Fi|Thriller | 31 | | 2288 | Thing, The (1982) | Action|Horror|Sci-Fi|Thriller | 32 | +---------+--------------------------------------------------------------------------+----------------------------------+ 33 | 34 | -------------------------------------------------------------------------------- /movielens-similar-items-demo.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | 3 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | # SPDX-License-Identifier: MIT-0 5 | 6 | import sys 7 | import getopt 8 | import boto3 9 | import pandas as pd 10 | from datetime import datetime 11 | from tabulate import tabulate 12 | import locale 13 | 14 | locale.setlocale(locale.LC_ALL, '') 15 | 16 | personalize_runtime = None 17 | 18 | from shared import ( 19 | load_interactions, 20 | load_movies, 21 | lookup_movie_title_and_genres, 22 | get_random_movie_ids, 23 | get_interactions_for_user, 24 | get_popular_genres 25 | ) 26 | 27 | def get_recommendations_for_item(campaign_arn, item_id, num_results = 20): 28 | response = personalize_runtime.get_recommendations( 29 | campaignArn = campaign_arn, 30 | itemId = str(item_id), 31 | numResults = num_results 32 | ) 33 | 34 | recommendations = [] 35 | 36 | for item in response['itemList']: 37 | title_and_genres = lookup_movie_title_and_genres(item['itemId']) 38 | recommendations.append([item['itemId'], title_and_genres[0], title_and_genres[1]]) 39 | 40 | df = pd.DataFrame(recommendations) 41 | df.columns = ['ITEM_ID', 'TITLE', 'GENRES'] 42 | return df 43 | 44 | if __name__=="__main__": 45 | region = None 46 | campaign_arn = None 47 | item_id = None 48 | 49 | try: 50 | opts, args = getopt.getopt(sys.argv[1:], 'hc:i:r:', ['campaign-arn=', 'item-id=', 'region=']) 51 | except getopt.GetoptError: 52 | print(f'Usage: {sys.argv[0]} -c campaign-arn [-i item-id] [-r region]') 53 | sys.exit(2) 54 | 55 | for opt, arg in opts: 56 | if opt == '-h': 57 | print(f'Usage: {sys.argv[0]} -c campaign-arn [-i item-id] [-r region]') 58 | sys.exit() 59 | elif opt in ('-c', '--campaign-arn'): 60 | campaign_arn = arg 61 | elif opt in ('-i', '--item-id'): 62 | item_id = arg 63 | elif opt in ('-r', '--region'): 64 | region = arg 65 | 66 | if not campaign_arn: 67 | print('campaign-arn is required') 68 | print(f'Usage: {sys.argv[0]} -c campaign-arn [-i item-id] [-r region]') 69 | sys.exit(1) 70 | 71 | load_movies() 72 | load_interactions() 73 | 74 | personalize_runtime = boto3.client(service_name = 'personalize-runtime', region_name = region) 75 | 76 | print() 77 | print('************ ITEM INFO ***************') 78 | if not item_id: 79 | print('No item_id provided so randomly selecting a user from the interactions dataset') 80 | item_id = int(get_random_movie_ids()[0]) 81 | print(f'item_id: {item_id}') 82 | 83 | movie = lookup_movie_title_and_genres(item_id) 84 | print(f'Title: {movie[0]}') 85 | print(f'Genres: {movie[1]}') 86 | 87 | print() 88 | 89 | print('************ ITEM RECOMMENDATIONS ***************') 90 | recs_df = get_recommendations_for_item(campaign_arn, item_id, 50) 91 | print(tabulate(recs_df.head(20), headers=list(recs_df.columns), showindex = False, tablefmt="pretty")) 92 | print() 93 | -------------------------------------------------------------------------------- /movielens-user-personalization-demo.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | 3 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | # SPDX-License-Identifier: MIT-0 5 | 6 | import sys 7 | import getopt 8 | import boto3 9 | import pandas as pd 10 | from datetime import datetime 11 | from tabulate import tabulate 12 | import locale 13 | 14 | from shared import ( 15 | load_interactions, 16 | load_movies, 17 | lookup_movie_title_and_genres, 18 | get_random_user_ids, 19 | get_interactions_for_user, 20 | get_popular_genres 21 | ) 22 | 23 | personalize_runtime = None 24 | 25 | def get_recommendations_for_user(campaign_arn, user_id, num_results = 20): 26 | response = personalize_runtime.get_recommendations( 27 | campaignArn = campaign_arn, 28 | userId = str(user_id), 29 | numResults = num_results 30 | ) 31 | 32 | recommendations = [] 33 | 34 | for item in response['itemList']: 35 | title_and_genres = lookup_movie_title_and_genres(item['itemId']) 36 | recommendations.append([item['itemId'], title_and_genres[0], title_and_genres[1], item["score"]]) 37 | 38 | df = pd.DataFrame(recommendations) 39 | df.columns = ['ITEM_ID', 'TITLE', 'GENRES', 'SCORE'] 40 | return df 41 | 42 | if __name__=="__main__": 43 | region = None 44 | campaign_arn = None 45 | user_id = None 46 | 47 | try: 48 | opts, args = getopt.getopt(sys.argv[1:], 'hc:u:r:', ['campaign-arn=', 'user-id=', 'region=']) 49 | except getopt.GetoptError: 50 | print(f'Usage: {sys.argv[0]} -c campaign-arn [-u user-id] [-r region]') 51 | sys.exit(2) 52 | 53 | for opt, arg in opts: 54 | if opt == '-h': 55 | print(f'Usage: {sys.argv[0]} -c campaign-arn [-u user-id] [-r region]') 56 | sys.exit() 57 | elif opt in ('-c', '--campaign-arn'): 58 | campaign_arn = arg 59 | elif opt in ('-u', '--user-id'): 60 | user_id = arg 61 | elif opt in ('-r', '--region'): 62 | region = arg 63 | 64 | if not campaign_arn: 65 | print('campaign-arn is required') 66 | print(f'Usage: {sys.argv[0]} -c campaign-arn [-u user-id] [-r region]') 67 | sys.exit(1) 68 | 69 | load_movies() 70 | load_interactions() 71 | 72 | personalize_runtime = boto3.client(service_name = 'personalize-runtime', region_name = region) 73 | 74 | print() 75 | print('************ USER INFO ***************') 76 | if not user_id: 77 | print('No user_id provided so randomly selecting a user from the interactions dataset') 78 | user_id = int(get_random_user_ids(1)[0]) 79 | print(f'user_id: {user_id}') 80 | print() 81 | 82 | print('************ RECENT USER INTERACTIONS ***************') 83 | user_interactions_df = get_interactions_for_user(user_id) 84 | print(tabulate(user_interactions_df.head(20), headers=list(user_interactions_df.columns), showindex = False, tablefmt="pretty")) 85 | print() 86 | 87 | print('************ USER TOP GENRES ***************') 88 | user_top_genres = get_popular_genres(user_interactions_df) 89 | print(tabulate(user_top_genres, headers=['GENRE', 'COUNT'], showindex = False, tablefmt="pretty")) 90 | print() 91 | 92 | print('************ USER RECOMMENDATIONS ***************') 93 | recs_df = get_recommendations_for_user(campaign_arn, user_id, 50) 94 | print(tabulate(recs_df.head(20), headers=list(recs_df.columns), showindex = False, tablefmt="pretty")) 95 | print() 96 | 97 | print('************ TOP USER vs RECOMMENDATIONS GENRES ***************') 98 | recs_top_genres = get_popular_genres(recs_df) 99 | top_compare_df = pd.concat([user_top_genres['unique_values'], recs_top_genres['unique_values']], axis=1) 100 | top_compare_df.columns = ['TopUserGenres', 'TopRecsGenres'] 101 | print(tabulate(top_compare_df, headers=['User Top Genres', 'Recs Top Genres'], showindex = False, tablefmt="pretty")) -------------------------------------------------------------------------------- /movielens-create-batch-input-demo.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | 3 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | # SPDX-License-Identifier: MIT-0 5 | 6 | import sys 7 | import getopt 8 | import boto3 9 | import pandas as pd 10 | import json 11 | from datetime import datetime 12 | 13 | personalize_runtime = None 14 | 15 | from shared import ( 16 | load_movies, 17 | load_interactions, 18 | get_random_movie_ids, 19 | get_random_user_ids 20 | ) 21 | 22 | JOB_TYPES = ['user-personalization', 'similar-items', 'personalized-ranking'] 23 | 24 | def create_user_personalization_input_file(num_records_to_generate): 25 | user_ids = get_random_user_ids(num_records_to_generate) 26 | 27 | ts = datetime.now().strftime('%Y%m%d-%H%M%S') 28 | input_filename = f'batch-input-{JOB_TYPES[0]}-{ts}.json' 29 | 30 | with open(input_filename, 'w') as json_input: 31 | for user_id in user_ids: 32 | json_input.write(json.dumps({'userId': str(user_id)}) + '\n') 33 | 34 | return input_filename 35 | 36 | def create_similar_items_input_file(num_records_to_generate): 37 | item_ids = get_random_movie_ids(num_records_to_generate) 38 | 39 | ts = datetime.now().strftime('%Y%m%d-%H%M%S') 40 | input_filename = f'batch-input-{JOB_TYPES[1]}-{ts}.json' 41 | 42 | with open(input_filename, 'w') as json_input: 43 | for item_id in item_ids: 44 | json_input.write(json.dumps({'itemId': str(item_id)}) + '\n') 45 | 46 | return input_filename 47 | 48 | def create_personalized_ranking_input_file(num_records_to_generate, num_items_per_rank): 49 | user_ids = get_random_user_ids(num_records_to_generate) 50 | 51 | ts = datetime.now().strftime('%Y%m%d-%H%M%S') 52 | input_filename = f'batch-input-{JOB_TYPES[2]}-{ts}.json' 53 | 54 | with open(input_filename, 'w') as json_input: 55 | for user_id in user_ids: 56 | item_ids = get_random_movie_ids(num_items_per_rank) 57 | item_list = [str(id) for id in item_ids] 58 | json_input.write(json.dumps({'userId': str(user_id), 'itemList': item_list}) + '\n') 59 | 60 | return input_filename 61 | 62 | def usage_and_exit(code = None, message = None): 63 | if message: 64 | print(message) 65 | print(f'Usage: {sys.argv[0]} -j job-type [-b bucket-name] [-r region]') 66 | print(f'\twhere job-type is one of {JOB_TYPES}') 67 | sys.exit(code) 68 | 69 | if __name__=="__main__": 70 | job_type = None 71 | bucket_name = None 72 | region = None 73 | 74 | num_records_to_generate = 50 75 | num_items_per_rank = 20 76 | 77 | try: 78 | opts, args = getopt.getopt(sys.argv[1:], 'hj:b:r:', ['job-type=', 'bucket-name=', 'region=']) 79 | except getopt.GetoptError: 80 | usage_and_exit(2) 81 | 82 | for opt, arg in opts: 83 | if opt == '-h': 84 | usage_and_exit() 85 | sys.exit() 86 | elif opt in ('-j', '--job-type'): 87 | job_type = arg 88 | elif opt in ('-b', '--bucket-name'): 89 | bucket_name = arg 90 | elif opt in ('-r', '--region'): 91 | region = arg 92 | 93 | if not job_type: 94 | usage_and_exit(1, f'job-type is required ({JOB_TYPES})') 95 | elif job_type not in JOB_TYPES: 96 | usage_and_exit(1, f'job-type is invalid; must be one of {JOB_TYPES}') 97 | 98 | load_movies() 99 | load_interactions() 100 | 101 | print() 102 | print('Generating input file...') 103 | 104 | if job_type == JOB_TYPES[0]: 105 | input_filename = create_user_personalization_input_file(num_records_to_generate) 106 | elif job_type == JOB_TYPES[1]: 107 | input_filename = create_similar_items_input_file(num_records_to_generate) 108 | elif job_type == JOB_TYPES[2]: 109 | input_filename = create_personalized_ranking_input_file(num_records_to_generate, num_items_per_rank) 110 | else: 111 | usage_and_exit(1, 'Unexpected job-type') 112 | 113 | upload_filename = f'input/{input_filename}' 114 | 115 | if bucket_name: 116 | print() 117 | print(f'Uploading input file {input_filename} to s3://{bucket_name}/{upload_filename}') 118 | 119 | s3_client = boto3.client(service_name = 's3', region_name = region) 120 | response = s3_client.upload_file(input_filename, bucket_name, upload_filename) -------------------------------------------------------------------------------- /movielens-ranking-demo.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | 3 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | # SPDX-License-Identifier: MIT-0 5 | 6 | import sys 7 | import getopt 8 | import boto3 9 | import pandas as pd 10 | from datetime import datetime 11 | from tabulate import tabulate 12 | import locale 13 | 14 | from shared import ( 15 | load_interactions, 16 | load_movies, 17 | lookup_movie_title_and_genres, 18 | get_random_user_ids, 19 | get_random_movie_ids, 20 | get_interactions_for_user, 21 | get_popular_genres 22 | ) 23 | 24 | personalize_runtime = None 25 | 26 | def get_reranked_items_for_user(campaign_arn, user_id, item_ids): 27 | response = personalize_runtime.get_personalized_ranking( 28 | campaignArn = campaign_arn, 29 | userId = str(user_id), 30 | inputList = [str(id) for id in item_ids] 31 | ) 32 | 33 | recommendations = [] 34 | 35 | for item in response['personalizedRanking']: 36 | title_and_genres = lookup_movie_title_and_genres(item['itemId']) 37 | recommendations.append([item['itemId'], title_and_genres[0], title_and_genres[1], item.get('score')]) 38 | 39 | df = pd.DataFrame(recommendations) 40 | df.columns = ['ITEM_ID', 'TITLE', 'GENRES', 'SCORE'] 41 | return df 42 | 43 | if __name__=="__main__": 44 | region = None 45 | campaign_arn = None 46 | user_id = None 47 | item_ids = None 48 | 49 | try: 50 | opts, args = getopt.getopt(sys.argv[1:], 'hc:u:i:r:', ['campaign-arn=', 'user-id=', 'item-ids=', 'region=']) 51 | except getopt.GetoptError: 52 | print(f'Usage: {sys.argv[0]} -c campaign-arn [-u user-id] [-i item-ids] [-r region]') 53 | sys.exit(2) 54 | 55 | for opt, arg in opts: 56 | if opt == '-h': 57 | print(f'Usage: {sys.argv[0]} -c campaign-arn [-u user-id] [-i item-ids] [-r region]') 58 | sys.exit() 59 | elif opt in ('-c', '--campaign-arn'): 60 | campaign_arn = arg 61 | elif opt in ('-u', '--user-id'): 62 | user_id = arg 63 | elif opt in ('-i', '--item-ids'): 64 | item_ids = arg.split(',') 65 | elif opt in ('-r', '--region'): 66 | region = arg 67 | 68 | if not campaign_arn: 69 | print('campaign-arn is required') 70 | print(f'Usage: {sys.argv[0]} -c campaign-arn [-u user-id] [-i item-ids] [-r region]') 71 | sys.exit(1) 72 | 73 | load_movies() 74 | load_interactions() 75 | 76 | personalize_runtime = boto3.client(service_name = 'personalize-runtime', region_name = region) 77 | 78 | print() 79 | print('************ USER INFO ***************') 80 | if not user_id: 81 | print('No user_id provided so randomly selecting a user from the interactions dataset') 82 | user_id = int(get_random_user_ids(1)[0]) 83 | print(f'user_id: {user_id}') 84 | print() 85 | 86 | print() 87 | print('************ ITEM IDS INFO ***************') 88 | if not item_ids: 89 | print('No item_ids provided so randomly selecting 20 movies from the movies dataset') 90 | item_ids = get_random_movie_ids(20) 91 | print(f'item_ids: {item_ids}') 92 | print() 93 | 94 | unranked_list = [] 95 | for item_id in item_ids: 96 | unranked_list.append(lookup_movie_title_and_genres(item_id)) 97 | 98 | unranked_df = pd.DataFrame(unranked_list, columns = ['TITLE', 'GENRES']) 99 | print(tabulate(unranked_df, headers=list(unranked_df.columns), showindex = False, tablefmt="pretty")) 100 | print() 101 | 102 | print('************ RECENT USER INTERACTIONS ***************') 103 | user_interactions_df = get_interactions_for_user(user_id) 104 | print(tabulate(user_interactions_df.head(20), headers=list(user_interactions_df.columns), showindex = False, tablefmt="pretty")) 105 | print() 106 | 107 | print('************ USER TOP GENRES ***************') 108 | user_top_genres = get_popular_genres(user_interactions_df) 109 | print(tabulate(user_top_genres, headers=['GENRE', 'COUNT'], showindex = False, tablefmt="pretty")) 110 | print() 111 | 112 | print('************ RERANKED ITEMS ***************') 113 | recs_df = get_reranked_items_for_user(campaign_arn, user_id, item_ids) 114 | print(tabulate(recs_df.head(20), headers=list(recs_df.columns), showindex = False, tablefmt="pretty")) 115 | print() 116 | 117 | print('************ UNRANKED vs RANKED ITEMS ***************') 118 | top_compare_df = pd.concat([unranked_df['TITLE'], recs_df['TITLE']], axis=1) 119 | top_compare_df.columns = ['Unranked', 'Reranked'] 120 | print(tabulate(top_compare_df, headers=['Unranked Movies', 'Reranked Movies'], showindex = False, tablefmt="pretty")) -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Amazon Personalize / MovieLens - evaluating inference 2 | 3 | ## What 4 | 5 | This project includes some basic utility scripts written in python that make it easy to subjectively evaluate the inference results of [Amazon Personalize](https://aws.amazon.com/personalize/) campaigns trained on the [MovieLens](https://grouplens.org/datasets/movielens/) "small" dataset. 6 | 7 | ## Why 8 | 9 | The Amazon Personalize [sample notebooks](https://github.com/aws-samples/amazon-personalize-samples/tree/master/next_steps/workshops/POC_in_a_box) already do a great job of walking you through preparing and uploading the MovieLens dataset into Personalize and then training models, creating campaigns, and testing inference use-cases. The notebooks absolutely provide the best end-to-end experience. However, if you want to probe the Personalize campaigns created in the sample notebooks a little deeper to, say, evaluate the recommendations against historical interactions, these scripts may prove to be helpful. 10 | 11 | Since the Amazon Personalize console and raw API responses only include movie/item IDs, interpreting those responses against actual movie titles and user histories is painful. Hence, these scripts were developed. 12 | 13 | ## How 14 | 15 | The scripts in this project depend on Personalize campaigns trained off the MovieLens "small" datasets already being provisioning in an AWS account that you have access to. This project does not cover the data preparation, import, and training steps. See the [notebooks](https://github.com/aws-samples/amazon-personalize-samples/tree/master/next_steps/workshops/POC_in_a_box) for these steps. 16 | 17 | Assuming you have the 3 campaigns setup in your AWS account, you're all set to use these scripts to test them out. 18 | 19 | ### Setup 20 | 21 | 1. Go through the [notebooks](https://github.com/aws-samples/amazon-personalize-samples/tree/master/next_steps/workshops/POC_in_a_box) to train models and create campaigns in Personalize using the MovieLens "small" dataset. 22 | 1. Download the `interactions.csv` and `movies.csv` files from the SageMaker notebook instance used in the notebooks to the root of this project. 23 | 1. Pick one of the scripts and evaluate the results. 24 | 25 | ## Inference scripts 26 | 27 | ### User Personalization 28 | 29 | The [movielens-user-personalization-demo](./movielens-user-personalization-demo.py) script will test the [User-Personalization](https://docs.aws.amazon.com/personalize/latest/dg/native-recipe-new-item-USER_PERSONALIZATION.html) backed campain. 30 | 31 | - Pass a `user-id` on the command line or let the script randomly select a user to use as the target of personalized recommendations. 32 | - Displays recent interactions for the user to give you a sense of the user's interests. 33 | - Displays a summary of the most popular genres for the user based on their interaction history. 34 | - Displays recommended movie titles and scores from the user-personalization campaign. 35 | - Displays side-by-side comparison of the user's top genres from their interaction history with the genres from the recommended movies. 36 | 37 | See [sample output](./samples/user-personalization-demo-output.txt) for an example of the script's output. 38 | 39 | ### Similar Items 40 | 41 | The [movielens-similar-items-demo](./movielens-similar-items-demo.py) script will test the [SIMS](https://docs.aws.amazon.com/personalize/latest/dg/native-recipe-sims.html) backed campain. 42 | 43 | - Pass an `item-id` on the command line or let the script randomly select a movie to use as the target for similar item recommendations. 44 | - Displays the movie title and genre(s) for the selected movie. 45 | - Displays the similar item recommendations results so you can evaluate them against the target movie. 46 | 47 | See [sample output](./samples/similar-items-demo-output.txt) for an example of the script's output. 48 | 49 | ### Personalized Ranking 50 | 51 | The [movielens-ranking-demo](./movielens-ranking-demo.py) script will test the [Personalized-Ranking](https://docs.aws.amazon.com/personalize/latest/dg/native-recipe-search.html) backed campain. 52 | 53 | - Pass a `user-id` on the command line or let the script randomly select a user to use as the target of personalized ranking recommendations. 54 | - Pass `item-ids` on the command line or let the script randomly select 20 movies to rerank. 55 | - Displays recent interactions for the user to give you a sense of the user's interests. 56 | - Displays a summary of the most popular genres for the user based on their interaction history. 57 | - Displays the movies reranked by Personalize for the user. 58 | - Displays a side-by-side comparison of the unranked and reranked movies. 59 | 60 | See [sample output](./samples/ranking-demo-output.txt) for an example of the script's output. 61 | 62 | ### Batch Recommendations 63 | 64 | The [movielens-create-batch-input-demo](./movielens-create-batch-input-demo.py) script will generate an input file for an Amazon Personalize [batch recommendations](https://docs.aws.amazon.com/personalize/latest/dg/recommendations-batch.html) inference job and upload it to an S3 bucket (optional). 65 | 66 | - Specify the job type you want to create an input file for on the command line (`user-personalization`, `similar-items`, or `personalized-ranking`). 67 | - Based on the job type, the appropriately formatted input file will be built based on a randomly selected user, item, or items (reranking). 68 | - The generated input file will be uploaded to the S3 bucket if a bucket name is provided on the command line. 69 | 70 | Once your input file(s) are created and uploaded to S3, you can then submit batch inference jobs for each file from the AWS console or via the [CreateBatchInferenceJob](https://docs.aws.amazon.com/personalize/latest/dg/API_CreateBatchInferenceJob.html) API. Be sure to setup the proper bucket policy and IAM role as described in the [documentation](https://docs.aws.amazon.com/personalize/latest/dg/recommendations-batch.html). 71 | 72 | Sample input/output files: 73 | 74 | - User personalization: [input file](./samples/batch-input-user-personalization-20201105-161225.json) | [output file](./samples/batch-output-user-personalization-20201105-161225.json) 75 | - Similar items: [input file](./samples/batch-input-similar-items-20201106-042152.json) | [output file](./samples/batch-output-similar-items-20201106-042152.json) 76 | - Personalized ranking: [input file](./samples/batch-input-personalized-ranking-20201106-044648.json) | [output file](./samples/batch-output-personalized-ranking-20201106-044648.json) 77 | 78 | ## License Summary 79 | 80 | This sample code is made available under a modified MIT license. See the LICENSE file. 81 | -------------------------------------------------------------------------------- /samples/user-personalization-demo-output.txt: -------------------------------------------------------------------------------- 1 | Loading movie data... 2 | Successfully loaded 9,742 movies 3 | Loading interaction data... 4 | Successfully loaded 158,371 interactions 5 | 6 | ************ USER INFO *************** 7 | No user_id provided so randomly selecting a user from the interactions dataset 8 | user_id: 595 9 | 10 | ************ RECENT USER INTERACTIONS *************** 11 | +---------+------------+------------------------------------------------------------+-------------------------------------------+---------------------+ 12 | | ITEM_ID | EVENT_TYPE | TITLE | GENRES | DATE | 13 | +---------+------------+------------------------------------------------------------+-------------------------------------------+---------------------+ 14 | | 2336 | watch | Elizabeth (1998) | Drama | 1999-10-02 13:04:40 | 15 | | 501 | watch | Naked (1993) | Drama | 1999-10-02 13:03:51 | 16 | | 1912 | watch | Out of Sight (1998) | Comedy|Crime|Drama|Romance|Thriller | 1999-10-02 13:02:28 | 17 | | 1966 | watch | Metropolitan (1990) | Comedy | 1999-10-02 13:01:12 | 18 | | 1186 | click | Sex, Lies, and Videotape (1989) | Drama | 1999-10-02 13:00:25 | 19 | | 1711 | click | Midnight in the Garden of Good and Evil (1997) | Crime|Drama|Mystery | 1999-10-02 12:59:49 | 20 | | 2396 | click | Shakespeare in Love (1998) | Comedy|Drama|Romance | 1999-10-02 12:58:55 | 21 | | 2770 | click | Bowfinger (1999) | Comedy | 1999-10-02 12:56:38 | 22 | | 2078 | watch | Jungle Book, The (1967) | Animation|Children|Comedy|Musical | 1999-10-01 19:54:14 | 23 | | 1094 | watch | Crying Game, The (1992) | Drama|Romance|Thriller | 1999-10-01 19:53:17 | 24 | | 2353 | click | Enemy of the State (1998) | Action|Thriller | 1999-10-01 19:51:24 | 25 | | 780 | watch | Independence Day (a.k.a. ID4) (1996) | Action|Adventure|Sci-Fi|Thriller | 1999-10-01 19:50:41 | 26 | | 265 | watch | Like Water for Chocolate (Como agua para chocolate) (1992) | Drama|Fantasy|Romance | 1999-10-01 19:49:54 | 27 | | 509 | click | Piano, The (1993) | Drama|Romance | 1999-10-01 19:49:10 | 28 | | 50 | watch | Usual Suspects, The (1995) | Crime|Mystery|Thriller | 1999-10-01 19:48:06 | 29 | | 1278 | click | Young Frankenstein (1974) | Comedy|Fantasy | 1999-10-01 19:46:38 | 30 | | 1569 | click | My Best Friend's Wedding (1997) | Comedy|Romance | 1999-10-01 19:44:36 | 31 | | 2761 | watch | Iron Giant, The (1999) | Adventure|Animation|Children|Drama|Sci-Fi | 1999-10-01 19:43:51 | 32 | | 1199 | watch | Brazil (1985) | Fantasy|Sci-Fi | 1999-10-01 19:43:00 | 33 | | 2628 | watch | Star Wars: Episode I - The Phantom Menace (1999) | Action|Adventure|Sci-Fi | 1999-10-01 19:42:09 | 34 | +---------+------------+------------------------------------------------------------+-------------------------------------------+---------------------+ 35 | 36 | ************ USER TOP GENRES *************** 37 | +-----------+-------+ 38 | | GENRE | COUNT | 39 | +-----------+-------+ 40 | | Drama | 10 | 41 | | Comedy | 7 | 42 | | Romance | 6 | 43 | | Thriller | 5 | 44 | | Sci-Fi | 4 | 45 | | Fantasy | 3 | 46 | | Crime | 3 | 47 | | Adventure | 3 | 48 | | Action | 3 | 49 | | Mystery | 2 | 50 | | Children | 2 | 51 | | Animation | 2 | 52 | | Musical | 1 | 53 | +-----------+-------+ 54 | 55 | ************ USER RECOMMENDATIONS *************** 56 | +---------+------------------------------------------------+--------------------------------+-----------+ 57 | | ITEM_ID | TITLE | GENRES | SCORE | 58 | +---------+------------------------------------------------+--------------------------------+-----------+ 59 | | 1302 | Field of Dreams (1989) | Children|Drama|Fantasy | 0.0112908 | 60 | | 1641 | Full Monty, The (1997) | Comedy|Drama | 0.0087742 | 61 | | 2336 | Elizabeth (1998) | Drama | 0.0082736 | 62 | | 3408 | Erin Brockovich (2000) | Drama | 0.0069018 | 63 | | 671 | Mystery Science Theater 3000: The Movie (1996) | Comedy|Sci-Fi | 0.0057007 | 64 | | 1120 | People vs. Larry Flynt, The (1996) | Comedy|Drama | 0.0055633 | 65 | | 852 | Tin Cup (1996) | Comedy|Drama|Romance | 0.0054851 | 66 | | 1784 | As Good as It Gets (1997) | Comedy|Drama|Romance | 0.0052152 | 67 | | 2268 | Few Good Men, A (1992) | Crime|Drama|Thriller | 0.0050713 | 68 | | 719 | Multiplicity (1996) | Comedy | 0.0046091 | 69 | | 1042 | That Thing You Do! (1996) | Comedy|Drama | 0.0045338 | 70 | | 1597 | Conspiracy Theory (1997) | Drama|Mystery|Romance|Thriller | 0.0043447 | 71 | | 788 | Nutty Professor, The (1996) | Comedy|Fantasy|Romance|Sci-Fi | 0.0041623 | 72 | | 1673 | Boogie Nights (1997) | Drama | 0.0040814 | 73 | | 785 | Kingpin (1996) | Comedy | 0.0040531 | 74 | | 1777 | Wedding Singer, The (1998) | Comedy|Romance | 0.0039702 | 75 | | 1721 | Titanic (1997) | Drama|Romance | 0.0039501 | 76 | | 3174 | Man on the Moon (1999) | Comedy|Drama | 0.0038945 | 77 | | 2006 | Mask of Zorro, The (1998) | Action|Comedy|Romance | 0.003749 | 78 | | 838 | Emma (1996) | Comedy|Drama|Romance | 0.0037293 | 79 | +---------+------------------------------------------------+--------------------------------+-----------+ 80 | 81 | ************ TOP USER vs RECOMMENDATIONS GENRES *************** 82 | +-----------------+-----------------+ 83 | | User Top Genres | Recs Top Genres | 84 | +-----------------+-----------------+ 85 | | Drama | Drama | 86 | | Comedy | Comedy | 87 | | Romance | Romance | 88 | | Thriller | Crime | 89 | | Sci-Fi | Thriller | 90 | | Fantasy | Sci-Fi | 91 | | Crime | Fantasy | 92 | | Adventure | Action | 93 | | Action | War | 94 | | Mystery | Mystery | 95 | | Children | Children | 96 | | Animation | nan | 97 | | Musical | nan | 98 | +-----------------+-----------------+ 99 | -------------------------------------------------------------------------------- /samples/batch-input-personalized-ranking-20201106-044648.json: -------------------------------------------------------------------------------- 1 | {"userId": "308", "itemList": ["163645", "1116", "50872", "98083", "98160", "3837", "99846", "8934", "175707", "133377", "3614", "122260", "304", "27368", "6422", "69304", "1204", "89343", "169034", "72998"]} 2 | {"userId": "131", "itemList": ["48516", "5609", "959", "2210", "5134", "8015", "1265", "3148", "67295", "8720", "1188", "4297", "2041", "90945", "7377", "4130", "5049", "1244", "4801", "141818"]} 3 | {"userId": "400", "itemList": ["459", "8427", "179813", "413", "80862", "7786", "3707", "44193", "3028", "4231", "151781", "46322", "290", "609", "291", "115122", "735", "4671", "326", "145080"]} 4 | {"userId": "332", "itemList": ["7439", "160440", "171759", "6212", "158528", "85179", "316", "125970", "64285", "44972", "3017", "1502", "6", "3130", "86190", "81932", "58376", "7938", "103372", "3596"]} 5 | {"userId": "176", "itemList": ["207", "182823", "2896", "3977", "52950", "3674", "5040", "122888", "54276", "1603", "128087", "828", "390", "60037", "1610", "144714", "168418", "5255", "83086", "118700"]} 6 | {"userId": "538", "itemList": ["27815", "7085", "50804", "70334", "5459", "4840", "66171", "7261", "81831", "2501", "1216", "33639", "141799", "165075", "83349", "4388", "27255", "153236", "4495", "2142"]} 7 | {"userId": "206", "itemList": ["1459", "65135", "3652", "89840", "487", "5489", "33132", "102084", "25", "4823", "75416", "175431", "4156", "44694", "6059", "27692", "140956", "86628", "8057", "39"]} 8 | {"userId": "65", "itemList": ["5033", "7155", "72167", "5448", "81847", "68848", "41617", "3431", "2975", "27644", "102445", "4064", "8916", "54354", "1283", "106144", "65126", "55577", "91325", "7085"]} 9 | {"userId": "140", "itemList": ["3536", "112727", "3107", "102084", "2320", "8656", "125970", "8969", "31123", "60289", "5390", "990", "4426", "3129", "650", "54503", "2078", "90245", "1236", "3"]} 10 | {"userId": "171", "itemList": ["7045", "56941", "7141", "8743", "190221", "3692", "85354", "58559", "4189", "141749", "4973", "5847", "58655", "27846", "84246", "3401", "3153", "1290", "302", "60538"]} 11 | {"userId": "119", "itemList": ["55290", "56156", "1262", "83369", "102747", "34048", "1306", "182293", "2106", "61246", "130482", "45720", "3709", "1255", "96945", "3534", "6031", "3763", "2725", "68872"]} 12 | {"userId": "210", "itemList": ["8965", "801", "122246", "6808", "69516", "5874", "7444", "1438", "2581", "31038", "62836", "46367", "95761", "1277", "39414", "32160", "5040", "47491", "1566", "148626"]} 13 | {"userId": "455", "itemList": ["65230", "301", "2275", "84273", "2118", "96007", "71129", "1095", "6552", "114847", "1474", "169984", "148172", "4876", "110826", "2889", "1954", "31086", "37211", "5497"]} 14 | {"userId": "202", "itemList": ["54001", "691", "1206", "2372", "40581", "407", "58154", "2019", "4771", "92192", "3420", "96121", "1244", "7730", "2546", "6386", "52885", "42738", "107069", "74647"]} 15 | {"userId": "442", "itemList": ["3683", "8795", "3196", "6816", "82459", "51884", "2944", "4958", "8196", "4260", "153070", "6887", "59103", "1437", "93022", "146684", "117192", "5633", "4743", "46322"]} 16 | {"userId": "319", "itemList": ["2096", "2702", "1092", "117922", "351", "965", "8799", "128594", "4180", "4572", "49272", "1094", "1862", "5081", "1875", "118696", "2852", "93610", "101577", "3515"]} 17 | {"userId": "596", "itemList": ["167772", "6234", "81834", "6484", "5706", "94130", "899", "2467", "76143", "32116", "26974", "143472", "82095", "82848", "1623", "58839", "6951", "107997", "3838", "27176"]} 18 | {"userId": "10", "itemList": ["4808", "93326", "54281", "77", "27306", "3401", "4267", "74154", "82767", "94867", "165343", "2476", "8024", "2338", "2572", "74948", "6696", "105731", "129514", "4085"]} 19 | {"userId": "314", "itemList": ["105121", "157200", "68597", "26741", "48412", "4433", "57368", "4792", "104374", "135787", "3037", "176413", "4713", "316", "60766", "81791", "78620", "59429", "55247", "58975"]} 20 | {"userId": "486", "itemList": ["82095", "4354", "159415", "3565", "3454", "5965", "120827", "169912", "7171", "6461", "71520", "71640", "7789", "58295", "1912", "955", "3446", "103384", "8690", "4942"]} 21 | {"userId": "557", "itemList": ["8491", "121342", "103085", "1345", "26567", "148978", "835", "3943", "586", "5456", "134326", "2022", "2056", "122906", "1569", "105213", "1947", "7493", "1678", "2472"]} 22 | {"userId": "44", "itemList": ["3810", "110297", "45208", "1794", "67534", "2119", "3634", "2949", "4175", "71438", "119964", "661", "165671", "144222", "2011", "1621", "135534", "31038", "3909", "2828"]} 23 | {"userId": "283", "itemList": ["146656", "70565", "54116", "115680", "60161", "6162", "46855", "1936", "7987", "69436", "5755", "800", "184253", "90403", "1230", "4673", "117867", "5613", "79333", "3130"]} 24 | {"userId": "467", "itemList": ["973", "27708", "126921", "92243", "1306", "91079", "42943", "6803", "136556", "87483", "4929", "88108", "253", "7010", "90057", "161634", "107447", "101360", "135532", "8875"]} 25 | {"userId": "134", "itemList": ["160341", "69122", "78209", "4200", "30892", "3324", "96430", "6", "4437", "2740", "350", "4608", "7386", "2467", "143031", "4900", "4917", "665", "66511", "77201"]} 26 | {"userId": "53", "itemList": ["2377", "4782", "36477", "91325", "107013", "4721", "412", "92674", "2800", "77233", "920", "97870", "101973", "426", "31150", "1517", "121338", "1551", "116941", "84392"]} 27 | {"userId": "491", "itemList": ["5345", "255", "748", "6989", "74095", "4740", "8614", "6271", "1907", "54503", "69951", "96815", "141836", "6244", "1794", "72479", "6330", "142366", "172875", "158842"]} 28 | {"userId": "329", "itemList": ["51314", "143410", "1352", "2450", "62208", "2060", "3048", "4325", "131749", "308", "4734", "87222", "26612", "109723", "162082", "142424", "65135", "1127", "4822", "47124"]} 29 | {"userId": "79", "itemList": ["72294", "534", "1552", "175585", "78088", "91666", "55253", "66783", "49649", "95167", "3000", "65193", "3082", "6751", "6679", "175781", "143969", "7223", "78174", "43679"]} 30 | {"userId": "500", "itemList": ["71264", "4420", "1626", "4864", "138610", "1805", "25905", "5256", "7301", "3942", "96608", "5544", "5051", "8879", "2001", "1893", "180297", "74868", "91535", "8771"]} 31 | {"userId": "0", "itemList": ["163134", "6464", "141820", "52", "130976", "106642", "26150", "4083", "82095", "5304", "6313", "6217", "4803", "4516", "3115", "1994", "184253", "5888", "4231", "6709"]} 32 | {"userId": "253", "itemList": ["46337", "79242", "1385", "7050", "178613", "4036", "100487", "5613", "1527", "2183", "6290", "5060", "57243", "1965", "2939", "5797", "58826", "58025", "3521", "1801"]} 33 | {"userId": "378", "itemList": ["34523", "1091", "33162", "86332", "26258", "430", "171765", "2405", "3965", "27032", "170", "116817", "183301", "6424", "90384", "138966", "2740", "808", "4224", "8815"]} 34 | {"userId": "163", "itemList": ["92234", "2373", "2385", "34072", "57368", "1542", "58293", "7924", "2871", "26169", "62383", "46335", "4616", "175781", "2972", "162600", "4067", "7310", "21", "62293"]} 35 | {"userId": "385", "itemList": ["8938", "79132", "33188", "4499", "26265", "132462", "2571", "7882", "4697", "100044", "44204", "67255", "6002", "91128", "71", "253", "5212", "1702", "7345", "60397"]} 36 | {"userId": "224", "itemList": ["1644", "84553", "96608", "44511", "5021", "141836", "236", "1380", "8910", "166526", "4956", "88672", "90719", "93766", "72308", "3263", "275", "179053", "1207", "1318"]} 37 | {"userId": "29", "itemList": ["5733", "6157", "157775", "82684", "3551", "51666", "3284", "4326", "4224", "3959", "892", "7560", "168", "2888", "100159", "2112", "136838", "2164", "81784", "5156"]} 38 | {"userId": "411", "itemList": ["8340", "6210", "139855", "2295", "5723", "7560", "1216", "104419", "3716", "43333", "145839", "6530", "90603", "6333", "82", "3623", "2435", "135518", "55261", "526"]} 39 | {"userId": "333", "itemList": ["553", "6530", "3424", "138210", "3909", "3062", "25788", "80363", "100159", "92234", "40412", "7104", "15", "46574", "170551", "3130", "201", "73515", "93006", "26158"]} 40 | {"userId": "205", "itemList": ["43930", "137857", "174909", "53894", "172875", "136016", "118784", "113374", "104078", "8865", "5733", "2599", "1307", "4280", "90249", "353", "841", "6564", "136556", "927"]} 41 | {"userId": "280", "itemList": ["536", "7820", "69406", "88699", "3566", "2002", "4248", "169670", "5168", "4351", "105355", "89047", "2555", "4366", "66798", "5741", "2903", "89864", "50842", "3930"]} 42 | {"userId": "245", "itemList": ["112303", "4089", "56174", "161044", "158966", "2420", "5562", "8378", "146028", "138210", "8848", "294", "55872", "3276", "116963", "95497", "129737", "4526", "5328", "141818"]} 43 | {"userId": "225", "itemList": ["7085", "152081", "4546", "46862", "7983", "2616", "83177", "63876", "359", "6636", "1096", "8043", "2634", "141810", "77364", "144352", "134861", "5499", "77667", "6872"]} 44 | {"userId": "562", "itemList": ["6237", "48518", "6390", "5398", "2255", "3699", "8461", "74868", "5954", "8827", "6271", "4776", "4005", "2580", "68347", "4355", "32160", "171", "3679", "5477"]} 45 | {"userId": "293", "itemList": ["2810", "96114", "1453", "171695", "1231", "51412", "68347", "4190", "1037", "128099", "4104", "87", "1892", "180985", "79428", "1432", "4654", "141646", "53578", "94494"]} 46 | {"userId": "432", "itemList": ["454", "40723", "98499", "104875", "8492", "1913", "1408", "1406", "65133", "27831", "6217", "96471", "6186", "2153", "53450", "122922", "4689", "3286", "3695", "5450"]} 47 | {"userId": "128", "itemList": ["89343", "73386", "5387", "72696", "97836", "2749", "43936", "152085", "7256", "2696", "165671", "128", "51937", "6857", "8967", "67508", "31903", "5011", "147286", "1867"]} 48 | {"userId": "590", "itemList": ["26870", "57147", "4437", "44241", "87222", "60072", "8973", "3826", "4349", "104245", "3107", "126482", "5706", "4478", "4595", "4293", "1549", "49389", "7486", "5955"]} 49 | {"userId": "347", "itemList": ["481", "3996", "6294", "3519", "3870", "3963", "1439", "26590", "51255", "130840", "8364", "122884", "8711", "64", "1323", "149350", "4197", "97328", "27156", "25999"]} 50 | {"userId": "291", "itemList": ["4826", "2858", "1286", "118834", "3434", "103984", "6448", "1231", "136297", "71999", "1552", "104925", "2771", "62586", "8921", "779", "202", "128366", "183959", "142420"]} 51 | -------------------------------------------------------------------------------- /samples/batch-output-similar-items-20201106-042152.json: -------------------------------------------------------------------------------- 1 | {"input":{"itemId":"75341"},"output":{"recommendedItems":["120138","147286","170597","134326","165959","170411","172589","173619","172793","129514","141830","163072","172587","147282","172585","2131","80124","170777","175293","141816","175435","147300","140265","175431","179133"]},"error":null} 2 | {"input":{"itemId":"127194"},"output":{"recommendedItems":["318","356","296","593","110","2571","527","260","480","589","150","457","2959","1","47","50","2858","1198","4993","608","7153","590","780","5952","858"]},"error":null} 3 | {"input":{"itemId":"44238"},"output":{"recommendedItems":["318","356","296","593","110","2571","527","260","480","589","150","457","2959","1","47","50","2858","1198","4993","608","7153","590","780","5952","858"]},"error":null} 4 | {"input":{"itemId":"8167"},"output":{"recommendedItems":["318","356","296","593","110","2571","527","260","480","589","150","457","2959","1","47","50","2858","1198","4993","608","7153","590","780","5952","858"]},"error":null} 5 | {"input":{"itemId":"169982"},"output":{"recommendedItems":["318","356","296","593","110","2571","527","260","480","589","150","457","2959","1","47","50","2858","1198","4993","608","7153","590","780","5952","858"]},"error":null} 6 | {"input":{"itemId":"362"},"output":{"recommendedItems":["531","596","350","48","218","2033","277","552","60","491","594","2048","158","553","1489","87234","1919","2899","1226","2103","1606","484","121","107","6358"]},"error":null} 7 | {"input":{"itemId":"2178"},"output":{"recommendedItems":["2349","2925","2344","2511","334","1964","2351","1264","213","1273","1966","1965","2952","2583","1238","2973","2702","2863","1303","41","1077","2109","1261","1125","1912"]},"error":null} 8 | {"input":{"itemId":"109282"},"output":{"recommendedItems":["318","356","296","593","110","2571","527","260","480","589","150","457","2959","1","47","50","2858","1198","4993","608","7153","590","780","5952","858"]},"error":null} 9 | {"input":{"itemId":"78959"},"output":{"recommendedItems":["318","356","296","593","110","2571","527","260","480","589","150","457","2959","1","47","50","2858","1198","4993","608","7153","590","780","5952","858"]},"error":null} 10 | {"input":{"itemId":"6954"},"output":{"recommendedItems":["318","356","296","593","110","2571","527","260","480","589","150","457","2959","1","47","50","2858","1198","4993","608","7153","590","780","5952","858"]},"error":null} 11 | {"input":{"itemId":"26225"},"output":{"recommendedItems":["318","356","296","593","110","2571","527","260","480","589","150","457","2959","1","47","50","2858","1198","4993","608","7153","590","780","5952","858"]},"error":null} 12 | {"input":{"itemId":"8827"},"output":{"recommendedItems":["103606","6612","27329","59810","8998","74282","7078","26528","4663","4040","4091","47122","7444","53024","26471","60766","73854","6332","6593","56805","69069","6619","101142","6932","8011"]},"error":null} 13 | {"input":{"itemId":"728"},"output":{"recommendedItems":["1893","8275","6945","6713","8607","5632","4969","6041","7069","6724","27741","45928","49772","2390","12","44694","27731","1189","88","85","232","135","765","7","673"]},"error":null} 14 | {"input":{"itemId":"6145"},"output":{"recommendedItems":["318","356","296","593","110","2571","527","260","480","589","150","457","2959","1","47","50","2858","1198","4993","608","7153","590","780","5952","858"]},"error":null} 15 | {"input":{"itemId":"7321"},"output":{"recommendedItems":["318","356","296","593","110","2571","527","260","480","589","150","457","2959","1","47","50","2858","1198","4993","608","7153","590","780","5952","858"]},"error":null} 16 | {"input":{"itemId":"8596"},"output":{"recommendedItems":["318","356","296","593","110","2571","527","260","480","589","150","457","2959","1","47","50","2858","1198","4993","608","7153","590","780","5952","858"]},"error":null} 17 | {"input":{"itemId":"102407"},"output":{"recommendedItems":["120130","127052","90374","26249","68205","86644","104283","26903","106766","137337","156387","132660","65982","26776","67788","6350","57504","127108","4270","103141","55167","98154","64957","56801","65261"]},"error":null} 18 | {"input":{"itemId":"4478"},"output":{"recommendedItems":["318","356","296","593","110","2571","527","260","480","589","150","457","2959","1","47","50","2858","1198","4993","608","7153","590","780","5952","858"]},"error":null} 19 | {"input":{"itemId":"4226"},"output":{"recommendedItems":["7361","2959","2329","4878","2858","4973","5782","6874","4993","7153","3949","1193","1206","5952","79132","44191","1884","48516","6016","4995","48780","1213","4011","7438","50"]},"error":null} 20 | {"input":{"itemId":"124484"},"output":{"recommendedItems":["318","356","296","593","110","2571","527","260","480","589","150","457","2959","1","47","50","2858","1198","4993","608","7153","590","780","5952","858"]},"error":null} 21 | {"input":{"itemId":"6721"},"output":{"recommendedItems":["6387","6567","27801","6618","44974","3624","1221","1036"]},"error":null} 22 | {"input":{"itemId":"1647"},"output":{"recommendedItems":["318","356","296","593","110","2571","527","260","480","589","150","457","2959","1","47","50","2858","1198","4993","608","7153","590","780","5952","858"]},"error":null} 23 | {"input":{"itemId":"4397"},"output":{"recommendedItems":["318","356","296","593","110","2571","527","260","480","589","150","457","2959","1","47","50","2858","1198","4993","608","7153","590","780","5952","858"]},"error":null} 24 | {"input":{"itemId":"605"},"output":{"recommendedItems":["6785","3259","537","2262","1290","89","4308","900","4621","3274","2468","3261","6873","5380","1678","28","934","3536","6059","3244","1441","74","4623","1091","4161"]},"error":null} 25 | {"input":{"itemId":"74545"},"output":{"recommendedItems":["110387","133115","82667","81788","90600","73023","90439","55290","91077","91630","98961","94864","55276","6281","96829","104879","91658","7156","55118","86833","57669","80489","51540","64839","27773"]},"error":null} 26 | {"input":{"itemId":"102165"},"output":{"recommendedItems":["318","356","296","593","110","2571","527","260","480","589","150","457","2959","1","47","50","2858","1198","4993","608","7153","590","780","5952","858"]},"error":null} 27 | {"input":{"itemId":"48322"},"output":{"recommendedItems":["40614","45501","4880","36535","5785","48082","2596","4873","27904","8957","30810","4975","262","48385","4979","3897","46578","7147","4878","2329","293","7361","2959","318"]},"error":null} 28 | {"input":{"itemId":"7713"},"output":{"recommendedItems":["318","356","296","593","110","2571","527","260","480","589","150","457","2959","1","47","50","2858","1198","4993","608","7153","590","780","5952","858"]},"error":null} 29 | {"input":{"itemId":"8933"},"output":{"recommendedItems":["318","356","296","593","110","2571","527","260","480","589","150","457","2959","1","47","50","2858","1198","4993","608","7153","590","780","5952","858"]},"error":null} 30 | {"input":{"itemId":"1437"},"output":{"recommendedItems":["318","356","296","593","110","2571","527","260","480","589","150","457","2959","1","47","50","2858","1198","4993","608","7153","590","780","5952","858"]},"error":null} 31 | {"input":{"itemId":"2978"},"output":{"recommendedItems":["318","356","296","593","110","2571","527","260","480","589","150","457","2959","1","47","50","2858","1198","4993","608","7153","590","780","5952","858"]},"error":null} 32 | {"input":{"itemId":"84240"},"output":{"recommendedItems":["58554","71033","40414","62644","27803","89864","8873","80906","5995","81845","68157","1193","4226","2858","527","296"]},"error":null} 33 | {"input":{"itemId":"107408"},"output":{"recommendedItems":["120138","147286","170597","134326","75341","165959","170411","172589","173619","172793","129514","141830","163072","172587","147282","172585","2131","80124","170777","175293","141816","175435","147300","140265","175431"]},"error":null} 34 | {"input":{"itemId":"263"},"output":{"recommendedItems":["318","356","296","593","110","2571","527","260","480","589","150","457","2959","1","47","50","2858","1198","4993","608","7153","590","780","5952","858"]},"error":null} 35 | {"input":{"itemId":"2478"},"output":{"recommendedItems":["4577","4482","4541","4516","1083","2899","1226","2263","2372","2771","4293","4564","1804","2110","2151","157","4007","2795","2989","2796","41716","4509","4102","3142","4396"]},"error":null} 36 | {"input":{"itemId":"7190"},"output":{"recommendedItems":["318","356","296","593","110","2571","527","260","480","589","150","457","2959","1","47","50","2858","1198","4993","608","7153","590","780","5952","858"]},"error":null} 37 | {"input":{"itemId":"2605"},"output":{"recommendedItems":["2738","3130","1184","55241","691","1096","2247","1375","62383","3991","2469","1438","2436","2874","2151","2622","2724","1371","3203","1238","2000","2490","2006","2779","2259"]},"error":null} 38 | {"input":{"itemId":"86548"},"output":{"recommendedItems":["318","356","296","593","110","2571","527","260","480","589","150","457","2959","1","47","50","2858","1198","4993","608","7153","590","780","5952","858"]},"error":null} 39 | {"input":{"itemId":"66943"},"output":{"recommendedItems":["78142","146986","149508","131610","26265","153408","156781","93022","51167","139157","78620","84512","177185","96608","143559","157775","53355","131104","94661","131098","158882","148632","84246","142444","104875"]},"error":null} 40 | {"input":{"itemId":"143472"},"output":{"recommendedItems":["318","356","296","593","110","2571","527","260","480","589","150","457","2959","1","47","50","2858","1198","4993","608","7153","590","780","5952","858"]},"error":null} 41 | {"input":{"itemId":"4337"},"output":{"recommendedItems":["318","356","296","593","110","2571","527","260","480","589","150","457","2959","1","47","50","2858","1198","4993","608","7153","590","780","5952","858"]},"error":null} 42 | {"input":{"itemId":"85295"},"output":{"recommendedItems":["318","356","296","593","110","2571","527","260","480","589","150","457","2959","1","47","50","2858","1198","4993","608","7153","590","780","5952","858"]},"error":null} 43 | {"input":{"itemId":"179813"},"output":{"recommendedItems":["318","356","296","593","110","2571","527","260","480","589","150","457","2959","1","47","50","2858","1198","4993","608","7153","590","780","5952","858"]},"error":null} 44 | {"input":{"itemId":"2001"},"output":{"recommendedItems":["2432","2738","3130","4374","91488","73501","2000","2269","691","1096","2633","2327","2302","2247","1970","54736","2469","1184","4054","1377","5364","2874","2151","2003","1975"]},"error":null} 45 | {"input":{"itemId":"198"},"output":{"recommendedItems":["2744","3894","280","229","1401","16","431","1277","6","4121","340","305","3041","3436","1306","490","249","1619","1390","207","353","14","555","442","144"]},"error":null} 46 | {"input":{"itemId":"48877"},"output":{"recommendedItems":["55577","42723","81535","39400","88179","92048","88932","55555","5339","522","5712","4496","7983","57532","40412","90353","88272","39446","63436","89761","5106","2554","387","7000","3501"]},"error":null} 47 | {"input":{"itemId":"2586"},"output":{"recommendedItems":["318","356","296","593","110","2571","527","260","480","589","150","457","2959","1","47","50","2858","1198","4993","608","7153","590","780","5952","858"]},"error":null} 48 | {"input":{"itemId":"4002"},"output":{"recommendedItems":["4679","4062","1260","3925","152173","141544","140247","172881","26585","105593","3022","4814","4577","4482","4541","4516","4008","824","670","2707","65133","162598","7846","2126","3552"]},"error":null} 49 | {"input":{"itemId":"2245"},"output":{"recommendedItems":["2262","1958","3167","3073","3169","2476","2145","1964","2248","6785","2020","537","2374","4623","1290","4161","63433","1939","3066","3109","3093","3098","1569","3074","2570"]},"error":null} 50 | {"input":{"itemId":"594"},"output":{"recommendedItems":["596","497","616","350","362","364","531","540","551","2081","3061","48","368","508","1028","277","317","539","575","34","595","552","7","224","1032"]},"error":null} 51 | -------------------------------------------------------------------------------- /samples/ranking-demo-output.txt: -------------------------------------------------------------------------------- 1 | Loading movie data... 2 | Successfully loaded 9,742 movies 3 | Loading interaction data... 4 | Successfully loaded 158,371 interactions 5 | 6 | ************ USER INFO *************** 7 | No user_id provided so randomly selecting a user from the interactions dataset 8 | user_id: 302 9 | 10 | 11 | ************ ITEM IDS INFO *************** 12 | No item_ids provided so randomly selecting 20 movies from the movies dataset 13 | item_ids: [3795, 5802, 7845, 25834, 45074, 1447, 6365, 3769, 1835, 46972, 7477, 2334, 5470, 179119, 3648, 71248, 4016, 93855, 6687, 31737] 14 | 15 | +---------------------------------------------------------------------------+---------------------------------------------+ 16 | | TITLE | GENRES | 17 | +---------------------------------------------------------------------------+---------------------------------------------+ 18 | | Five Senses, The (1999) | Drama | 19 | | World of Henry Orient, The (1964) | Comedy | 20 | | Tremors II: Aftershocks (1996) | Comedy|Horror|Sci-Fi | 21 | | Captains Courageous (1937) | Adventure|Drama | 22 | | Wild, The (2006) | Adventure|Animation|Children|Comedy|Fantasy | 23 | | Gridlock'd (1997) | Crime | 24 | | Matrix Reloaded, The (2003) | Action|Adventure|Sci-Fi|Thriller|IMAX | 25 | | Thunderbolt and Lightfoot (1974) | Action | 26 | | City of Angels (1998) | Drama|Fantasy|Romance | 27 | | Night at the Museum (2006) | Action|Comedy|Fantasy|IMAX | 28 | | Eye See You (D-Tox) (2002) | Horror|Thriller | 29 | | Siege, The (1998) | Action|Thriller | 30 | | The Importance of Being Earnest (1952) | Comedy|Romance | 31 | | The Death of Stalin (2017) | Comedy | 32 | | Abominable Snowman, The (Abominable Snowman of the Himalayas, The) (1957) | Horror|Sci-Fi | 33 | | Extract (2009) | Comedy | 34 | | Emperor's New Groove, The (2000) | Adventure|Animation|Children|Comedy|Fantasy | 35 | | God Bless America (2011) | Comedy|Drama | 36 | | My Boss's Daughter (2003) | Comedy|Romance | 37 | | Bunny Lake Is Missing (1965) | Mystery|Thriller | 38 | +---------------------------------------------------------------------------+---------------------------------------------+ 39 | 40 | ************ RECENT USER INTERACTIONS *************** 41 | +---------+------------+--------------------------------------------------------------------------------+----------------------------------+---------------------+ 42 | | ITEM_ID | EVENT_TYPE | TITLE | GENRES | DATE | 43 | +---------+------------+--------------------------------------------------------------------------------+----------------------------------+---------------------+ 44 | | 1221 | watch | Godfather: Part II, The (1974) | Crime|Drama | 1997-01-28 17:43:16 | 45 | | 1198 | watch | Raiders of the Lost Ark (Indiana Jones and the Raiders of the Lost Ark) (1981) | Action|Adventure | 1997-01-28 17:43:16 | 46 | | 858 | watch | Godfather, The (1972) | Crime|Drama | 1997-01-28 17:42:29 | 47 | | 383 | click | Wyatt Earp (1994) | Western | 1997-01-28 17:42:02 | 48 | | 458 | click | Geronimo: An American Legend (1993) | Drama|Western | 1997-01-28 17:42:02 | 49 | | 47 | click | Seven (a.k.a. Se7en) (1995) | Mystery|Thriller | 1997-01-28 17:41:04 | 50 | | 260 | click | Star Wars: Episode IV - A New Hope (1977) | Action|Adventure|Sci-Fi | 1997-01-28 17:41:04 | 51 | | 377 | click | Speed (1994) | Action|Romance|Thriller | 1997-01-28 17:40:32 | 52 | | 589 | click | Terminator 2: Judgment Day (1991) | Action|Sci-Fi | 1997-01-28 17:40:32 | 53 | | 293 | click | Léon: The Professional (a.k.a. The Professional) (Léon) (1994) | Action|Crime|Drama|Thriller | 1997-01-28 17:40:32 | 54 | | 480 | watch | Jurassic Park (1993) | Action|Adventure|Sci-Fi|Thriller | 1997-01-28 17:40:32 | 55 | | 110 | click | Braveheart (1995) | Action|Drama|War | 1997-01-28 17:39:47 | 56 | | 457 | watch | Fugitive, The (1993) | Thriller | 1997-01-28 17:39:46 | 57 | | 21 | watch | Get Shorty (1995) | Comedy|Crime|Thriller | 1997-01-28 17:39:44 | 58 | | 296 | click | Pulp Fiction (1994) | Comedy|Crime|Drama|Thriller | 1997-01-28 17:39:43 | 59 | | 707 | click | Mulholland Falls (1996) | Crime|Drama|Thriller | 1997-01-28 17:23:39 | 60 | | 628 | click | Primal Fear (1996) | Crime|Drama|Mystery|Thriller | 1997-01-28 17:22:38 | 61 | | 762 | click | Striptease (1996) | Comedy|Crime | 1997-01-28 17:22:37 | 62 | | 14 | watch | Nixon (1995) | Drama | 1997-01-28 17:22:02 | 63 | | 786 | watch | Eraser (1996) | Action|Drama|Thriller | 1997-01-28 17:22:02 | 64 | +---------+------------+--------------------------------------------------------------------------------+----------------------------------+---------------------+ 65 | 66 | ************ USER TOP GENRES *************** 67 | +-----------+-------+ 68 | | GENRE | COUNT | 69 | +-----------+-------+ 70 | | Thriller | 16 | 71 | | Drama | 15 | 72 | | Action | 12 | 73 | | Crime | 10 | 74 | | Comedy | 7 | 75 | | Adventure | 7 | 76 | | Romance | 6 | 77 | | Sci-Fi | 5 | 78 | | Mystery | 4 | 79 | | Western | 2 | 80 | | War | 1 | 81 | +-----------+-------+ 82 | 83 | ************ RERANKED ITEMS *************** 84 | +---------+---------------------------------------------------------------------------+---------------------------------------------+-----------+ 85 | | ITEM_ID | TITLE | GENRES | SCORE | 86 | +---------+---------------------------------------------------------------------------+---------------------------------------------+-----------+ 87 | | 31737 | Bunny Lake Is Missing (1965) | Mystery|Thriller | 0.2283751 | 88 | | 7845 | Tremors II: Aftershocks (1996) | Comedy|Horror|Sci-Fi | 0.1877946 | 89 | | 1447 | Gridlock'd (1997) | Crime | 0.1282427 | 90 | | 3769 | Thunderbolt and Lightfoot (1974) | Action | 0.1101736 | 91 | | 3648 | Abominable Snowman, The (Abominable Snowman of the Himalayas, The) (1957) | Horror|Sci-Fi | 0.0779894 | 92 | | 2334 | Siege, The (1998) | Action|Thriller | 0.0623344 | 93 | | 4016 | Emperor's New Groove, The (2000) | Adventure|Animation|Children|Comedy|Fantasy | 0.0552557 | 94 | | 3795 | Five Senses, The (1999) | Drama | 0.0453717 | 95 | | 6687 | My Boss's Daughter (2003) | Comedy|Romance | 0.0368708 | 96 | | 1835 | City of Angels (1998) | Drama|Fantasy|Romance | 0.0261012 | 97 | | 46972 | Night at the Museum (2006) | Action|Comedy|Fantasy|IMAX | 0.017293 | 98 | | 5470 | The Importance of Being Earnest (1952) | Comedy|Romance | 0.0134799 | 99 | | 6365 | Matrix Reloaded, The (2003) | Action|Adventure|Sci-Fi|Thriller|IMAX | 0.0099298 | 100 | | 179119 | The Death of Stalin (2017) | Comedy | 0.0007883 | 101 | | 5802 | World of Henry Orient, The (1964) | Comedy | nan | 102 | | 25834 | Captains Courageous (1937) | Adventure|Drama | nan | 103 | | 45074 | Wild, The (2006) | Adventure|Animation|Children|Comedy|Fantasy | nan | 104 | | 7477 | Eye See You (D-Tox) (2002) | Horror|Thriller | nan | 105 | | 71248 | Extract (2009) | Comedy | nan | 106 | | 93855 | God Bless America (2011) | Comedy|Drama | nan | 107 | +---------+---------------------------------------------------------------------------+---------------------------------------------+-----------+ 108 | 109 | ************ UNRANKED vs RANKED ITEMS *************** 110 | +---------------------------------------------------------------------------+---------------------------------------------------------------------------+ 111 | | Unranked Movies | Reranked Movies | 112 | +---------------------------------------------------------------------------+---------------------------------------------------------------------------+ 113 | | Five Senses, The (1999) | Bunny Lake Is Missing (1965) | 114 | | World of Henry Orient, The (1964) | Tremors II: Aftershocks (1996) | 115 | | Tremors II: Aftershocks (1996) | Gridlock'd (1997) | 116 | | Captains Courageous (1937) | Thunderbolt and Lightfoot (1974) | 117 | | Wild, The (2006) | Abominable Snowman, The (Abominable Snowman of the Himalayas, The) (1957) | 118 | | Gridlock'd (1997) | Siege, The (1998) | 119 | | Matrix Reloaded, The (2003) | Emperor's New Groove, The (2000) | 120 | | Thunderbolt and Lightfoot (1974) | Five Senses, The (1999) | 121 | | City of Angels (1998) | My Boss's Daughter (2003) | 122 | | Night at the Museum (2006) | City of Angels (1998) | 123 | | Eye See You (D-Tox) (2002) | Night at the Museum (2006) | 124 | | Siege, The (1998) | The Importance of Being Earnest (1952) | 125 | | The Importance of Being Earnest (1952) | Matrix Reloaded, The (2003) | 126 | | The Death of Stalin (2017) | The Death of Stalin (2017) | 127 | | Abominable Snowman, The (Abominable Snowman of the Himalayas, The) (1957) | World of Henry Orient, The (1964) | 128 | | Extract (2009) | Captains Courageous (1937) | 129 | | Emperor's New Groove, The (2000) | Wild, The (2006) | 130 | | God Bless America (2011) | Eye See You (D-Tox) (2002) | 131 | | My Boss's Daughter (2003) | Extract (2009) | 132 | | Bunny Lake Is Missing (1965) | God Bless America (2011) | 133 | +---------------------------------------------------------------------------+---------------------------------------------------------------------------+ 134 | -------------------------------------------------------------------------------- /samples/batch-output-user-personalization-20201105-161225.json: -------------------------------------------------------------------------------- 1 | {"input":{"userId":"581"},"output":{"recommendedItems":["4896","4878","5349","5989","4963","48394","5418","4034","5816","4011","2571","45499","49530","59315","27773","4886","70286","49272","3994","4226","44191","112852","5679","47","5218"],"scores":[0.0621289,0.0587985,0.0581878,0.0531788,0.0446839,0.0307161,0.0225393,0.0155925,0.01296,0.0105193,0.0098963,0.0096673,0.009374,0.0084467,0.0082911,0.0068667,0.0063763,0.0062768,0.0061772,0.0061015,0.0052818,0.0052556,0.0052257,0.0051466,0.0050899]},"error":null} 2 | {"input":{"userId":"100"},"output":{"recommendedItems":["2710","1407","2167","70","799","784","2707","2841","3499","1061","1912","724","2541","5570","2617","3005","1717","1608","1824","1994","1645","2867","1513","879","2995"],"scores":[0.117142,0.0385297,0.0374981,0.0234942,0.0191859,0.016439,0.0127669,0.0125878,0.0109665,0.0108787,0.0104291,0.0083672,0.0070175,0.0067254,0.0065102,0.0063791,0.0063669,0.006115,0.0061048,0.0058454,0.0056474,0.0056351,0.0054796,0.0054599,0.0053158]},"error":null} 3 | {"input":{"userId":"169"},"output":{"recommendedItems":["8636","8644","6378","34162","34319","34048","4447","44191","5378","52281","51662","33679","33004","1485","6373","7458","59784","4018","4963","6711","8641","4299","36529","30825","37386"],"scores":[0.0246501,0.0165074,0.0110971,0.0110423,0.008943,0.0086756,0.0081131,0.0071065,0.0070961,0.0065477,0.0064327,0.0061845,0.005839,0.0053163,0.0052002,0.0051167,0.005116,0.0049122,0.0045496,0.0045285,0.0042327,0.0042116,0.0042021,0.0041106,0.0040835]},"error":null} 4 | {"input":{"userId":"284"},"output":{"recommendedItems":["216","267","585","466","248","376","274","520","237","413","203","333","234","415","223","342","45","355","552","368","471","485","370","255","18"],"scores":[0.0551094,0.0485001,0.0473738,0.0358437,0.0322793,0.0235484,0.0235019,0.0229996,0.0206801,0.0201449,0.0160814,0.0157314,0.0127642,0.0124757,0.0122981,0.0122937,0.0121923,0.0116764,0.0115814,0.0108347,0.0102553,0.0101536,0.0099725,0.0098965,0.0098655]},"error":null} 5 | {"input":{"userId":"591"},"output":{"recommendedItems":["3408","3967","4022","3897","3755","4019","3863","3717","4246","4235","3300","4979","3753","3409","3977","3785","5014","4448","3623","3893","3174","3510","4034","5445","3317"],"scores":[0.0195638,0.013553,0.0128492,0.0118365,0.0104784,0.0103388,0.0095023,0.0087109,0.0084767,0.0080492,0.0078657,0.00744,0.0068879,0.0067478,0.0066115,0.006599,0.0058634,0.0057553,0.0056424,0.0053735,0.0052627,0.0052089,0.0051121,0.0051091,0.0050235]},"error":null} 6 | {"input":{"userId":"341"},"output":{"recommendedItems":["112138","119145","134368","6378","69122","91542","93510","136020","96610","61024","122904","33794","73017","103372","104760","157432","135536","168248","43419","79091","51255","117590","104211","132157","112171"],"scores":[0.0286397,0.0171806,0.0154889,0.0133237,0.0128076,0.0127182,0.0113086,0.0106081,0.0105153,0.0101181,0.0094932,0.0092634,0.0082863,0.0074363,0.0070212,0.0060008,0.0059092,0.0051489,0.0050666,0.0050275,0.0046337,0.0043674,0.0043472,0.0041908,0.0040162]},"error":null} 7 | {"input":{"userId":"568"},"output":{"recommendedItems":["480","780","589","208","10","231","316","457","593","2571","380","292","434","110","1","736","288","150","161","32","329","648","733","44191","253"],"scores":[0.7217169,0.0751042,0.0241044,0.0184309,0.0125812,0.0125092,0.0118536,0.0086705,0.0073041,0.007138,0.0069372,0.0060305,0.0051383,0.0048705,0.0043847,0.0043482,0.0029851,0.0029523,0.0026631,0.0021974,0.0018756,0.0016745,0.0016611,0.0015273,0.001473]},"error":null} 8 | {"input":{"userId":"553"},"output":{"recommendedItems":["4011","4878","4226","5418","5989","3949","5445","6874","79132","48516","48385","58559","3948","1732","4022","69122","51255","74458","4886","6016","5013","296","91529","4973","3994"],"scores":[0.0503968,0.0417948,0.034017,0.0260349,0.0199914,0.0169096,0.0150194,0.0110711,0.0092652,0.0087818,0.0082008,0.0081255,0.0077454,0.0074615,0.0070514,0.006884,0.0063563,0.0061857,0.0054422,0.0054238,0.0054084,0.0053913,0.0051117,0.0050482,0.00502]},"error":null} 9 | {"input":{"userId":"483"},"output":{"recommendedItems":["4896","2959","5378","4306","4963","5989","4027","6377","5816","6539","4886","4995","3751","5349","5464","3994","4370","60069","3793","4993","76093","5952","3147","41566","6502"],"scores":[0.0285529,0.0150501,0.0138957,0.0137243,0.0129447,0.0100959,0.0100526,0.009682,0.0084045,0.0079837,0.0074141,0.0073633,0.0072775,0.006708,0.0062653,0.0058351,0.0056592,0.005625,0.0056012,0.0051961,0.0050556,0.0049291,0.0046156,0.0044428,0.0043417]},"error":null} 10 | {"input":{"userId":"585"},"output":{"recommendedItems":["3949","48394","44555","55820","55765","64614","4878","6016","48516","44199","57669","68954","904","58559","44665","296","5995","912","67255","55276","111","49530","51540","608","68157"],"scores":[0.0268706,0.0196521,0.0192158,0.0183848,0.0143648,0.0115239,0.0098434,0.0094757,0.009215,0.0087311,0.0082276,0.0068899,0.0067189,0.0066692,0.0065652,0.0065611,0.0060049,0.0056952,0.0056587,0.0054535,0.0052037,0.0049488,0.004619,0.0045826,0.0045737]},"error":null} 11 | {"input":{"userId":"468"},"output":{"recommendedItems":["47","50","225","454","377","282","432","300","350","111","21","500","364","34","367","553","317","2","420","160","315","266","440","257","11"],"scores":[0.1126808,0.0880523,0.0409882,0.0348355,0.0289722,0.0288489,0.0277149,0.0271896,0.027135,0.0266083,0.0251577,0.023127,0.0194456,0.0152172,0.0146826,0.0144117,0.0139884,0.0121991,0.011844,0.0112898,0.0092279,0.0091891,0.0088014,0.0083557,0.0082395]},"error":null} 12 | {"input":{"userId":"309"},"output":{"recommendedItems":["1201","3681","904","1252","1269","930","8228","903","908","1212","924","2186","933","2947","3334","1945","906","923","48774","5008","1203","1209","3462","1287","2176"],"scores":[0.0512281,0.0363058,0.0202416,0.0189587,0.0151481,0.0134441,0.0130485,0.0129587,0.0119008,0.0110502,0.0101105,0.0099442,0.0088723,0.008828,0.0080529,0.0077842,0.0076227,0.0075857,0.0074628,0.0066134,0.0060904,0.0060411,0.0059461,0.005778,0.0056991]},"error":null} 13 | {"input":{"userId":"26"},"output":{"recommendedItems":["225","454","34","47","300","364","21","480","593","50","288","410","292","587","95","434","377","500","111","185","161","457","10","592","420"],"scores":[0.0977147,0.0953853,0.0451273,0.0343352,0.0321793,0.0283374,0.0270611,0.0267108,0.025834,0.0232239,0.0231649,0.022625,0.0198848,0.0191624,0.0181508,0.0174387,0.0154004,0.0145639,0.0131153,0.0124706,0.0120301,0.0110046,0.0104621,0.0102723,0.0099345]},"error":null} 14 | {"input":{"userId":"253"},"output":{"recommendedItems":["4878","4011","4226","66097","6016","4973","1089","73017","27904","8533","45499","1617","4034","37729","4886","111","50","7361","47","5299","3751","59369","4963","5418","4901"],"scores":[0.0497243,0.02922,0.0288504,0.0222984,0.0131344,0.0075523,0.0071964,0.0064516,0.0064469,0.0058105,0.005797,0.0057433,0.0055115,0.0052745,0.0050949,0.0050155,0.0048436,0.0046967,0.0044106,0.0043307,0.0042547,0.0040493,0.0039396,0.0036485,0.0035371]},"error":null} 15 | {"input":{"userId":"538"},"output":{"recommendedItems":["4878","6016","5218","4973","5299","4896","91658","48394","56367","5669","1136","5349","4011","68954","5418","4226","4034","60069","6218","81591","4246","4776","356","4370","5816"],"scores":[0.0268198,0.0222632,0.0200885,0.0187486,0.0145962,0.0140912,0.0104852,0.0102021,0.0102015,0.008685,0.0073297,0.006727,0.0066857,0.0063907,0.0062348,0.0060778,0.0056255,0.0056248,0.0046709,0.0045162,0.0044907,0.0040168,0.0039082,0.0038625,0.0037876]},"error":null} 16 | {"input":{"userId":"30"},"output":{"recommendedItems":["79132","68157","58559","2959","3147","44191","104841","60069","73017","54286","68954","2028","33794","8961","115617","8665","7438","2571","5418","50872","6539","6874","2692","76093","60684"],"scores":[0.0902384,0.0693564,0.0498792,0.0498278,0.0447857,0.0347141,0.0232419,0.0205047,0.0201646,0.0147725,0.0111779,0.0097098,0.0096266,0.0093393,0.0085456,0.0083458,0.0076459,0.007363,0.0073605,0.0069461,0.006756,0.005964,0.0054825,0.0053573,0.0052734]},"error":null} 17 | {"input":{"userId":"149"},"output":{"recommendedItems":["329","260","780","32","1371","1374","541","1196","318","1097","1356","2571","1375","2640","924","3702","2628","1527","1214","527","610","671","1544","1240","316"],"scores":[0.0305296,0.0259655,0.0249977,0.0248635,0.0196348,0.0189781,0.0172841,0.0148085,0.0136533,0.0130824,0.0129865,0.0124115,0.012283,0.0109009,0.0106213,0.0098377,0.0095538,0.0092795,0.009138,0.0088212,0.0081925,0.0080722,0.007826,0.007737,0.007433]},"error":null} 18 | {"input":{"userId":"64"},"output":{"recommendedItems":["2085","1198","1148","1035","1374","2987","2018","2355","2080","2396","1029","5218","3034","2059","1028","3793","541","2687","3114","1214","3751","2081","4306","783","588"],"scores":[0.0184175,0.0092569,0.0080843,0.0076192,0.0073901,0.0070156,0.0068027,0.0058272,0.0055924,0.005386,0.0053499,0.0053146,0.0048639,0.0048177,0.0047684,0.0046268,0.0046157,0.0045186,0.0044156,0.0043982,0.0042546,0.004136,0.004105,0.0039112,0.0039066]},"error":null} 19 | {"input":{"userId":"435"},"output":{"recommendedItems":["4011","4963","44191","4848","4878","6874","58559","5445","68358","48516","5349","3275","5418","5378","54286","33794","4896","3948","1089","7438","60684","6016","32587","5464","4995"],"scores":[0.0449321,0.0422275,0.0406246,0.030077,0.0255553,0.0231979,0.0216369,0.0203953,0.0182817,0.0167842,0.0149876,0.0146694,0.0141324,0.0120472,0.0120472,0.0099173,0.0094787,0.0076651,0.0066987,0.0066531,0.0063197,0.0063122,0.0062472,0.0061639,0.0061629]},"error":null} 20 | {"input":{"userId":"315"},"output":{"recommendedItems":["1304","2951","3037","2896","1201","1283","3681","599","3671","1254","5063","4329","1086","383","2921","70492","553","3806","5435","6429","6386","5440","1244","933","1333"],"scores":[0.1015206,0.0695907,0.0260297,0.0242702,0.0215795,0.0167298,0.0123452,0.0092637,0.0088304,0.0087598,0.008707,0.0083011,0.0081688,0.0077226,0.0075131,0.0062083,0.0056321,0.0052007,0.0052007,0.0052007,0.0052007,0.0052007,0.0051697,0.0047832,0.0046917]},"error":null} 21 | {"input":{"userId":"96"},"output":{"recommendedItems":["2115","260","1210","1587","1101","1375","2406","1275","1374","2140","1198","1196","2013","2161","44","2193","1370","2105","2950","2872","2640","5040","2100","1371","53453"],"scores":[0.0478615,0.0418998,0.0383442,0.0250039,0.0244241,0.0217618,0.0208511,0.0113497,0.010738,0.0105476,0.0105053,0.0093689,0.0093385,0.0076352,0.0068941,0.0068727,0.0067106,0.0063907,0.00614,0.0061092,0.006082,0.0059711,0.0058182,0.00559,0.0054288]},"error":null} 22 | {"input":{"userId":"573"},"output":{"recommendedItems":["58559","68954","48516","91529","6016","68358","296","74458","79132","4878","111","50","48394","57669","70286","54286","44555","68157","49530","60069","4993","89745","527","49272","4995"],"scores":[0.0655734,0.0491858,0.0381624,0.0197283,0.0171885,0.0153444,0.0149596,0.0138855,0.0128845,0.0107331,0.0104163,0.0091467,0.0074125,0.0071001,0.0070572,0.0068366,0.0066516,0.006245,0.0061577,0.0061071,0.0058709,0.005779,0.0056699,0.0055028,0.0054809]},"error":null} 23 | {"input":{"userId":"385"},"output":{"recommendedItems":["750","1304","1256","969","2067","2941","5060","2944","1183","920","1269","1270","2529","898","1333","1944","951","1288","4194","1247","1084","356","1272","2300","1250"],"scores":[0.0242521,0.0163306,0.0163039,0.0141132,0.0137699,0.0112542,0.0104947,0.0103355,0.0099304,0.0082243,0.006014,0.0056278,0.0055555,0.0054387,0.0053023,0.0049417,0.0047843,0.0046175,0.0043875,0.0043104,0.0042405,0.0041928,0.0041187,0.0038865,0.0038841]},"error":null} 24 | {"input":{"userId":"517"},"output":{"recommendedItems":["4246","5991","5377","4973","5299","4018","5620","5957","4975","4447","3481","5902","4979","4308","3536","3825","4896","4700","4741","4995","5380","5464","4014","6218","4025"],"scores":[0.0527657,0.0203406,0.0196476,0.017904,0.0171986,0.0127162,0.0120782,0.009924,0.0094453,0.0080544,0.0079351,0.0076496,0.0075228,0.0071446,0.0065657,0.0063946,0.0058597,0.0056563,0.0054942,0.0048969,0.0047457,0.0046919,0.0046651,0.0045946,0.0045147]},"error":null} 25 | {"input":{"userId":"40"},"output":{"recommendedItems":["371","355","368","508","60","5","52","234","158","362","497","529","36","14","2","62","376","175","5591","216","337","223","333","26","274"],"scores":[0.0099092,0.0098064,0.0092078,0.0091907,0.0091898,0.0086167,0.0083328,0.0081657,0.0078168,0.0078087,0.0071917,0.0070271,0.0069611,0.0069384,0.0068987,0.0067092,0.0056016,0.0054844,0.0054576,0.0053828,0.0052657,0.0050163,0.004729,0.0046964,0.0046805]},"error":null} 26 | {"input":{"userId":"166"},"output":{"recommendedItems":["50","163","6","1377","6378","2002","5418","1089","32","377","4262","316","353","288","356","527","47","293","3256","370","480","589","173","3275","5445"],"scores":[0.0154854,0.0145696,0.0145563,0.0124674,0.0123927,0.0111927,0.0109328,0.0104496,0.0097558,0.009453,0.0093379,0.0089313,0.0086336,0.0085004,0.0080951,0.0076476,0.0076474,0.0071968,0.0064866,0.0060041,0.0058502,0.0058484,0.0058341,0.0055125,0.0053205]},"error":null} 27 | {"input":{"userId":"503"},"output":{"recommendedItems":["97921","1884","105504","91077","92681","104069","97938","96588","86911","3174","102445","122246","92535","91535","89864","106782","1784","103449","79592","7323","1060","2395","3160","223","3255"],"scores":[0.0121988,0.0065189,0.0055495,0.0055493,0.004887,0.0037191,0.0034602,0.0034247,0.0032912,0.0031459,0.0029315,0.0028618,0.0027815,0.0025955,0.002581,0.0025662,0.0025044,0.0024832,0.0024175,0.0024107,0.0023987,0.0023969,0.0023789,0.0023456,0.0023398]},"error":null} 28 | {"input":{"userId":"230"},"output":{"recommendedItems":["33679","49278","62374","52973","8361","68319","51935","68791","8371","57368","45499","71254","1676","1552","6564","49272","6059","71530","8644","1917","5349","34048","2393","51412","60126"],"scores":[0.0185381,0.015887,0.0105381,0.0102377,0.0099478,0.0093756,0.0076259,0.0074869,0.0069348,0.0066517,0.0064535,0.0061603,0.0059628,0.0058541,0.0056874,0.0056462,0.0056124,0.0055681,0.0053646,0.0052605,0.0051296,0.0050143,0.0049457,0.0049074,0.004799]},"error":null} 29 | {"input":{"userId":"144"},"output":{"recommendedItems":["552","1380","168","186","1320","370","1396","48","466","357","236","11","316","117630","237","500","317","440","2406","224","1035","2424","3996","252","351"],"scores":[0.0542596,0.0240733,0.020541,0.0168852,0.014379,0.0123898,0.0113359,0.0105451,0.0098715,0.0082395,0.0081883,0.0068692,0.0068344,0.0066853,0.006393,0.0063269,0.0061214,0.0059419,0.0058133,0.0056774,0.0052448,0.005157,0.0049868,0.0048815,0.0045213]},"error":null} 30 | {"input":{"userId":"19"},"output":{"recommendedItems":["1092","1343","1269","3386","1086","164","492","47","1089","350","913","2267","1617","906","608","904","2076","1625","3044","2184","368","3706","7636","3219","3204"],"scores":[0.02414,0.0164441,0.0160881,0.0153085,0.0129925,0.0085969,0.0084639,0.0069026,0.0064191,0.006203,0.0052154,0.0051725,0.0048997,0.0048557,0.0048378,0.0046523,0.0043535,0.0042711,0.0040689,0.0040057,0.0039793,0.003914,0.0038118,0.0035494,0.0034896]},"error":null} 31 | {"input":{"userId":"25"},"output":{"recommendedItems":["104841","187593","68358","110102","89745","44191","111759","164179","168252","84152","71535","72998","58559","122904","68157","52281","48780","107406","102125","60684","56174","122892","94864","70286","77561"],"scores":[0.0664622,0.0289246,0.0256196,0.0208262,0.0188816,0.0184546,0.016916,0.0155953,0.0148613,0.0122527,0.0119712,0.0112196,0.0091168,0.0086883,0.0084256,0.0082118,0.0079393,0.0068147,0.0065589,0.0065289,0.0062812,0.0061878,0.0059232,0.0056992,0.0056773]},"error":null} 32 | {"input":{"userId":"543"},"output":{"recommendedItems":["4018","5299","4246","88163","45720","72998","58047","64969","46976","3753","106782","3825","4979","6942","66203","2671","61024","94959","5010","4823","91500","4447","5218","73017","4025"],"scores":[0.0629432,0.0285126,0.0221821,0.0206382,0.0162807,0.0137683,0.0124314,0.0109152,0.0103538,0.0096967,0.0095572,0.0091924,0.0072786,0.0072556,0.0069725,0.0062886,0.0057848,0.0056427,0.0055512,0.0052769,0.0048257,0.0047645,0.0047072,0.0045318,0.0045312]},"error":null} 33 | {"input":{"userId":"398"},"output":{"recommendedItems":["5291","923","8228","1086","4969","904","6870","942","913","1252","1617","1284","933","8778","1945","1084","910","3730","3435","1950","147326","903","2940","1089","2726"],"scores":[0.509944,0.0986665,0.0607842,0.0262642,0.0247311,0.0138029,0.011854,0.0097607,0.0093217,0.0082619,0.0072668,0.0066991,0.0064857,0.0061744,0.0058325,0.0057605,0.0055451,0.0043739,0.0040327,0.0039639,0.0038888,0.0035625,0.0035053,0.0034563,0.0031535]},"error":null} 34 | {"input":{"userId":"102"},"output":{"recommendedItems":["168","204","252","552","353","440","186","509","11","222","350","236","648","474","442","282","48","376","39","2","315","227","95","170","151"],"scores":[0.0440616,0.0283662,0.0277661,0.0271209,0.0269337,0.0247563,0.0218562,0.0204561,0.0194265,0.0172896,0.0169343,0.0150702,0.0139205,0.0138818,0.0137919,0.0124786,0.0123008,0.0119804,0.0117312,0.0114487,0.0114102,0.0103685,0.0095871,0.0094196,0.0091788]},"error":null} 35 | {"input":{"userId":"451"},"output":{"recommendedItems":["593","457","165","480","153","10","318","344","380","21","592","185","474","316","231","349","434","780","296","110","161","410","288","208","339"],"scores":[0.2938164,0.1447638,0.0647966,0.0361779,0.0252077,0.0193079,0.0170455,0.0156523,0.0143126,0.0137404,0.0122857,0.0111891,0.0095723,0.0090462,0.0078551,0.0072625,0.0071867,0.0070856,0.0069276,0.0064891,0.006077,0.0058592,0.0052311,0.00506,0.0047361]},"error":null} 36 | {"input":{"userId":"24"},"output":{"recommendedItems":["4018","134393","5299","5620","7293","2671","134528","114762","49286","2144","188751","5957","129354","69757","58998","132660","110771","164909","56949","34162","66203","122904","64969","31685","5943"],"scores":[0.0213086,0.0177787,0.0173636,0.0146823,0.0120209,0.0094337,0.0081524,0.0080131,0.0072673,0.0070235,0.0069477,0.006647,0.0065414,0.0058799,0.0058793,0.0058504,0.0054856,0.0051858,0.0049416,0.0048753,0.0048517,0.0047964,0.0047533,0.004523,0.0042435]},"error":null} 37 | {"input":{"userId":"323"},"output":{"recommendedItems":["108190","122916","166203","117529","111659","122912","122882","179511","122906","135133","122918","122900","187595","134853","110102","122922","189333","116823","122892","166635","139385","136864","112852","122924","122898"],"scores":[0.0564503,0.0251164,0.0236777,0.0228899,0.0217216,0.0200702,0.0169712,0.0152561,0.0126764,0.0124939,0.0123203,0.0115665,0.0112798,0.0106284,0.0091842,0.0091081,0.0091079,0.0090582,0.0083504,0.0079742,0.0073226,0.0071405,0.0070131,0.0068632,0.0068301]},"error":null} 38 | {"input":{"userId":"570"},"output":{"recommendedItems":["4148","3623","70","5418","3753","6502","3555","5502","4011","2167","3948","3826","3354","5445","5266","5219","5679","4027","3300","3793","3977","3863","2683","4020","5378"],"scores":[0.0517039,0.0333348,0.0201228,0.0174248,0.0161105,0.0161066,0.0123206,0.0117973,0.0111951,0.0106602,0.0100001,0.0087609,0.0084675,0.0079653,0.0079472,0.0073482,0.0072489,0.0070004,0.0069839,0.0069816,0.0069595,0.006867,0.0065383,0.0063368,0.006334]},"error":null} 39 | {"input":{"userId":"344"},"output":{"recommendedItems":["2571","6539","89745","648","81834","2959","367","527","1197","1036","1270","116797","597","106782","608","2329","141","750","79132","480","8368","4993","78499","112852","3147"],"scores":[0.0231776,0.0177129,0.0172066,0.0158307,0.0149848,0.0148012,0.0121112,0.0111953,0.0103074,0.0098553,0.0094629,0.009208,0.0090332,0.0088479,0.008459,0.0083499,0.0080709,0.0078428,0.0067733,0.0066655,0.0065864,0.0064363,0.0062212,0.0059895,0.00594]},"error":null} 40 | {"input":{"userId":"366"},"output":{"recommendedItems":["48774","68157","59315","32587","68358","33794","70286","36529","44191","60069","59369","48516","49530","54286","49272","5418","7458","4011","6333","6874","58559","57669","51662","2959","2028"],"scores":[0.0360572,0.0235416,0.0214434,0.0169152,0.0166423,0.0151547,0.0140584,0.0128554,0.0108996,0.0108534,0.0099229,0.0092531,0.009238,0.0092054,0.009166,0.0089301,0.0086126,0.0084166,0.0079741,0.0077455,0.0076554,0.0072674,0.0072006,0.0059479,0.0058508]},"error":null} 41 | {"input":{"userId":"352"},"output":{"recommendedItems":["4011","2947","6874","1994","4848","4878","3741","105504","8665","2542","7438","4963","2353","5903","5418","74458","1089","52722","1288","44191","1748","6979","6016","96079","70"],"scores":[0.0271653,0.0149266,0.0117608,0.011516,0.0109097,0.0105346,0.0099099,0.0077988,0.007374,0.0071095,0.0069628,0.0068869,0.0066321,0.0066018,0.0065876,0.0058665,0.0055583,0.0052065,0.0050686,0.0049948,0.0049246,0.0048641,0.0045016,0.0043363,0.0042786]},"error":null} 42 | {"input":{"userId":"132"},"output":{"recommendedItems":["1721","1393","1784","3556","2858","1059","2396","1704","4995","1680","1639","2324","912","2706","2125","2393","2340","3155","1046","1923","3996","892","27020","2671","1357"],"scores":[0.3220486,0.1004467,0.0588608,0.046384,0.039888,0.0359028,0.0307454,0.0269926,0.0193971,0.0148583,0.0124106,0.0076403,0.0072402,0.0069479,0.006636,0.0063672,0.0056362,0.0054214,0.0050948,0.0050508,0.004431,0.0042461,0.0042414,0.0041254,0.0039579]},"error":null} 43 | {"input":{"userId":"47"},"output":{"recommendedItems":["2291","4027","4896","296","5816","4995","2858","597","4306","4973","4975","587","5618","4129","5991","4011","5218","1704","1197","4963","5902","2987","1088","5672","1249"],"scores":[0.0140541,0.0070801,0.0065293,0.0065135,0.0062904,0.0052778,0.0052358,0.0050717,0.004169,0.0039272,0.0036575,0.0035578,0.0032862,0.0032128,0.0032092,0.0032042,0.0031952,0.0031714,0.0029586,0.0027499,0.0026576,0.0025394,0.0025236,0.0024062,0.0023858]},"error":null} 44 | {"input":{"userId":"117"},"output":{"recommendedItems":["719","656","762","9","743","837","852","840","880","65","747","1429","785","1359","801","1405","135","2580","810","637","2805","813","1367","1474","788"],"scores":[0.0379432,0.0201545,0.0166905,0.0166553,0.0164786,0.0159115,0.0139415,0.0122356,0.0120233,0.0115417,0.0103378,0.010292,0.0101293,0.0099927,0.0094862,0.0087729,0.0085283,0.007931,0.0075613,0.0073087,0.0069525,0.0067917,0.0065263,0.006269,0.0062279]},"error":null} 45 | {"input":{"userId":"53"},"output":{"recommendedItems":["357","552","7","141","1035","648","224","25","344","5","474","223","1380","1210","597","260","58","186","376","39","3","252","534","215","351"],"scores":[0.0175022,0.0114843,0.0097758,0.0091058,0.0089101,0.0085356,0.0081593,0.0081073,0.0079438,0.0078245,0.0075212,0.0064742,0.0061659,0.0060253,0.0060047,0.0056731,0.0054474,0.0052169,0.0051697,0.0050394,0.004942,0.0046025,0.0044629,0.004275,0.004026]},"error":null} 46 | {"input":{"userId":"77"},"output":{"recommendedItems":["54286","44191","58559","49272","4963","68358","48774","73017","5418","59369","60684","5349","48516","5378","3275","51662","52722","5445","56174","53996","51935","68954","96079","6016","4901"],"scores":[0.1023698,0.0527243,0.0430887,0.0368434,0.0346652,0.0232737,0.0215376,0.0152206,0.0135665,0.0133869,0.0125165,0.0106323,0.0097276,0.0084167,0.0079964,0.0076001,0.0073821,0.0070223,0.0062836,0.0059488,0.0056911,0.0056434,0.0055897,0.0055404,0.0054685]},"error":null} 47 | {"input":{"userId":"560"},"output":{"recommendedItems":["80831","90866","86882","47610","95441","73017","73268","64957","4720","71535","94959","85414","104374","88810","79592","86781","79702","88163","83134","89492","76293","97921","88125","86911","67255"],"scores":[0.0280555,0.0107082,0.0101454,0.009941,0.009001,0.0081444,0.0057733,0.005706,0.0055998,0.0055197,0.0053424,0.0052356,0.005161,0.0045819,0.0044712,0.0044334,0.0042587,0.0039989,0.003925,0.0038901,0.0037759,0.0036828,0.0036592,0.0036288,0.0034079]},"error":null} 48 | {"input":{"userId":"511"},"output":{"recommendedItems":["122882","109374","152077","115149","112556","134853","71535","111781","142488","91542","91658","117529","179401","117887","47997","73017","85414","77561","159093","116897","97304","141994","67255","135518","84152"],"scores":[0.0147664,0.0139205,0.0137811,0.0111962,0.0097574,0.0092591,0.0075819,0.0072259,0.0068373,0.0067822,0.0063545,0.0061467,0.0059113,0.0058777,0.0058626,0.0056454,0.0049635,0.0049536,0.0049325,0.004751,0.0046965,0.0045125,0.004452,0.0044152,0.0043459]},"error":null} 49 | {"input":{"userId":"265"},"output":{"recommendedItems":["2770","3300","3863","3408","3948","3753","3977","70","5502","4979","4011","3301","3555","3174","3785","1923","3911","3752","2539","3273","3717","5445","5378","2167","3624"],"scores":[0.0135324,0.0100145,0.0097545,0.0090771,0.0065004,0.0063732,0.0063414,0.0063304,0.005946,0.0058793,0.0055793,0.0055605,0.0052623,0.0051876,0.0048135,0.0047036,0.0046963,0.0045142,0.0044237,0.0044195,0.0044182,0.0044024,0.0043538,0.0042367,0.0037981]},"error":null} 50 | {"input":{"userId":"550"},"output":{"recommendedItems":["116797","115617","60069","112852","59315","68954","122912","111759","108190","122900","122918","48774","111362","139385","6333","152081","68157","68319","70286","122922","58559","122892","6539","122882","122916"],"scores":[0.0826676,0.0359247,0.0338864,0.0239191,0.0177551,0.014326,0.0143198,0.0123812,0.0109914,0.0094131,0.0093776,0.0092853,0.0090124,0.0086091,0.0085317,0.0077138,0.0077123,0.0068181,0.006406,0.0062001,0.0057236,0.0055722,0.0054799,0.0054546,0.0053477]},"error":null} 51 | -------------------------------------------------------------------------------- /samples/batch-output-personalized-ranking-20201106-044648.json: -------------------------------------------------------------------------------- 1 | {"input":{"userId":"308","itemList":["163645","1116","50872","98083","98160","3837","99846","8934","175707","133377","3614","122260","304","27368","6422","69304","1204","89343","169034","72998"]},"output":{"recommendedItems":["50872","27368","72998","3614","169034","304","175707","133377","1116","3837","163645","1204","98083","98160","99846","8934","122260","6422","69304","89343"],"scores":[0.8177364,0.1363394,0.0120753,0.0113619,0.0077758,0.0042688,0.0030489,0.0024201,0.0018393,0.0017594,0.0011547,2.198E-4,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]},"error":null} 2 | {"input":{"userId":"131","itemList":["48516","5609","959","2210","5134","8015","1265","3148","67295","8720","1188","4297","2041","90945","7377","4130","5049","1244","4801","141818"]},"output":{"recommendedItems":["1265","48516","1188","3148","5049","1244","67295","2041","8720","5134","4130","141818","8015","2210","5609","959","4297","90945","7377","4801"],"scores":[0.8417906,0.060153,0.0381597,0.019443,0.0158687,0.0137544,0.0047274,0.0014586,0.0011247,9.445E-4,8.494E-4,8.471E-4,7.991E-4,8.0E-5,0.0,0.0,0.0,0.0,0.0,0.0]},"error":null} 3 | {"input":{"userId":"400","itemList":["459","8427","179813","413","80862","7786","3707","44193","3028","4231","151781","46322","290","609","291","115122","735","4671","326","145080"]},"output":{"recommendedItems":["80862","413","4231","44193","46322","8427","735","3707","290","179813","115122","145080","609","291","459","7786","3028","151781","4671","326"],"scores":[0.4171876,0.134688,0.1289307,0.0731612,0.0436301,0.0402182,0.0352308,0.0344613,0.0247049,0.0193172,0.0123604,0.0098738,0.0095351,0.0090958,0.0076049,0.0,0.0,0.0,0.0,0.0]},"error":null} 4 | {"input":{"userId":"332","itemList":["7439","160440","171759","6212","158528","85179","316","125970","64285","44972","3017","1502","6","3130","86190","81932","58376","7938","103372","3596"]},"output":{"recommendedItems":["6","3017","3130","1502","6212","44972","7439","64285","316","81932","160440","86190","103372","85179","158528","171759","125970","58376","7938","3596"],"scores":[0.4827588,0.2834286,0.0588292,0.0419968,0.028729,0.0213224,0.0159091,0.0152202,0.0129262,0.0112711,0.0070823,0.0060601,0.0058374,0.0045687,0.0040601,0.0,0.0,0.0,0.0,0.0]},"error":null} 5 | {"input":{"userId":"176","itemList":["207","182823","2896","3977","52950","3674","5040","122888","54276","1603","128087","828","390","60037","1610","144714","168418","5255","83086","118700"]},"output":{"recommendedItems":["207","1610","3977","828","5040","390","3674","1603","60037","128087","168418","2896","182823","54276","118700","144714","52950","122888","5255","83086"],"scores":[0.9415796,0.037956,0.0080617,0.0030352,0.0027947,0.0017872,0.0015158,9.1E-4,6.505E-4,5.917E-4,3.19E-4,2.389E-4,1.736E-4,1.641E-4,1.138E-4,1.081E-4,0.0,0.0,0.0,0.0]},"error":null} 6 | {"input":{"userId":"538","itemList":["27815","7085","50804","70334","5459","4840","66171","7261","81831","2501","1216","33639","141799","165075","83349","4388","27255","153236","4495","2142"]},"output":{"recommendedItems":["1216","2142","5459","27815","2501","4388","27255","7261","66171","81831","83349","70334","153236","165075","7085","50804","4840","33639","141799","4495"],"scores":[0.4420654,0.2523768,0.1038156,0.0452996,0.0433858,0.0354864,0.0262689,0.0254896,0.0065424,0.0050703,0.0050388,0.0046632,0.0031914,0.0013058,0.0,0.0,0.0,0.0,0.0,0.0]},"error":null} 7 | {"input":{"userId":"206","itemList":["1459","65135","3652","89840","487","5489","33132","102084","25","4823","75416","175431","4156","44694","6059","27692","140956","86628","8057","39"]},"output":{"recommendedItems":["25","4823","1459","39","487","3652","6059","75416","175431","140956","27692","86628","44694","65135","89840","5489","33132","102084","4156","8057"],"scores":[0.6182669,0.1826702,0.1052558,0.058537,0.0107972,0.0097683,0.0041713,0.002931,0.0027139,0.002076,0.0016317,8.378E-4,3.428E-4,0.0,0.0,0.0,0.0,0.0,0.0,0.0]},"error":null} 8 | {"input":{"userId":"65","itemList":["5033","7155","72167","5448","81847","68848","41617","3431","2975","27644","102445","4064","8916","54354","1283","106144","65126","55577","91325","7085"]},"output":{"recommendedItems":["81847","7155","102445","68848","8916","91325","55577","65126","2975","5448","3431","1283","5033","72167","41617","27644","4064","54354","106144","7085"],"scores":[0.6435823,0.1556482,0.1009494,0.0217721,0.0208064,0.0207491,0.0126705,0.0112632,0.0055511,0.0049301,0.00128,7.973E-4,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]},"error":null} 9 | {"input":{"userId":"140","itemList":["3536","112727","3107","102084","2320","8656","125970","8969","31123","60289","5390","990","4426","3129","650","54503","2078","90245","1236","3"]},"output":{"recommendedItems":["54503","8969","990","3107","650","31123","3129","3536","2320","3","4426","2078","112727","102084","8656","125970","60289","5390","90245","1236"],"scores":[0.6222042,0.2052408,0.0420158,0.0273702,0.0210582,0.0189628,0.017475,0.0168274,0.0150692,0.009188,0.0024957,0.0020926,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]},"error":null} 10 | {"input":{"userId":"171","itemList":["7045","56941","7141","8743","190221","3692","85354","58559","4189","141749","4973","5847","58655","27846","84246","3401","3153","1290","302","60538"]},"output":{"recommendedItems":["1290","302","4973","3401","7045","8743","5847","56941","27846","58559","58655","3153","84246","85354","141749","7141","190221","3692","4189","60538"],"scores":[0.5487034,0.1208654,0.080989,0.0584355,0.0390844,0.0389687,0.0367317,0.0170952,0.0169982,0.010906,0.0106093,0.0076956,0.0068794,0.0044529,0.0015852,0.0,0.0,0.0,0.0,0.0]},"error":null} 11 | {"input":{"userId":"119","itemList":["55290","56156","1262","83369","102747","34048","1306","182293","2106","61246","130482","45720","3709","1255","96945","3534","6031","3763","2725","68872"]},"output":{"recommendedItems":["45720","34048","3534","56156","55290","96945","1262","61246","1255","1306","2106","83369","68872","3763","130482","102747","182293","3709","6031","2725"],"scores":[0.7601746,0.0708229,0.0448834,0.044113,0.0311825,0.0134827,0.0076045,0.0071665,0.0051308,0.0050962,0.0044833,0.003588,0.0012104,5.74E-4,4.666E-4,2.06E-5,0.0,0.0,0.0,0.0]},"error":null} 12 | {"input":{"userId":"210","itemList":["8965","801","122246","6808","69516","5874","7444","1438","2581","31038","62836","46367","95761","1277","39414","32160","5040","47491","1566","148626"]},"output":{"recommendedItems":["148626","8965","7444","1566","39414","62836","46367","5040","1438","47491","1277","6808","31038","2581","801","122246","69516","5874","95761","32160"],"scores":[0.4915647,0.2945834,0.0796428,0.0404815,0.0301128,0.0191206,0.0109734,0.0071319,0.0064989,0.0044447,0.0043162,0.0036418,0.0034103,0.0021404,0.0019366,0.0,0.0,0.0,0.0,0.0]},"error":null} 13 | {"input":{"userId":"455","itemList":["65230","301","2275","84273","2118","96007","71129","1095","6552","114847","1474","169984","148172","4876","110826","2889","1954","31086","37211","5497"]},"output":{"recommendedItems":["1095","65230","6552","2118","2889","2275","96007","1474","4876","1954","169984","148172","301","84273","71129","114847","110826","31086","37211","5497"],"scores":[0.8623133,0.0456794,0.0303076,0.0179341,0.0101163,0.0088659,0.0081311,0.0061006,0.0054601,0.0047303,2.418E-4,1.198E-4,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]},"error":null} 14 | {"input":{"userId":"202","itemList":["54001","691","1206","2372","40581","407","58154","2019","4771","92192","3420","96121","1244","7730","2546","6386","52885","42738","107069","74647"]},"output":{"recommendedItems":["1244","1206","2019","691","407","7730","2372","52885","2546","40581","92192","54001","42738","107069","58154","4771","3420","96121","6386","74647"],"scores":[0.8618985,0.0592785,0.0320021,0.0135956,0.010203,0.009671,0.0080457,0.0013413,0.0012293,9.401E-4,5.479E-4,5.144E-4,4.892E-4,1.795E-4,6.4E-5,0.0,0.0,0.0,0.0,0.0]},"error":null} 15 | {"input":{"userId":"442","itemList":["3683","8795","3196","6816","82459","51884","2944","4958","8196","4260","153070","6887","59103","1437","93022","146684","117192","5633","4743","46322"]},"output":{"recommendedItems":["4958","4743","4260","6887","59103","46322","8196","51884","93022","3683","82459","146684","3196","117192","2944","8795","6816","153070","1437","5633"],"scores":[0.5472267,0.1103567,0.0750221,0.064268,0.0443796,0.0369673,0.027339,0.0265693,0.017137,0.0167925,0.0102566,0.0076269,0.0075098,0.0053324,0.0032161,0.0,0.0,0.0,0.0,0.0]},"error":null} 16 | {"input":{"userId":"319","itemList":["2096","2702","1092","117922","351","965","8799","128594","4180","4572","49272","1094","1862","5081","1875","118696","2852","93610","101577","3515"]},"output":{"recommendedItems":["118696","49272","101577","3515","5081","4180","4572","1862","1875","351","2702","1094","2096","1092","965","117922","8799","128594","2852","93610"],"scores":[0.6209535,0.2181029,0.0905355,0.0177687,0.016809,0.0116666,0.0057405,0.0049445,0.0046722,0.0025524,0.0022904,0.0020995,8.873E-4,6.522E-4,3.248E-4,0.0,0.0,0.0,0.0,0.0]},"error":null} 17 | {"input":{"userId":"596","itemList":["167772","6234","81834","6484","5706","94130","899","2467","76143","32116","26974","143472","82095","82848","1623","58839","6951","107997","3838","27176"]},"output":{"recommendedItems":["94130","81834","26974","2467","6951","6234","1623","107997","6484","58839","899","82848","167772","5706","76143","32116","143472","82095","3838","27176"],"scores":[0.1688455,0.1419675,0.1242783,0.1190595,0.0916207,0.0821063,0.0816449,0.0727005,0.06503,0.0272476,0.0233893,0.0021099,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]},"error":null} 18 | {"input":{"userId":"10","itemList":["4808","93326","54281","77","27306","3401","4267","74154","82767","94867","165343","2476","8024","2338","2572","74948","6696","105731","129514","4085"]},"output":{"recommendedItems":["8024","2338","4808","2572","3401","93326","74154","2476","82767","74948","4085","129514","54281","105731","165343","77","27306","4267","94867","6696"],"scores":[0.4290134,0.0960331,0.0915759,0.0735543,0.0545446,0.0363866,0.034289,0.0333876,0.0291725,0.0285304,0.0261584,0.020087,0.0197889,0.0171207,0.0103577,0.0,0.0,0.0,0.0,0.0]},"error":null} 19 | {"input":{"userId":"314","itemList":["105121","157200","68597","26741","48412","4433","57368","4792","104374","135787","3037","176413","4713","316","60766","81791","78620","59429","55247","58975"]},"output":{"recommendedItems":["316","3037","4792","4713","48412","78620","57368","104374","60766","4433","176413","157200","55247","105121","68597","26741","135787","81791","59429","58975"],"scores":[0.8771964,0.051812,0.0143183,0.0138939,0.0120451,0.0079921,0.0074506,0.0065622,0.0035438,0.0028455,0.0011708,7.849E-4,3.846E-4,0.0,0.0,0.0,0.0,0.0,0.0,0.0]},"error":null} 20 | {"input":{"userId":"486","itemList":["82095","4354","159415","3565","3454","5965","120827","169912","7171","6461","71520","71640","7789","58295","1912","955","3446","103384","8690","4942"]},"output":{"recommendedItems":["5965","103384","3446","1912","8690","58295","71520","4942","6461","159415","3565","955","82095","4354","3454","120827","169912","7171","71640","7789"],"scores":[0.3502961,0.2182249,0.1462435,0.1366095,0.0628993,0.054611,0.013554,0.0068149,0.0056927,0.0034333,0.0013712,2.498E-4,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]},"error":null} 21 | {"input":{"userId":"557","itemList":["8491","121342","103085","1345","26567","148978","835","3943","586","5456","134326","2022","2056","122906","1569","105213","1947","7493","1678","2472"]},"output":{"recommendedItems":["586","1569","105213","122906","1678","3943","1345","148978","134326","5456","835","2472","2022","1947","8491","121342","103085","26567","2056","7493"],"scores":[0.9511259,0.0248147,0.0061723,0.0032592,0.0030532,0.0027715,0.0023171,0.0019799,0.0010941,9.889E-4,9.368E-4,8.292E-4,4.058E-4,1.833E-4,6.8E-5,0.0,0.0,0.0,0.0,0.0]},"error":null} 22 | {"input":{"userId":"44","itemList":["3810","110297","45208","1794","67534","2119","3634","2949","4175","71438","119964","661","165671","144222","2011","1621","135534","31038","3909","2828"]},"output":{"recommendedItems":["661","2011","1621","2828","2949","3810","31038","45208","3634","67534","144222","165671","110297","1794","2119","4175","71438","119964","135534","3909"],"scores":[0.8819568,0.0711497,0.0217283,0.0121978,0.003922,0.0031521,0.0021661,0.0015272,0.0013583,4.338E-4,2.27E-4,1.81E-4,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]},"error":null} 23 | {"input":{"userId":"283","itemList":["146656","70565","54116","115680","60161","6162","46855","1936","7987","69436","5755","800","184253","90403","1230","4673","117867","5613","79333","3130"]},"output":{"recommendedItems":["1230","800","7987","3130","5613","46855","70565","60161","1936","54116","90403","117867","69436","146656","184253","115680","6162","5755","4673","79333"],"scores":[0.8711581,0.0466546,0.0218459,0.0208044,0.0154533,0.0120008,0.005652,0.0018994,0.0010664,0.0010146,7.498E-4,7.206E-4,6.829E-4,2.144E-4,8.28E-5,0.0,0.0,0.0,0.0,0.0]},"error":null} 24 | {"input":{"userId":"467","itemList":["973","27708","126921","92243","1306","91079","42943","6803","136556","87483","4929","88108","253","7010","90057","161634","107447","101360","135532","8875"]},"output":{"recommendedItems":["253","42943","1306","136556","92243","135532","87483","161634","126921","973","27708","91079","6803","4929","88108","7010","90057","107447","101360","8875"],"scores":[0.4364118,0.2229693,0.1952752,0.0467327,0.0255579,0.0253237,0.018881,0.0116586,0.0106097,0.0065801,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]},"error":null} 25 | {"input":{"userId":"134","itemList":["160341","69122","78209","4200","30892","3324","96430","6","4437","2740","350","4608","7386","2467","143031","4900","4917","665","66511","77201"]},"output":{"recommendedItems":["6","350","69122","4900","4608","2467","4917","96430","66511","4437","7386","78209","160341","4200","30892","3324","2740","143031","665","77201"],"scores":[0.6825016,0.313507,0.0022963,3.641E-4,3.482E-4,3.258E-4,3.115E-4,1.397E-4,8.95E-5,8.9E-5,2.08E-5,6.5E-6,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]},"error":null} 26 | {"input":{"userId":"53","itemList":["2377","4782","36477","91325","107013","4721","412","92674","2800","77233","920","97870","101973","426","31150","1517","121338","1551","116941","84392"]},"output":{"recommendedItems":["1517","426","412","116941","91325","920","1551","2377","84392","101973","4782","36477","107013","4721","92674","2800","77233","97870","31150","121338"],"scores":[0.740988,0.1262015,0.0761134,0.0141171,0.0124174,0.0110523,0.0090377,0.0054084,0.0036888,9.753E-4,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]},"error":null} 27 | {"input":{"userId":"491","itemList":["5345","255","748","6989","74095","4740","8614","6271","1907","54503","69951","96815","141836","6244","1794","72479","6330","142366","172875","158842"]},"output":{"recommendedItems":["69951","54503","8614","1907","255","6244","6989","172875","6330","158842","748","5345","74095","4740","6271","96815","141836","1794","72479","142366"],"scores":[0.3886177,0.3460466,0.0880851,0.0465158,0.0403774,0.0378045,0.0161474,0.0127601,0.0125294,0.0096832,0.0014331,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]},"error":null} 28 | {"input":{"userId":"329","itemList":["51314","143410","1352","2450","62208","2060","3048","4325","131749","308","4734","87222","26612","109723","162082","142424","65135","1127","4822","47124"]},"output":{"recommendedItems":["1127","308","2450","1352","2060","51314","47124","4734","142424","143410","162082","87222","62208","3048","4325","131749","26612","109723","65135","4822"],"scores":[0.6395802,0.1681904,0.1365535,0.0221927,0.0105392,0.0071018,0.0063196,0.0049494,0.0023688,0.0017193,3.029E-4,1.822E-4,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]},"error":null} 29 | {"input":{"userId":"79","itemList":["72294","534","1552","175585","78088","91666","55253","66783","49649","95167","3000","65193","3082","6751","6679","175781","143969","7223","78174","43679"]},"output":{"recommendedItems":["1552","3082","534","3000","43679","175781","49649","6751","66783","55253","72294","78088","175585","143969","95167","91666","65193","6679","7223","78174"],"scores":[0.4571525,0.2603,0.135722,0.0271125,0.0191861,0.0174237,0.0166508,0.0163058,0.0151512,0.0141339,0.010049,0.0062482,0.0022218,0.0019115,4.31E-4,0.0,0.0,0.0,0.0,0.0]},"error":null} 30 | {"input":{"userId":"500","itemList":["71264","4420","1626","4864","138610","1805","25905","5256","7301","3942","96608","5544","5051","8879","2001","1893","180297","74868","91535","8771"]},"output":{"recommendedItems":["8879","2001","1893","3942","71264","25905","5544","96608","4420","5051","1805","1626","74868","91535","180297","4864","138610","5256","7301","8771"],"scores":[0.2481349,0.1849895,0.1691225,0.0871518,0.0832401,0.0730895,0.0723323,0.0256248,0.0219263,0.0135421,0.0097104,0.0080538,0.0029315,1.104E-4,4.05E-5,0.0,0.0,0.0,0.0,0.0]},"error":null} 31 | {"input":{"userId":"0","itemList":["163134","6464","141820","52","130976","106642","26150","4083","82095","5304","6313","6217","4803","4516","3115","1994","184253","5888","4231","6709"]},"output":{"recommendedItems":["1994","52","3115","4231","6313","4803","4083","4516","6709","106642","141820","184253","163134","6464","130976","26150","82095","5304","6217","5888"],"scores":[0.2231485,0.1267317,0.1101264,0.1090016,0.0895654,0.074203,0.068785,0.0652085,0.0465694,0.0379413,0.0338369,0.0076046,0.0072778,0.0,0.0,0.0,0.0,0.0,0.0,0.0]},"error":null} 32 | {"input":{"userId":"253","itemList":["46337","79242","1385","7050","178613","4036","100487","5613","1527","2183","6290","5060","57243","1965","2939","5797","58826","58025","3521","1801"]},"output":{"recommendedItems":["57243","79242","5613","1527","6290","4036","58025","178613","46337","5797","3521","1965","1801","5060","2183","1385","7050","100487","2939","58826"],"scores":[0.2657995,0.2350154,0.1406204,0.1042276,0.069936,0.0541577,0.0485754,0.0191097,0.0138942,0.013803,0.0137968,0.0097675,0.0038317,0.0031931,0.0018179,0.0016146,8.394E-4,0.0,0.0,0.0]},"error":null} 33 | {"input":{"userId":"378","itemList":["34523","1091","33162","86332","26258","430","171765","2405","3965","27032","170","116817","183301","6424","90384","138966","2740","808","4224","8815"]},"output":{"recommendedItems":["86332","8815","171765","170","33162","1091","34523","90384","430","2405","808","26258","3965","27032","116817","183301","6424","138966","2740","4224"],"scores":[0.2367492,0.2036952,0.1585349,0.1058451,0.0913279,0.041008,0.0395315,0.0352569,0.0314998,0.0241456,0.0194478,0.012958,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]},"error":null} 34 | {"input":{"userId":"163","itemList":["92234","2373","2385","34072","57368","1542","58293","7924","2871","26169","62383","46335","4616","175781","2972","162600","4067","7310","21","62293"]},"output":{"recommendedItems":["58293","21","46335","4067","1542","2373","62293","34072","2871","175781","57368","162600","4616","92234","7924","62383","2385","26169","2972","7310"],"scores":[0.4710788,0.3925896,0.0329589,0.0252366,0.0210385,0.0176876,0.0082926,0.006313,0.0060714,0.0043414,0.0034567,0.0034487,0.0026826,0.0025693,0.0020913,1.429E-4,0.0,0.0,0.0,0.0]},"error":null} 35 | {"input":{"userId":"385","itemList":["8938","79132","33188","4499","26265","132462","2571","7882","4697","100044","44204","67255","6002","91128","71","253","5212","1702","7345","60397"]},"output":{"recommendedItems":["4499","2571","4697","71","26265","5212","1702","7345","253","79132","44204","91128","60397","67255","8938","33188","132462","7882","100044","6002"],"scores":[0.7094248,0.0961266,0.0429889,0.040376,0.0379158,0.030841,0.0116868,0.0104841,0.0089592,0.0043854,0.003779,0.0020792,7.461E-4,2.072E-4,0.0,0.0,0.0,0.0,0.0,0.0]},"error":null} 36 | {"input":{"userId":"224","itemList":["1644","84553","96608","44511","5021","141836","236","1380","8910","166526","4956","88672","90719","93766","72308","3263","275","179053","1207","1318"]},"output":{"recommendedItems":["3263","1380","8910","1644","275","4956","236","96608","1318","72308","1207","88672","93766","84553","44511","5021","141836","166526","90719","179053"],"scores":[0.2918038,0.2598782,0.1170955,0.1103505,0.0672647,0.0597247,0.0234373,0.0210286,0.0203943,0.0123297,0.007397,0.004888,0.0044076,0.0,0.0,0.0,0.0,0.0,0.0,0.0]},"error":null} 37 | {"input":{"userId":"29","itemList":["5733","6157","157775","82684","3551","51666","3284","4326","4224","3959","892","7560","168","2888","100159","2112","136838","2164","81784","5156"]},"output":{"recommendedItems":["168","6157","4326","892","81784","157775","2112","7560","3284","5156","3959","3551","5733","82684","51666","4224","2888","100159","136838","2164"],"scores":[0.4106499,0.3870123,0.059035,0.0568893,0.0315964,0.014103,0.0135698,0.0083056,0.0075893,0.0051,0.0048492,0.0013003,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]},"error":null} 38 | {"input":{"userId":"411","itemList":["8340","6210","139855","2295","5723","7560","1216","104419","3716","43333","145839","6530","90603","6333","82","3623","2435","135518","55261","526"]},"output":{"recommendedItems":["526","82","3623","8340","6210","6530","1216","7560","43333","55261","135518","145839","6333","139855","2295","5723","104419","3716","90603","2435"],"scores":[0.3925355,0.3586244,0.0833099,0.0795817,0.0210089,0.0183205,0.0131773,0.0103289,0.0102855,0.0055197,0.0022632,0.0021538,0.0021129,7.779E-4,0.0,0.0,0.0,0.0,0.0,0.0]},"error":null} 39 | {"input":{"userId":"333","itemList":["553","6530","3424","138210","3909","3062","25788","80363","100159","92234","40412","7104","15","46574","170551","3130","201","73515","93006","26158"]},"output":{"recommendedItems":["3424","93006","6530","201","3130","553","7104","40412","15","73515","80363","92234","138210","25788","3062","3909","100159","46574","170551","26158"],"scores":[0.4082902,0.0810966,0.0785882,0.0779176,0.0654181,0.0591035,0.0586654,0.0539044,0.0351941,0.0300818,0.0286652,0.0107761,0.007033,0.0044476,8.179E-4,0.0,0.0,0.0,0.0,0.0]},"error":null} 40 | {"input":{"userId":"205","itemList":["43930","137857","174909","53894","172875","136016","118784","113374","104078","8865","5733","2599","1307","4280","90249","353","841","6564","136556","927"]},"output":{"recommendedItems":["1307","53894","353","2599","113374","172875","4280","90249","136556","8865","137857","841","6564","174909","136016","927","43930","118784","104078","5733"],"scores":[0.9605879,0.0073367,0.0062973,0.004183,0.0041402,0.0036148,0.0034797,0.0021782,0.0016667,0.0016495,0.0014818,9.562E-4,7.864E-4,6.133E-4,5.704E-4,4.582E-4,0.0,0.0,0.0,0.0]},"error":null} 41 | {"input":{"userId":"280","itemList":["536","7820","69406","88699","3566","2002","4248","169670","5168","4351","105355","89047","2555","4366","66798","5741","2903","89864","50842","3930"]},"output":{"recommendedItems":["89864","105355","69406","4366","50842","3566","536","2002","7820","4351","88699","4248","169670","5168","89047","2555","66798","5741","2903","3930"],"scores":[0.8250232,0.0961258,0.039446,0.0250791,0.0077074,0.0034505,0.0017161,8.349E-4,5.3E-4,8.67E-5,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]},"error":null} 42 | {"input":{"userId":"245","itemList":["112303","4089","56174","161044","158966","2420","5562","8378","146028","138210","8848","294","55872","3276","116963","95497","129737","4526","5328","141818"]},"output":{"recommendedItems":["2420","8378","294","141818","4526","95497","55872","56174","138210","158966","112303","4089","161044","5562","146028","8848","3276","116963","129737","5328"],"scores":[0.4433499,0.2666874,0.1701072,0.0519088,0.0418866,0.0220467,0.0017816,0.0010785,7.259E-4,4.274E-4,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]},"error":null} 43 | {"input":{"userId":"225","itemList":["7085","152081","4546","46862","7983","2616","83177","63876","359","6636","1096","8043","2634","141810","77364","144352","134861","5499","77667","6872"]},"output":{"recommendedItems":["2616","6636","1096","46862","7983","359","2634","141810","77364","152081","63876","7085","4546","83177","8043","144352","134861","5499","77667","6872"],"scores":[0.5505298,0.172987,0.0769084,0.0711886,0.0381316,0.0362101,0.0294884,0.0218868,0.0012962,7.736E-4,5.995E-4,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]},"error":null} 44 | {"input":{"userId":"562","itemList":["6237","48518","6390","5398","2255","3699","8461","74868","5954","8827","6271","4776","4005","2580","68347","4355","32160","171","3679","5477"]},"output":{"recommendedItems":["4776","2580","5954","8827","5477","4005","3679","3699","68347","4355","74868","171","5398","6237","48518","6390","2255","8461","6271","32160"],"scores":[0.6098457,0.3673292,0.0076353,0.0060455,0.0023909,0.0018787,0.0015436,0.0011388,6.724E-4,6.236E-4,3.501E-4,2.948E-4,2.513E-4,0.0,0.0,0.0,0.0,0.0,0.0,0.0]},"error":null} 45 | {"input":{"userId":"293","itemList":["2810","96114","1453","171695","1231","51412","68347","4190","1037","128099","4104","87","1892","180985","79428","1432","4654","141646","53578","94494"]},"output":{"recommendedItems":["1037","1892","4654","87","1432","171695","1231","2810","68347","4190","79428","51412","180985","96114","1453","128099","4104","141646","53578","94494"],"scores":[0.6249002,0.1276445,0.0703027,0.0544648,0.0358779,0.0247822,0.0243092,0.0215168,0.0058021,0.0042658,0.0040982,0.0011718,8.636E-4,0.0,0.0,0.0,0.0,0.0,0.0,0.0]},"error":null} 46 | {"input":{"userId":"432","itemList":["454","40723","98499","104875","8492","1913","1408","1406","65133","27831","6217","96471","6186","2153","53450","122922","4689","3286","3695","5450"]},"output":{"recommendedItems":["27831","122922","454","104875","65133","5450","1406","96471","3286","98499","2153","1408","40723","8492","1913","6217","6186","53450","4689","3695"],"scores":[0.3767619,0.1663289,0.1157449,0.100297,0.06042,0.0548024,0.0413118,0.0361967,0.0269953,0.011702,0.0071048,0.0023343,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]},"error":null} 47 | {"input":{"userId":"128","itemList":["89343","73386","5387","72696","97836","2749","43936","152085","7256","2696","165671","128","51937","6857","8967","67508","31903","5011","147286","1867"]},"output":{"recommendedItems":["2749","128","147286","2696","6857","5011","5387","7256","43936","97836","152085","165671","89343","73386","72696","51937","8967","67508","31903","1867"],"scores":[0.4827444,0.1700786,0.1151116,0.1082503,0.0477452,0.0278076,0.0187814,0.0166173,0.0085845,0.002358,0.0011494,7.715E-4,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]},"error":null} 48 | {"input":{"userId":"590","itemList":["26870","57147","4437","44241","87222","60072","8973","3826","4349","104245","3107","126482","5706","4478","4595","4293","1549","49389","7486","5955"]},"output":{"recommendedItems":["87222","60072","8973","126482","104245","5955","4437","57147","4293","3826","3107","4349","26870","44241","5706","4478","4595","1549","49389","7486"],"scores":[0.9642266,0.0100182,0.0064662,0.0037799,0.0034011,0.0031567,0.003102,0.0021777,0.001682,0.0011701,6.412E-4,1.783E-4,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]},"error":null} 49 | {"input":{"userId":"347","itemList":["481","3996","6294","3519","3870","3963","1439","26590","51255","130840","8364","122884","8711","64","1323","149350","4197","97328","27156","25999"]},"output":{"recommendedItems":["481","64","51255","27156","3519","3996","26590","1323","1439","8364","3963","6294","122884","149350","3870","130840","8711","4197","97328","25999"],"scores":[0.6712248,0.1096804,0.0439714,0.0377327,0.0308896,0.0276501,0.0234088,0.0184532,0.0149105,0.0098232,0.0052977,0.0040772,0.0020887,7.915E-4,0.0,0.0,0.0,0.0,0.0,0.0]},"error":null} 50 | {"input":{"userId":"291","itemList":["4826","2858","1286","118834","3434","103984","6448","1231","136297","71999","1552","104925","2771","62586","8921","779","202","128366","183959","142420"]},"output":{"recommendedItems":["2858","1552","142420","2771","103984","4826","779","1231","1286","71999","118834","3434","6448","136297","104925","62586","8921","202","128366","183959"],"scores":[0.9622401,0.0167008,0.0072066,0.0064061,0.003538,0.0021957,0.0012277,3.404E-4,1.074E-4,3.69E-5,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]},"error":null} 51 | --------------------------------------------------------------------------------