Spaces:
Sleeping
Sleeping
Update classification.py
Browse files- classification.py +1 -1
classification.py
CHANGED
@@ -179,7 +179,7 @@ def match_categories(df, category_df, treshold=0.45):
|
|
179 |
cos_scores = util.cos_sim(ebd_content, torch.stack(list(category_df['Embeddings']), dim=0))[0]
|
180 |
high_score_indices = [i for i, score in enumerate(cos_scores) if score > treshold]
|
181 |
categories_list.append("@~@".join([category_df.loc[index, 'description'] for index in high_score_indices]))
|
182 |
-
experts_list.append("@~@".join(
|
183 |
topic_list.append("@~@".join([category_df.loc[index, 'topic'] for index in high_score_indices]))
|
184 |
scores_list.append("@~@".join([str(float(cos_scores[index])) for index in high_score_indices]))
|
185 |
for j in high_score_indices:
|
|
|
179 |
cos_scores = util.cos_sim(ebd_content, torch.stack(list(category_df['Embeddings']), dim=0))[0]
|
180 |
high_score_indices = [i for i, score in enumerate(cos_scores) if score > treshold]
|
181 |
categories_list.append("@~@".join([category_df.loc[index, 'description'] for index in high_score_indices]))
|
182 |
+
experts_list.append(["@~@".join(list(set(category_df.loc[index, 'experts'])) for index in high_score_indices)])
|
183 |
topic_list.append("@~@".join([category_df.loc[index, 'topic'] for index in high_score_indices]))
|
184 |
scores_list.append("@~@".join([str(float(cos_scores[index])) for index in high_score_indices]))
|
185 |
for j in high_score_indices:
|