From 04ac0ff847756e6a191ae72c07fcd9076e4f67db Mon Sep 17 00:00:00 2001 From: DE0CH Date: Mon, 22 Jun 2020 01:02:57 +0800 Subject: [PATCH] updated goe_filter so it doesn't use google trans --- geo_filter.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/geo_filter.py b/geo_filter.py index 3ca1868..134f231 100644 --- a/geo_filter.py +++ b/geo_filter.py @@ -53,8 +53,10 @@ def process_files(path, dirs, files, geo_filtered_dict): os.makedirs('processed') except FileExistsError: pass + processes = [] for i in range(100): p = multiprocessing.Process(target=worker, args=(q, geo_filtered_dict)) + processes.append(p) p.start() os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = 'twitter-sentiment-analysis-f22ce784b0a8.json' try: @@ -67,5 +69,7 @@ def process_files(path, dirs, files, geo_filtered_dict): with open('geo_filtered.pkl', 'wb') as f: pickle.dump(geo_filtered, f) print('done') + for p in processes: + p.kill()