{'fraction_non_alphanumeric': 0.02188976377952756, 'fraction_numerical': 0.001653543307086614, 'mean_word_length': 5.150605326876513, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Research on User Behavior with Collaborative Recommendation Based on Social Network

With the rise of social networks and the existence of a large number of active users, a large number of data recording daily life are constantly generated. This kind of data has the characteristics of interactivity, real-time and sociality, which implies a lot of valuable information. Therefore, social network data has a very positive role in promoting the construction of smart city. In this paper, users’ annotation information of the item in social network is used. Similarity model is established with appropriate similarity calculation method. Users’ social relationship in social network is used to establish trust relationship and model for users. Personalized recommendation algorithm is improved to dig user behavior data, analyze users’ interests and hobbies. Information of interest or item can be recommended to meet the needs of users to the maximum extent. And the stickiness of users to the website is increased. Based on the widely used recommendation algorithm, this paper analyzes the user behavior with trust-based collaborative recommendation algorithm based on user relationship of social network.


Introduction
With the advent of Web 2.0, the Internet has entered new stage of development. Internet changed from Employee-generated content into User-generated content. Users have more chances to participate in the Internet. They are both web content viewers, also the web content manufacturers. Based on this, all sorts of social network applications also emerge in endlessly. User-centered information production model leads to the exploding of data in the Internet. So, how to effectively use the data for user behavior analysis, to meet the needs of users, and thus enhance the competitiveness of the site, has become a major research and development of Internet applications.
Collaborative filtering algorithm is a classical algorithm in the field of recommendation system, but the similarity calculation of this algorithm depends a lot on data. And in the actual Internet applications, the sparsity of data is inevitable. Therefore, in order to solve this problem, this paper proposes an improved collaborative filtering algorithm based on social trust.
First, this paper uses labelling information of social network users to establish the similarity model according to the step of collaborative filtering algorithm. Secondly, this paper uses the users' social relations to build trust relationship, and it is modelled as a user trust model. Then, this paper makes neighbor selection respectively for user similarity model and user trust model. Finally, this paper combines predicted value based on two neighbors to give the final recommendation by way of linear fusion. Experiment results show that the improved algorithm effectively improves the social network recommendations, and has higher recommendation accuracy.

Social Network Service
Social network service (SNS), which is based on the relationship between people, provides a social service platform for communication and interaction between network users. It takes the network as the carrier, provides users with various forms of communication and interaction functions, and helps users expand their social circle. The original social network is based on the theory of six degree segmentation. Six degrees of separation, also known as the small world theory, was first proposed by Stanley Milgram, a professor of Psychology. He proposed that the distance between any two strangers is no more than six. That is to say, in the process of interpersonal communication, we can strengthen any stranger through six friends at most. Compared with other Internet products, social network has its unique characteristics, including real name system, real social relations, privacy protection, etc.
Social network encourages users to register with real information, makes users' communication easy and reassuring, and brings users new experience. Due to the characteristics of real name system, users can easily find their classmates, friends, family members and colleagues in social networks, and establish friend relationships. Users can interact freely in this circle of friends, just like in the real society. At the same time, social networks provide users with privacy protection mechanisms. For example, users can set the degree of openness of basic information, add friends, invite friends, delete friends, etc.

Collaborative Filtering Recommendation Algorithm
Collaborative filtering recommendation algorithm (CFR) is one of the most widely used and successful recommendation technologies in the recommendation system. The concept of collaborative filtering was first proposed by Goldberg, Nicols, Oki and Terry in 1992 and applied to tapestry system. Its basic idea is to use group wisdom to recommend products or information that may be of interest to users according to the preferences of groups with similar interests and common experience. Through analysing the user's behaviour, system filtering finds the correlation or similarity between products or users, and then recommends them to users.
Collaborative filtering recommendation algorithms are mainly divided into two types: user-based recommendation algorithm and item-based recommendation algorithm. The collaborative filtering recommendation algorithm based on users is classified according to users, so the users belonging to the same category will be interested in the same item. The collaborative filtering recommendation algorithm based on items is classified according to items. So the items belonging to the same category will be liked by the same users. For example, when people are looking for movies they want to see, actually they ask people with the same taste what movies they have seen recently, and most of the movies they really like. A user who has read a book of special interest is likely to be equally interested in the same subject or book of the same author.

The Basic Idea of Trust-based Collaborative Filtering Algorithm
The traditional collaborative filtering algorithm based on memory usually analyzes the user's historical behavior information to establish similarity model, then selects the active user's neighbor set, and finally obtains the final prediction results through the prediction model, forming recommendations. Although the traditional collaborative filtering algorithm can achieve good recommendation results, the data sparsity and the limitation of similarity calculation in the process of recommendation affect the quality of system recommendation obviously.
As mentioned earlier, in addition to the evaluation matrix information, there is rich user social network information available in social network applications. Therefore, based on the shortcomings of collaborative filtering algorithm, combined with the current thought of large-scale social network user behavior analysis, this paper improves the traditional collaborative filtering algorithm, introduces the trust between social network users, corrects the prediction formula, and proposes a collaborative filtering algorithm based on social network trust, abbreviated as Trust-based CF. The basic idea of Trust-based collaborative filtering algorithm is: using the evaluation matrix information of users, an improved similarity calculation method is proposed to get the similarity model of users; using the social network information of users, a trust calculation method is proposed to get the trust model of users; then, according to the similarity and trust, the nearest neighbor set is selected respectively; finally, the collaborative filtering idea is used to predict for no scoring items and recommendation is generated. The framework is as follows:

User Similarity and Trust Model
In the field of recommendation system, there are two forms of users' scoring information: one is the form of users' free scoring, the other is the binary annotation mode of "like" and "don't like". According to the form of user free scoring, Pearson correlation coefficient or modified cosine similarity is usually used to calculate the similarity between users. This method is very mature at present. For binary annotation, cosine similarity or Jaccard correlation coefficient is usually used to calculate the similarity between users. In practical application, the similarity measurement method has shortcomings, that is positive and negative labels are treated equally. In the application of microblog, a common function is to recommend the microblog account that the user may be interested in. And generally, the situation that the user rejects the recommendation is far more than that of accepting the recommendation. That is to say, the number of negative annotations is far more than the number of positive annotations, which leads to the number of negative annotations in the items that the two users jointly annotate is far more than the number of positive annotations number.
In the e-commerce website, the online system recommends products to users on the basis of users' interests and hobbies. Of course, the interests and hobbies are obtained by analyzing users' historical behavior data. In real life, when people buy goods, they will also refer to the opinions of the people around them, and whether this opinion will eventually be adopted depends on the trust between them. Social networks contain both of these factors, which can analyze users' interests and hobbies through their historical behavior data, and estimate their trust based on the relationship between social network users' friends. So it can get better recommendation effect.

Similarity Calculation
The results of similarity calculation will directly affect the accuracy of recommendation. Common similarity calculation methods include cosine similarity, modified cosine similarity and Pearson similarity [9][10]. Cosine similarity is calculated as follows (1): (1) In formula (1), the rui is the rating of user u to item i, rvi is the rating of user v to item i. And Iu is the set of grading from user u, Iv is the set of grading from user v. Iuv is the set of grading from user u and user v together.
Cosine similarity represents the difference in direction mostly, but it cannot represent the difference between each dimension in the vector. Therefore, the modified cosine similarity first subtracts the average value of the dimension from each value in the vector, and then calculates the cosine.
Pearson correlation coefficient is a value between -1 and 1, which reflects the linear correlation between the two variables. When the correlation between the two variables is high, the correlation value tends to be 1. When the correlation is weak, the correlation value tends to be 0. The formula is as follows: (2) In formula (2), the rui is the rating of user u to item i, rvi is the rating of user v to item i. And ru is the mean grade score of user u, rv is the mean grade score of user v. Iuv is the set of grading from user u and user v together.

Experiment and Result
According to the recommendation algorithm proposed in this paper, Tencent microblog data set is selected for experiments. In this paper the traditional collaborative filtering recommendation model and the improved recommendation model proposed in this paper are compared, and the experimental results are compared and analyzed.
In this paper, MAE (mean absolute error) is used as the performance evaluation index. MAE uses the average value of the absolute value of the difference between the predicted results and the real results of the test data to show the quality of the recommended results. The smaller the value is, the higher the accuracy of the recommendation is. The calculation formula is as follows (3): In formula (3), |T| is the number of test set. rui is the actual ranking to item i of user u. Rui is the prediction ranking of recommendation algorithm. The differences of these two methods are shown in the figure 1 below.  The experiment results show that the MAE values of the two algorithms decrease with the increase of k value. However, in the whole process of change, the MAE value of the trust-based CF algorithm proposed in this paper is less than that of the basic CF algorithm, which shows that the recommendation effect of this algorithm is better than that of the basic CF algorithm. It verifies the validity and accuracy of the trust-based CF algorithm proposed in this paper, and greatly improves the recommendation effect of social networks.

Acknowledgement
This research was financially supported by the Funding Item of Competence Development Program for Beijing VET Teachers.