SantanuBanerjee commited on
Commit
c88b6f4
·
verified ·
1 Parent(s): bd96e0d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -13
app.py CHANGED
@@ -465,8 +465,8 @@ def nlp_pipeline(original_df):
465
  # return processed_df, budget_cluster_df, problem_cluster_df, location_clusters, problem_clusters
466
 
467
  # # Generate project proposals
468
- # location_clusters = dict(enumerate(processed_df['Location_Category_Words'].unique()))
469
- # problem_clusters = dict(enumerate(processed_df['Problem_Category_Words'].unique()))
470
  project_proposals = create_project_proposals(budget_cluster_df, problem_cluster_df, location_clusters, problem_clusters)
471
 
472
  console_messages.append("NLP pipeline completed.")
@@ -507,18 +507,18 @@ def process_excel(file):
507
 
508
 
509
 
510
- # # Ensure location_clusters and problem_clusters are in DataFrame format
511
- # if isinstance(location_clusters, pd.DataFrame):
512
- # location_clusters.to_excel(writer, sheet_name='Location_Clusters', index=False)
513
- # else:
514
- # console_messages.append("Converting Location Clusters to df")
515
- # pd.DataFrame(location_clusters).to_excel(writer, sheet_name='Location_Clusters', index=False)
516
 
517
- # if isinstance(problem_clusters, pd.DataFrame):
518
- # problem_clusters.to_excel(writer, sheet_name='Problem_Clusters', index=False)
519
- # else:
520
- # console_messages.append("Converting Problem Clusters to df")
521
- # pd.DataFrame(problem_clusters).to_excel(writer, sheet_name='Problem_Clusters', index=False)
522
 
523
 
524
 
 
465
  # return processed_df, budget_cluster_df, problem_cluster_df, location_clusters, problem_clusters
466
 
467
  # # Generate project proposals
468
+ location_clusters = dict(enumerate(processed_df['Location_Category_Words'].unique()))
469
+ problem_clusters = dict(enumerate(processed_df['Problem_Category_Words'].unique()))
470
  project_proposals = create_project_proposals(budget_cluster_df, problem_cluster_df, location_clusters, problem_clusters)
471
 
472
  console_messages.append("NLP pipeline completed.")
 
507
 
508
 
509
 
510
+ # Ensure location_clusters and problem_clusters are in DataFrame format
511
+ if isinstance(location_clusters, pd.DataFrame):
512
+ location_clusters.to_excel(writer, sheet_name='Location_Clusters', index=False)
513
+ else:
514
+ console_messages.append("Converting Location Clusters to df")
515
+ pd.DataFrame(location_clusters).to_excel(writer, sheet_name='Location_Clusters', index=False)
516
 
517
+ if isinstance(problem_clusters, pd.DataFrame):
518
+ problem_clusters.to_excel(writer, sheet_name='Problem_Clusters', index=False)
519
+ else:
520
+ console_messages.append("Converting Problem Clusters to df")
521
+ pd.DataFrame(problem_clusters).to_excel(writer, sheet_name='Problem_Clusters', index=False)
522
 
523
 
524