# Research of Contextual Semantic Reasoning Model Based on Domain Ontology

Authors: Jinhai Li; Yunlei Ma; Xiang Zhan; Jiaming Pei
Journal: Scientific Programming
 (2021)

---

## Abstract

With the development of mobile network technology and the popularization of mobile terminals, traditional information recommendation systems are gradually changing in the direction of real-time and mobile information recommendation. Information recommendation brings the problem of user contextual sensitivity within the mobile environment. For this problem, first, this paper constructs a domain ontology, which is applicable to the contextual semantic reasoning model. Second, based on the “5W + 1H” method, this paper constructs a context pedigree of the mobile environment using a model framework of a domain ontology. The contextual factors of the mobile environment are divided into six categories: the What-object context, the Where-place context, the When-time context, the Who-subject context, the Why-reason context, and the How-effect context. Then, considering the degree of influence of each contextual factor from the mobile context pedigree to the user is different, this paper uses contextual conditional entropy to calculate the contextual weight of each contextual attribute in the recommendation process. Based on this, a contextual semantic reasoning model based on a domain ontology is constructed. Finally, based on the open dataset provided by GroupLens, this paper verifies the validity and efficiency of the model through a simulation experiment.


---

## Body

## 1. Introduction

User sensitivity to context and user preference are two major mechanisms of information recommendation in the mobile Internet environment. Between them, user preference has been widely studied by domestic and foreign scholars, and many user preference models that can be used in recommendation systems have been constructed. For example, Wu et al. constructed an anonymous user preference model by combining the short-term preferences of anonymous users with the long-term preferences of various professional user groups [1]. Weng et al. used a standard LDA model to mine user preferences [2]. However, although scholars have preliminarily explored contextual sensitivity, there is still a lack of systematic and in-depth study.Context is the environmental factor that influences the expression of user needs [3]. Concerning the definition of contextual sensitivity, Akbulut et al. explained that contextual sensitivity refers to the reactions and special needs of users in a given environment [4]. In the mobile network environment, the user recommendation service not only needs to consider the user’s preferences but also needs to meet the individual needs according to the real-time environment in which the user is. Most of the existing context-sensitive recommendation services provide user location information based on GPS and recommend eligible information using a group of users at the same location. On this basis, to better provide personalized services for users in the mobile network environment, some scholars introduce other contextual factors such as time to achieve real-time and on-the-spot delivery of information corresponding to user context to meet the user’s personalized needs in a specific geographical location and at a specific time [5, 6].It can be seen that context plays a key role in the personalized needs of users in the mobile environment. However, through the study of recommendation problems in different fields, it is found that the contextual factors considered in different fields are not the same, and the degree of influence of various contextual factors on the personalized needs of users is also quite different.The sensitivities of different users to the context are different. How the context affects the user’s personalized selection is a function of the contextual semantics, while the contextual semantics in specific environments are derived from a contextual semantic reasoning model. Therefore, this paper will focus on the reasoning process of contextual semantics.


## 2. Related Literature Research

