Spaces:
Sleeping
Sleeping
columns adj
Browse files- functions.py +13 -0
functions.py
CHANGED
|
@@ -70,6 +70,19 @@ def get_embbedings(table, colname):
|
|
| 70 |
# Process similarity
|
| 71 |
|
| 72 |
def process_similarity_results(table1, table2, harmonization=True):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
|
| 74 |
embeddings1 = get_embbedings(table1, 'concatenated_input')
|
| 75 |
embeddings2 = get_embbedings(table2,'concatenated_input')
|
|
|
|
| 70 |
# Process similarity
|
| 71 |
|
| 72 |
def process_similarity_results(table1, table2, harmonization=True):
|
| 73 |
+
|
| 74 |
+
if 'Indicator ID' in table1.columns:
|
| 75 |
+
table1['ID'] = table1['Indicator ID'].astype(str)
|
| 76 |
+
else:
|
| 77 |
+
table1['ID'] = table1['ID'].astype(str)
|
| 78 |
+
|
| 79 |
+
if 'Indicator ID' in table2.columns:
|
| 80 |
+
table2['ID'] = table2['Indicator ID'].astype(str)
|
| 81 |
+
else:
|
| 82 |
+
table2['ID'] = table2['ID'].astype(str)
|
| 83 |
+
|
| 84 |
+
table1 = concatenate_columns(table1, columns= columns_embeddings_col1)
|
| 85 |
+
table2 = concatenate_columns(table2,columns= columns_embeddings_col2)
|
| 86 |
|
| 87 |
embeddings1 = get_embbedings(table1, 'concatenated_input')
|
| 88 |
embeddings2 = get_embbedings(table2,'concatenated_input')
|