Research Article

Big Data Aspect-Based Opinion Mining Using the SLDA and HME-LDA Models

Algorithm 2. The initialization of Gibbs sampling.

1: for to Ddo
2:  //Randomly assign topic t to sentences in Corpus
3:  t = randomint from (1, T);
4:  documentTopics [d] = t;
5:  documentTopicsCount [d][t]++;
6:  for to Ndo
7:   //Randomly assign value to y
8:   y = randomint from (0,1);
9:   ;
10:   //Randomly assign value to u
11:   u = randomint from (0,1);
12:   ;
13:   ify ==0 then
14:    //statistic of aspect targets with topic t plus 1
15:    aspectWordCount [w][t]++;
16:   end if
17:   ify ==1 and u ==0 then
18:    //statistic of positive opinion with topic t plus 1
19:    positiveWordCount [w][t]++;
20:   end if
21:   ify ==1 and u ==1 then
22:    //statistic of negative opinion with topic t plus 1
23:    negativeWordCount [w][t]++;
24:   end if
25:  end for
26: end for
Algorithm 2. The initialization of Gibbs sampling.