Spaces:
Sleeping
Sleeping
Update src/services/processor.py
Browse files
src/services/processor.py
CHANGED
@@ -91,7 +91,7 @@ def get_contrastive_similarities(constraints, pre_encoded_tech_data, pre_encoded
|
|
91 |
|
92 |
for i, constraint in enumerate(constraints):
|
93 |
constraint_embedding = constraint_embeddings[i]
|
94 |
-
|
95 |
for j, tech2 in enumerate(pre_encoded_tech_data):
|
96 |
tech_embedding = pre_encoded_tech_embeddings[j]
|
97 |
|
@@ -105,8 +105,8 @@ def get_contrastive_similarities(constraints, pre_encoded_tech_data, pre_encoded
|
|
105 |
"id2": tech2["id"],
|
106 |
"similarity": purpose_sim
|
107 |
})
|
108 |
-
|
109 |
-
|
110 |
return selected_pairs, matrix
|
111 |
|
112 |
def find_best_list_combinations(list1: list[str], list2: list[str], matrix) -> list[dict]:
|
|
|
91 |
|
92 |
for i, constraint in enumerate(constraints):
|
93 |
constraint_embedding = constraint_embeddings[i]
|
94 |
+
constraint_matrix = []
|
95 |
for j, tech2 in enumerate(pre_encoded_tech_data):
|
96 |
tech_embedding = pre_encoded_tech_embeddings[j]
|
97 |
|
|
|
105 |
"id2": tech2["id"],
|
106 |
"similarity": purpose_sim
|
107 |
})
|
108 |
+
constraint_matrix.append(purpose_sim)
|
109 |
+
matrix.append(constraint_matrix)
|
110 |
return selected_pairs, matrix
|
111 |
|
112 |
def find_best_list_combinations(list1: list[str], list2: list[str], matrix) -> list[dict]:
|