## 3 Methodology
### Preprocessing Module
The \(EAV\) is defined as the set of tuples:_

Figure 2.6

_where \(\forall id_{i}.ID\) are UIDs and \(\forall eq_{j}.EA\) are the constituent elements in each \(ap_{j}.AP\)._

An example of an \(EAV\) derived from \(AV\) can be given as: \(EAV=\{(ID\): \"0\", \(EA\): {\"waiter\"}), (\(ID\): \"1\", \(EA\): {\"food\"}), and (\(ID\): \"2\", \(EA\): {\"views\", \"of\", \"city\"})\(\}\)). Another example of \(EAV\) can be demonstrated as \(EAV=\{(ID\): \"0\", \(EA\): {\"bread\", \"and\", \"butter\", \"pudding\", \"with\", \"blueberries\"})\(\}\)). 1. Analysis of Aspect Term Types: This stage involves identifying the types associated with each aspect term extracted in \(AV\). To accomplish this, each element of aspect term \(ea_{j}.EA\in EAV\) is examined to ascertain whether it represents a single-aspect term or comprises multiple-word aspect terms. In the case of a single-word aspect term, such as {\"waiter\"} or {\"food\", SPARQL queries are utilized to interrogate the properties \"dbo:type\" or \"rdf:type\" within LOD resources, thereby determining the types associated with these entities for extended aspect terms. When dealing with multiple-word terms, as exemplified by {\"bread\", \"and\", \"butter\", \"pudding\", \"with\", \"blueberries\"}, extracted from the intricate multiple-word aspect term \"bread and butter pudding with blueberries\", determining the type of this term directly from LOD is not feasible. Only fragments of it can be retrieved from LOD. Hence, a combination of the N-gram model and LOD is employed to ascertain the type of these multiple-word aspect terms. This process unfolds in three steps: The initial step entails determining the N-gram size of each \(ea_{j}.EA\), which represents a multiple-word term. This determination is achieved by utilizing Equations (3) and (4) [45] from the N-gram model, as illustrated in the sample outcomes presented in Figure 2.7

Figure 2.8

Figure 2.9

where \(Ngram\) is the sequence of \(N\) consecutive words, and \(m\) represents the length of each multiple-word term. Subsequently, the second step entails selecting the first index for each N-gram size, such as [bread], [bread and], [bread and butter], [bread and butter pudding], [bread and butter pudding with], and [bread and butter pudding with blueberries]. Lastly, the types of each sequence are examined using the \"dbo:type\" or \"rdf:type\" properties through SPARQL from the LOD, as shown in the example results in \[DG=<V,E>,\]0

This study delves into the efficacy of N-gram indexing for entity type identification. The initial N-gram indexes across various N-gram sizes are detailed in \[DG=<V,E>,\]1 The detail shows that unigrams (1-gram, e.g., \"bread\") and quadrigrams (4-gram, e.g., \"bread and butter pudding\") can yield satisfactory accuracy. Notably, the entity type of the 4-gram \"bread and butter pudding\" accurately encompasses both \"pudding\" and \"food\". Similarly, the unigram \"bread\" is precisely classified as both \"food\" and \"mouna\" (a specific bread type). This observation underscores the effectiveness of extrapolating the entity type captured by the 4-gram to represent the type of the entire multiple-word term. \begin{table}
\begin{tabular}{c c} \hline \hline
**N-Gram Size** & **Sequence Examples** \\ \hline
1-gram & [bread], [and], [butter], [pudding], [with], [blueberries] \\
2-gram & [bread and],[and butter], [butter pudding], [pudding with], [with blueberries] \\
3-gram & [bread and butter], [and butter pudding], [butter pudding with], [putding with], [putding with blueberries] \\
4-gram & [bread and butter pudding], [and butter pudding with], [butter pudding with], [butter pudding with blueberries] \\
5-gram & [bread and butter pudding with], [and butter pudding with], [and butter pudding with blueberries] \\
6-gram & [bread and butter pudding with blueberries] \\ \hline \hline \end{tabular}
\end{table} 
Table 1: An example results of the N-gram sequences.