Learning Sentiment over Network Embedding for Recommendation System

With the rapid development of Internet, various unstructured information, such as user-generated content, textual reviews, and implicit or explicit feedbacks have grown continuously. Though structured knowledge bases (KBs) which consist of a large number of triples exhibit great advantages in recommendation field recently. In this paper, we propose a novel approach to learn sentiment over network embedding for recommendation system based on the knowledge graph which we have been built, that is, we integrate the network embedding method with the sentiment of user reviews. Specifically, we use the typical network embedding method node2vec to embed the large-scale structured data into a low-dimensional vector space to capture the internal semantic information of users and attractions and apply the user weight scoring which is the combination of user review ratings and textual reviews to get similar attractions among users. Experimental results on real-world dataset verified the superior recommendation performance on precision, recall, and F-measure of our approach compared with state-of-the-art baselines.


I. INTRODUCTION
Recommendation system (RS) is the information filtering system that effectively alleviates information overload by filtering vital information fragment out of large amount of dynamically generated information according to user's preferences, interest, or observed behavior about items [1]. RS has been widely used in various areas including movies, books, news, restaurants, music, social tags and products. The tourism field is one of the research hotspots in RS area.
With the rapid development of Internet, it is an important factor that tourism services are changing from the past. Exchanging travel-related information between travelers through the Internet has become more important and effective. However, it is a challenge for searching tourism information because finding or identifying the most relevant information about tourist attraction, routing, point of interest, and planning a trip is difficult. Therefore, RSs have been employed considerably in the tourism field for recommending travel routes, activities, and points of interests.
Furthermore, the travel websites collect rating scores which tourists give to a series of facilities offered in destinations and use rating scores to develop RS. However, travel rely on rating scores for different factors, for example, value for money, safety, cleanliness, and so on. These rating scores are not efficient enough to deliver precise information, whereas textual reviews, which are the unstructured information, are significant, because they help travelers know about each aspect of the attractions. But it is difficult for travelers to read and understand the whole meaning in textual reviews to obtain expressive sentiments regarding the attraction. The optimum solution for this kind of problem is analyzing the useful information available on websites and adapting sentiment analysis to describe user's preferences in the recommendation system. As shown by Zhu et al. [2], a collaborative filtering method was used to recommend items by extracting the emotional polarity from user's comments and then combined the weight of the emotional polarity with rating to improve the performance of the recommendation system. As examples, Bauman et al. [3] and Musto et al. [4] exploited aspect-level sentiment analysis from reviews for recommendation system. They used sentiment analysis to extract user's aspects and built fine-grained representation of the item preferences. These aspects were integrated to predict ratings, and generated the recommendation list which covered aspects of user experiences of the items. Zheng et al. [5] added temporal information in the recommendation process. They calculated the value of user's emotion by opinion mining technique, constructed temporal model by season and holiday influences, and applied a collaborative filtering technique to recommend destination popularity.
Knowledge bases (KBs) which contain rich information of entities and relations, such as Freebase [6], YAGO [7], NELL [8], and DBpedia [9], may shed some light on this problem. A promising approach to KB representation is to embed KBs into low-dimensional vector spaces [10]- [13]. By embedding KBs which contain multi-type properties of entities and relations into unified entity/relation vector spaces, we can effectively measure the semantic correlations between entities and relations while preserving the internal structure information of them. In the past few years, KBs have become extremely useful resources for many RSs. Wu and Ester [14] studied the problem of personalized sentiment polarity by developing a topic modeling approach for the explainable recommendation and generating topical word clouds to show important of the corresponding word. Lu et al. [15] presented a knowledge graph to recommend travel attraction in a new item by using the semantic information.
Wu et al. [16] extended a collaborative filtering method by adapting knowledge graph representation learning based on the TransE model to get the semantic information of items.
From the research mentioned above, it is quite clear that the existing studies have a lack of systematic research on user behavior and satisfaction, low levels of feature extraction, and completely a personalized recommendation. However, the sparsity of KBs enables the design of efficient embedding algorithms but can make it harder to generalize in statistical learning [17]. Fortunately, network embedding algorithms, such as [18]- [20] that learn embeddings of a graph's vertices, by modeling a stream of short random walks can overcome the above issue. These latent embeddings of vertices can capture neighborhood similarity and community membership with a relatively small number of dimensions. In this paper, we would like to ask a key question, i.e., "Can we learn the power of sentiment over the KBs embedding?" The main challenge to answer this question is how to effectively emerge the rich data from unstructured and structured information while preserving the internal structures to enhance the final performance of personalized recommendation system. Inspired by the above motivation, in this paper, we propose a novel approach to learn sentiment over network embedding for recommendation system. By encoding the tourism network based on knowledge base from multi-type user historical behavior and item properties into a unified user/item embedding, we can improve the recommendation performance while preserving the internal structures of users and items in knowledge bases. Initially, we take advantage of the vast amount of textual review data and natural language processing (NLP) techniques to find the user weight scoring which is the combination of user review ratings and textual reviews. Specifically, we use the typical network embedding method node2vec to embed the tourism network which derived from our tourism knowledge graph into a low-dimensional vector space to capture the internal semantic information of users and items. Next, we use the cosine similarity to learn upon the network embedding for getting similar items among users based on KBs. In addition, we aim at adding sentiment analysis to knowledge base embedding to detect users' expression and help better understand users' preferences by using a great value of the textual positive word and negative word feature. The structural semantic embedding feature handles to obtain more comprehensive user preference. It can be utilized to make finer grained and more reliable recommendation explanations to suggest the users make more informed decisions. Our approach outperforms other embedding methods when the labeled nodes in the tourism network are scarce.
The key contributions of this paper are summarized as the following: 1) We investigate the textual review features to capture the user preferences more comprehensively by using the user weight scoring which is the combination of user review ratings and textual reviews. 2) Our approach is able to capture the internal structure information for users and items in a tourism network based on knowledge graph with embeddings by computing the similarity upon the KBs embedding for a personalized recommendation.
3) Based on the real-world tourism dataset, we have conducted extensive experiments to evaluate the effectiveness of our approach. The results reveal that our approach significantly outperforms baseline methods.
The remainder of this paper is organized as follows. Section II introduces related work. Section III provides the proposed method. In Section IV, experimental results and analysis are presented. The last Section provides the conclusion and future work.

