Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -382,6 +382,8 @@ def generate_project_proposal(problem_descriptions, location, problem_domain):
|
|
382 |
return proposal
|
383 |
|
384 |
def create_project_proposals(budget_cluster_df, problem_cluster_df, location_clusters, problem_clusters):
|
|
|
|
|
385 |
proposals = {}
|
386 |
for loc in budget_cluster_df.index:
|
387 |
for prob in budget_cluster_df.columns:
|
@@ -395,7 +397,7 @@ def create_project_proposals(budget_cluster_df, problem_cluster_df, location_clu
|
|
395 |
location,
|
396 |
problem_domain)
|
397 |
proposals[(loc, prob)] = proposal
|
398 |
-
|
399 |
return proposals
|
400 |
|
401 |
|
@@ -462,6 +464,7 @@ def nlp_pipeline(original_df):
|
|
462 |
# Create cluster dataframes
|
463 |
budget_cluster_df, problem_cluster_df = create_cluster_dataframes(processed_df)
|
464 |
|
|
|
465 |
# return processed_df, budget_cluster_df, problem_cluster_df, location_clusters, problem_clusters
|
466 |
|
467 |
# # Generate project proposals
|
@@ -507,18 +510,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 |
-
|
513 |
-
else:
|
514 |
-
|
515 |
-
|
516 |
|
517 |
-
if isinstance(problem_clusters, pd.DataFrame):
|
518 |
-
|
519 |
-
else:
|
520 |
-
|
521 |
-
|
522 |
|
523 |
|
524 |
|
|
|
382 |
return proposal
|
383 |
|
384 |
def create_project_proposals(budget_cluster_df, problem_cluster_df, location_clusters, problem_clusters):
|
385 |
+
print("\n Starting function: create_project_proposals")
|
386 |
+
console_messages.append("\n Starting function: create_project_proposals")
|
387 |
proposals = {}
|
388 |
for loc in budget_cluster_df.index:
|
389 |
for prob in budget_cluster_df.columns:
|
|
|
397 |
location,
|
398 |
problem_domain)
|
399 |
proposals[(loc, prob)] = proposal
|
400 |
+
console_messages.append("\n Exiting function: create_project_proposals")
|
401 |
return proposals
|
402 |
|
403 |
|
|
|
464 |
# Create cluster dataframes
|
465 |
budget_cluster_df, problem_cluster_df = create_cluster_dataframes(processed_df)
|
466 |
|
467 |
+
print("Clustering Done...")
|
468 |
# return processed_df, budget_cluster_df, problem_cluster_df, location_clusters, problem_clusters
|
469 |
|
470 |
# # Generate project proposals
|
|
|
510 |
|
511 |
|
512 |
|
513 |
+
# # Ensure location_clusters and problem_clusters are in DataFrame format
|
514 |
+
# if isinstance(location_clusters, pd.DataFrame):
|
515 |
+
# location_clusters.to_excel(writer, sheet_name='Location_Clusters', index=False)
|
516 |
+
# else:
|
517 |
+
# console_messages.append("Converting Location Clusters to df")
|
518 |
+
# pd.DataFrame(location_clusters).to_excel(writer, sheet_name='Location_Clusters', index=False)
|
519 |
|
520 |
+
# if isinstance(problem_clusters, pd.DataFrame):
|
521 |
+
# problem_clusters.to_excel(writer, sheet_name='Problem_Clusters', index=False)
|
522 |
+
# else:
|
523 |
+
# console_messages.append("Converting Problem Clusters to df")
|
524 |
+
# pd.DataFrame(problem_clusters).to_excel(writer, sheet_name='Problem_Clusters', index=False)
|
525 |
|
526 |
|
527 |
|