lalithadevi commited on
Commit
367d701
1 Parent(s): 7d8b789

Update news_category_similar_news_prediction.py

Browse files
news_category_similar_news_prediction.py CHANGED
@@ -88,7 +88,7 @@ def process_prediction_df(df, df_type: str="production"):
88
  df.reset_index(drop=True, inplace=True)
89
 
90
  df.reset_index(drop=True, inplace=True)
91
- df.loc[final_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'
 
88
  df.reset_index(drop=True, inplace=True)
89
 
90
  df.reset_index(drop=True, inplace=True)
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'