This section mainly reviews the latest domestic and foreign related studies that focus on the application and reasoning of contextual semantics.Li et al. constructed a recommendation algorithm that combined semantic association and context awareness. The algorithm improved the overspecialization problem of traditional recommendations by employing a case similarity algorithm based on semantic association. It enhanced the contextual sensitivity of recommendation results based on context awareness [7]. Aleman et al. also combined semantic association with context awareness and assigned different weights for semantic association and context awareness to recommend and rank resources through postcontext filtering. It was proven that a recommendation algorithm combining semantic association and context awareness can improve the problem of a lack of contextual sensitivity [8, 9]. In the dynamic service quality prediction of personalized service recommendations, Jin et al. designed a two-stage prediction method based on historical and current contexts. This method predicted the missing value of the current context based on the results of the historical context [10]. Zhang et al. researched the anchor recommendation of live streaming platforms. They proposed a model of multihead related unit to capture the preference matching between the viewer and the anchor based on the dynamic changes of the context and the preference of both the viewer and the anchor [11]. Kim et al. proposed a context-aware model by merging context awareness in a personalized health service system. The model was applied to extract missing values of user preference in a collaborative filtering algorithm and realized the fusion of collaborative filtering and context awareness [12].The usage of contextual semantics in personalized recommendation systems is mainly divided into two categories: one is based on context filtering and the other is based on context modeling. For the method based on context filtering, the contexts of the target user are determined, and then the similarity between the current context and each historical context is calculated. The datasets with low similarity are removed, and the filtered datasets are used for recommendation. Compared with the recommendation based on the whole dataset, this method has lower time and space complexity, but some semantic relevance is lost while filtering the dataset [13]. The method based on context modeling has higher recommendation performance, although the modeling process is more complex. Nitu et al. integrated users’ recent travel interests into a personalized travel recommendation system. An improvising personalized travel recommendation system was constructed by adding the recency weight, which was sensitive to time context, into the model [14]. Karatzoglou et al. applied multivariate recommendation to context modeling and implemented tensor decomposition by using Tucker decomposition. This method has good prediction accuracy, but it can only be applied to simple classification contexts [15]. Mi et al. proposed an enterprise knowledge recommendation algorithm based on a factor decomposition machine. By transforming contextual data of knowledge into feature vectors, enterprise data can be effectively utilized to meet the individual knowledge needs of employees, and knowledge recommendations can be targeted accurately [16].In addition to being widely used in the field of personalized recommendation, the context has also been applied in some special fields. For example, in the study of cell type identification which is a key step in cellular heterogeneity analysis, Tian et al. regarded the data of single-cell RNA-sequencing themselves, which needed to be identified as contextual factors in the recommendation of clustering methods, to recommend the most suitable clustering method for cell type identification [17]. Malek et al. proposed an electric vehicle speed prediction method for univariate and multivariate contexts based on long short-term memory. The results show that the multivariate context model is better than the univariate context model in short-term and long-term prediction [18]. Khazbak et al. proposed an enhanced scheme that allows a user to specify their location context privacy preference for user privacy in ride-hailing services, and the scheme can better protect a user’s privacy at the cost of limited matching accuracy [19].In the mobile Internet environment, the user’s context information is more dynamic, and the existing context classification cannot cover all the contexts that may appear. Therefore, a context modeling method based on the classification context has poor universality. In a recommendation based on context awareness, the importance of each contextual factor to the user’s preferences is different, which cannot be simply treated equally, so it is necessary to analyze the influence of different contextual factors on a user’s preferences.


## 3. Construction of Contextual Semantic Reasoning Model Based on Domain Ontology

Ontology is considered the most effective tool for modeling contextual semantics. Contextual information can develop contextual ontology using domain ontology, so the entities in a contextual reality can be formalized and mapped into a machine-understandable and sharable knowledge structure for reasoning in contextual semantics [20]. Therefore, this paper builds a contextual semantic reasoning model based on a domain ontology.


### 3.1. Construction of Domain Ontology

Based on the specific domain requirements involved in the mobile environment, the domain ontology required by the reasoning model is determined. On the one hand, the mapping rules for the conversion from a vocabulary to an ontology are made based on a thesaurus. On the other hand, taking existing ontologies in the domain as supplementary resources, the concept of vocabulary is formalized and mapped, and the ontology is reused and reconstructed to form the core concept and relational system that can reflect the common characteristics of the domain. Thus, a domain ontology for the organization and description of contextual semantics is constructed, and the detailed description file of domain ontology is formed [21].The construction of a concept system is the focus of the construction of a domain ontology [22]. It mainly consists of five parts: identifying the core classes of the ontology, determining the hierarchy of the classes, defining the relationships between the classes, defining the attributes of the classes, and creating instances of the classes. The specific process of constructing a domain ontology is shown in Figure 1.Figure 1
The construction process of a domain ontology.


