diff --git a/social_sent_helpers.py b/social_sent_helpers.py new file mode 100644 index 0000000000000000000000000000000000000000..d690bf037e4ebb3e8dbcad4306efe0792ad05772 --- /dev/null +++ b/social_sent_helpers.py @@ -0,0 +1,16 @@ +import pandas as pd +from os import listdir +from os.path import isfile, join +from tqdm.notebook import tqdm + +def read_lexicon(name): + return pd.read_csv("lexicons\\"+ name +".tsv", names=["word", "so", "sd"], header=None, sep="\t", engine="python") + +def list_lexicons(): + return pd.Series([f[:-4] for f in listdir("lexicons") if isfile(join("lexicons", f))]).sort_values() + +def read_all_lexicons(): + return [read_lexicon(name) for name in tqdm(list_lexicons(), desc="Reading lexicons from disk")] + +games_list = ["gaming", "Smite", "skyrim", "PS4", "xboxone", "Eve"] +sports_list = ["sports", "hockey", "Fitness", "baseball", "MMA", "bicycling"] \ No newline at end of file