II. RELATED WORK
Recommendation field presents a wide variety in the way it has been focused on. In this section, we briefly review the related work of recommendation systems, graph embedding for RS, and network embedding for RS.

A. Recommendation Systems
Recommendation systems have been used to predict future demands for users based on the existing data. Three commonly used algorithms of recommendation systems are Content-Based Filtering (CB), Collaborative Filtering (CF) and Hybrid Recommendation.
CB recommendation approach focuses on items that are similar to those that a user liked in the past or is examining in the present, and it has been used in many fields. Laß et al. [21] studied the context for a tourist trip recommendation by investigating the impact of context information like time, weather, and history visited by questionnaire. The list of point of interests are generated with sequences of items by the ranking of point of interests. Ayyaz et al. [22] proposed a movie content based method to create a user profile by considering user history. Then a fuzzy-based technique is employed to find the similarities and differences between the user profile and the items, and to predict the ratings.
CF recommendation approach focuses on user's interest over the target item on the basis of views expressed by other like-minded users. Yu et al. [23] presented a personalized travel package recommendation to help users make travel plans. It provided point of interest recommendation based on user interest and check-in time. The user preference and location popularity are modeled by using spatial and temporal data from user check-in records to recommend the sequence of point of interest and travel planning. Lian et al. [24] studied content-aware collaborative filtering method by incorporating semantic contents from implicit feedback. They established the close relationship and computed the similarity between users for tourism recommendation.
The hybrid recommendation approach combines two or more recommendation techniques in an attempt to avoid the limitations of traditional. Majeed et al. [25] proposed a hybrid personalized recommendations on restaurants, bars, hotels, and sports activities. Explicit user feedback data was used for computing the recommendations while user's information needs were examined to capture expressive tags for the algorithm. Gong et al. [26] developed a novel attractions recommendation approach in smart tourism services platform to bring people a better travel experience. The approach is modified on the basis of content matching to select the most similar attractions by considering attraction popularity. Next, association rule mining technique was used to find other attractions list, then a trip plan module recommended a personalized travel schedule.

