Algorithm 1.
T = List(t) |
Ct = List() |
w = Set() |
At = List(multimodal_terms) |
csv = DataFrame() |
defclean(T): |
foreach tTdo: |
t.remove_hyperlinks() |
t.remove_punctuation() |
Ct.append(t) |
end for |
returnCt |
defcategory_wise(Ct, w, At): |
foreach tCtdo: |
w = Set(t.split()) |
ifwintersectionAt != NULLdo: |
csv.append(t) |
end if |
end for |
returncsv |
defpos_tagging(csv): |
foreach tcsvdo: |
pos_tagged= List(pos_tag(t)) |
ifword_class == adjorword_class == adv |
pos_words.append(word) |
end if |
end for |
returnpos_words |
deflexicon(pos_words): |
forword in lexicon_wordsdo: |
ifword intersection pos_words != 0 |
do:emotion_words.append(word) |
end if |
end for |
returnemotion_words |
defcount_frequency(emotion_words): |
foreach emotion_wordstwdo: |
word_count += 1 |
word_dict.add(emotion_word,word_count) |
end for |
returnword_dict |
defscoring_system(word_dict): |
forrow in lexicon_words.itertuples(): |
ifkey,value in word_dict.items(): |
if(row.key ==1): |
value += 1 |
end for |
end for |
end |