lalithadevi
commited on
Commit
•
06d4f50
1
Parent(s):
a3697ff
Update news_category_similar_news_prediction.py
Browse files
news_category_similar_news_prediction.py
CHANGED
@@ -95,7 +95,7 @@ def predict_news_category_similar_news(old_news: pd.DataFrame, new_news: pd.Data
|
|
95 |
sim_news = [find_similar_news(text, search_vec, collection, vectorizer, sent_model, ce_model) for search_vec, text in zip(sent_embs, headlines)]
|
96 |
new_news['category'] = label
|
97 |
new_news['pred_proba'] = prob
|
98 |
-
|
99 |
final_df = pd.concat([old_news, new_news], axis=0, ignore_index=True)
|
100 |
final_df.drop_duplicates(subset='url', keep='first', inplace=True)
|
101 |
final_df.reset_index(drop=True, inplace=True)
|
|
|
95 |
sim_news = [find_similar_news(text, search_vec, collection, vectorizer, sent_model, ce_model) for search_vec, text in zip(sent_embs, headlines)]
|
96 |
new_news['category'] = label
|
97 |
new_news['pred_proba'] = prob
|
98 |
+
new_news['similar_news'] = sim_news
|
99 |
final_df = pd.concat([old_news, new_news], axis=0, ignore_index=True)
|
100 |
final_df.drop_duplicates(subset='url', keep='first', inplace=True)
|
101 |
final_df.reset_index(drop=True, inplace=True)
|