Commit
•
132f624
1
Parent(s):
2431f23
Update news_category_similar_news_prediction.py
Browse files
news_category_similar_news_prediction.py
CHANGED
@@ -90,15 +90,19 @@ def predict_news_category_similar_news(old_news: pd.DataFrame, new_news: pd.Data
|
|
90 |
raise Exception('No New News Found')
|
91 |
else:
|
92 |
# new_news = new_news.copy()
|
|
|
93 |
new_news = delete_outdated_news(new_news)
|
|
|
94 |
logger.warning(f'new news columns: {[*new_news.columns]}')
|
95 |
-
|
96 |
|
97 |
if isinstance(old_news, pd.DataFrame):
|
98 |
# old_news = old_news.copy()
|
|
|
99 |
old_news = delete_outdated_news(old_news)
|
|
|
100 |
logger.warning(f'old news columns: {[*old_news.columns]}')
|
101 |
-
|
102 |
old_news.drop(columns='_id', inplace=True)
|
103 |
logger.warning('Dropped _id column from old news data frame.')
|
104 |
else:
|
|
|
90 |
raise Exception('No New News Found')
|
91 |
else:
|
92 |
# new_news = new_news.copy()
|
93 |
+
logger.warning(f'{len(new_news)} new news items found before deleting outdated news')
|
94 |
new_news = delete_outdated_news(new_news)
|
95 |
+
logger.warning(f'{len(new_news)} new news items found after deleting outdated news')
|
96 |
logger.warning(f'new news columns: {[*new_news.columns]}')
|
97 |
+
|
98 |
|
99 |
if isinstance(old_news, pd.DataFrame):
|
100 |
# old_news = old_news.copy()
|
101 |
+
logger.warning(f'{len(old_news)} old news items found before deleting outdated news')
|
102 |
old_news = delete_outdated_news(old_news)
|
103 |
+
logger.warning(f'{len(old_news)} old news items found after deleting outdated news')
|
104 |
logger.warning(f'old news columns: {[*old_news.columns]}')
|
105 |
+
|
106 |
old_news.drop(columns='_id', inplace=True)
|
107 |
logger.warning('Dropped _id column from old news data frame.')
|
108 |
else:
|