B. Knowledge Graph Embedding for RS
Knowledge Graph (KG) is essentially a directed graph, which is used to describe the relationships between the objects in the real world by symbolic form. A typical KG comprises triples (head entity, relation, tail entity) ((h, r, t) for short), where head and tail are entities and relation represents the relationship between the two entities.
Knowledge graph embedding algorithms, which viewed as a general graph representation method have been proposed. Its goal is to represent entities and relations in a knowledge graph as dense, low-dimensional and real-valued vectors [27]. Among various embedding models appeared in recent years, the translation-based models such as TransE [11], TransH [12], TransR [13], and TranSparse [28] achieved the state-of-the-art performance. Typically, in TransE, the relationship is a translation from the head entity to the tail entity in the vector space: if (h,r,t) holds, the addition of the embedding of h and the embedding of r is supposed to close to the embedding of t. The translation-based models have been applied to many real-world applications widely due to their robustness and efficiency, and recommendation systems have been one of the most popular downstream tasks of knowledge graph embedding. Zhang et al. [29] applied knowledge graph embedding considering structural knowledge (e.g. triples), textual knowledge (e.g. abstract) and visual knowledge (e.g. poster) based on TransR to derive a semantic representation of items for item recommendation. Wu et al. [16] extended collaborative filtering by adapting knowledge graph representation learning based on TransE to get the semantic information of items.

C. Network Embedding for RS
Network embedding, also known as network representation learning has been proposed and aroused considerable research interest. It aims at learning the low-dimensional representations of vertexes in a network, while the structure and inherent properties of a graph are preserved.
Various network embedding models have been proposed to learn feature representations for nodes in networks and achieved outstanding performance on many network analysis tasks. Most notably models known as Word2Vec proposed by Mikolov et al. [10] mainly focus on learning the representation of each word by facilitating the prediction of its context. DeepWalk [17], LINE [18], node2vec [19], and entity2vec [20] are extended models based on Word2Vec, which optimize for prediction of nodes in the neighborhood of a given node based on its representation. Perozzi et al. [17] presented DeepWalk which is a structure-only model that employs random walk and Skip-Gram to learn the embedding of nodes. Tang et al. [18] designed LINE (Large-scale Information Network Embedding) to learn nodes representations in large-scale networks by considering the first-order and second-order proximities and it is a structure-only model. Grover and Leskovec [19] proposed node2vec, which improved the method of DeepWalk with a biased random walk procedure, to effectively perform feature learning from networks by learning a mapping of nodes to a low-dimensional space of features that maximizes the likelihood of preserving network neighborhoods of nodes.
Among existing approaches, node2vec has achieved a great performance in learning the features of network structure. Research work Palumbo et al. [20] has exploited its efficiency over the common dataset MovieLens 1M in link prediction scenario. It presented entity2rec to learn property-specific vector representations of knowledge graph entities in a completely unsupervised way based on node2vec.
In this paper, we use node2vec to automatically capture complex latent relationship among users and attractions in the tourism network based on the knowledge graph and use the cosine similarity to get the similar attractions among users, finally, the network embedding framework is proposed for tourism recommendation.

III. PROPOSED METHOD
In this section, we present a novel approach to learn sentiment over network embedding for recommendation system as illustrated in Fig. 1, then we proceed to describe its details. While our approach is general and can be used to recommend any consumer item, we chose a specific example domain for illustration. We select the less studied consumer domain in the textual review of recommendation, is that, tourism. In addressing the choice of places to visit, user's interest is the leading reasons promising RS in the tourism field. Here, we will present our method to recommend attraction in the tourism domain in Bangkok, Thailand. Our model consists of three key components: 1) Data Collection; 2) Textual Positive and Negative Word Feature; and 3) Network Embedding Based on Tourism KG. In the first part of data collection, we show the process to collect and get the dataset from web crawler. The second part of textual positive and negative word feature, we present how to obtain the textual review feature from positive words and negative words. The last part of network embedding based on tourism KG, we introduce node2vec method based on our tourist KG and explain how to learn a novel framework over the KBs embedding by node2vec for a personalized recommendation system.