### 3.2. Construction of the Mobile Context Pedigree

Due to the contextual factors in the mobile environment being numerous and difficult to use, by using the “5W + 1H” method, this paper will construct a context pedigree of the mobile environment using a model framework of domain ontology. The contextual factors of the mobile environment are divided into six categories: the What-object context, the Where-location context, the When-time context, the Who-subject context, the Why-reason context, and the How-effect context. These six kinds of context basically cover all kinds of contextual factors in the mobile environment. Before the storage of the context, each contextual factor in the mobile environment is converted into one of the “5W + 1H” methods to ensure the integrity of the context.


#### 3.2.1. What-Object Context

The object context refers to the relevant information of the recommended object, including the superior category and subordinate attributes of the recommended object, that is, the upper and lower levels of the object in the ontology.


#### 3.2.2. Where-Location Context

The location context not only refers to the location information of the object and subject but also includes the environment, weather conditions, and traffic conditions related to the specific location. The contextual sensitivity of the users in the mobile environment is affected so much by these factors that the change of any subfactors will cause significant changes in the information service requirements of the users.


#### 3.2.3. When-Time Context

The time context includes not only the time node the user is currently in but also the occurrence and duration times and the frequency of occurrence of a user’s behavior. Such contextual factors can mine a user’s behavior habits and capture the user’s preferences and interests more accurately.


#### 3.2.4. Who-Subject Context

The subject context covers the user’s identity, job, income, educational background, interest, preference, and so forth. It is used to describe the basic situation of the user.


#### 3.2.5. Why-Reason Context

The reason context includes not only the reasons for the user’s demand for information services, such as birthday parties and family dinners but also the reasons for the user’s behavior that has occurred. The recommended objects will be filtered according to the comparison between current and historical reasons and the evaluation of historical behaviors.


#### 3.2.6. How-Effect Context

The effect context includes the content and quality of a successful recommendation and the feedback. The mobile environment makes the feedback behavior free from a time and place. Timely feedback can better reflect objective facts and ensure credibility.Based on the above analysis of the “5W + 1H” method, the mobile context pedigree is constructed with the domain ontology as the model framework, as shown in Figure2.Figure 2
The mobile context pedigree.The mobile context pedigree is composed of a series of core context concepts. These core concepts have a certain semantic relationship to ensure the integrity of the mobile context pedigree. Each core concept derives many subconcepts and correlates with many attributes.


### 3.3. Calculation of the Contextual Influence Based on the Conditional Entropy

The influence of the different contextual factors on a user is different in the mobile context pedigree. The different values of some context attributes have a greater influence on the user’s selection during the recommendation process, which indicates that these context attributes have a greater influence on the user’s preferences. The different values of some context attributes have a smaller influence on the user’s selection, which indicates that these context attributes have a small influence on the user’s preferences. In this paper, conditional entropy is used to calculate the influence of each context attribute in the recommendation process, and the influence weight of each context attribute on users is measured based on the contextual conditional entropy. The contextual conditional entropy reflects the uncertainty when a user selects the recommended object based on a certain context attribute. The greater the conditional entropy is, the smaller the influence of the conditional entropy on the user’s selection of the recommended object will be. The smaller the conditional entropy is, the greater the influence of the conditional entropy on the user’s selection of the recommended object will be. The method to calculate contextual conditional entropy is shown in the following:(1)HI|c=−∑i=1nPci∑j=1mPIj|cilog2PIj|ci,where HI|c represents the contextual conditional entropy of the context attribute c corresponding to the recommended object I. The larger HI|c is, the smaller the influence of the context attribute on the user’s selection of the recommended object I will be and vice versa. n represents that context attribute c contains n attribute values. m expresses that the recommended object I is divided into m selections. Pci represents the probability that the context attribute c takes the value ci, and PIj|ci represents the probability that the user selects the recommended object Ij when the context attribute c takes the value ci.The contextual weight represents the proportion of the context attribute when the user selects the recommended object. The smaller the contextual conditional entropy value is, the less uncertainty there is regarding the user’s selection after the context attribute is known, and the greater the influence of the context attribute on the user’s selection of the recommended object, which means that this context attribute has a greater weight in the recommendation. The higher the conditional entropy value is, the smaller the influence of the contextual attribute on the user’s selection of the recommended object will be. The calculation method of the contextual weight is shown as follows:(2)Wc=1−HI|cC−∑c∈CHI|c,where HI|c is the contextual conditional entropy in which the context attribute c corresponds to the recommended object I based on formula (1). C represents the set of all context attributes, and C represents the number of all context attributes.Formula (2) shows that the contextual weight is inversely correlated with the value of the contextual condition entropy. The smaller the value of the contextual condition entropy is, the larger the contextual weight is, that is, the higher the influence of the context attribute on the user’s selection of the recommended object.


