Jan Mühlnikel
commited on
Commit
·
fa25391
1
Parent(s):
5ca912a
experiment
Browse files
functions/calc_matches.py
CHANGED
@@ -54,9 +54,6 @@ def calc_matches(filtered_df, project_df, similarity_matrix, top_x):
|
|
54 |
filtered_df_index_map = {index: i for i, index in enumerate(filtered_df_indices)}
|
55 |
project_df_index_map = {index: i for i, index in enumerate(project_df_indices)}
|
56 |
|
57 |
-
st.write(filtered_df_indices)
|
58 |
-
st.write(project_df_indices)
|
59 |
-
|
60 |
# Select submatrix based on indices from both dataframes
|
61 |
match_matrix = similarity_matrix[filtered_df_indices, :][:, project_df_indices]
|
62 |
|
@@ -74,8 +71,8 @@ def calc_matches(filtered_df, project_df, similarity_matrix, top_x):
|
|
74 |
# Get the corresponding similarity values
|
75 |
top_values = match_matrix.data[linear_indices]
|
76 |
|
77 |
-
top_filtered_df_indices = [
|
78 |
-
top_project_df_indices = [
|
79 |
|
80 |
# Create resulting dataframes with top matches and their similarity scores
|
81 |
st.write(top_indices)
|
|
|
54 |
filtered_df_index_map = {index: i for i, index in enumerate(filtered_df_indices)}
|
55 |
project_df_index_map = {index: i for i, index in enumerate(project_df_indices)}
|
56 |
|
|
|
|
|
|
|
57 |
# Select submatrix based on indices from both dataframes
|
58 |
match_matrix = similarity_matrix[filtered_df_indices, :][:, project_df_indices]
|
59 |
|
|
|
71 |
# Get the corresponding similarity values
|
72 |
top_values = match_matrix.data[linear_indices]
|
73 |
|
74 |
+
top_filtered_df_indices = [filtered_df_index_map[i] for i in top_indices[0]]
|
75 |
+
top_project_df_indices = [project_df_index_map[i] for i in top_indices[1]]
|
76 |
|
77 |
# Create resulting dataframes with top matches and their similarity scores
|
78 |
st.write(top_indices)
|