From fc16ab7c5daf722972a7710107755991bbe7e2a6 Mon Sep 17 00:00:00 2001 From: AuYeung Date: Tue, 6 Aug 2024 15:24:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=87=E6=BB=A4=E7=A9=BA=E7=99=BD=E5=AD=97?= =?UTF-8?q?=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/words.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/words.py b/tools/words.py index d9f0a8c..3ca0778 100644 --- a/tools/words.py +++ b/tools/words.py @@ -27,7 +27,7 @@ class AsyncWordCloudGenerator: async def generate_word_frequency_and_cloud(self, data, save_words_prefix): all_text = ' '.join(item['content'] for item in data) - words = [word for word in jieba.lcut(all_text) if word not in self.stop_words] + words = [word for word in jieba.lcut(all_text) if word not in self.stop_words and len(word.strip()) > 0] word_freq = Counter(words) # Save word frequency to file