Skip to main content
. 2022 Jan 20;10(2):198. doi: 10.3390/healthcare10020198
Algorithm 1. Algorithm of sentiment orientation analysis based on sentiment dictionary
1. // Calculation of sentiment value
2. if vi in sentiment_dict
3.   then Ei=Avi×Bvi
4. if vi in privative_words
5.   then Ei=Cvi×Bvi
6. Esi=i=1kEi // the sentiment tendency of each sentence scores
7. E=i=1nEsi // total score of sentiment tendency of single comment text on Weibo
8. // Analysis of sentiment tendency. The rules of classification are as follows.
9. if E > 0
10.   then E is positive
11.   else if E = 0
12.      then E is neutral
13.      else E is negative