#region Description: task7
#7. Consider categories generated by Empath Client https://github.com/Ejhfast/empath-client. Apply Empath Client to D1
#and D2 class,  and report those categories who held non-zero weights. Record these findings in database, where for each
#tweet message, assign the corresponding set of Empath categories.

#endregion
print('input is: translated_tweet')
#####################################################################################
from empath import Empath
lexicon = Empath()

tweet_cats=[]
for tweet in translated_tweet:
    categories = lexicon.analyze(tweet, normalize=True)
    cats = [key for key, val in categories.items() if val >= 0.05]
    tweet_cats.append(cats)