Research Article

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

Algorithm 3. The result processing of the Gibbs sampling.

1: //Create a 3d array to store results
2: init results[][][]
3: for topic in TopicList do
4: for wordType in {A, P, N} do
5:  for v in V do
6:   result = new result
7:   result.topic = topic
8:   result.word = v
9:   result.wordType = wordType
10:   Calculate according to Equation. (13), Equation. (14), Equation. (15)
11:   result.prob =
12:   //Add result to the array
13:   results[topic][wordType][v] = result
14:  end for
15: end for
16: end for
17: //Next, sort the results
18: for topic in TopicList do
19: /Store sentences contain results
20: finalResults[][][]
21: for wordType in {A, P, N} do
22:   //Sort byvalue and get the results of the top m
23:   finalResults[topic][wordType] = getTopKByPhi(results[topic][wordType], m)
24:   for to m do
25:   Query the corresponding sentence of result.v from the inverted index described in Section 3.1.1 and add it to the result
26:   end for
27: end for
28: end for
29: return finalResults
Algorithm 3. The result processing of the Gibbs sampling.