### 3.4. Contextual Semantic Reasoning Model Based on Domain Ontology

The mobile context pedigree constructed in this paper not only includes mobile context information, which is divided by the Where-location context, When-time context, and Why-reason context, but also includes recommended object information which is divided by the What-object context, the user’s personal information which is divided by the Who-subject context, and the user’s evaluation information regarding the recommended object, which is divided by the How-effect context. Therefore, before performing contextual semantic reasoning, it is necessary to update the mobile context pedigree with the user’s historical context information to obtain the initial How-effect context. According to the contextual semantics contained in the mobile context pedigree, through semantic analysis, determine the relevance of user interests and contexts and summarize the reasoning rules. Then, collect the user’s current context information through the mobile client, and based on the mobile context pedigree, the user’s current context information is standardized to the standard style in the mobile context pedigree. Then, according to the reasoning rules, the user’s interest in the current context is inferred. According to the user’s feedback on the recommended object, the mobile context system is maintained and updated. The contextual semantic reasoning model based on domain ontology is shown in Figure3.Figure 3
Contextual semantic reasoning model based on domain ontology.The concept set of the context attributes includes not only the concept of the current context attribute but also the weight factor corresponding to the attribute.The key to the contextual semantic reasoning model lies in the generation of a reasoning rule set [6]. The specific process of the reasoning rule set generation is as follows.Assume that the mobile context pedigree instance set isI. First, the four concept sets of Ii for each instance are extracted from the instance set I: the context attribute concept set CI, the user attribute concept set UI, the product attribute concept set PI, and the effect attribute concept set EI. The CI contains the concept of the context attribute instance and its weight factor, the UI contains the concept of the user attribute instance, the PI contains the concept of the product attribute instance, and the EI contains the concept of the effect attribute instance. The CI, UI, PI, and EI concept sets extracted from the mobile context pedigree instances are shown in Figure 4, where the concept class to which the instance concept belongs is in brackets.Figure 4
Concept sets of various attributes.The concepts extracted from a single mobile context pedigree instanceIi are related to each other. Using the Apriori association rule mining algorithm, frequent concept association patterns can be induced from all concepts extracted by I. For each associated pattern, the concept of the context attributes belonging to CI, the concept of the user attributes belonging to UI, and the concept of the effect attributes belonging to EI are regarded as the reasoning preconditions, and the concept of the product attributes belonging to PI is regarded as the reasoning results. The associated CI, UI, PI, and EI generate the reasoning rules. A reasoning rule corresponding to the mobile context pedigree is shown in Figure 5.Figure 5
Generation of reasoning rules.


## 3.1. Construction of Domain Ontology

Based on the specific domain requirements involved in the mobile environment, the domain ontology required by the reasoning model is determined. On the one hand, the mapping rules for the conversion from a vocabulary to an ontology are made based on a thesaurus. On the other hand, taking existing ontologies in the domain as supplementary resources, the concept of vocabulary is formalized and mapped, and the ontology is reused and reconstructed to form the core concept and relational system that can reflect the common characteristics of the domain. Thus, a domain ontology for the organization and description of contextual semantics is constructed, and the detailed description file of domain ontology is formed [21].The construction of a concept system is the focus of the construction of a domain ontology [22]. It mainly consists of five parts: identifying the core classes of the ontology, determining the hierarchy of the classes, defining the relationships between the classes, defining the attributes of the classes, and creating instances of the classes. The specific process of constructing a domain ontology is shown in Figure 1.Figure 1
The construction process of a domain ontology.


