diff --git a/newshomepages/analyze/drudge.py b/newshomepages/analyze/drudge.py index 1abc0e41d86..0c3f232ee7c 100644 --- a/newshomepages/analyze/drudge.py +++ b/newshomepages/analyze/drudge.py @@ -57,8 +57,8 @@ def get_lemma(headline: str): # Read it into our NPL thing doc = nlp(headline) - # Parse out all the words - token_list = [token.strip() for token in doc if token.strip()] + # Parse out all the words, and remove empty ones + token_list = [token for token in doc if token.text.strip()] # Remove stop words token_list = [t for t in token_list if not t.is_stop]