From 93078f32a47504901836244d497f01f1f3809d34 Mon Sep 17 00:00:00 2001 From: palewire Date: Sat, 26 Aug 2023 20:01:48 -0400 Subject: [PATCH] try to fix that --- newshomepages/analyze/drudge.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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]