## 3.2. Construction of the Mobile Context Pedigree

Due to the contextual factors in the mobile environment being numerous and difficult to use, by using the “5W + 1H” method, this paper will construct a context pedigree of the mobile environment using a model framework of domain ontology. The contextual factors of the mobile environment are divided into six categories: the What-object context, the Where-location context, the When-time context, the Who-subject context, the Why-reason context, and the How-effect context. These six kinds of context basically cover all kinds of contextual factors in the mobile environment. Before the storage of the context, each contextual factor in the mobile environment is converted into one of the “5W + 1H” methods to ensure the integrity of the context.


### 3.2.1. What-Object Context

The object context refers to the relevant information of the recommended object, including the superior category and subordinate attributes of the recommended object, that is, the upper and lower levels of the object in the ontology.


### 3.2.2. Where-Location Context

The location context not only refers to the location information of the object and subject but also includes the environment, weather conditions, and traffic conditions related to the specific location. The contextual sensitivity of the users in the mobile environment is affected so much by these factors that the change of any subfactors will cause significant changes in the information service requirements of the users.


### 3.2.3. When-Time Context

The time context includes not only the time node the user is currently in but also the occurrence and duration times and the frequency of occurrence of a user’s behavior. Such contextual factors can mine a user’s behavior habits and capture the user’s preferences and interests more accurately.


### 3.2.4. Who-Subject Context

The subject context covers the user’s identity, job, income, educational background, interest, preference, and so forth. It is used to describe the basic situation of the user.


### 3.2.5. Why-Reason Context

The reason context includes not only the reasons for the user’s demand for information services, such as birthday parties and family dinners but also the reasons for the user’s behavior that has occurred. The recommended objects will be filtered according to the comparison between current and historical reasons and the evaluation of historical behaviors.


### 3.2.6. How-Effect Context

The effect context includes the content and quality of a successful recommendation and the feedback. The mobile environment makes the feedback behavior free from a time and place. Timely feedback can better reflect objective facts and ensure credibility.Based on the above analysis of the “5W + 1H” method, the mobile context pedigree is constructed with the domain ontology as the model framework, as shown in Figure2.Figure 2
The mobile context pedigree.The mobile context pedigree is composed of a series of core context concepts. These core concepts have a certain semantic relationship to ensure the integrity of the mobile context pedigree. Each core concept derives many subconcepts and correlates with many attributes.


## 3.2.1. What-Object Context

The object context refers to the relevant information of the recommended object, including the superior category and subordinate attributes of the recommended object, that is, the upper and lower levels of the object in the ontology.


## 3.2.2. Where-Location Context

The location context not only refers to the location information of the object and subject but also includes the environment, weather conditions, and traffic conditions related to the specific location. The contextual sensitivity of the users in the mobile environment is affected so much by these factors that the change of any subfactors will cause significant changes in the information service requirements of the users.


## 3.2.3. When-Time Context

The time context includes not only the time node the user is currently in but also the occurrence and duration times and the frequency of occurrence of a user’s behavior. Such contextual factors can mine a user’s behavior habits and capture the user’s preferences and interests more accurately.


## 3.2.4. Who-Subject Context

The subject context covers the user’s identity, job, income, educational background, interest, preference, and so forth. It is used to describe the basic situation of the user.


## 3.2.5. Why-Reason Context

The reason context includes not only the reasons for the user’s demand for information services, such as birthday parties and family dinners but also the reasons for the user’s behavior that has occurred. The recommended objects will be filtered according to the comparison between current and historical reasons and the evaluation of historical behaviors.


