Skip to content

Instantly share code, notes, and snippets.

@maxca
Last active August 12, 2018 05:41
Show Gist options
  • Save maxca/7faf6a50f35d4f62c4a3a2b1a4dcdeec to your computer and use it in GitHub Desktop.
Save maxca/7faf6a50f35d4f62c4a3a2b1a4dcdeec to your computer and use it in GitHub Desktop.
pseudo code.text
/**
* Author: Samarkchsngn@gmail.com
**/
INPUT: Word
Output: Sentiment Classification
Set class = {positive, negative, neutral}
Set prior = {0.3333, 0.3333, 0.3333}
Set score = 1
IF (word === dictionary’s word)
$score = $score * ($count + 1)
Else
$count = 0
# for caculator score of class
$score[class] = prior[class] * $score[classs]
# for counting total of class item
For each (classes as class)
$totalscore[class] += $socre[class]
# for calculator score of class division by total item
For each (classes as class)
$score[class] = $score[class] / $totalsocre[class]
Return Classification
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment