# Context-Based Model for Browsing the Web Through Voice
## 5 Model Functionalities for Voice-Based Web Browsing
### Contexts and Query Matching  
As mentioned in previous sections, the context of the user, the context of web pages, and the user request are represented by descriptor terms that are basically keywords. Based on the comparison and analysis of these keyword sets, the most appropriate content for the user is sought. The objective of the comparison is to determine which set of keywords from the context of web pages has the highest similarity to the keywords from the user's context and request. Measures of similarity and distance are used in various fields to quantify and compare the similarity or difference between sets or elements. Since, in this problem, we wish to compare sets of words with each other, Jaccard's coefficient [40] was chosen for the following reasons:  
* It is suitable for comparing sets;
* It considers only the presence or absence of words in the sets, regardless of the order or frequency of occurrence;
* It does not take into account duplicates within sets;
* It provides intuitive interpretation. As illustrated in Figure 6, the context matching process consists of two phases: \begin{table}
\begin{tabular}{c c c} \hline
**Type** & **Description** & **Example** \\ \hline \multirow{2}{*}{amod} & \multirow{2}{*}{Indicates that an adjective modifies a noun} & “red apple”: the adjective “red” modifies the noun “apple”. \\ \multirow{2}{*}{nmod} & \multirow{2}{*}{Indicates that a noun modifies} & “geography book”: the noun “geography” modifies the noun “book”. \\  & & another noun & modifies the noun “book”. \\ \multirow{2}{*}{nsubj} & \multirow{2}{*}{Indicates that a noun performs the main} & “The dog banks”: the noun “dog” performs the main action in the sentence. \\ \multirow{2}{*}{nsubj} & \multirow{2}{*}{Indicates that a noun performs the main} & “geography book”: the noun “geography” modifies the noun “book”. \\  & & modifies the noun “book”. \\ \multirow{2}{*}{nsubj} & \multirow{2}{*}{Indicates that a noun performs the main} & “The dog banks”: the noun “dog” performs the main action in the sentence. \\  & & actions in a sentence & performs the main action in the sentence. \\ \hline \end{tabular}
\end{table} 
Table 7: Dependency relationships. Figure 6: Phases of contexts and query matching. Phase 1: the matches between the keywords extracted from the User Request Keywords and the User Context Keywords are identified. The values of the first column of the User Context table (see Table 5) are taken and compared with the User Request Keywords. When a match is found, the User Context Keywords of a certain row is added to the User Request Keywords;
* Phase 2: the Jaccard coefficient is calculated between the keywords resulting from the identification of matches and the keywords of the context of each web page (see Resulting Keywords and Web Page Contextual Keywords in Figure 6). As mentioned above, the Jaccard coefficient is a numerical measure of the degree to which two sets of data are similar. The values of this coefficient are between zero, when there is no similarity, and one, when there is total similarity. The Jaccard coefficient is defined as the size of the intersection of the sets divided by the size of their union [40]. Mathematically, it is expressed as follows: \[J(A,B)=\frac{|A\cap B|}{|A\cup B|}\] (1) where:
* \(A\) and \(B\) are sets of data;
* \(|A\cap B|\) represents the cardinality of the intersection of \(A\) and \(B\), i.e., the number of elements present in both \(A\) and \(B\);
* \(|A\cup B|\) denotes the cardinality of the union of \(A\) and \(B\), i.e., the number of unique elements in both sets. Finally, five of those web pages whose set of Web Page Contextual Keywords (WPCK) has obtained a high similarity with the set of Resulting Keywords (RK) are selected, i.e., they have a Jaccard coefficient \(J\)(_WPCK_, _RK_) close to 1. The selected pages are listed as results to be presented to the user. The remaining five pages are sorted by similarity, from highest to lowest, and temporarily stored in case the user wants to explore or navigate them without making a new search request.