## 3.2.6. How-Effect Context

The effect context includes the content and quality of a successful recommendation and the feedback. The mobile environment makes the feedback behavior free from a time and place. Timely feedback can better reflect objective facts and ensure credibility.Based on the above analysis of the “5W + 1H” method, the mobile context pedigree is constructed with the domain ontology as the model framework, as shown in Figure2.Figure 2
The mobile context pedigree.The mobile context pedigree is composed of a series of core context concepts. These core concepts have a certain semantic relationship to ensure the integrity of the mobile context pedigree. Each core concept derives many subconcepts and correlates with many attributes.


## 3.3. Calculation of the Contextual Influence Based on the Conditional Entropy

The influence of the different contextual factors on a user is different in the mobile context pedigree. The different values of some context attributes have a greater influence on the user’s selection during the recommendation process, which indicates that these context attributes have a greater influence on the user’s preferences. The different values of some context attributes have a smaller influence on the user’s selection, which indicates that these context attributes have a small influence on the user’s preferences. In this paper, conditional entropy is used to calculate the influence of each context attribute in the recommendation process, and the influence weight of each context attribute on users is measured based on the contextual conditional entropy. The contextual conditional entropy reflects the uncertainty when a user selects the recommended object based on a certain context attribute. The greater the conditional entropy is, the smaller the influence of the conditional entropy on the user’s selection of the recommended object will be. The smaller the conditional entropy is, the greater the influence of the conditional entropy on the user’s selection of the recommended object will be. The method to calculate contextual conditional entropy is shown in the following:(1)HI|c=−∑i=1nPci∑j=1mPIj|cilog2PIj|ci,where HI|c represents the contextual conditional entropy of the context attribute c corresponding to the recommended object I. The larger HI|c is, the smaller the influence of the context attribute on the user’s selection of the recommended object I will be and vice versa. n represents that context attribute c contains n attribute values. m expresses that the recommended object I is divided into m selections. Pci represents the probability that the context attribute c takes the value ci, and PIj|ci represents the probability that the user selects the recommended object Ij when the context attribute c takes the value ci.The contextual weight represents the proportion of the context attribute when the user selects the recommended object. The smaller the contextual conditional entropy value is, the less uncertainty there is regarding the user’s selection after the context attribute is known, and the greater the influence of the context attribute on the user’s selection of the recommended object, which means that this context attribute has a greater weight in the recommendation. The higher the conditional entropy value is, the smaller the influence of the contextual attribute on the user’s selection of the recommended object will be. The calculation method of the contextual weight is shown as follows:(2)Wc=1−HI|cC−∑c∈CHI|c,where HI|c is the contextual conditional entropy in which the context attribute c corresponds to the recommended object I based on formula (1). C represents the set of all context attributes, and C represents the number of all context attributes.Formula (2) shows that the contextual weight is inversely correlated with the value of the contextual condition entropy. The smaller the value of the contextual condition entropy is, the larger the contextual weight is, that is, the higher the influence of the context attribute on the user’s selection of the recommended object.


## 3.4. Contextual Semantic Reasoning Model Based on Domain Ontology

