marmarbar003 / TxtMin-Project-SA

0 stars 0 forks source link

Relative Frequencies? #3

Open hannahhommel opened 4 months ago

hannahhommel commented 4 months ago

If we have time should we look at the relative word frequencies?

I think it would look something like this:

For the positive words: relative_frequencies = {word: count / total_words for word, count in word_counter.items()} return relative_frequencies

For the negative words: relative_frequencies = {word: count / total_words for word, count in negative_word_counter.items()} return relative_frequencies

And then something like this: (sentimentalORnegative)_word_relative_freq = {} for gender in genders: (sentimentalORnegative)_word_relativefreq[gender] = analyze(sentimentalORnegative)_words_by_gender(data, gender)

Does this make sense? I would try to run it myself, but the code is not running on my laptop right now for some reason.