lalithadevi commited on
Commit
e3e2a58
1 Parent(s): 58ada3c

Update news_category_similar_news_prediction.py

Browse files
news_category_similar_news_prediction.py CHANGED
@@ -91,8 +91,8 @@ def process_prediction_df(df, df_type: str="production"):
91
  df.loc[df['pred_proba']<CLASSIFIER_THRESHOLD, 'category'] = 'NATION'
92
  df.loc[(df['title'].str.contains('Pakistan')) & (df['category'] == 'NATION'), 'category'] = 'WORLD'
93
  logger.warning('Updated category of articles having Pakistan in title and category=NATION to WORLD')
94
- df.loc[(df['title'].str.contains('Zodiac Sign', case=False)) | (df['title'].str.contains('Horoscope', case=False)), 'category'] = 'SCIENCE'
95
- logger.warning('Updated category of articles having Zodiac Sign in title to SCIENCE')
96
 
97
  logger.warning(f"Exiting process_prediction_df(): {df_type}")
98
  return df
 
91
  df.loc[df['pred_proba']<CLASSIFIER_THRESHOLD, 'category'] = 'NATION'
92
  df.loc[(df['title'].str.contains('Pakistan')) & (df['category'] == 'NATION'), 'category'] = 'WORLD'
93
  logger.warning('Updated category of articles having Pakistan in title and category=NATION to WORLD')
94
+ df.loc[(df['title'].str.contains('Zodiac Sign', case=False)) | (df['title'].str.contains('Horoscope', case=False)), 'category'] = 'ASTROLOGY'
95
+ logger.warning('Updated category of articles having Zodiac Sign in title to ASTROLOGY')
96
 
97
  logger.warning(f"Exiting process_prediction_df(): {df_type}")
98
  return df