Spaces:
Runtime error
Runtime error
Update src/core.py
Browse files- src/core.py +23 -0
src/core.py
CHANGED
@@ -26,4 +26,27 @@ def process_input(data, global_tech, global_tech_embeddings):
|
|
26 |
best_technologies_id = select_technologies(best_combinations)
|
27 |
best_technologies = get_technologies_by_id(best_technologies_id,global_tech)
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
return best_technologies
|
|
|
26 |
best_technologies_id = select_technologies(best_combinations)
|
27 |
best_technologies = get_technologies_by_id(best_technologies_id,global_tech)
|
28 |
|
29 |
+
return best_technologies
|
30 |
+
|
31 |
+
|
32 |
+
def process_input_from_constraints(constraints, global_tech, global_tech_embeddings):
|
33 |
+
|
34 |
+
constraints_stemmed = stem(constraints, "constraints")
|
35 |
+
|
36 |
+
save_dataframe(constraints_stemmed, "constraints_stemmed.xlsx")
|
37 |
+
|
38 |
+
#global_tech, keys, original_tech = preprocess_tech_data(df)
|
39 |
+
|
40 |
+
save_dataframe(global_tech, "global_tech.xlsx")
|
41 |
+
|
42 |
+
result_similarities, matrix = get_contrastive_similarities(constraints_stemmed, global_tech, global_tech_embeddings, )
|
43 |
+
|
44 |
+
save_to_pickle(result_similarities)
|
45 |
+
|
46 |
+
print(f"Matrix : {matrix} \n Constraints : {constraints_stemmed} \n Gloabl tech : {global_tech}")
|
47 |
+
|
48 |
+
best_combinations = find_best_list_combinations(constraints_stemmed, global_tech, matrix)
|
49 |
+
best_technologies_id = select_technologies(best_combinations)
|
50 |
+
best_technologies = get_technologies_by_id(best_technologies_id,global_tech)
|
51 |
+
|
52 |
return best_technologies
|