Spaces:
Sleeping
Sleeping
Update app.py
Browse files123456789103 unmodified lines141516171819202122232425262728293031323326 unmodified lines606162636465666768697071727374757677787980814 unmodified lines868788899091924 unmodified lines9798991001011021031041051066 unmodified lines1131141151161171181198 unmodified lines1281291301311321331341351361371381391401411421431441451461471481491501511521531 unmodified line1551561571581591601611621631641655 unmodified lines17117217317417517617710 unmodified lines1881891901911921931941951961971981992002012022032045 unmodified lines2102112122132142152162172182192202212222231 unmodified line2252262272282292302312322332349 unmodified lines24424524624724824925025125225325425525625725825926026126226326426514 unmodified lines2802812822832842852862872882892902918 unmodified lines30030130230330430530638 unmodified lines34534634734834935035122 unmodified lines37437537637737837938020 unmodified lines40140240340440540640738 unmodified lines4464474484494504514521 unmodified line4544554564574584594604614624634644654664674684694704714724732 unmodified lines47647747847948048148248348448548648748848949049149249349449526 unmodified lines5225235245255265275285295305315325335345355365375385395405415425434 unmodified lines5485495505515525535544 unmodified lines5595605615625635645655665675686 unmodified lines5755765775785795805818 unmodified lines5905915925935945955965975985996006016026036046056066076086096106116126136146151 unmodified line6176186196206216226236246256266275 unmodified lines63363463563663763863910 unmodified lines6506516526536546556566576586596606616626636646656665 unmodified lines6726736746756766776786796806816826836846851 unmodified line6876886896906916926936946956969 unmodified lines70670770870971071171271371471571671771871972072172272372472572672714 unmodified lines7427437447457467477487497507517527538 unmodified lines76276376476576676776838 unmodified lines80780880981081181281322 unmodified lines83683783883984084184220 unmodified lines8638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019025 unmodified lines9089099109119129139141 unmodified line916917918919920921922"""Gradio App for Hybrid Movie Recommendation SystemDeploy to Hugging Face Spaces as 'DataSynthis_Job_task'File: app.py"""import gradio as grimport pickleimport pandas as pd3 unmodified linesimport osfrom scipy.sparse import csr_matrix#==============================================================================# MODEL CLASS DEFINITIONS (Required for unpickling)#==============================================================================class ItemBasedCF:"""Item-Based Collaborative Filtering"""passclass SVDRecommender:"""SVD Recommender"""passclass NeuralCF(nn.Module):"""Neural Collaborative Filtering Model"""def __init__(self, n_users, n_movies, embedding_dim=50, hidden_layers=[64, 32, 16]):super(NeuralCF, self).__init__()26 unmodified linesreturn torch.clamp(prediction, 1, 5).item()class HybridRecommender:"""Hybrid Recommendation System"""passclass MovieLensDataLoader:"""Data Loader"""pass#==============================================================================# LOAD MODEL AND DATA#==============================================================================def load_model_and_data():"""Load the trained model and necessary data"""import os# Debug: Check what files existprint("Checking for files...")print(f"Current directory: {os.getcwd()}")print(f"Files in current directory: {os.listdir('.')}")4 unmodified linesprint("ERROR: model_artifacts/ folder does not exist!")try:# Check each file individuallyfiles_to_check = ['model_artifacts/hybrid_model.pkl','model_artifacts/loader.pkl',4 unmodified linesif not os.path.exists(file_path):print(f"ERROR: Missing file: {file_path}")else:file_size = os.path.getsize(file_path) / (1024*1024) # MBprint(f"Found: {file_path} ({file_size:.2f} MB)")# Load fileswith open('model_artifacts/hybrid_model.pkl', 'rb') as f:model = pickle.load(f)print("β Loaded hybrid_model.pkl")6 unmodified linesmovies = pickle.load(f)print("β Loaded movies.pkl")# Get list of usersuser_ids = sorted(loader.user_id_map.keys())print(f"β Model loaded successfully! {len(user_ids)} users available")8 unmodified linestraceback.print_exc()return None, None, None, []# Load everything at startupprint("Loading model and data...")model, loader, movies_df, user_ids = load_model_and_data()print(f"Model loaded! Available users: {len(user_ids)}")#==============================================================================# RECOMMENDATION FUNCTION#==============================================================================def get_recommendations(user_id, num_recommendations):"""Get movie recommendations for a userArgs:user_id: User ID (int)num_recommendations: Number of recommendations to returnReturns:Formatted string with recommendations"""if model is None or loader is None:return "β Error: Model not loaded properly. Please check the model files."1 unmodified lineuser_id = int(user_id)num_recommendations = int(num_recommendations)# Check if user existsif user_id not in loader.user_id_map:return f"β User ID {user_id} not found! Please select a valid user ID."# Get recommendationsrecommendations = model.recommend_movies(user_id=user_id,N=num_recommendations,5 unmodified linesif not recommendations:return f"β No recommendations found for User {user_id}"# Format outputoutput = f"π¬ **Top {num_recommendations} Movie Recommendations for User {user_id}**\n\n"output += "=" * 60 + "\n\n"10 unmodified linesexcept Exception as e:return f"β Error generating recommendations: {str(e)}"def get_user_history(user_id):"""Show user's rating historyArgs:user_id: User IDReturns:Formatted string with user's past ratings"""if model is None or loader is None:return "β Error: Model not loaded properly."5 unmodified linesuser_idx = loader.user_id_map[user_id]# Get user's ratings from the training datauser_ratings = model.item_cf.user_item_matrix[user_idx].toarray().flatten()rated_indices = np.where(user_ratings > 0)[0]if len(rated_indices) == 0:return f"No rating history found for User {user_id}"# Get movie detailshistory = []for movie_idx in rated_indices:original_movie_id = loader.reverse_movie_map[movie_idx]1 unmodified linerating = user_ratings[movie_idx]history.append((title, rating))# Sort by rating (highest first)history.sort(key=lambda x: x[1], reverse=True)# Format outputoutput = f"π **Rating History for User {user_id}**\n\n"output += f"Total movies rated: {len(history)}\n"output += f"Average rating: {np.mean([r for _, r in history]):.2f}\n\n"9 unmodified linesexcept Exception as e:return f"β Error: {str(e)}"def get_movie_info(movie_title_search):"""Search for movies by titleArgs:movie_title_search: Search queryReturns:Formatted string with matching movies"""if movies_df is None:return "β Error: Movies data not loaded"try:# Search for moviesmatches = movies_df[movies_df['title'].str.contains(movie_title_search, case=False, na=False)]if len(matches) == 0:14 unmodified linesexcept Exception as e:return f"β Error: {str(e)}"#==============================================================================# GRADIO INTERFACE#==============================================================================# Create Gradio interface with tabswith gr.Blocks(theme=gr.themes.Soft(), title="Movie Recommender - DataSynthis") as demo:gr.Markdown("""8 unmodified lineswith gr.Tabs():# TAB 1: Get Recommendationswith gr.Tab("π― Get Recommendations"):gr.Markdown("### Get personalized movie recommendations for any user")38 unmodified lines- Click "Get Recommendations" to see personalized movie suggestions""")# TAB 2: User Historywith gr.Tab("π User History"):gr.Markdown("### View a user's rating history")22 unmodified linesoutputs=history_output)# TAB 3: Search Movieswith gr.Tab("π Search Movies"):gr.Markdown("### Search for movies in the database")20 unmodified linesoutputs=search_output)# TAB 4: Aboutwith gr.Tab("βΉοΈ About"):gr.Markdown("""## About This System38 unmodified linesUser IDs range from 1 to 943, and movie IDs range from 1 to 1682.""")# Footergr.Markdown("""---<div style='text-align: center'>1 unmodified line</div>""")# Launch the appif __name__ == "__main__":demo.launch(share=False,server_name="0.0.0.0",server_port=7860)"""Gradio App for Hybrid Movie Recommendation SystemDeploy to Hugging Face Spaces as 'DataSynthis_Job_task'File: app.py"""import gradio as grimport pickleimport pandas as pdimport numpy as np2 unmodified linesimport osfrom scipy.sparse import csr_matrix#==============================================================================# MODEL CLASS DEFINITIONS (Required for unpickling)#==============================================================================class ItemBasedCF:"""Item-Based Collaborative Filtering"""passclass SVDRecommender:"""SVD Recommender"""passclass NeuralCF(nn.Module):"""Neural Collaborative Filtering Model"""def __init__(self, n_users, n_movies, embedding_dim=50, hidden_layers=[64, 32, 16]):super(NeuralCF, self).__init__()26 unmodified linesreturn torch.clamp(prediction, 1, 5).item()class HybridRecommender:"""Hybrid Recommendation System"""passclass MovieLensDataLoader:"""Data Loader"""pass#==============================================================================# LOAD MODEL AND DATA#==============================================================================def load_model_and_data():"""Load the trained model and necessary data"""import os# Debug: Check what files existprint("Checking for files...")print(f"Current directory: {os.getcwd()}")print(f"Files in current directory: {os.listdir('.')}")4 unmodified linesprint("ERROR: model_artifacts/ folder does not exist!")try:# Check each file individuallyfiles_to_check = ['model_artifacts/hybrid_model.pkl','model_artifacts/loader.pkl',4 unmodified linesif not os.path.exists(file_path):print(f"ERROR: Missing file: {file_path}")else:file_size = os.path.getsize(file_path) / (1024*1024) # MBprint(f"Found: {file_path} ({file_size:.2f} MB)")# Load fileswith open('model_artifacts/hybrid_model.pkl', 'rb') as f:model = pickle.load(f)print("β Loaded hybrid_model.pkl")6 unmodified linesmovies = pickle.load(f)print("β Loaded movies.pkl")# Get list of usersuser_ids = sorted(loader.user_id_map.keys())print(f"β Model loaded successfully! {len(user_ids)} users available")8 unmodified linestraceback.print_exc()return None, None, None, []# Load everything at startupprint("Loading model and data...")model, loader, movies_df, user_ids = load_model_and_data()print(f"Model loaded! Available users: {len(user_ids)}")#==============================================================================# RECOMMENDATION FUNCTION#==============================================================================def get_recommendations(user_id, num_recommendations):"""Get movie recommendations for a userArgs:user_id: User ID (int)num_recommendations: Number of recommendations to returnReturns:Formatted string with recommendations"""if model is None or loader is None:return "β Error: Model not loaded properly. Please check the model files."1 unmodified lineuser_id = int(user_id)num_recommendations = int(num_recommendations)# Check if user existsif user_id not in loader.user_id_map:return f"β User ID {user_id} not found! Please select a valid user ID."# Get recommendationsrecommendations = model.recommend_movies(user_id=user_id,N=num_recommendations,5 unmodified linesif not recommendations:return f"β No recommendations found for User {user_id}"# Format outputoutput = f"π¬ **Top {num_recommendations} Movie Recommendations for User {user_id}**\n\n"output += "=" * 60 + "\n\n"10 unmodified linesexcept Exception as e:return f"β Error generating recommendations: {str(e)}"def get_user_history(user_id):"""Show user's rating historyArgs:user_id: User IDReturns:Formatted string with user's past ratings"""if model is None or loader is None:return "β Error: Model not loaded properly."5 unmodified linesuser_idx = loader.user_id_map[user_id]# Get user's ratings from the training datauser_ratings = model.item_cf.user_item_matrix[user_idx].toarray().flatten()rated_indices = np.where(user_ratings > 0)[0]if len(rated_indices) == 0:return f"No rating history found for User {user_id}"# Get movie detailshistory = []for movie_idx in rated_indices:original_movie_id = loader.reverse_movie_map[movie_idx]1 unmodified linerating = user_ratings[movie_idx]history.append((title, rating))# Sort by rating (highest first)history.sort(key=lambda x: x[1], reverse=True)# Format outputoutput = f"π **Rating History for User {user_id}**\n\n"output += f"Total movies rated: {len(history)}\n"output += f"Average rating: {np.mean([r for _, r in history]):.2f}\n\n"9 unmodified linesexcept Exception as e:return f"β Error: {str(e)}"def get_movie_info(movie_title_search):"""Search for movies by titleArgs:movie_title_search: Search queryReturns:Formatted string with matching movies"""if movies_df is None:return "β Error: Movies data not loaded"try:# Search for moviesmatches = movies_df[movies_df['title'].str.contains(movie_title_search, case=False, na=False)]if len(matches) == 0:14 unmodified linesexcept Exception as e:return f"β Error: {str(e)}"#==============================================================================# GRADIO INTERFACE#==============================================================================# Create Gradio interface with tabswith gr.Blocks(theme=gr.themes.Soft(), title="Movie Recommender - DataSynthis") as demo:gr.Markdown("""8 unmodified lineswith gr.Tabs():# TAB 1: Get Recommendationswith gr.Tab("π― Get Recommendations"):gr.Markdown("### Get personalized movie recommendations for any user")38 unmodified lines- Click "Get Recommendations" to see personalized movie suggestions""")# TAB 2: User Historywith gr.Tab("π User History"):gr.Markdown("### View a user's rating history")22 unmodified linesoutputs=history_output)# TAB 3: Search Movieswith gr.Tab("π Search Movies"):gr.Markdown("### Search for movies in the database")20 unmodified linesoutputs=search_output)# TAB 4: Aboutwith gr.Tab("βΉοΈ About"):gr.Markdown("""## About This System### π― Model ArchitectureThis is a **Hybrid Recommendation System** that combines three powerful approaches:1. **Item-Based Collaborative Filtering**- Uses cosine similarity between movies- Recommends movies similar to what you've liked before2. **SVD Matrix Factorization**- Decomposes the user-movie rating matrix- Discovers latent factors that explain user preferences3. **Neural Collaborative Filtering (NCF)**- Deep learning model with user and movie embeddings- Learns complex non-linear patterns in user behavior### π Dataset- **MovieLens 100k** dataset- 100,000 ratings from 943 users on 1,682 movies- Ratings scale: 1-5 stars### π― Performance Metrics- **Precision@10**: 26.77%- **NDCG@10**: 28.50%- **Model improves recommendations by 40% vs baseline**### π¨βπ» Created For**DataSynthis Job Task**### π Technologies Used- PyTorch (Neural Networks)- Scikit-learn (SVD, Similarity)- Pandas & NumPy (Data Processing)5 unmodified linesUser IDs range from 1 to 943, and movie IDs range from 1 to 1682.""")# Footergr.Markdown("""---<div style='text-align: center'>1 unmodified line</div>""")# Launch the appif __name__ == "__main__":demo.launch(share=False,1233 unmodified lines7891011121314151617181926 unmodified lines46474849505152535455565758594 unmodified lines6465666768694 unmodified lines7475767778798081826 unmodified lines8990919293948 unmodified lines1031041051061071081091101111121131 unmodified line1151161171181191201211221235 unmodified lines12913013113213313410 unmodified lines1451461471481491501515 unmodified lines1571581591601611621631641651661671681 unmodified line1701711721731741751761779 unmodified lines18718818919019119219319419519619714 unmodified lines2122132142152162178 unmodified lines22622722822923023138 unmodified lines27027127227327427522 unmodified lines29829930030130230320 unmodified lines32432532632732832938 unmodified lines3683693703713723731 unmodified line3753763773783793803813823833843853862 unmodified lines38939039139239339439539639739839940040126 unmodified lines4284294304314324334344354364374384394404414 unmodified lines4464474484494504514 unmodified lines4564574584594604614624634646 unmodified lines4714724734744754768 unmodified lines4854864874884894904914924934944951 unmodified line4974984995005015025035045055 unmodified lines51151251351451551610 unmodified lines5275285295305315325335 unmodified lines5395405415425435445455465475485495501 unmodified line5525535545555565575585599 unmodified lines56957057157257357457557657757857914 unmodified lines5945955965975985998 unmodified lines60860961061161261338 unmodified lines65265365465565665722 unmodified lines68068168268368468520 unmodified lines7067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377385 unmodified lines7447457467477487491 unmodified line751752753754755756import gradio as grimport pickleimport pandas as pd3 unmodified linesimport osfrom scipy.sparse import csr_matrixclass ItemBasedCF:passclass SVDRecommender:passclass NeuralCF(nn.Module):def __init__(self, n_users, n_movies, embedding_dim=50, hidden_layers=[64, 32, 16]):super(NeuralCF, self).__init__()26 unmodified linesreturn torch.clamp(prediction, 1, 5).item()class HybridRecommender:passclass MovieLensDataLoader:passdef load_model_and_data():import osprint("Checking for files...")print(f"Current directory: {os.getcwd()}")print(f"Files in current directory: {os.listdir('.')}")4 unmodified linesprint("ERROR: model_artifacts/ folder does not exist!")try:files_to_check = ['model_artifacts/hybrid_model.pkl','model_artifacts/loader.pkl',4 unmodified linesif not os.path.exists(file_path):print(f"ERROR: Missing file: {file_path}")else:file_size = os.path.getsize(file_path) / (1024*1024)print(f"Found: {file_path} ({file_size:.2f} MB)")with open('model_artifacts/hybrid_model.pkl', 'rb') as f:model = pickle.load(f)print("β Loaded hybrid_model.pkl")6 unmodified linesmovies = pickle.load(f)print("β Loaded movies.pkl")user_ids = sorted(loader.user_id_map.keys())print(f"β Model loaded successfully! {len(user_ids)} users available")8 unmodified linestraceback.print_exc()return None, None, None, []print("Loading model and data...")model, loader, movies_df, user_ids = load_model_and_data()print(f"Model loaded! Available users: {len(user_ids)}")def get_recommendations(user_id, num_recommendations):if model is None or loader is None:return "β Error: Model not loaded properly. Please check the model files."1 unmodified lineuser_id = int(user_id)num_recommendations = int(num_recommendations)if user_id not in loader.user_id_map:return f"β User ID {user_id} not found! Please select a valid user ID."recommendations = model.recommend_movies(user_id=user_id,N=num_recommendations,5 unmodified linesif not recommendations:return f"β No recommendations found for User {user_id}"output = f"π¬ **Top {num_recommendations} Movie Recommendations for User {user_id}**\n\n"output += "=" * 60 + "\n\n"10 unmodified linesexcept Exception as e:return f"β Error generating recommendations: {str(e)}"def get_user_history(user_id):if model is None or loader is None:return "β Error: Model not loaded properly."5 unmodified linesuser_idx = loader.user_id_map[user_id]user_ratings = model.item_cf.user_item_matrix[user_idx].toarray().flatten()rated_indices = np.where(user_ratings > 0)[0]if len(rated_indices) == 0:return f"No rating history found for User {user_id}"history = []for movie_idx in rated_indices:original_movie_id = loader.reverse_movie_map[movie_idx]1 unmodified linerating = user_ratings[movie_idx]history.append((title, rating))history.sort(key=lambda x: x[1], reverse=True)output = f"π **Rating History for User {user_id}**\n\n"output += f"Total movies rated: {len(history)}\n"output += f"Average rating: {np.mean([r for _, r in history]):.2f}\n\n"9 unmodified linesexcept Exception as e:return f"β Error: {str(e)}"def get_movie_info(movie_title_search):if movies_df is None:return "β Error: Movies data not loaded"try:matches = movies_df[movies_df['title'].str.contains(movie_title_search, case=False, na=False)]if len(matches) == 0:14 unmodified linesexcept Exception as e:return f"β Error: {str(e)}"with gr.Blocks(theme=gr.themes.Soft(), title="Movie Recommender - DataSynthis") as demo:gr.Markdown("""8 unmodified lineswith gr.Tabs():with gr.Tab("π― Get Recommendations"):gr.Markdown("### Get personalized movie recommendations for any user")38 unmodified lines- Click "Get Recommendations" to see personalized movie suggestions""")with gr.Tab("π User History"):gr.Markdown("### View a user's rating history")22 unmodified linesoutputs=history_output)with gr.Tab("π Search Movies"):gr.Markdown("### Search for movies in the database")20 unmodified linesoutputs=search_output)with gr.Tab("βΉοΈ About"):gr.Markdown("""## About This System38 unmodified linesUser IDs range from 1 to 943, and movie IDs range from 1 to 1682.""")gr.Markdown("""---<div style='text-align: center'>1 unmodified line</div>""")if __name__ == "__main__":demo.launch(share=False,server_name="0.0.0.0",server_port=7860)import gradio as grimport pickleimport pandas as pdimport numpy as np2 unmodified linesimport osfrom scipy.sparse import csr_matrixclass ItemBasedCF:passclass SVDRecommender:passclass NeuralCF(nn.Module):def __init__(self, n_users, n_movies, embedding_dim=50, hidden_layers=[64, 32, 16]):super(NeuralCF, self).__init__()26 unmodified linesreturn torch.clamp(prediction, 1, 5).item()class HybridRecommender:passclass MovieLensDataLoader:passdef load_model_and_data():import osprint("Checking for files...")print(f"Current directory: {os.getcwd()}")print(f"Files in current directory: {os.listdir('.')}")4 unmodified linesprint("ERROR: model_artifacts/ folder does not exist!")try:files_to_check = ['model_artifacts/hybrid_model.pkl','model_artifacts/loader.pkl',4 unmodified linesif not os.path.exists(file_path):print(f"ERROR: Missing file: {file_path}")else:file_size = os.path.getsize(file_path) / (1024*1024)print(f"Found: {file_path} ({file_size:.2f} MB)")with open('model_artifacts/hybrid_model.pkl', 'rb') as f:model = pickle.load(f)print("β Loaded hybrid_model.pkl")6 unmodified linesmovies = pickle.load(f)print("β Loaded movies.pkl")user_ids = sorted(loader.user_id_map.keys())print(f"β Model loaded successfully! {len(user_ids)} users available")8 unmodified linestraceback.print_exc()return None, None, None, []print("Loading model and data...")model, loader, movies_df, user_ids = load_model_and_data()print(f"Model loaded! Available users: {len(user_ids)}")def get_recommendations(user_id, num_recommendations):if model is None or loader is None:return "β Error: Model not loaded properly. Please check the model files."1 unmodified lineuser_id = int(user_id)num_recommendations = int(num_recommendations)if user_id not in loader.user_id_map:return f"β User ID {user_id} not found! Please select a valid user ID."recommendations = model.recommend_movies(user_id=user_id,N=num_recommendations,5 unmodified linesif not recommendations:return f"β No recommendations found for User {user_id}"output = f"π¬ **Top {num_recommendations} Movie Recommendations for User {user_id}**\n\n"output += "=" * 60 + "\n\n"10 unmodified linesexcept Exception as e:return f"β Error generating recommendations: {str(e)}"def get_user_history(user_id):if model is None or loader is None:return "β Error: Model not loaded properly."5 unmodified linesuser_idx = loader.user_id_map[user_id]user_ratings = model.item_cf.user_item_matrix[user_idx].toarray().flatten()rated_indices = np.where(user_ratings > 0)[0]if len(rated_indices) == 0:return f"No rating history found for User {user_id}"history = []for movie_idx in rated_indices:original_movie_id = loader.reverse_movie_map[movie_idx]1 unmodified linerating = user_ratings[movie_idx]history.append((title, rating))history.sort(key=lambda x: x[1], reverse=True)output = f"π **Rating History for User {user_id}**\n\n"output += f"Total movies rated: {len(history)}\n"output += f"Average rating: {np.mean([r for _, r in history]):.2f}\n\n"9 unmodified linesexcept Exception as e:return f"β Error: {str(e)}"def get_movie_info(movie_title_search):if movies_df is None:return "β Error: Movies data not loaded"try:matches = movies_df[movies_df['title'].str.contains(movie_title_search, case=False, na=False)]if len(matches) == 0:14 unmodified linesexcept Exception as e:return f"β Error: {str(e)}"with gr.Blocks(theme=gr.themes.Soft(), title="Movie Recommender - DataSynthis") as demo:gr.Markdown("""8 unmodified lineswith gr.Tabs():with gr.Tab("π― Get Recommendations"):gr.Markdown("### Get personalized movie recommendations for any user")38 unmodified lines- Click "Get Recommendations" to see personalized movie suggestions""")with gr.Tab("π User History"):gr.Markdown("### View a user's rating history")22 unmodified linesoutputs=history_output)with gr.Tab("π Search Movies"):gr.Markdown("### Search for movies in the database")20 unmodified linesoutputs=search_output)with gr.Tab("βΉοΈ About"):gr.Markdown(""" About This SystemModel ArchitectureThis is a Hybrid Recommendation System that combines three powerful approaches:1. Item-Based Collaborative Filtering- Uses cosine similarity between movies- Recommends movies similar to what you've liked before2. SVD Matrix Factorization- Decomposes the user-movie rating matrix- Discovers latent factors that explain user preferences3. Neural Collaborative Filtering (NCF)- Deep learning model with user and movie embeddings- Learns complex non-linear patterns in user behaviorPerformance Metrics- Precision@10: 26.77%- NDCG@10: 28.50%- Model improves recommendations by 40% vs baseline**Technologies Used- PyTorch (Neural Networks)- Scikit-learn (SVD, Similarity)- Pandas & NumPy (Data Processing)5 unmodified linesUser IDs range from 1 to 943, and movie IDs range from 1 to 1682.""")gr.Markdown("""---<div style='text-align: center'>1 unmodified line</div>""")if __name__ == "__main__":demo.launch(share=False,
app.py+16-182