From e51d681479d0da320810534e36065adc3481f52b Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Tue, 23 Nov 2021 14:40:00 -0500 Subject: [PATCH] [+] Add Chinese and Japanese keywords --- src/process/twitter_process.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/process/twitter_process.py b/src/process/twitter_process.py index 6870413..14acf6a 100644 --- a/src/process/twitter_process.py +++ b/src/process/twitter_process.py @@ -213,8 +213,17 @@ def is_covid_related(text: str) -> bool: :param text: Text content :return: Whether the text is covid related """ - # We cannot include words like "pandemic" or "vaccine" because they might refer to other + # English + # We're hesitate to include words like "pandemic" or "vaccine" because they might refer to other # pandemics or other vaccines. However, I think we need to include "the pandemic" because many - # posts refer to covid only as "the pandemic". - keywords = 'covid; the pandemic; lockdown; spikevax; comirnaty; vaxzevria; 疫情'.split('; ') + # posts refer to covid only as "the pandemic." + keywords = ['covid', 'the pandemic', 'lockdown', 'spikevax', 'comirnaty', 'vaxzevria', + 'coronavirus', 'moderna', 'pfizer', 'quarantine', 'vaccine'] + + # Chinese + keywords += ['新冠', '疫情', '感染', '疫苗', '隔离'] + + # Japanese + keywords += ['コロナ', '検疫'] + return any(k in text.lower() for k in keywords)