A. Data Collection
At first, we implement a web crawler, which is developed in Python language, to collect the tourism data in Bangkok from the TripAdvisor website, which has been ranked as the most popular site for trip planning and providing reviews from travelers about their experiences in hotels, restaurants and monuments, the end of retrieved data is October 7, 2018. All information about the data is stored in our database. Tourism data is divided into 2 types: attractions and users. Attractions include attraction ID, attraction name, location, category, open time and ticket. Users include user ID, user name, user country, user review rating, user visit date, and user textual review. Each data record mainly describes the user review ratings of the attraction by different users. A set of user's reviews marked with a rating scale, from 1 to 5, which corresponds to the user's review on the attraction: 1 represents the least liking and 5 represents the most liking. Table I shows the structure in our database.

B. Textual Positive Word and Negative Word Feature
The main task of this component is to extract positive word and negative word features from the textual reviews and to compute the user weight scoring. We aim to understand that a tourist would express positive or negative about attraction, based on their freely textual review and rating. The key question of the analysis is "Does the user express a positive or negative textual review?" and "Does the user give a rating consistent with an expressed textual review?" We take advantage of the vast amount of textual review data and NLP techniques to adapt. Firstly, from the data set, the textual reviews are cleaned by removing format, punctuation, extra whitespace and lowercase letters. Word tokenize is used to split the sentence into words. Stop words, which are words with no information value but appear too common in a language, are removed according to a list from the NLTK corpus [30]. We also use the word lemmatization process to reduce inflectional forms and a word to a common base form from WordNet [31]. After that, we extract meaningful words occurred frequently within the textual reviews based on the binary distinction of positive and negative to analyze for transformation individual text of the textual reviews. We focus on incorporating positive word and negative word features extracted from the textual reviews into the recommendation process. To automatically extract positive word and negative word features from the textual reviews, we employ well understood NLP methods. However, we quickly discover that some words are not helpful in discriminating tastes, that is, they are too common word to be adequately representative of user tastes that used in several works. Some words are too specific to capture the users' general taste aspects. For example, "cheap", is arranged in negative word groups. Cheap is often used to convey low quality. In tourism domain, people usually used to express high quality, one example is the entrance fee is cheap and worth. Hence, we build a new positive word corpus and a new negative word corpus for tourism domain in our work. The frequent words of positive and negative are ordered by descending frequently as shown in Fig. 2 and Fig. 3 respectively.  Then, we need to assign a weight for each positive and negative term in the textual reviews. In the text feature extraction, term weight is a measure of how important a word is in a document. There are many methods to assign weights to terms in documents, such as TF-IDF, topic modeling, bag of words. TF-IDF, short for term frequency-inverse document frequency is a well know method to evaluate how important is a word in a document. It works well for term weighting scheme which computes two statistics for each term in each document between TF and IDF.
The term frequency (TF) denoted as tfi,j is the number of times a word occurs within a collection of textual reviews for a particular attraction, that is, the total number of occurrences of i in j. For instance, if a review says "This place is very beautiful but dirty", then the term positive frequency for "very" is 1, the term positive frequency for "beautiful" is 1, and the term negative frequency for "dirty" is 1. The overall term frequency for each word is divided by the total number of words within the positive word corpus and the negative word corpus. Document frequency dfi is defined as the total number of attractions with textual reviews containing i. The inverse document frequency (IDF) represented as idfi is a measure of how much information the word provides whether the term is common or rare across different textual reviews, is defined as: where N is the total number of attractions. When TF and IDF are multiplied, we obtain TF-IDF which is a composite weight is given to each word in each corpus of textual reviews for a given attraction, is defined as: Due to difference in scale, user review rating is at 5-star scale while TF-IDF weight is to the base 10. So, the user weight scoring is appeared in each a textual review of a user by calculating between user review rating and TF-IDF, is defined as: where X is the user weight scoring which is equal to the value of user review rating or the TF-IDF weight (Wi) times the data number (Xi) divided by the sum of the weights. Table  II takes Temple-of-the-Reclining-Buddha-(Wat-Pho) as an example to demonstrate the calculation of TF-IDF and the user weight scoring. TF-IDF captures the textual positive word and negative word features from textual reviews. While the user weight scoring is the combination of ratings and TF-IDF. It is evident from the results that many users give high rating scores while they expressed feelings on reviews a bit. Meanwhile, many users give low rating scores but they expressed feeling in deep. But not all, many users give rating scores consistent with their expressed textual reviews.
An overall of the distribution of user review rating is shown in Fig. 4. Most of users give rating to attraction are in the 3-5 range, while very few user review ratings are in the 1-2 range. Fig. 5 shows the distribution of TF-IDF from the positive and negative word processing. Users have different tendencies to express the textual review. The data of TF-IDF is a scatter chart in the 0-10 range. The distribution of the user weight scoring by calculating between user review rating and TF-IDF is shown in Fig. 6. The average of the user weight scoring is in the 2-8 range. In other words, there is a tendency of users given rather high rating scores. But a tendency of TF-IDF result is the same average from low to high textual ratings. So, a tendency of the user weight scoring is in medium scores.

