I want to select articles based on the Boolean condition as
(unemployment OR inflation) AND (covid19 OR uncertain) AND (tax OR spending OR bank)
I am looking to do it by exact string matching. I have given below codes below. The problem with the current code is that it gets me words as, taxes, taxable, taxpayers for the word "tax" Thanks in advance!!
df = data[['date', 'title', 'body_text']]
def wordestimaor(X):
df['count'] = X.body_text.str.contains("covid19|uncertain")\
& X.body_text.str.contains("unemployment|inflation")\
& X.body_text.str.contains("|tax|spending|bank",case = False,regex= True)
return X.head(2)
wordestimaor(df)
