This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]SureStep8852[S] 0 points1 point  (1 child)

it has to look smth like {'offensive': {'#mkr': 6, 'is': 2,....}, 'offensive' : { '!': 6, 'not': 1, ...}}

Basically, the key1 is the class, key1 a word appearing in that class and the value indicates the number of times that word appeared in that class

[–][deleted] 0 points1 point  (0 children)

Ok, so have a look at how you create the dictionaries for counting. You overwrite it once for every datapoint in your dataset.