-
-
Save amankharwal/633adf9dd1b736bc82f7848671caedff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
l = ["joy", 'fear', "anger", "sadness", "disgust", "shame", "guilt"] | |
l.sort() | |
label_freq = {} | |
for label, _ in data: | |
label_freq[label] = label_freq.get(label, 0) + 1 | |
# print the labels and their counts in sorted order | |
for l in sorted(label_freq, key=label_freq.get, reverse=True): | |
print("{:10}({}) {}".format(convert_label(l, emotions), l, label_freq[l])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment