# SmartTips: Online Products Recommendations System Based on Analyzing Customers Reviews
## 4 The Proposed System for Product Recommendations
### Rating Products  
The primary task of the proposed recommender system is rating products, which has been built primarily on the prominent aspect terms within the text [40]. Generally, the proposed model for rating products considers the following information: review text, aspect term frequency, sentiment words,and their polarities, where the number of positive or negative sentiment words towards each aspect term were considered, and readers' vote on each review containing one or more aspect terms. Moreover, we consider only reviews from actual practice by accepting reviews submitted by customers with verified purchases. The inputs to this task are the review data, including the review text itself, and meta-data, specifically the readers' votes. We believe that positive readers' votes are a significant indicator of the relevance and confidence of the review's assumptions; conversely, negative votes represent a justification of distrust of the customer's assumptions. The negative experiences of some customers with a particular product or company may push them to take revenge by writing some imaginary defects in the product, so the readers' disagreement with the comment is considered evidence of the lack of credibility of the review. The model starts with applying the aspect term extraction model to the review text--next, the extraction of opinion words associated with aspect terms from each review, respectively. The dependency relations extracted through applying the dependency parser with the help of POS tags is the more suitable method for extracting the opin  
Figure 3: The overall scheme of the proposed recommender system. ion words. Subsequently, measuring the polarity of these words using the lexical-based technique to rate the extracted aspects. Algorithm 1 presents the technique followed for computing the sentiment score for each aspect related to a specific product in the dataset. ```
1:(LIST: Review_Data)
2:(LIST: Aspect_Terms)
3:(LIST: Aspect_Ratings)
4:Initialization:
5:Create \(\leftarrow\) (LIST : Aspect_Ratings)
6:for each review \(\in\) Review_Data do
7: Extract \(\leftarrow\) review \(\Rightarrow\) {\(v^{+}\),\(v^{-}\)}
8: Extract \(\leftarrow\) review \(\Rightarrow\) \"review_text\"
9:for each token \(\in\) review_text\"
10:if token \(\in\) Aspect_Terms then
11:if token \(\
ot\in\) Aspect_Ratings then
12: Append \(\leftarrow\) token \(\Rightarrow\) \"Aspect_Ratings\"
13:endif
14: Extract \(\leftarrow\) review_text : token \(\Rightarrow\) \"sentiment_words\"
15:Count \(\leftarrow\) sentiment_words \(\Rightarrow\) \"csv\"
16: Add \(\leftarrow\) csw \(\Rightarrow\) Aspect_Ratings[\"token\"][\"sw_count\"]
17: Detect \(\leftarrow\) sentiment_words \(\Rightarrow\) \"polarity\"
18:if (polarity == positive) then
19:\(psc=\) csw + \(v^{+}-v^{-}\)
20: Add \(\leftarrow\) psc \(\Rightarrow\) Aspect_Ratings[\"token\"][\"pscore\"]
21:elseif (polarity == negative) then
22:\(nsc=\) csw + \(v^{+}-v^{-}\)
23: Add \(\leftarrow\) nsc \(\Rightarrow\) Aspect_Ratings[\"token\"][\"nscore\"]
24:endif
25:endif
26:endfor
27:endfor
28:for each aspect \(\in\) Aspect_Ratings do
29:\(ssc=(\) aspect[\"pscore\"]-aspect[\"nscore\"])/aspect[\"sw_count\"]
30: Add \(\leftarrow\) ssc \(\Rightarrow\) Aspect_Ratings[\"aspect\"][\"sscore\"]
31:endfor
32:return Aspect_Ratings
```  
**Algorithm 1** Computing the sentiment score  
In general, the rating of various aspects related to a particular product can be performed by calculating the sentiment score \"_SScore_\", which is primarily based on the derivation of two leading indicators: the positivity score \"_PScore_\" and the negativity score \"_NScore_\", which can be obtained using the following equations. \[PScore(a)= \begin{cases}\sum\limits_{i=1}^{k}\,p_{r_{i}}+v_{r_{i}}^{+}-v_{r_{i}}^ {-}&\text{ if }p_{r_{i}}>0,\\ 0&\text{ if }p_{r_{i}}=0,\end{cases}  \tag{1}\]  
where \(p_{r_{i}}\) refers to the number of positive words associated with the aspect \"a\" in the \(i\)th review, and \(v_{r_{i}}^{+},v_{r_{i}}^{-}\) refers to the number of positive and negative readers' votes, respectively.