{'fraction_non_alphanumeric': 0.033331040176114476, 'fraction_numerical': 0.014137314254265272, 'mean_word_length': 4.89596430744271, '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}}
Predicting Restaurant Consumption Level through Social Media Footprints

Accurate prediction of user attributes from social media is valuable for both social science analysis and consumer targeting. In this paper, we propose a systematic method to leverage user online social media content for predicting offline restaurant consumption level. We utilize the social login as a bridge and construct a dataset of 8,844 users who have been linked across Dianping (similar to Yelp) and Sina Weibo. More specifically, we construct consumption level ground truth based on user self report spending. We build predictive models using both raw features and, especially, latent features, such as topic distributions and celebrities clusters. The employed methods demonstrate that online social media content has strong predictive power for offline spending. Finally, combined with qualitative feature analysis, we present the differences in words usage, topic interests and following behavior between different consumption level groups.


Introduction
Over the past decade, microblogging services like Twitter and Sina Weibo have built up a huge user base. For example, by the end of 2014, Sina Weibo has accumulated more than 500 million users, out of which 167 million are monthly active users. With the growing popularity of microblogging service, businesses are also looking for new opportunities on social media, e.g., identifying target consumers and marketing their products. Compared with traditional consumer targeting scenarios, social media has several factors in its favour. Firstly, traditional consumer targeting techniques are mainly based on users' query logs or web access histories, and it is generally limited by session length (Dasgupta et al., 2012). While on social media, users have accumulated much more abundant traces, such as tweets, relationships and profiles. Secondly, according to a recent study (Nielson, 2012), 92% of consumers believe recommendations from friends over all other forms of advertising and 64% of salesperson believe word of mouth is the most effective way of marketing. Since social network links both friends and families, it becomes a natural platform for business to take advantage of word of mouth utility (Trusov et al., 2009).
Demographic profile is the starting point of defining target consumers for marketing. Demographic includes multiple aspects such as simple attributes like gender and age, and more complicated attributes like income, personality and consumption level. Since a large number of users provide their profiles on social media, inferring user attributes such as gender (Ciot et al., 2013;Liu and Ruths, 2013;Rao et al., 2011), age (Al Zamal et al., 2012;Nguyen et al., 2013), political polarity (Volkova et al., 2014), or occupation (Preoţiuc-Pietro et al., 2015a) from social media has already been widely studied. In this paper, we focus on the consumption level attribute prediction.
Consumption behavior reflects one's economic capacity and living standards (Brewer et al., 2012). An accurate consumption level prediction model can help business dealers identify their target consumers and recommend suitable products. Moreover, since consumption level is an important factor of economic status (Stutzer, 2004), effective prediction of consumption level will facilitate social economic researches on social media. However, unlike the gender attribute that is displayed on one's page, or political orientation that is unequivocally stated in one's tweets, consumption behavior related attributes are hard to acquire automatically from microblogging service.
In this paper, we take advantage of the "socialization" of third party websites to build the ground truth collection. Specifically, we map one's Weibo (the largest microblogging service in China) account to his or her corresponding Dianping (the largest consumer review site in China) account. We carefully construct a dataset of 8,844 users who have been linked across Dianping and Weibo, and use one's self-report spending history to build the consumption level ground truth.
We propose a systematic method that takes social media features for consumption level prediction. We hypothesize that consumption level is correlated with various features, mainly including three aspects. The first aspect is user profiles including gender, age and education. Secondly, we hypothesize that language use in social media is a predictive factor for consumption level. We take textual features as the second aspect for prediction. Finally, we hypothesize that people of different economic statuses have their own unique tastes and interests. We take the following links which reflect one's interests and tastes as the third aspect for prediction. Owing to the noisy tweet content and sparse following relationships, this problem is technically challenging. We make use of topic modeling and LIWC categories to generate dense representations of text features. For graph features, due to the large quantities of users on Weibo, using raw following relationships directly has sparsity problem. To address it, we propose a matrix factorization algorithm on following matrix and naturally generate dense representations of user following preferences.
We take the raw features, and especially latent features as input features. We adopt the gradient boosted decision tree that can generate nonlinear combinations of input features, to predict user's consumption level. Empirical experiments demonstrate that rich features on social media have strong predictive power for consumption level, and latent features have best prediction performance. We conduct Spearman correlation test between topic preference and restaurant spending. We have found that the topic preference of a user is significantly correlated with the consumption level. We also report several new findings about consumption level and behavior on social media, e.g., users who follow topics such as luxury brands and politics, or talk more about money (e.g., audit, cash, owe) tend to be of higher consumption level, while users who follow topics about popular stars, use more character expressions and more assent words (e.g., agree, OK, yes) tend to be of lower consumption level. These findings will facilitate future attempts to consumer targeting, and may suggest extension application to spending prediction in other domains. The flexibility of our approach lies in that we identify important and general types of correlations that are easy to leverage from external social media sites.

Dataset Description
We focus on Sina Weibo, the largest Chinese microblogging service, as the studied microblogging service. We select a popular crowd-sourced review site, Dianping as the external website to help construct user consumption level ground truth. We do not adopt the automatic user linking methods but use "selfdisclosure" to identify the same user across these two medias: some Weibo users provide their Dianping links in their tweets. This approach generates an accurate linking of across-website users. Weibo Dataset: Sina Weibo is the largest Chinese microblogging service. We crawl the Weibo search page 1 to find those who declare their Dianping pages in their tweets. In this way, we get 62,015 users and then we crawl all the detailed information of these linked users, including profiles, tweets, followers and following links. Dianping dataset: Dianping 2 is the largest social based crowd-sourced review site in China, which is similar to Yelp in terms of overall design and service. Dianping has two major components: users and local businesses. Users on Dianping can comment on and grade for local businesses, e.g., restaurants and hotels. Besides score and comment, user can also provide how much an average person spend for a meal in the restaurant. Each restaurant is usually assigned a small set of taste categories, price, score and starts a thread of reviews. We crawl all the reviews of 62,015 linked users mentioned above. The linked users have posted 286,069 reviews for 35,650 restaurants. We also crawl the 35,650 restaurants pages. The 35,650 restaurants are located in 45 cities in China, covering 98 different taste categories. We calculate the average restaurant spending in different cities and the result is shown in Figure 1. As shown in the figure, big cities such as Beijing and Shanghai are more expensive than other cities such as Guangzhou and Hangzhou. Moreover, users in Beijing and Shanghai take a share of 78.8% of our users. To make the population in our dataset more homogeneous, we only keep those who are located in Beijing or Shanghai. Dianping contains many categories of restaurants and different categories have different prices. The prices of different categories are shown in Figure 2. Since categories like cafe shop mainly provide drinks and can not be taken as real restaurants, we filter out restaurants in such categories. In order to gain a reliable estimation of consumption level, we only keep those who have post more than ten reviews. Finally, we obtain a total of 8,844 users. We find that these users are active on Weibo. They have posted 13,026,078 tweets and have 3,078,497 following links in total. We summarize the data statistics in Table 2

Problem Definition
If we can estimate one's consumption level according to his or her microblogging account, we can help the businesses design suitable marketing strategies, e.g., sending coupons to those who are more sensitive to price. We formulate this task as a typical prediction task: it aims to estimate the user consumption level. We assume the following general definition of the task: given a user's accumulated spending history h (i) and corresponding social media data s, we would like to test with varying type of s how accurate introduction of s can predict the label of h (i) .
To formulate the consumption level prediction task, we assume that there are a set of m users U = {u (1) , u (2) , u (3) , ...u (m) }. For each user, let y (i) denotes the consumption level of user u (i) . Higher value of y (i) means higher consumption level. A feature vector x (i) can be constructed for each user u (i) . The aim of the learning task is to derive a prediction function f such that, for each feature vector x (i) , it outputs a consumption level f (x (i) ).

Features
In this section, we discuss features extracted from Weibo service. In particular, we study how to derive effective latent features for the task.

Raw Features
Raw features are features that can be directly extracted from one's Weibo homepage. In this category, we consider the following three aspects: I. METADATA Demographic fields of users. Fields such as gender and education level are binary features. Education level with value one indicates the user has accessed to university education. Tags are a list of self reported words that users describe themselves. A separate binary feature is included for each unique tag. A user has 4 tags on average. For example, a user use tags such as music and shopping to represent one's interest.
II. RAWWORDS Unigrams in one's tweets and retweets. We use binary features for each unique unigram.
III. RAWFOLLOW All users that one follows. We use binary features for each unique followee.

Latent Features
In addition to raw features, we consider leveraging the latent features to improve predictions. We attempt to find semantics from the sparse user word matrix and user following matrix.

LIWC of Tweets (LIWCT)
Linguistic Inquiry and Word Count is a dictionary that classifies English words into psychological meaningful categories (Tausczik and Pennebaker, 2010). LIWC demonstrates its ability to detect psychological meaning in a wide range of applications such as emotionality investigation (Alpers et al., 2005) and personality prediction (Pennebaker and King, 1999). Previous study on social media shows that LIWC provides effective psychological features to determine the relationship between users (Adali et al., 2012) and the credibility of comments (Ott et al., 2011

Topic Modeling of Tweets (LDAT)
In addition to employing raw text features, i.e., RAWWORD, we also use a high level representation of words to discover latent semantics. In order to distill topics from tweets, we adopt Latent Dirichlet Allocation method (Blei et al., 2003), which is an unsupervised learning method to discover latent topic distribution using large amounts of documents.
The model has two parameters, i.e., the document topic distribution θ i and the topic word distribution ϕ i . By learning θ i and ϕ i , document's topic distribution can be obtained and hence we get user's preferences on each topic. Since we care about user's topic distribution instead of a single tweet's topic distribution, we aggregate the user's tweets and retweets into documents and take the documents as the input of LDA model.
We take the resulted vector θ i to describe user u i 's topic distribution. In this study, we set topic number k to 200 and run LDA with 500 iterations using Gibbs 3 sampling.

SVD Following Matrix (SVDF)
Because economic status is the central concern of hierarchical society, people of different economic statuses have their own unique tastes and interests (Wong and Ahuvia, 1998). Intuitively, if one is interested in some areas, it is natural that he or she will follow some related celebrities on social media. Therefore, celebrities that one follows can reflect the interest of the user (Lim and Datta, 2012). Since celebrities have large quantities of followers, in this paper, we take the account that has more than 30,000 followers as a celebrity account. The most direct way of utilizing celebrity features is to take each individual celebrity as a distinct feature aspect, i.e., RAWFOLLOW. However, since the celebrity accounts are of a huge number, using the celebrity features directly can result in sparsity problem. To tackle this problem, we use matrix decomposition to capture the hidden interest of one user. The row of the matrix denotes users in our dataset, the column of the matrix denotes the celebrity accounts and the element f ij is set to 1 if user u i follows celebrity c j . Different from traditional matrix decomposition task that has elements ranging from 1 to 5, in our case, the element of matrix only have two values representing whether user follows the celebrity. Hence, we choose the following logistic loss as our optimization goal.
where f ij denotes whether user u i follows celebrity c j , U (i) denotes the latent vector of u i , C(j) denotes the latent vector of c j and λ is the regularization coefficient. We take the resulted U (i) with varying length to describe one's interest. In this study, we employ stochastic gradient descent for matrix factorization parameter inference (Rendle, 2012) .

Clustering and Labeling
In this section, we introduce how we derive user consumption level label y (i) from the consumption history h (i) . We use Gaussian mixture model to cluster users over their price space. The motivation for clustering is to find the natural structure of consumption prices and avoid manual threshold settings. This makes the labels of users more reliable and applicable to other dataset. The following part introduces the Gaussian mixture model and how we apply it to our dataset.
Gaussian mixture model is a probabilistic model which assumes that data is generated from finite number of Gaussian distributions. Given n data points x = {x 1 , x 2 , x 3 , ..., x n }, the probability of generating the data x i is as follows: where π denotes the distribution over components, p( In our task, we calculate average of the user u i 's spending history h (i) for each user, and in this way we get a list containing average spending of all users, i.e., L = {avg(h (1) ), ...avg(h (m) )}. L (i) ranges from 33 Yuan to 436 Yuan. We calculate average spending irrespectively of restaurant category because we find that most users visit diverse categories of restaurants. Since we focus on the relative consumption level of users instead of the real spending of users, we formalize the task as classification task. We apply the Gaussian mixture model to the spending list L. We assume that users come from k (k=2) different consumption levels, and the user's label y (i) is the cluster number the user belongs to.

Experiment
In the above section, we have shown how to extract features from social media and how to derive labels from spending history. We are going a step further to figure out the feasibility of using these social media features to predict the user's consumption level. We conduct experiments on the collected Weibo and Dianping dataset as described in Section 2. We set the component number of Gaussian mixture model to 2, i.e., users are labeled either one or zero indicating whether they are of high consumption level. We take 60% of users as training portion, 20% as validation portion and the remaining 20% as the test portion. For the evaluation, we take the accuracy, precision, recall and F1 measure as the evaluation metrics.

Quantitative Evaluation
We employ GBDT 4 and logistic regression 5 as the prediction models. Since traditional survey-based consumption behavior analysis task mainly focus on demographic attributes (Jang et al., 2004;Fodness, 1994), in this paper, we refer to the results obtained with feature METADATA as baseline. Specifically,  for baseline features, we use logistic regression to combine all features together, which is a one layer classifier; for the RAW features and LATENT features, we construct a two layer classifier to combine heterogeneous features, i.e., in the first layer, we construct base classifiers using single feature sources, then we build a second layer classifier on top of the first layer classifier which takes the output of base classifiers as input. In our study, for the second layer classifier, we employ logistic regression to combine heterogeneous features. Since features such as RAWWORD and RAWFOLLOW are of high dimensions, we use L1 regularized logistic regression to construct base classifier; for the LATENT features, we use GBDT as the prediction model to construct non-linear base classifier. For LATENT feature base classifier selection, we have compared logistic regression with GBDT and found that GBDT preforms better than logistic regression. Therefore, we choose GBDT as the base classifier. The prediction results with different set of features are listed in Table 2.
For baseline features, we conduct experiments on age, gender, education and tags. As shown in Table 2, tags are the most predictive features and perform better than education and age. This is reasonable because tags contain much richer information than age and education and are related to user's profession and interests. Furthermore, the gender feature performs the same as random guess, hence we do not incorporate the gender feature into baselines. This suggest that the man and the woman do not have significant difference in restaurant consumption.
For RAW feature source, the amount of feature candidates is very large, e.g., hundreds of thousands of words. By borrowing the idea of feature selection in previous text classification task (Forman, 2003), we use χ 2 test to select representative features for classification. We select 4715 features for RAWWORD and 7820 features for RAWFOLLOW, which achieves best performance for prediction. Results in Table 2 suggest that RAW features are competitive for consumption level prediction, e.g., while baseline features can achieve 58.89% accuracy and 62.10% F1, RAWWORD alone can achieve 65.74% accuracy and 66.28% F1, and RAWFOLLOW alone can achieve 69.45% accuracy and 71.37% F1.
For LDAT feature source, we set the vocabulary size to 31514 and the number of topics to 200. By distilling topic semantics from tweets of users, the prediction accuracy can achieve 74.51%, which has been improved by 13.34% in contrast to RAWWORD. For LIWCT feature source, we would have expected LIWCT performs better than RAWWORD, since it categorizes the words into psychological and linguistic meaningful categories. A closer analysis of LIWCT features reveal that the vocabulary of LI-WCT has relatively small overlap with the most distinguishing words in RAWWORD. For SVDF feature source, we conduct experiments with varying length of SVDF features. We find that when the length is more than 25, the performance does not increase, hence we set the length to 25 in our experiments. As presented in Table 2, accuracy of SVDF method achieves 76.73% and is much better than the result of RAWFOLLOW feature. This is also because SVDF features can capture high level interest of users.  Table 3: Topics sorted by absolute of Spearman correlation coefficient ρ. Topic labels are manually created.

Qualitative Analysis
In the above, we demonstrated that latent features, such as LDAT and SVDF, are the most effective features for predicting user consumption level. In this section, we conduct further hypothesis test to analyze the language divergence and the interest divergence between users at different consumption levels.
To select topics that are most correlated with consumption level, we present the formal Spearman correlation coefficient 6 test. The Spearman's coefficient ρ lies in the interval [−1, 1], and a value of "+1" or "-1" indicates a perfect, positive or negative Spearman correlation. Intuitively, it is straightforward to generate two rankings of users, either by average spending or by topic preference. However, it is noted that ρ is sensitive to small value differences of both measures, and it will be difficult to obtain robust correlation values in this case. To capture the general trend, therefore, we group users according to their average spending. We sort users according to their average spending in descending order, split users equally into 100 buckets and examine the correlation at the group level. Table 3 demonstrates the most correlated topics sorted by absolute of ρ. It is worth noting that topics with positive correlation coefficients reflect interests of high consumption level users, while topics with negative correlation coefficients reflect interests of low consumption level users. As shown in the table, users of higher consumption level prefer topics such as "Luxury Brands", while in contrast users of lower consumption level care more about "Mass Brands". This is consist with previous study on consumer behavior (Wong and Ahuvia, 1998), which shows that people buy luxury brands to take it as publicly visible markers of their economic status. Interestingly, we also find that users who speak Shanghai dialect are more likely to be of higher consumption level. We also conduct the correlation test within only Shanghai users, and we find that Shanghai dialect is also significantly correlated with high spending.  Table 4: Topic preference t-test between different age and gender groups. " †"," ‡", " §" indicate the t test is significant at the level of 0.1, 0.05 and 0.01 respectively.
While on the other hand, users who use more web trending "Character expressions" tend to be of lower consumption level. Since our ground truth dataset is based on spending in restaurants, the top topics also cover food related topics, i.e., "Seafood" and "Cooking". "Seafood" is generally more expensive and hence it is an indicator of higher consumption level, while users who love "Cooking" may prefer dine in and consume less in restaurants. Moreover, high consumption level users talk more about "Politics", "Driving" and "Auto".
We conduct t test to analyze the interaction between topic preference and profile factors. Table 4 demonstrates the t test results. According to user self report age, we divide users into two groups, i.e., older than 30 years old or younger than 30 years old. A positive t indicates that elder group has higher preference on the topic. As shown in the table, elder users prefer topics such as "Politics", "Driving", "Shanghai dialect" and "Auto", and younger users prefer topics such as "Character expression", "Stars", "Luxury brands", "Cooking" and "Tennis". Generally speaking, elder people have higher spending power. Therefore, topics that elder users prefer are positively correlated with spending, while most topics that younger users prefer are negatively correlated with spending. Similarly, we conduct t test of topic preference between female users and male users. Topics such as "Character expression" and "Tennis" have no significant difference between females and males. Female users have significantly higher preference on topics such as "Luxury brands", "Cooking" and "Seafood", and male users have higher preference on topics such as "Driving" and "Auto".  For the celebrity features, we select the celebrities with highest χ 2 scores and present them in Table 5. As listed in the table, users of low consumption level follow celebrity such as coupon, subway, TV cuisine programme and reciting words app. On the contrary, high consumption level users follow celebrity such as traveling, wine, high grade hotels and international radio host.
For the LIWCT features, we also select the categories that have strongest correlation coefficient ρ with consumption level. Interestingly, we found that high consumption level users talk more about money (e.g., audit, cash, owe). On the contrary, low consumption level users talk more about time (e.g, end, until, season) and assent words (e.g., agree, OK, yes).

Related Work
User profiling aims to infer attributes of users from massive online data. Demographic attributes are widely used for ad targeting (Cheng and Cantú-Paz, 2010) and product recommendation (Wang et al., 2015). Traditional user profiling is mainly based on users' search logs or web access histories (Weber and Castillo, 2010;Hu et al., 2007). Recently, more and more researchers focus on user profiling on social media (Fink et al., 2012;Goswami et al., 2009;Tu et al., 2015).
In addition to simple demographic attributes such as gender or age, recently, researchers focus on complicated attributes such as political orientation (Pennacchiotti and Popescu, 2011), tags (Feng and Wang, 2012), locations (Backstrom et al., 2010;Pavalanathan and Eisenstein, 2015), occupation (Preoţiuc-Pietro et al., 2015a) and personal interests (Yang et al., 2011). However, the economic status related attributes have not been fully explored, which is partially due the difficulty in ground truth collection. Preoţiuc-Pietro et al. (2015b)'s work on income prediction from social media is the most relevant work to ours. Though consumption and income are related, as previous work on social economics (Brewer et al., 2012) has pointed out, " the amount of consumption in any period is not constrained to be equal to income in that period". Recent work on social economic classification (Lampos et al., 2016) is also related to our work. Their work focus on behavior features while we focus on language features and latent features. Furthermore, besides prediction task, we conduct an exploratory data analysis of language use patterns between users of different consumption levels. This work is also related to the study of food consumption on twitter (Abbar et al., 2015), and the work showed that foods mentioned in tweets are correlated with national obesity and diabetes statistics. The authors (Abbar et al., 2015) conduct experiments mainly from nutrition and health aspects, while we conduct experiments from the social economic aspect.
Our work is also related to mining heterogeneous social networks (Deng et al., 2012;Wang et al., 2011;Deng et al., 2011). Recently, many researchers focus on mapping accounts on different sites to one person (Zafarani and Liu, 2009; in real world. By utilizing these studies, we can link more users from Dianping and Weibo, and hence scale our task to larger dataset. Moreover, there are also works that utilize user linking feature to leverage social media knowledge for solving the cold start problem on third party website (Xiao et al., 2014;Zhang and Pennacchiotti, 2013). Since we estimate user consumption level accurately, it can also be used to solve the cold start problem in recommendation scenario.

Conclusion
In this paper, we focus on understanding the relationship between user's online social media behavior and offline restaurant spending. We link user's social media account and corresponding review site account, and then build consumption level ground truth based on user self report spending in their reviews. We propose the topic modeling methods and the matrix factorization methods to tackle the feature sparsity problem. We demonstrate that raw features and latent features on social media can predict consumption level with strong accuracy. The empirical analysis measures the correlation between social media features and consumption levels, and sheds light on language use differences across users at different consumption levels.