# Semantic Search Enhanced with Rating Scores
## 3 The Semantic Similarity Method
#### SemSim\({}^{e}\)  
The _SemSim\({}^{e}\)_ method, which is based on _SemSim_, has been conceived in order to manage a more refined representation of an \(OFV\), where concepts are associated with scores. In _SemSim\({}^{e}\)_, an \(OFV\) is indicated as \(OFV^{e}\) and, similar to the previous section, \(RV^{e}\) and \(AV^{e}\) as well.  
In our approach, the presence of the scores in the \(AV^{e}\) and \(RV^{e}\) represents a refined annotation and a refined request vector, respectively. In the case of the \(AV^{e}\), each score, denoted by \(s^{a}\), stands for the quality level of the feature characterizing the resource, while in the case of \(RV^{e}\), denoted by \(s^{r}\), it indicates the priority degree assigned by the user to the requested feature. As mentioned above, these scores are: \(H\) (_High_), \(M\) (_Medium_), or \(L\) (_Low_). Therefore, a given \(OFV^{e}\), say _of\(v^{e}\)_, is represented as follows:  
\[\textit{of}v^{e}=\{(c_{1},s_{1}),...,(c_{n},s_{n})\}\]  
where \(s_{i}\) is \(s_{i}^{a}\) or \(s_{i}^{r}\), \(c_{i}\) is a \(c_{i}^{a}\) or \(c_{i}^{r}\), \(i=1,\ldots,n\).  
The _sensim\({}^{e}\)_ function evaluates the similarity between an \(AV^{e}\) and a \(RV^{e}\), represented as \(av^{e}\) and a \(rv^{e}\), respectively, by coupling their elements. The value calculated by _sensim\({}^{e}\)_ is achieved by multiplying the _consim_ value by the _score matching_ value, namely \(sm\), illustrated in Table 1, on the basis of both \(s^{a}\) and \(s^{r}\) scores. Formally, given:  
\[\begin{array}{l}rv^{e}=\{(c_{1}^{r},s_{1}^{r}),...,(c_{m}^{r},s_{m}^{r})\}\\ av^{e}=\{(c_{1}^{a},s_{1}^{a}),...,(c_{n}^{a},s_{n}^{a})\}\end{array}\]  
_sensim\({}^{e}(rv^{e},av^{e})\)_ is defined as follows:  
\[\begin{array}{l}sensim^{e}(rv^{e},av^{e})=\frac{\sum_{(c_{i}^{r},c_{j}^{a}) \in P_{M}}{consim(c_{i}^{r},c_{j}^{a})*sm(s_{i}^{r},s_{j}^{a})}}{m}\end{array} \tag{3}\]  
where \((c_{i}^{r},s_{i}^{r})\in rv^{e}\), \((c_{j}^{a},s_{j}^{a})\in av^{e}\), and \(P_{M}\in\mathcal{P}(rv,av)\) is utilized to evaluate the _sensim_ value between \(rv\) and \(av\), without considering the rating scores of both \(rv^{e}\) and \(av^{e}\).  
As mentioned above, in the experimentation presented in the next section, we also address an evolution of \(SemSim\), referred to as \(SemSim_{RV}\), where in contrasting the \(RV\) with the \(AV\), analogously to \(SemSim^{e}\), the number of features defined in the user request are considered rather than the maximal cardinality of the compared \(OFV\). Formally, the \(sensim_{RV}(rv,av)\) function is defined as the _sensim_(\(rv\), \(av\)) (see formula (2)), where \(max\{n,m\}\) is replaced by the cardinality of the request vector \(m\), i.e.,  
\[\begin{array}{l}sensim_{RV}(rv,av)=\frac{max_{P\in\mathcal{P}(rv,av)}\{\sum_ {(c_{i}^{r},c_{j}^{a})\in P}{consim(c_{i}^{r},c_{j}^{a})}\}}{m}\end{array} \tag{4}\]  
Note that \(max\{n,m\}\) in Equation (2) has been replaced in both Equations (3) and (4) by \(m\), which is the cardinality of the request vector, in order to give relevance to the user request and, in particular, to the features searched by the user.  
\begin{table}
\begin{tabular}{c|c c c c} \hline \multicolumn{5}{c}{\(s^{r}\)} \\ \hline  & & \(H\) & \(M\) & \(L\) \\ \hline \multirow{3}{*}{\(s^{a}\)} & \(H\) & 1.0 & 0.8 & 0.5 \\  & \(M\) & 0.8 & 1.0 & 0.8 \\  & \(L\) & 0.5 & 0.8 & 1.0 \\ \hline \end{tabular}
\end{table}
Table 1: The score matching function \(sm\).