Last active
August 12, 2018 05:41
-
-
Save maxca/7faf6a50f35d4f62c4a3a2b1a4dcdeec to your computer and use it in GitHub Desktop.
pseudo code.text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Author: [email protected] | |
**/ | |
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