From f08a21d8af40ed61b7a2198b43f2fc1c5c894943 Mon Sep 17 00:00:00 2001 From: Daniel <59575049+lemoentjiez@users.noreply.github.com> Date: Mon, 26 Dec 2022 15:25:12 +0200 Subject: [PATCH] Update networking.py --- LabPSA_3/networking.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/LabPSA_3/networking.py b/LabPSA_3/networking.py index 1186450..5aabaf0 100644 --- a/LabPSA_3/networking.py +++ b/LabPSA_3/networking.py @@ -1,4 +1,3 @@ - import json import matplotlib.pyplot as plt import nltk @@ -125,7 +124,15 @@ for noun in nouns_counted: if noun in words_per_tweet[id]: normLikes += likes_per_id[id] normRetweets += retweets_per_id[id] - popularity_nouns[noun] = word_count_dict[noun] * (1.4 + normRetweets) * (1.2 + normLikes) + popularity_nouns[noun] = word_count_dict[noun] * (1.4 * normRetweets) * (1.2 * normLikes) + if (noun == "right"): + print("KID NOUN") + print("KID RT") + print(normRetweets) + print("KID LIKES") + print(normLikes) + print("KID FREQ") + print(word_count_dict[noun]) popularity_nouns = dict(sorted(popularity_nouns.items(), key=lambda item: item[1], reverse=True)) # Outputs popularity nouns