The mobile context pedigree constructed in this paper not only includes mobile context information, which is divided by the Where-location context, When-time context, and Why-reason context, but also includes recommended object information which is divided by the What-object context, the user’s personal information which is divided by the Who-subject context, and the user’s evaluation information regarding the recommended object, which is divided by the How-effect context. Therefore, before performing contextual semantic reasoning, it is necessary to update the mobile context pedigree with the user’s historical context information to obtain the initial How-effect context. According to the contextual semantics contained in the mobile context pedigree, through semantic analysis, determine the relevance of user interests and contexts and summarize the reasoning rules. Then, collect the user’s current context information through the mobile client, and based on the mobile context pedigree, the user’s current context information is standardized to the standard style in the mobile context pedigree. Then, according to the reasoning rules, the user’s interest in the current context is inferred. According to the user’s feedback on the recommended object, the mobile context system is maintained and updated. The contextual semantic reasoning model based on domain ontology is shown in Figure3.Figure 3
Contextual semantic reasoning model based on domain ontology.The concept set of the context attributes includes not only the concept of the current context attribute but also the weight factor corresponding to the attribute.The key to the contextual semantic reasoning model lies in the generation of a reasoning rule set [6]. The specific process of the reasoning rule set generation is as follows.Assume that the mobile context pedigree instance set isI. First, the four concept sets of Ii for each instance are extracted from the instance set I: the context attribute concept set CI, the user attribute concept set UI, the product attribute concept set PI, and the effect attribute concept set EI. The CI contains the concept of the context attribute instance and its weight factor, the UI contains the concept of the user attribute instance, the PI contains the concept of the product attribute instance, and the EI contains the concept of the effect attribute instance. The CI, UI, PI, and EI concept sets extracted from the mobile context pedigree instances are shown in Figure 4, where the concept class to which the instance concept belongs is in brackets.Figure 4
Concept sets of various attributes.The concepts extracted from a single mobile context pedigree instanceIi are related to each other. Using the Apriori association rule mining algorithm, frequent concept association patterns can be induced from all concepts extracted by I. For each associated pattern, the concept of the context attributes belonging to CI, the concept of the user attributes belonging to UI, and the concept of the effect attributes belonging to EI are regarded as the reasoning preconditions, and the concept of the product attributes belonging to PI is regarded as the reasoning results. The associated CI, UI, PI, and EI generate the reasoning rules. A reasoning rule corresponding to the mobile context pedigree is shown in Figure 5.Figure 5
Generation of reasoning rules.


## 4. Simulation Experiment