C. Network Embedding Based on Tourism KG Feature
In this work, we use the network to model the relationship between users and attractions over the tourism KG directly by encoding the tourism network based on knowledge base from multi-type user historical behavior and item properties into a unified user/item embedding. Specifically, we define 7 types of entities and 6 types of relations in our system, where the entities include user, attraction, city, category, rating, review and user weight scoring, while the relations include:  LOCATED_IN: the relation from an attraction to a city, meaning that the attraction is located in the city.  CATEGORY_OF: the relation from an attraction to a category, meaning that the attraction belongs to the category.  SUB_CATEGORY_OF: the relation from a sub-category to a category, meaning that the sub-category belongs to the category.  VISITED: the relation from a user to an attraction, meaning that the user has visited the attraction.  GIVE_RATING: the relation from a user to an attraction, meaning that the user gives a rating to the attraction.  COMMENT: the relation from a user to an attraction, meaning that the attraction is reviewed by the user.  USER_WEIGHT_SCORING: the relation from a user to an attraction, meaning the user give the user weight scoring to the attraction.  To generate a personalized recommendation system for a particular user, we take advantage of the relation type VISITED by using USER_WEIGHT_SCORING. As shown in Fig. 7, the left graph is the whole knowledge graph which contains all kinds of entities and relations. The orange color circles represent users, green color circles are attractions, and the remains are other entities. For the VISITED property, we generate a sub-graph in the right graph which named as a user-attraction network, where users and attractions are nodes, VISITED linked users and attractions. Note that only the user weight scoring values are no less than 3 will be marked as VISITED in the network.
We view the recommendation task as a multi-label classification problem of a network based on the node2vec method. Given a user-attraction network G (U, A, E), where U and A are nodes of the network, and E represent edges E U A . Our goal is to learn users and attractions vector representations with a small dimension d which encodes community structure that can be easily clustering users and attractions.
A corresponding user and attraction sequence 12 [ , ,..., ] n S u u u  are generated by using the random walk strategy. Formally, u is a given source node, and a random walk is simulated of a flexible length l which related to the scale of the user-attraction network. uj is the ith node in the walk, starting with u1 = u. Nodes uj are generated by the following distribution: where vk  represents the unnormalized transition probability between v and k, and N is the normalizing constant. Edge (t, v) is just traversed by a random walk which now resides at node v. For selecting the next node, the following unnormalized transition probability is used to compute the transition probabilities vx  on edges (v, x): where wvx is the weights on edges (v, x), in the case of no weighted graphs the default values are 1, and pg  is obtained by the following formula: where dtx is the shortest path distance between t and x and the International Journal of Machine Learning and Computing, Vol. 11, No. 1, January 2021 value of dtx is one of the sets {0, 1, 2}.
Optimizing the following node2vec objective function which is a log-likelihood function: where N is the number of nodes in this sequence, X u j denotes a feature vector which is composed of the context nodes of uj.
Here, we use X represents the feature vector of the attraction, and Y represents the feature vector of the user. After get the feature vectors of users and attractions in the unified vector space, we use the following formula to measure the correlation between a user and attractions and generate the prediction score.
For each pair (X, Y), we will first replace the later one by all of the attractions in the network in turn, and compute the similarity scores for these attractions by the cosine similarity, which is a popular measure metric of similarity between two vectors (attractions) of n dimensions. The cosine similarity function is shown as follows.
where Xi and Yi are elements of vector X and Y respectively. Finally, the system returns a recommendation list according to the similarity scores.

