Require: Reddit comments. Ensure: Sentiment label (positive, negative, or neutral). 1: For (each comments in the dataset) do. 2: For (each word in the comments) do. 3: Repersented it with its part of speech using POS tagging. 4: Look up the polarity score of it in a sentiment lexicon dictionary. 5: End for. 6: Compute the average polarity of all the words in the comment. 7: If (average polarity > 0.05) then label the comment with a positive sentiment. 8: Else if (average polarity Î [−0.05, 0.05]) then label the comment with a neutral sentiment. 9: Else label the comment with a negative sentiment. 10: End if. 11: End for. |