To evaluate the validity of the contextual semantic reasoning model based on the domain ontology presented in this paper, a simulation experiment is conducted. The dataset used to verify the model comes from the open dataset provided by GroupLens. This dataset contains the users’ contextual information and the users’ rating of the movie (between 1 and 5 points). The dataset meets the data requirements of this experiment. To facilitate the simulation experiment, this paper selects those users who have released more than 30 ratings from the original dataset, which includes 8,000 ratings of 500 movies made by 100 users in different contexts, and this dataset is regarded as the verification data. From this dataset, 70% of the data are used for training and 30% of the data are used for testing, and the experiment recommends a movie with a predicted rating of 4.4 or above to the user.The validity of the model is verified by comparison with the mean absolute error (MAE) and the root mean square error (RMSE) of a traditional collaborative filtering model, a model based on content filtering, and a contextual semantic reasoning model that does not consider the contextual weight. The MAE weighs the accuracy of the model by calculating the average of the absolute error between the predicted rating and the actual rating. The smaller the MAE is, the higher the accuracy is. The RMSE weighs the accuracy of the model by calculating the square root of the square of the deviation between the predicted rating and the actual rating and the ratio of the number of usersn. The smaller the RMSE is, the higher the accuracy is. The difference between the MAE and the RMSE is that the MAE reflects absolute errors, while the RMSE is more sensitive to outliers and can reflect the degree of outliers with large errors.If the test set has a total ofn user ratings, the actual user rating set is A, and the predicted user rating set is P, then the MAE and RMSE calculation formulas are (3)MAE=∑i=1nAi−Pin,RMSE=∑i=1nAi−Pi2n.The MAE comparison results are shown in Figure6. As seen from Figure 6, the MAE of the model discussed in this paper is significantly lower than that of the traditional collaborative filtering model, the model based on content filtering, and the contextual semantic reasoning model that does not consider the contextual weight. It shows that the accuracy of this model is better than that of the traditional collaborative filtering model, the model based on content filtering, and the contextual semantic reasoning model that does not consider the contextual weight. Moreover, we can see more clearly in Table 1, when the percentage of the training set reaches 50%, the accuracy of the model discussed in this paper first becomes stable; that is, this model tends to be stable based on fewer samples and time.Figure 6
The MAE comparison of the four models.Table 1
The MAE difference between different samples.
ModelThe difference between 40% and 50%The difference between 50% and 60%The difference between 60% and 70%CSRM0.130.040.02TCFM0.130.080.04MBCF0.150.070.03CSCW0.130.080.03The RMSE comparison results are shown in Figure7. As seen from Figure 7, the RMSE of the model discussed in this paper is significantly lower than that of the traditional collaborative filtering model, the model based on content filtering, and the contextual semantic reasoning model that does not consider the contextual weight. This indicates that the number of outliers with large errors in the model constructed in the paper is relatively small. We can see more clearly in Table 2. The same situation occurs whereby that when the percentage of the training set reaches 50%, the accuracy of the model discussed in this paper first becomes stable. This shows that the model constructed in the paper can avoid the increase of outliers with fewer samples.Figure 7
The RMSE comparison of the four models.Table 2
The RMSE difference between different samples.
ModelThe difference between 40% and 50%The difference between 50% and 60%The difference between 60% and 70%CSRM0.110.050.02TCFM0.130.070.04MBCF0.170.060.02CSCW0.070.060.01In addition to the validity of the model, the efficiency of the model is also an important index to judge the quality of the model. The efficiency of the model is verified by comparison with the average running time of the traditional collaborative filtering model, the model based on content filtering, and the contextual semantic reasoning model that does not consider the contextual weight. The average running time comparison of the four models is shown in Figure8. At the same time, to facilitate the observation of a gap between the data, the average running time of the contextual semantic reasoning model based on the domain ontology using 10% of the training set is set as standard 1, and the remaining average running time is standardized to this point.Figure 8
The average running time comparison of the four models.As seen from Figure8, the average running time of the model discussed in this paper is significantly lower than that of the model based on content filtering. Compared with the traditional collaborative filtering model, it does not show advantages while the percentage of the training set is less than 50%. However, when the percentage of the training set is greater than 50%, the advantage is relatively obvious. The reason for the above phenomenon is that the main work of both the model based on content filtering and the traditional collaborative filtering model is the calculation of a rating matrix, which undoubtedly consumes more time compared with the reasoning calculation of the existing reasoning rules based on the contextual semantic reasoning model. In addition, in the experimental dataset, the number of items is much larger than the number of users, so the average running time of the model based on content filtering is longer. The contextual semantic reasoning model that does not consider the contextual weight is a simplified version of the model that is presented in this paper. The influence of the contextual weight on reasoning is not considered in the running process of the model. Therefore, the average running time has certain advantages over the model discussed in this paper. However, in the validation experiment of model validity, we know that the validity of the model that does not consider the contextual weight is lower.


## 5. Conclusion

In this paper, the user contextual sensitivity in the mobile recommendation process is studied in depth. Based on the specific domain requirements involved in the mobile environment, a domain ontology applicable to the context reasoning model is constructed. In view of the variety of contextual factors in the mobile environment and the difficulty of using them, the paper constructs a context pedigree of the mobile environment through the model framework of the domain ontology based on the “5W + 1H” method. Conditional entropy is used to calculate the influence of each context attribute in the recommendation process. Based on the above research, the construction of a contextual semantic reasoning model based on a domain ontology is completed. Finally, based on the open dataset provided by GroupLens, a simulation experiment is conducted. It is proven that this model is superior to the traditional collaborative filtering model, the model based on content filtering, and the contextual semantic reasoning model that does not consider the contextual weight.The GroupLens dataset is a dataset of movie ratings. Although this dataset contains users’ contextual information, the users’ contextual information in movies is relatively few compared with some fields. Therefore, the validity and efficiency of the model need to be validated through a broader dataset. In addition, as we can see from the experiment, with increasing experimental data, the recommendation accuracy of the proposed model gradually increases, but the system running time also increases. How to strike a balance between recommendation accuracy and system running time is also a research direction that needs to be focused on in the future.



---

*Source: 4011190-2021-09-13.xml*