IV. EXPERIMENTAL RESULTS AND ANALYSIS
In this section, we detail our experimental results and analysis. First, the data set description is introduced, followed by the evaluation metrics. Finally, the results of the experiments are presented.

A. Data Set Description
The tourism data set in our experiments is collected by a web crawler, which is developed in Python language, to collect the tourism data in Bangkok from the TripAdvisor website. The end of retrieved data is October 7, 2018, including 80,619 of the textual reviews of 11,854 tourists of 808 attractions. The data set contains the eleven fact attributes in tourist attraction: attraction ID, attraction name, location, category, open time, user ID, user name, user country, user review rating, user date, and user textual review. Each data record mainly describes the ratings of the attraction by different users. The rating scale from 1 to 5, which corresponds to the user's review on the attraction: 1 represents the least liking and 5 represents the most liking. In addition to reducing the impact of noise data, we select the user who has written a textual review in English language and a user who has written textual reviews more than 5 attractions. At the same time, using attributes to map the attraction ID in each record to the attraction entity represented by the name of the attraction in the network graph. Finally, we do the experiment on a data set consists of 75,130 the textual reviews with 9,589 tourists and 787 attractions, which are divided into a training set of 60,104 the textual reviews and a test set of 15,026 the textual reviews respectively, to perform the recommendation and verify the recommendation effect.

B. Evaluation Metrics
To evaluate the performance of our framework, we use three metrics which are typically the measure for evaluating Top-k recommendation performance: Precision @k, Recall @k, and F-measure @k.
Precision @k is the fraction of relevant retrieved documents. In a recommendation system evaluation setting, it corresponds to the true positive fraction of recommended attractions. Recall @k is the fraction of all relevant attractions which are retrieved. F-measure @k is a weighted average of precision and recall. There are formulas as follows: Recall 2 Precision Recall measure

C. Evaluation Results
We evaluate the performance of our whole framework. We compare our method, termed as "SNE", against the following baselines:  CF [32]: This method is a traditional Collaborative Filtering approach by the cosine similarity calculation.  CF-Noun [5]: This method uses Memory-based Collaborative Filtering integrated rating and review with extracted noun word to calculate rating prediction.  TransE-CF [16]: This method combines CF and a knowledge graph embedding called TransE to get the semantic information of attractions for recommendation list.  SNE: SNE is our approach to learn sentiment over network embedding for recommendation system by node2vec method with the user weight scoring. In our experiment, k is set to 2, 4, 6, 8, 10, 12, 14, 16, 18, and 20 respectively. When k changed, each algorithm recalculated Precision @k, Recall @k, and F-measure @k. The results are shown in Fig. 8, Fig. 9, and Fig. 10, give the following observations:  SNE outperforms CF, CF-Noun, and TransE-CF. This implies that using the typical network embedding method node2vec to embed the tourism network and use cosine similarity to get similar attractions among users by using user weight scoring can improve the recommendation performance, which demonstrates the insight of our framework learning sentiment over network embedding for enhancing recommendation. Moreover, it also demonstrates the textual positive word and negative word feature to capture the user preferences more comprehensively, the textual review features can capture semantic representations more effectively and thus improve the recommendation performance.  SNE still achieves better performance TransE-CF, which demonstrates the structural semantic embedding feature based on knowledge graph with embeddings and integrate with collaborative filtering method for a personalized recommendation. It can significant to directly model the internal structure information and improve the recommendation quality.

V. CONCLUSION AND FUTURE WORK
In this paper, we propose a novel approach to learn sentiment over network embedding for recommendation system by using both structured and unstructured information. The deep semantic information by extracting positive words and negative words over textual reviews are investigated, and we then combine them with user review rating to get the user weight scoring. We further learn the structured network embeddings of users and attractions through the user-attraction network, which is a sub-graph of the tourism knowledge graph, and compute the similarity among them to generate a personalized tourism recommendation system. Experimental results on real-world tourism dataset verified the superior recommendation performance on precision, recall, and F-measure three common metrics of our approach compared with state-of-the-art baselines.
In the future work, we will consider more features like user behavior and attraction properties, and compare with other knowledge graph embedding methods to enhance a personalized recommendation performance.