WO2019165944A1 - Transition probability network based merchant recommendation method and system thereof - Google Patents

Transition probability network based merchant recommendation method and system thereof Download PDF

Info

Publication number
WO2019165944A1
WO2019165944A1 PCT/CN2019/076049 CN2019076049W WO2019165944A1 WO 2019165944 A1 WO2019165944 A1 WO 2019165944A1 CN 2019076049 W CN2019076049 W CN 2019076049W WO 2019165944 A1 WO2019165944 A1 WO 2019165944A1
Authority
WO
WIPO (PCT)
Prior art keywords
merchant
transition probability
network
layer
vector
Prior art date
Application number
PCT/CN2019/076049
Other languages
French (fr)
Chinese (zh)
Inventor
李旭瑞
郑建宾
赵金涛
Original Assignee
中国银联股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中国银联股份有限公司 filed Critical 中国银联股份有限公司
Publication of WO2019165944A1 publication Critical patent/WO2019165944A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0241Advertisements
    • G06Q30/0251Targeted advertisements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]
    • G06Q30/0609Buyer or seller confidence or verification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/047Probabilistic or stochastic networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0241Advertisements

Definitions

  • the present invention relates to data processing, and in particular to a merchant recommendation method and system thereof for calculating a transition probability by constructing a neural network.
  • Some Internet websites also frequently recommend merchants to users, thereby saving users' shopping time, improving efficiency, and better improving the user service experience.
  • the present invention aims to provide a merchant recommendation method based on transition probability network and a merchant recommendation based on transition probability network, which can quickly analyze the association between merchant sequences according to the consumption sequence of a large number of users for more accurate recommendation. system.
  • the OneHot encoding step performs OneHot encoding on N merchants, wherein each merchant is mapped to an N-dimensional sparse vector;
  • a consumer merchant sequence construction step of constructing a consumer merchant sequence for a specified account, recording a business code corresponding to the related transaction, and sorting, wherein the merchant code is represented by a vector after OneHot encoding by the OneHot encoding step;
  • the transition probability network construction step constructs a neural network in which the vector after the OneHot encoding of each merchant is used as an input layer, and the probability distribution of the merchants of the merchants that may appear next after the merchant is taken as an output layer.
  • transition probability network construction step further comprising:
  • the merchant recommendation step is to recommend the merchant to the user based on the probability of occurrence of the merchant outputted by the transition probability network construction step.
  • the transition probability network construction step comprises the following sub-steps:
  • the neural model substep is trained to train the neural network based on a prescribed algorithm.
  • the dimension of the input layer is N
  • the dimension of the hidden layer is m
  • the weight matrix of the input layer to the hidden layer is recorded as W 1
  • the weight matrix W 1 is written as N rows * m columns
  • the kth dimension of the input vector is 1, only the row vector of the kth row in W 1 is extracted as an output.
  • the positive samples are weight-updated, and a part of the negative samples are randomly selected for weight update.
  • an account whose consumption times are greater than a preset threshold in a predetermined time period is counted, and for the statistical account, a merchant code corresponding to each transaction is recorded, and each of the accounts is The merchant codes of the merchants that are consumed in the specified period are arranged in order.
  • the training sample sub-step for the consumer merchant sequence, selecting a nearby merchant of the merchant as the input layer according to the specified location parameter to obtain a training sample or selecting a vicinity of the merchant as the input layer according to the specified time parameter Merchants get training samples.
  • OneHot encoding module which performs OneHot encoding on N merchants, wherein each merchant is mapped to an N-dimensional sparse vector;
  • a consumer merchant sequence building module for a specified account, recording a merchant code corresponding to the related transaction and sorting to construct a consumer merchant sequence, wherein the merchant code is represented by a vector after OneHot encoding by the OneHot encoding step;
  • the transition probability network construction module constructs a neural network in which the vector after the OneHot encoding of each merchant is used as an input layer, and the probability distribution of the merchants of the merchants that may appear next after the merchant is used as an output layer.
  • the merchant recommendation module recommends the merchant to the user based on the merchant appearance probability output by the transition probability network construction device.
  • the transition probability network building module has:
  • the neural model sub-module is trained to train the neural network based on a prescribed algorithm.
  • the dimension of the input layer is N
  • the dimension of the hidden layer is m
  • the weight matrix of the input layer to the hidden layer is W1
  • the weight matrix is W 1 is denoted as N rows * m columns
  • the kth dimension of the input vector is 1, only the row vector of the kth row in W 1 is extracted as an output.
  • the positive samples are weight-updated, and a part of the negative samples are randomly selected for weight update.
  • the consumer merchant sequence building module counts an account whose consumption times are greater than a preset threshold within a specified time period, and for a statistical account, records a merchant code corresponding to each transaction, and specifies a time for each segment of the account.
  • the merchant codes of the merchants in which they are consumed are arranged in order.
  • samples are obtained for merchant-related merchants.
  • the computer readable medium of the present invention has stored thereon a computer program, characterized in that the computer program is executed by a processor to implement the above-described transition probability network based merchant recommendation method.
  • the computer device of the present invention includes a memory, a processor, and a computer program stored on the memory and operable on the processor, wherein the processor executes the computer program to implement the above-described transition probability network based merchant Recommended method.
  • the architecture of the transition probability three-layer neural network can greatly make the calculation within the controllable range. Moreover, in the process of calculating the weight of the neural network, the calculation can be accelerated by using the "table lookup method” and the "negative sample sampling” method. According to the present invention, a three-layer neural network architecture with transition probability is proposed, which can quickly analyze the relationship between merchant series and make more accurate recommendations according to the consumption sequence of a large number of users.
  • FIG. 1 is a schematic diagram showing a merchant recommendation method based on a transition probability network of the present invention.
  • Fig. 2 is a flow chart showing the first embodiment of the merchant recommendation method based on the transition probability network of the present invention.
  • Figure 3 is a diagram showing the architecture of a merchant transition probability network model.
  • the business sequence of 7 merchants from merchant 1 to merchant 7 is shown in FIG.
  • the business sequence of 7 merchants from merchant 1 to merchant 7 is shown in FIG.
  • Fig. 6 is a block diagram showing the construction of a merchant recommendation system based on a transition probability network of the present invention.
  • FIG. 1 is a schematic diagram showing a merchant recommendation method based on a transition probability network of the present invention.
  • the merchant recommendation method based on the transition probability network of the present invention includes the following steps:
  • OneHot encoding step S100 Perform OneHot encoding on N merchants, wherein each merchant is mapped to an N-dimensional sparse vector, where N is a natural number;
  • a consumer merchant sequence construction step S200 for a prescribed account, recording a merchant code corresponding to the related transaction and sorting to construct a consumer merchant sequence, wherein the merchant code is represented by a vector after OneHot encoding by the OneHot encoding step S100;
  • Transition probability network construction step S300 constructing a neural network, wherein a vector after the OneHot encoding of each merchant is used as an input layer, and a probability distribution of a merchant occurrence of a merchant that may appear next after the merchant is taken as an output layer;
  • the merchant recommendation step S400 is to recommend the merchant to the user based on the merchant appearance probability output by the transition probability network construction step S300.
  • OneHot encoding step S100 the consumer merchant sequence construction step S200, the transition probability network construction step S300, and the merchant recommendation step S400 will be specifically described.
  • OneHot encoding is performed for N merchants. Each merchant is mapped to an N-dimensional sparse vector, where only the corresponding location of the merchant is 1, and all other bits are zero.
  • OneHot code one-hot code
  • OneHot code the unique heat code
  • the unique heat code status code 000001,000010,000100, 001000, 010000, 100000.
  • the one-hot state code of sixteen states should be: 0000000000000001,0000000000000010,0000000000000100, 0000000000001000, 0000000000010000, 0000000000100000, ..., 10000000000000000.
  • the account whose number of consumptions in the time T is greater than the threshold ⁇ is counted, and the threshold may be preset or may be changed as needed.
  • the threshold may be preset or may be changed as needed.
  • the merchant codes of each account in the period of time are arranged in order. Note that the merchants here are all vectors after OneHot encoding.
  • a three-layer neural network such as "input-hidden layer-output” is constructed.
  • the input is a merchant's OneHot code, with a fixed dimension hidden layer in the middle, and the output is the probability that the next merchant will appear.
  • the training sample is generated by using the consumer merchant sequence, and the neural network is quickly trained by using the "lookup table method" and the "negative sample sampling”. After the training is completed, the probability distribution of the merchants that may appear next for each merchant can be obtained.
  • the transition probability network construction step S300 may mainly include the following specific steps:
  • the input is the sparse OneHot vector corresponding to the current merchant.
  • the dimension of the output layer is the same as the input layer, except that each neuron on the layer outputs the probability corresponding to each merchant.
  • a training sample is generated using the constructed consumer merchant sequence above.
  • the constructed training sample is in the form of a key-value pair: (input merchant ⁇ export merchant).
  • input merchant ⁇ export merchant Optionally select a merchant in a consumer merchant sequence as the input merchant, and then select another merchant in the sequence that appears near the "input merchant” as the "export merchant.”
  • the above-mentioned three-layer neural network is trained.
  • the purpose of training a neural network is actually to obtain the parameters of the optimized network weight matrix.
  • the amount of calculation can be greatly reduced when optimizing the "input layer ⁇ hidden layer” and “hidden layer ⁇ output layer” weight matrix, respectively.
  • the specific method is as follows:
  • the weight matrix W 1 of the "input layer ⁇ hidden layer” if the input layer dimension is N and the hidden layer dimension is m, the weight matrix W 1 should be N rows * m columns. Considering the weight matrix of N*m as a table, when the kth dimension of the input vector is 1, only the row vector of the kth row of W 1 needs to be extracted is the calculation result we need.
  • a negative sample refers to a sample that does not exist in the training data.
  • each merchant's OneHot code is taken as input, and then the output layer is calculated, given an input merchant, and the probability value of each merchant in the merchant dictionary is output. That is to say, for a user, the merchant of the last transaction is used as the input of the neural network, then the merchant with the higher output probability should be more likely to appear in the context of the input merchant. In this way, when an account has a consumption, the neural network can be used to infer the ranking of the merchant that is most likely to be consumed next, and recommend it to the user from high to low.
  • FIG. 2 is a flow chart showing a first embodiment of a merchant recommendation method based on a transition probability network of the present invention.
  • step S1 merchant OneHot encoding is performed.
  • create a business dictionary For example, if there are a total of N merchants, then an initial business dictionary is built: ⁇ 1: merchant 1, 2: merchant 2, ..., N: merchant N ⁇ . In this way, each merchant can first correspond to a number. If N is 100,000, then OneHot can be coded for these 100,000 merchants. In this way, each merchant is mapped to a 100,000-dimensional sparse vector, where only the corresponding location of the merchant is 1, and all other bits are zero.
  • the vector after the merchant 1 is encoded by OneHot is [1, 0, 0, 0... 0]
  • the vector after the merchant 2 is encoded by OneHot is [0, 1, 0, 0... 0]
  • the merchant 3 passes the OneHot.
  • the vector after encoding is [0,0,1,0...0].
  • step S2 an account-level consumer merchant sequence is constructed. Specifically, an account that counts the number of consumptions within a period of time T greater than the threshold ⁇ is counted. For these accounts, record the merchant code for each transaction.
  • the merchant codes of each account in the period of time are arranged in order: ⁇ business 1, merchant 2, ..., merchant n ⁇ . Among them, the merchant code here is a vector after OneHot encoding.
  • a neural network model is constructed. Specifically, a three-layer neural network such as "input layer-hidden layer-output layer" is constructed.
  • the input layer is the sparse OneHot vector corresponding to the current merchant
  • the hidden layer is a compression vector of a specified length (the length generally does not need to be too large, the default dimension is 100 is enough)
  • the dimension of the output layer is the same as the input layer, but the layer
  • Each neuron on the output is the probability that each merchant corresponds.
  • Figure 3 is a diagram showing the architecture of a merchant transition probability network model.
  • the left side represents the input layer
  • the middle represents the hidden layer
  • the right side represents the output layer.
  • the input layer inputs the merchant OneHot code
  • the hidden layer represents the merchant scenario compression coding
  • the output layer outputs the merchant probability distribution.
  • W 1 the weight matrix from the "input layer ⁇ hidden layer”
  • W 2 the weight matrix from the "hidden layer ⁇ output layer”
  • the output layer can be constructed with a softmax regression classifier. As shown in Figure 3, the dimensions of the input and output layers are equal to the total number of all merchants.
  • a training sample is generated based on the consumer merchant sequence.
  • the training samples are generated using the constructed consumer merchant sequence above.
  • the constructed training sample is in the form of a key-value pair: (input merchant ⁇ export merchant).
  • the overall scheme is to arbitrarily select one of the merchants in the sequence of a certain consumer merchant as the input merchant, and then select another merchant in the sequence that appears in the vicinity of the "input merchant” as the "export merchant".
  • win_size represents the number of merchants selected from the left or right of the current "enter merchant”.
  • n_pick represents how many different merchants we choose from the entire window as our output.
  • a time threshold max_T can also be defined. If the key-value pairs we select are: (input merchant ⁇ export merchant), the corresponding consumption time interval is greater than max_T, we can think that there is no scenario between the two merchants. Dependent, so remove it from the training samples.
  • the vendor sequence of FIG. 4 is taken as an example to illustrate the parameters of win_size and the n_pick parameters.
  • the final training sample must be (business 1 ⁇ merchant 2), (business 1 ⁇ merchant 3).
  • the above input and output merchants are actually their corresponding OneHot encoding.
  • step S5 the neural network model is trained.
  • a large number of training samples have been generated from the consumer merchant sequence, and the above-mentioned three-layer neural network is trained based on these training data.
  • the weight matrix of "Input Layer ⁇ Hidden Layer” is set to W 1 . If the input layer dimension is N and the hidden layer dimension is m, then the weight matrix W 1 should be N rows * m columns. For example, if the size of the merchant dictionary is 100,000 and you want to use 100 features to represent a merchant, then the weight matrix W 1 should be 100,000 rows * 100 columns. In the calculation, it is necessary to multiply the input matrix of 1*N and the weight matrix of N*m. If the number of merchants is large, a large N will result in a lot of calculations.
  • the output layer is a softmax regression classifier in which each neuron will output a probability value between 0 and 1, and the sum of the probabilities of all output layer neuron nodes is one.
  • the function formula of Softmax is as follows:
  • a j represents the output of the jth neuron of the last layer
  • z j represents the input of the jth neuron of the last layer
  • e is a natural constant
  • log likelihood cost function Represents the summation of the inputs to all neurons in the last layer.
  • a k represents the output value of the kth neuron of the last layer; y k corresponds to the true value of the kth neuron, and the value is 0 or 1.
  • Our goal is to minimize this cost function. Notice that there is a ⁇ k summation in the cost function, which means that if the number of merchants is large, the optimization calculation process of the function will be very time consuming.
  • Negative samples are samples that we construct that do not exist in the training data.
  • the number of negative samples is generally about 5 or so.
  • the "random dot method" is used in the present invention for selection. That is, for each merchant k, we map it to a line segment of length expressed by the following formula:
  • cnt(k) indicates the number of times the merchant k appears in total
  • the denominator is the sum of the statistics of the number of times of all merchants.
  • step S7 the merchant is recommended based on the seriality of the output layer probability analysis. Specifically, after training the above neural network, each merchant's OneHot code is taken as an input, and then the output layer is calculated, given an input merchant, and the probability value of each merchant in the merchant dictionary is output. That is to say, for a user, the merchant of the last transaction is used as the input of the neural network, then the merchant with the higher output probability should be more likely to appear in the context of the input merchant. In this way, when an account has a consumption, we can use the neural network to infer the ranking of the merchants that are most likely to consume next, and recommend it to the user from high to low.
  • Fig. 6 is a block diagram showing the construction of a merchant recommendation system based on a transition probability network of the present invention.
  • the merchant recommendation system based on the transition probability network of the present invention has:
  • the OneHot encoding module 100 performs OneHot encoding on N merchants, wherein each merchant is mapped to an N-dimensional sparse vector;
  • the consumer merchant sequence building module 200 constructs a consumer merchant sequence for the specified account, records the merchant codes corresponding to the related transactions, and sorts the merchant code, wherein the merchant code is represented by a vector after the OneHot encoding by the OneHot encoding step;
  • the transition probability network building module 300 constructs a neural network, wherein a vector after the OneHot encoding of each merchant is used as an input layer, and a probability distribution of a merchant occurrence of a merchant that may appear next after the merchant is taken as an output layer;
  • the merchant recommendation module 400 recommends the merchant to the user based on the merchant appearance probability output by the transition probability network construction device.
  • the transition probability network construction module 300 has:
  • a neural network model sub-module 310 Constructing a neural network model sub-module 310, constructing a three-layer neural network including an input layer, a hidden layer, and an output layer;
  • the neural model sub-module 330 is trained to train the neural network based on a prescribed algorithm.
  • the dimension of the input layer is N
  • the dimension of the hidden layer is m
  • the weight matrix of the input layer to the hidden layer is recorded as W 1
  • the weight matrix W 1 is denoted as N rows * m columns
  • the kth dimension of the input vector is 1, only the row vector of the kth row in W 1 is extracted as an output.
  • the positive samples are weight-updated, and a part of the negative samples are randomly selected for weight update.
  • the consumer merchant sequence building module 200 counts the accounts whose consumption times in the time T is greater than the threshold ⁇ , and for the account that is counted, records the merchant code corresponding to each transaction, and the segment of each of the accounts is The merchant codes of the merchants that consume the specified time are arranged in order.
  • the generated training sample sub-module 320 selects a merchant that is related to the merchant location of the input layer according to the specified location parameter, obtains the training sample according to the specified location parameter, or selects the merchant as the merchant time associated with the input layer according to the specified time parameter. Get training samples.
  • the present invention further provides a computer readable medium having stored thereon a computer program, characterized in that the computer program is executed by a processor to implement the above-described transfer probability network-based merchant recommendation method of the present invention.
  • the present invention also provides a computer device comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, wherein the processor implements the above-described invention when the computer program is executed A merchant recommendation method based on a transfer probability network.
  • the merchant recommendation method based on the transition probability network and the merchant recommendation system based on the transition probability network discard the idea of the transfer matrix, and propose a framework of the transition probability three-layer neural network.
  • the network input is a merchant's unique heat code, and the output is the most likely merchant to appear next. Because a hidden layer with a fixed dimension is added in the middle (generally not too large, such as 100 dimensions), it is possible to avoid direct calculation of two columns between mass merchants (such as 100,000 * 100,000), instead of "input ⁇ The hidden layer "100,000 * 100, and the "hidden layer ⁇ output" of 100 * 100, so that the calculation is within the controllable range.
  • the "check table method” and the “negative sample sampling” method are further used to accelerate the calculation.
  • the “check table method” can further avoid the "input ⁇ hidden layer” of the matrix operation of 100,000 * 100, only need to index, "negative sample sampling” accelerates the "hidden layer ⁇ output” to some extent The calculation of the weight.
  • the merchant recommendation method based on the transition probability network and the merchant recommendation system based on the transition probability network do not depend on the “user-business score matrix”, but extract effective merchant-pair training samples according to the user's consumption sequence, avoiding hyperscale The "user-business" matrix.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • Development Economics (AREA)
  • Strategic Management (AREA)
  • Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Biomedical Technology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Biophysics (AREA)
  • General Business, Economics & Management (AREA)
  • Molecular Biology (AREA)
  • General Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Marketing (AREA)
  • Data Mining & Analysis (AREA)
  • Economics (AREA)
  • Evolutionary Computation (AREA)
  • Game Theory and Decision Science (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Probability & Statistics with Applications (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

A transition probability network based merchant recommendation method and a system thereof. The method comprises: carrying out OneHot coding on a number N of merchants, wherein each merchant is mapped to an N-dimensional sparse vector; for a prescribed account, recording and sorting merchant codes corresponding to relevant transactions so as to construct a consumption/merchant sequence, wherein the merchant codes are represented by vectors after OneHot coding; constructing a neural network, wherein the vector after OneHot coding of each merchant is taken as an input layer, and the occurrence probability distribution of merchants that may appear after the current merchant is taken as an output layer; and recommending merchants to a user on the basis of the merchant occurrence probability output by the transition probability network construction steps. The described method proposes an architecture of a transition-probability three-layer neural network; according to the consumption sequence of massive amounts of users, the relationships between merchant sequences can be quickly analyzed and more accurate recommendation thus can be made.

Description

基于转移概率网络的商户推荐方法及其系统Merchant recommendation method and system based on transition probability network 技术领域Technical field
本发明涉及数据处理,具体地涉及一种通过构建神经网络计算转移概率的商户推荐方法及其系统。The present invention relates to data processing, and in particular to a merchant recommendation method and system thereof for calculating a transition probability by constructing a neural network.
背景技术Background technique
用户们在消费的时候,已经习惯先从网络上去获取的商户信息,然后选择感兴趣的商户进行消费,即使在线下消费场景也是如此。一些互联网网站也会经常地向用户进行商户推荐,从而节约用户购物时间、提高效率,并且更好改善用户服务体验。When users are spending, they are accustomed to first obtaining the merchant information from the network, and then selecting the interested merchants to consume, even if the online consumption scene is the same. Some Internet websites also frequently recommend merchants to users, thereby saving users' shopping time, improving efficiency, and better improving the user service experience.
不过,很多商户推荐功能都是将商户按热门程度进行排序推荐,这导致大量用户收到的推荐信息都是类似的,没有针对用户喜好和的商户的特点进行推荐。这样,用户仍然会有很大的迷茫性,难以找到适合自己商户。通过检索发现,现在有一些公司也使用了一些机器学习方法来提升商户推荐的效率,但是这些方案大多建立在要准确获取用户各种隐私数据的基础之上。However, many merchant recommendation functions are to recommend merchants by popularity. This leads to a large number of users receiving similar recommendation information, and there is no recommendation for the characteristics of the user and the merchant. In this way, users will still have a lot of confusion and find it difficult to find a business that suits them. Through the search, some companies have also used some machine learning methods to improve the efficiency of merchant recommendation, but most of these solutions are based on the accurate acquisition of various user privacy data.
公开于本发明背景部分的信息仅仅旨在增加对本发明的总体背景的理解,而不应当被视为承认或以任何形式暗示该信息构成已为本领域一般技术人员所公知的现有技术。The information disclosed in the Background of the Invention is only intended to provide an understanding of the general background of the invention, and should not be construed as an admission or in any way.
发明内容Summary of the invention
鉴于上述问题,本发明旨在提供一种利一种能够根据海量用户的消费序列快速分析商户序列之间关联从而进行更精准推荐的基于转移概率网络的商户推荐方法以及基于转移概率网络的商户推荐系统。In view of the above problems, the present invention aims to provide a merchant recommendation method based on transition probability network and a merchant recommendation based on transition probability network, which can quickly analyze the association between merchant sequences according to the consumption sequence of a large number of users for more accurate recommendation. system.
本发明的基于转移概率网络的商户推荐方法,其特征在于,包括:The merchant recommendation method based on the transition probability network of the present invention is characterized in that it comprises:
OneHot编码步骤,对N个商户进行OneHot编码,其中,每个商户被映射为一个N维的稀疏向量;The OneHot encoding step performs OneHot encoding on N merchants, wherein each merchant is mapped to an N-dimensional sparse vector;
消费商户序列构建步骤,对于规定账户,记录相关交易对应的商户代码并排序而构建消费商户序列,其中,所述商户代码以由所述OneHot编码步骤进行OneHot编码之后的向量表示;以及a consumer merchant sequence construction step of constructing a consumer merchant sequence for a specified account, recording a business code corresponding to the related transaction, and sorting, wherein the merchant code is represented by a vector after OneHot encoding by the OneHot encoding step;
转移概率网络构建步骤,构建神经网络,其中,以每个商户的OneHot编码之后的向量作为输入层、以在该商户之后接下来可能出现的商户的商户出现概率分布作为输出层。The transition probability network construction step constructs a neural network in which the vector after the OneHot encoding of each merchant is used as an input layer, and the probability distribution of the merchants of the merchants that may appear next after the merchant is taken as an output layer.
可选地,在所述转移概率网络构建步骤之后进一步具备:Optionally, after the transition probability network construction step, further comprising:
商户推荐步骤,基于所述转移概率网络构建步骤输出的所述商户出现概率向用户推荐商户。The merchant recommendation step is to recommend the merchant to the user based on the probability of occurrence of the merchant outputted by the transition probability network construction step.
可选地,所述转移概率网络构建步骤包括下述子步骤:Optionally, the transition probability network construction step comprises the following sub-steps:
构建神经网络模型子步骤,构建包含具有输入层、隐藏层、输出层的三层神经网络;Constructing a neural network model sub-step to construct a three-layer neural network including an input layer, a hidden layer, and an output layer;
生成训练样本子步骤,基于所述消费商户序列生成训练样本;以及Generating a training sample sub-step to generate a training sample based on the consumer merchant sequence;
训练神经模型子步骤,基于规定算法训练该神经网络。The neural model substep is trained to train the neural network based on a prescribed algorithm.
可选地,在所述训练神经模型子步骤中,所述输入层的维度为N,所述隐藏层的维度为m,将输入层到隐藏层的权重矩阵记为W 1,则权重矩阵W 1记为N行*m列,当输入向量的第k维为1时,仅提取出W 1中的第k行的行向量作为输出。 Optionally, in the training neural model sub-step, the dimension of the input layer is N, the dimension of the hidden layer is m, and the weight matrix of the input layer to the hidden layer is recorded as W 1, then the weight matrix W 1 is written as N rows * m columns, and when the kth dimension of the input vector is 1, only the row vector of the kth row in W 1 is extracted as an output.
可选地,在所述训练神经模型子步骤中,对正样本进行权重更新,随机选取一部分的负样本进行权重更新。Optionally, in the training neural model sub-step, the positive samples are weight-updated, and a part of the negative samples are randomly selected for weight update.
可选地,在所述消费商户序列构建步骤中,统计规定时间内消费次数大于预设阈值的账户,对于统计出的账户,记录每一笔交易对应的商户代码,将每一个所述账户该段规定时间内消费所在商户的商户代码按照依次排列。Optionally, in the consumer merchant sequence construction step, an account whose consumption times are greater than a preset threshold in a predetermined time period is counted, and for the statistical account, a merchant code corresponding to each transaction is recorded, and each of the accounts is The merchant codes of the merchants that are consumed in the specified period are arranged in order.
可选地,在所述生成训练样本子步骤中,对于所述消费商户序列, 按照规定位置参数选取作为输入层的商户的附近商户得到训练样本或者按照规定时间参数选取作为输入层的商户的附近商户得到训练样本。Optionally, in the generating the training sample sub-step, for the consumer merchant sequence, selecting a nearby merchant of the merchant as the input layer according to the specified location parameter to obtain a training sample or selecting a vicinity of the merchant as the input layer according to the specified time parameter Merchants get training samples.
本发明的基于转移概率网络的商户推荐系统,其特征在于,具备:The merchant recommendation system based on the transition probability network of the present invention is characterized in that it has:
OneHot编码模块,对N个商户进行OneHot编码,其中,每个商户被映射为一个N维的稀疏向量;OneHot encoding module, which performs OneHot encoding on N merchants, wherein each merchant is mapped to an N-dimensional sparse vector;
消费商户序列构建模块,对于规定账户,记录相关交易对应的商户代码并排序而构建消费商户序列,其中,所述商户代码以由所述OneHot编码步骤进行OneHot编码之后的向量表示;以及a consumer merchant sequence building module, for a specified account, recording a merchant code corresponding to the related transaction and sorting to construct a consumer merchant sequence, wherein the merchant code is represented by a vector after OneHot encoding by the OneHot encoding step;
转移概率网络构建模块,构建神经网络,其中,以每个商户的OneHot编码之后的向量作为输入层、以在该商户之后接下来可能出现的商户的商户出现概率分布作为输出层。The transition probability network construction module constructs a neural network in which the vector after the OneHot encoding of each merchant is used as an input layer, and the probability distribution of the merchants of the merchants that may appear next after the merchant is used as an output layer.
可选地,进一步具备:Optionally, further comprising:
商户推荐模块,基于所述转移概率网络构建装置输出的所述商户出现概率向用户推荐商户。The merchant recommendation module recommends the merchant to the user based on the merchant appearance probability output by the transition probability network construction device.
可选地,所述转移概率网络构建模块具备:Optionally, the transition probability network building module has:
构建神经网络模型子模块,构建包含具有输入层、隐藏层、输出层的三层神经网络;Constructing a neural network model sub-module, and constructing a three-layer neural network including an input layer, a hidden layer, and an output layer;
生成训练样本子模块,利用所述消费商户序列生成训练样本;以及Generating a training sample sub-module, generating a training sample using the consumer merchant sequence;
训练神经模型子模块,基于规定算法训练该神经网络。The neural model sub-module is trained to train the neural network based on a prescribed algorithm.
可选地,在所述训练神经模型子模块中,设所述输入层的维度为N,所述隐藏层的维度为m,将输入层到隐藏层的权重矩阵记为W 1,则权重矩阵W 1记为N行*m列,当输入向量的第k维为1时,仅提取出W 1中的第k行的行向量作为输出。 Optionally, in the training neural model sub-module, the dimension of the input layer is N, the dimension of the hidden layer is m, and the weight matrix of the input layer to the hidden layer is W1 , and the weight matrix is W 1 is denoted as N rows * m columns, and when the kth dimension of the input vector is 1, only the row vector of the kth row in W 1 is extracted as an output.
可选地,所述训练神经模型子模块中,对正样本进行权重更新,随机选取一部分的负样本进行权重更新。Optionally, in the training neural model sub-module, the positive samples are weight-updated, and a part of the negative samples are randomly selected for weight update.
可选地,所述消费商户序列构建模块统计规定时间内消费次数大 于预设阈值的账户,对于统计出的账户,记录每一笔交易对应的商户代码,将每一个所述账户该段规定时间内消费所在商户的商户代码按照依次排列。Optionally, the consumer merchant sequence building module counts an account whose consumption times are greater than a preset threshold within a specified time period, and for a statistical account, records a merchant code corresponding to each transaction, and specifies a time for each segment of the account. The merchant codes of the merchants in which they are consumed are arranged in order.
可选地,在所述生成训练样本子模块对于所述消费商户序列,按照规定位置参数选取与作为输入层的商户位置相关的商户而得到训练样本、或者按照规定时间参数选取作为与输入层的商户时间相关的商户而得到训练样本。Optionally, in the generating the training sample sub-module, selecting, according to the specified location parameter, a merchant corresponding to the merchant location as the input layer according to the specified location parameter, obtaining the training sample, or selecting the parameter according to the specified time parameter as the input layer Train samples are obtained for merchant-related merchants.
本发明的计算机可读介质,其上存储有计算机程序,其特征在于,该计算机程序被处理器执行时实现上述的基于转移概率网络的商户推荐方法。The computer readable medium of the present invention has stored thereon a computer program, characterized in that the computer program is executed by a processor to implement the above-described transition probability network based merchant recommendation method.
本发明的计算机设备,包括存储器、处理器以及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现上述的基于转移概率网络的商户推荐方法。The computer device of the present invention includes a memory, a processor, and a computer program stored on the memory and operable on the processor, wherein the processor executes the computer program to implement the above-described transition probability network based merchant Recommended method.
根据本发明的基于转移概率网络的商户推荐方法以及基于转移概率网络的商户推荐系统,利用转移概率三层神经网络的架构,能够大大,使得计算在可控范围内。而且,在神经网络权重计算的过程中,进一步通过使用“查表法”以及“负样本抽样”法能够加速计算。根据本发明,提出了转移概率三层神经网络的架构,能够根据海量用户的消费序列,快速分析商户系列之间的关系,进行更精准的推荐。According to the merchant recommendation method based on the transition probability network and the merchant recommendation system based on the transition probability network, the architecture of the transition probability three-layer neural network can greatly make the calculation within the controllable range. Moreover, in the process of calculating the weight of the neural network, the calculation can be accelerated by using the "table lookup method" and the "negative sample sampling" method. According to the present invention, a three-layer neural network architecture with transition probability is proposed, which can quickly analyze the relationship between merchant series and make more accurate recommendations according to the consumption sequence of a large number of users.
通过纳入本文的附图以及随后与附图一起用于说明本发明的某些原理的具体实施方式,本发明的方法和装置所具有的其它特征和优点将更为具体地变得清楚或得以阐明。Other features and advantages of the method and apparatus of the present invention will become more apparent or <RTIgt; clarified</RTI> by the accompanying drawings and the accompanying drawings. .
附图说明DRAWINGS
图1是表示本发明的基于转移概率网络的商户推荐方法的示意图。1 is a schematic diagram showing a merchant recommendation method based on a transition probability network of the present invention.
图2是表示本发明的基于转移概率网络的商户推荐方法的第一 实施方式的流程图。Fig. 2 is a flow chart showing the first embodiment of the merchant recommendation method based on the transition probability network of the present invention.
图3是表示商户转移概率网络模型的架构。Figure 3 is a diagram showing the architecture of a merchant transition probability network model.
图4中表示了商户1到商户7的7个商户的商户序列。The business sequence of 7 merchants from merchant 1 to merchant 7 is shown in FIG.
图5中表示了商户1到商户7的7个商户的商户序列。The business sequence of 7 merchants from merchant 1 to merchant 7 is shown in FIG.
图6是表示本发明的基于转移概率网络的商户推荐系统的构造框图。Fig. 6 is a block diagram showing the construction of a merchant recommendation system based on a transition probability network of the present invention.
具体实施方式Detailed ways
下面介绍的是本发明的多个实施例中的一些,旨在提供对本发明的基本了解。并不旨在确认本发明的关键或决定性的要素或限定所要保护的范围。The following are some of the various embodiments of the invention, which are intended to provide a basic understanding of the invention. It is not intended to identify key or critical elements of the invention or the scope of the invention.
首先,对于本发明的基于转移概率网络的商户推荐方法进行说明。First, the merchant recommendation method based on the transition probability network of the present invention will be described.
图1是表示本发明的基于转移概率网络的商户推荐方法的示意图。1 is a schematic diagram showing a merchant recommendation method based on a transition probability network of the present invention.
如图1所示,本发明的基于转移概率网络的商户推荐方法包括下述步骤:As shown in FIG. 1, the merchant recommendation method based on the transition probability network of the present invention includes the following steps:
OneHot编码步骤S100:对N个商户进行OneHot编码,其中,每个商户被映射为一个N维的稀疏向量,N为自然数;OneHot encoding step S100: Perform OneHot encoding on N merchants, wherein each merchant is mapped to an N-dimensional sparse vector, where N is a natural number;
消费商户序列构建步骤S200:对于规定账户,记录相关交易对应的商户代码并排序而构建消费商户序列,其中,所述商户代码以由所述OneHot编码步骤S100进行OneHot编码之后的向量表示;a consumer merchant sequence construction step S200: for a prescribed account, recording a merchant code corresponding to the related transaction and sorting to construct a consumer merchant sequence, wherein the merchant code is represented by a vector after OneHot encoding by the OneHot encoding step S100;
转移概率网络构建步骤S300:构建神经网络,其中,以每个商户的OneHot编码之后的向量作为输入层、以在该商户之后接下来可能出现的商户的商户出现概率分布作为输出层;以及Transition probability network construction step S300: constructing a neural network, wherein a vector after the OneHot encoding of each merchant is used as an input layer, and a probability distribution of a merchant occurrence of a merchant that may appear next after the merchant is taken as an output layer;
商户推荐步骤S400,基于所述转移概率网络构建步骤S300输出的所述商户出现概率向用户推荐商户。The merchant recommendation step S400 is to recommend the merchant to the user based on the merchant appearance probability output by the transition probability network construction step S300.
接着,对于OneHot编码步骤S100、消费商户序列构建步骤S200、 转移概率网络构建步骤S300以及商户推荐步骤S400进行具体说明。Next, the OneHot encoding step S100, the consumer merchant sequence construction step S200, the transition probability network construction step S300, and the merchant recommendation step S400 will be specifically described.
首先,在OneHot编码步骤S100中,对N个商户进行OneHot编码。每一个商户都被映射为一个N维的稀疏向量,其中只有该商户对应的位置为1,其它位都为0。First, in the OneHot encoding step S100, OneHot encoding is performed for N merchants. Each merchant is mapped to an N-dimensional sparse vector, where only the corresponding location of the merchant is 1, and all other bits are zero.
所谓OneHot编码(one-hot code),即独热码,直观来说就是有多少个状态就有多少比特,而且只有一个比特为1,其他全为0的一种码制。通常,在通信网络协议栈中,使用八位或者十六位状态的独热码,且系统占用其中一个状态码,余下的可以供用户使用。The so-called OneHot code (one-hot code), that is, the unique heat code, is intuitively speaking, how many bits are there, and only one bit is 1, and all other codes are 0. Generally, in the communication network protocol stack, an eight-digit or six-bit status single-heat code is used, and the system occupies one of the status codes, and the rest can be used by the user.
例如,有6个状态的独热码状态编码为:000001,000010,000100,001000,010000,100000。再如,有十六个状态的独热码状态编码应该是:0000000000000001,0000000000000010,0000000000000100,0000000000001000,0000000000010000,0000000000100000,……,10000000000000000。For example, there are six states of the unique heat code status code: 000001,000010,000100, 001000, 010000, 100000. For another example, the one-hot state code of sixteen states should be: 0000000000000001,0000000000000010,0000000000000100, 0000000000001000, 0000000000010000, 0000000000100000, ..., 10000000000000000.
但是通常我们为了方便书写,将二进制简化为十六进制表示(从右往左每四位二进制位用一位十六进制数表示),那么,以上十六状态的独热码可以表示成0x0001,0x0002,0x0004,0x0008,0x0010,0x0020,……,0x8000(其中的0x是十六进制的前缀表示,在诸如PLC等程序中也有其他表示方法)。But usually we simplify the writing to simplify the binary to a hexadecimal representation (every four digits from right to left are represented by a hexadecimal number), then the above sixteen state of the heat code can be expressed as 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, ..., 0x8000 (where 0x is a hexadecimal prefix representation, and there are other representations in programs such as PLC).
其次,在消费商户序列构建步骤S200中,统计在一段时间T内的消费次数大于阈值θ的账户,该阈值可以预先设定,也可以根据需要进行变化。对于这些账户,记录其每一笔交易对应的商户代码。将每一个账户该段时间内消费所在商户代码按照先后顺序依次排列。注意这里的商户都是OneHot编码之后的向量。Next, in the consumer merchant sequence construction step S200, the account whose number of consumptions in the time T is greater than the threshold θ is counted, and the threshold may be preset or may be changed as needed. For these accounts, record the merchant code for each transaction. The merchant codes of each account in the period of time are arranged in order. Note that the merchants here are all vectors after OneHot encoding.
再次,在转移概率网络构建步骤S300中,构建一个“输入—隐藏层—输出”这样一个三层神经网。输入是一个商户的的OneHot编码,中间是一个固定维度的隐藏层,输出是接下来商户出现的概 率。利用消费商户序列来生成训练样本,使用“查找表法”和“负样本抽样”来快速训练该神经网络,训练完成后,即可得到每个商户接下来可能出现的商户的概率分布。Again, in the transition probability network construction step S300, a three-layer neural network such as "input-hidden layer-output" is constructed. The input is a merchant's OneHot code, with a fixed dimension hidden layer in the middle, and the output is the probability that the next merchant will appear. The training sample is generated by using the consumer merchant sequence, and the neural network is quickly trained by using the "lookup table method" and the "negative sample sampling". After the training is completed, the probability distribution of the merchants that may appear next for each merchant can be obtained.
具体地,转移概率网络构建步骤S300主要可以包括下述具体步骤:Specifically, the transition probability network construction step S300 may mainly include the following specific steps:
(1)构建神经网络模型子步骤(1) Constructing a neural network model substep
构建一个“输入—隐藏层—输出”这样一个三层神经网。其中输入就是当前商户对应的稀疏OneHot向量,输出层的维度与输入层一样,只不过该层上的每一个神经元输出的是每一个商户对应的概率。Construct a three-layer neural network such as “input-hidden layer-output”. The input is the sparse OneHot vector corresponding to the current merchant. The dimension of the output layer is the same as the input layer, except that each neuron on the layer outputs the probability corresponding to each merchant.
(2)基于消费商户序列生成训练样本子步骤(2) Generate training sample substeps based on the consumer merchant sequence
利用上面构造好的消费商户序列来生成训练样本。构造的训练样本的形式是一个键值对:(输入商户→输出商户)。任意选择某一消费商户序列中的某个商户作为输入商户,然后选择该序列中出现在该“输入商户”附近出现的另外一个商户作为“输出商户”。A training sample is generated using the constructed consumer merchant sequence above. The constructed training sample is in the form of a key-value pair: (input merchant → export merchant). Optionally select a merchant in a consumer merchant sequence as the input merchant, and then select another merchant in the sequence that appears near the "input merchant" as the "export merchant."
(3)训练神经网络模型子步骤(3) Training neural network model substeps
基于这些训练数据,训练上述提到的三层神经网。训练神经网络的目的其实就是获得最优化的网络权重矩阵的参数。这里,通过使用“查找表法”和“负样本抽样”,分别在优化“输入层→隐藏层”和“隐藏层→输出层”权重矩阵的时候能够极大地减少计算量。具体方法如下:Based on these training data, the above-mentioned three-layer neural network is trained. The purpose of training a neural network is actually to obtain the parameters of the optimized network weight matrix. Here, by using the "lookup table method" and the "negative sample sampling", the amount of calculation can be greatly reduced when optimizing the "input layer→hidden layer" and "hidden layer→output layer" weight matrix, respectively. The specific method is as follows:
(I)使用“查找表法”实现输入层到隐藏层的快速计算(I) Use the "look-up table method" to achieve fast calculation of the input layer to the hidden layer
首先,关于“输入层→隐藏层”的权重矩阵W 1,如果输入层维度为N,并且隐藏层维度为m,那么权重矩阵W 1应该为N行*m列。把N*m的权重矩阵看成一个表,当输入向量的第k维为1的时候,只需要提取出W 1的第k行那个行向量就是我们需要的计算结果。 First, regarding the weight matrix W 1 of the "input layer → hidden layer", if the input layer dimension is N and the hidden layer dimension is m, the weight matrix W 1 should be N rows * m columns. Considering the weight matrix of N*m as a table, when the kth dimension of the input vector is 1, only the row vector of the kth row of W 1 needs to be extracted is the calculation result we need.
(II)使用“负样本抽样”方法实现隐藏层到输出层的快速计算(II) Using the "negative sample sampling" method to achieve fast calculation of the hidden layer to the output layer
其次,关于正样本进行权重更新,然后随机选择一小部分的负样本来更新对应的权重,从而降低梯度下降过程中的计算量。负样本在这里是指,在训练数据中不存在的样本。在抽样的时候,我们使用“随机打点法”使得热门商户被选为负样本的概率要比冷门商户被选为负样本的概率大。Secondly, the positive samples are weighted and then a small number of negative samples are randomly selected to update the corresponding weights, thereby reducing the amount of computation in the gradient descent process. A negative sample here refers to a sample that does not exist in the training data. At the time of sampling, we use the “random tap method” to make the probability that a popular merchant is selected as a negative sample is greater than the probability that an unpopular merchant is selected as a negative sample.
(4)智能商户推荐子步骤(4) Smart merchant recommendation substeps
训练好上述神经网络之后,再将每个商户的OneHot编码作为输入,然后计算输出层,给定一个输入商户,输出商户词典中每个商户的概率值。也就是说,对于某个用户,将上一笔交易的商户作为神经网络的输入,那么输出概率越大的商户,应该越有可能出现在输入商户的上下文中。这样一来,当一个账户发生了一笔消费之后,就可以利用该神经网络推测出接下来最有可能去消费的商户的排名,从高到低推荐给该用户。After training the above neural network, each merchant's OneHot code is taken as input, and then the output layer is calculated, given an input merchant, and the probability value of each merchant in the merchant dictionary is output. That is to say, for a user, the merchant of the last transaction is used as the input of the neural network, then the merchant with the higher output probability should be more likely to appear in the context of the input merchant. In this way, when an account has a consumption, the neural network can be used to infer the ranking of the merchant that is most likely to be consumed next, and recommend it to the user from high to low.
接下,对于本发明的基于转移概率网络的商户推荐方法的第一实施方式进行说明。Next, a first embodiment of the merchant recommendation method based on the transition probability network of the present invention will be described.
图2是表示本发明的基于转移概率网络的商户推荐方法的第一实施方式的流程图。2 is a flow chart showing a first embodiment of a merchant recommendation method based on a transition probability network of the present invention.
如图2所示,在步骤S1中,进行商户OneHot编码。首先,建立一个商户词典。比如一共有N个商户,那么就构建一个初始商户词典:{1:商户1,2:商户2,…,N:商户N}。这样一来,每个商户都可以先对应到一个数字上去了。如果N是10万,那么可以对这10万个商户进行OneHot编码。这样,每一个商户都被映射为一个10万维的稀疏向量,其中只有该商户对应的位置为1,其它位都为0。As shown in FIG. 2, in step S1, merchant OneHot encoding is performed. First, create a business dictionary. For example, if there are a total of N merchants, then an initial business dictionary is built: {1: merchant 1, 2: merchant 2, ..., N: merchant N}. In this way, each merchant can first correspond to a number. If N is 100,000, then OneHot can be coded for these 100,000 merchants. In this way, each merchant is mapped to a 100,000-dimensional sparse vector, where only the corresponding location of the merchant is 1, and all other bits are zero.
例如,商户1经过OneHot编码之后的向量为[1,0,0,0……0],商户2经过OneHot编码之后的向量为[0,1,0,0……0],商户3经过OneHot编码之后的向量为[0,0,1,0……0]。For example, the vector after the merchant 1 is encoded by OneHot is [1, 0, 0, 0... 0], the vector after the merchant 2 is encoded by OneHot is [0, 1, 0, 0... 0], and the merchant 3 passes the OneHot. The vector after encoding is [0,0,1,0...0].
接着,在步骤S2中,构建账户级的消费商户序列。具体地, 统计在一段时间T内的消费次数大于阈值θ的账户。对于这些账户,记录其每一笔交易对应的商户代码。将每一个账户该段时间内消费所在商户代码按照先后顺序依次排列:{商户1,商户2,…,商户n}。其中,这里的商户代码都是OneHot编码之后的向量。Next, in step S2, an account-level consumer merchant sequence is constructed. Specifically, an account that counts the number of consumptions within a period of time T greater than the threshold θ is counted. For these accounts, record the merchant code for each transaction. The merchant codes of each account in the period of time are arranged in order: {business 1, merchant 2, ..., merchant n}. Among them, the merchant code here is a vector after OneHot encoding.
接着,在步骤S3中,构建神经网络模型。具体地,构建一个“输入层—隐藏层—输出层”这样一个三层神经网。其中输入层就是当前商户对应的稀疏OneHot向量,隐藏层是指定长度的压缩向量(长度一般不需要太大,默认维度是100就够了),输出层的维度与输入层一样,只不过该层上的每一个神经元输出的是每一个商户对应的概率。Next, in step S3, a neural network model is constructed. Specifically, a three-layer neural network such as "input layer-hidden layer-output layer" is constructed. The input layer is the sparse OneHot vector corresponding to the current merchant, and the hidden layer is a compression vector of a specified length (the length generally does not need to be too large, the default dimension is 100 is enough), the dimension of the output layer is the same as the input layer, but the layer Each neuron on the output is the probability that each merchant corresponds.
图3是表示商户转移概率网络模型的架构。Figure 3 is a diagram showing the architecture of a merchant transition probability network model.
在图3中,左侧表示输入层,中间表示隐藏层,右侧表示输出层。输入层输入的是商户OneHot编码,隐藏层表示商户情景压缩编码,输出层输出商户概率分布。其中,从“输入层→隐藏层”的权重矩阵记为W 1,从“隐藏层→输出层”的权重矩阵记为W 2。另外,输出层是可以有一个softmax回归分类器来构成。如图3所示,输入层和输出层的维度都等于所有商户的总个数。 In Fig. 3, the left side represents the input layer, the middle represents the hidden layer, and the right side represents the output layer. The input layer inputs the merchant OneHot code, the hidden layer represents the merchant scenario compression coding, and the output layer outputs the merchant probability distribution. Among them, the weight matrix from the "input layer → hidden layer" is denoted as W 1 , and the weight matrix from the "hidden layer → output layer" is denoted as W 2 . In addition, the output layer can be constructed with a softmax regression classifier. As shown in Figure 3, the dimensions of the input and output layers are equal to the total number of all merchants.
接着,在步骤S4中,基于消费商户序列生成训练样本。具体地,利用上面构造好的消费商户序列来生成训练样本。构造的训练样本的形式是一个键值对:(输入商户→输出商户)。总体方案是任意选择某一消费商户序列中的某个商户作为输入商户,然后选择该序列中出现在该“输入商户”附近出现的另外一个商户作为“输出商户”。Next, in step S4, a training sample is generated based on the consumer merchant sequence. Specifically, the training samples are generated using the constructed consumer merchant sequence above. The constructed training sample is in the form of a key-value pair: (input merchant → export merchant). The overall scheme is to arbitrarily select one of the merchants in the sequence of a certain consumer merchant as the input merchant, and then select another merchant in the sequence that appears in the vicinity of the "input merchant" as the "export merchant".
此外,还需要定义一个叫做win_size的参数,它代表着从当前“输入商户”的左边或右边选取商户的数量。另一个参数叫n_pick,它代表着我们从整个窗口中选取多少个不同的商户作为我们的输出。In addition, you need to define a parameter called win_size, which represents the number of merchants selected from the left or right of the current "enter merchant". The other parameter is n_pick, which represents how many different merchants we choose from the entire window as our output.
可选的,还可以定义一个时间阈值max_T,如果我们挑选出来 的键值对:(输入商户→输出商户)对应的消费时间间隔都大于max_T,我们可以认为这两个商户之间是不存在情景依赖的,所以将其从训练样本中去除。Optionally, a time threshold max_T can also be defined. If the key-value pairs we select are: (input merchant → export merchant), the corresponding consumption time interval is greater than max_T, we can think that there is no scenario between the two merchants. Dependent, so remove it from the training samples.
这里以图4的商户序列为例说明win_size的参数和n_pick参数进行说明。Here, the vendor sequence of FIG. 4 is taken as an example to illustrate the parameters of win_size and the n_pick parameters.
图4中表示了商户1到商户7的7个商户的商户序列。这样,对于一个消费商户序列{商户1,商户2,…,商户7},如果我们选取商户4作为“输入商户”。如果设置win_size=2,那么就代表着选取“输入商户”左侧2个和右侧2个商户进入我们的窗口,也就是说,选取:商户2、商户3、商户5、以及商户6。The business sequence of 7 merchants from merchant 1 to merchant 7 is shown in FIG. Thus, for a consumer merchant sequence {business 1, merchant 2, ..., merchant 7}, if we select merchant 4 as the "input merchant". If win_size=2 is set, it means that 2 and 2 merchants on the left side of “Input Merchant” are selected to enter our window, that is, select: Merchant 2, Merchant 3, Merchant 5, and Merchant 6.
而当n_pick=2时,将会随机得到两组训练样本,即(商户4→商户2),(商户4→商户5)。When n_pick=2, two sets of training samples will be randomly obtained, namely (Business 4 → Merchant 2), (Business 4 → Merchant 5).
而如果我们选取商户1作为“输入商户”,并且win_size和n_pick参数也都设置为2的话,那么最终够得到的训练样本一定是(商户1→商户2),(商户1→商户3)。其中,以上输入输出商户其实都是其对应的OneHot编码。And if we select merchant 1 as the "input merchant" and the win_size and n_pick parameters are also set to 2, then the final training sample must be (business 1 → merchant 2), (business 1 → merchant 3). Among them, the above input and output merchants are actually their corresponding OneHot encoding.
接着,在步骤S5中,训练神经网络模型。通过上述步骤,已经从消费商户序列中生成了大量的训练样本,下面就基于这些训练数据,训练上述提到的三层神经网。Next, in step S5, the neural network model is trained. Through the above steps, a large number of training samples have been generated from the consumer merchant sequence, and the above-mentioned three-layer neural network is trained based on these training data.
训练神经网络的目的其实就是获得最优化的网络权重矩阵的参数。不过考虑到商户数量数目巨大,我们并不打算利用传统的方法去训练模型,否则会非常耗费计算力。这里,我们使用了两个技术手段,分别在优化“输入层→隐藏层”和“隐藏层→输出层”权重矩阵的时候能够极大地减少计算量。具体方法如下:The purpose of training a neural network is actually to obtain the parameters of the optimized network weight matrix. However, considering the large number of merchants, we do not intend to use traditional methods to train the model, otherwise it will be very computationally intensive. Here, we use two technical means to greatly reduce the amount of calculation when optimizing the "input layer → hidden layer" and "hidden layer → output layer" weight matrix. The specific method is as follows:
首先,对于使用“查找表法”实现输入层到隐藏层的快速计算进行说明。First, a description will be given of the fast calculation of the input layer to the hidden layer using the "lookup table method".
如上面已经提到的,“输入层→隐藏层”的权重矩阵设为W 1。如果输入层维度为N,并且隐藏层维度为m,那么权重矩阵W 1应该 为N行*m列。比如商户词典大小为10万个,并且想用100个特征来表示一个商户,那么权重矩阵W 1应该为10万行*100列。在计算的时候,需要将1*N的输入矩阵与N*m的权重矩阵与进行相乘。如果当商户数量很大的话,很大N会导致非常多的计算量。 As already mentioned above, the weight matrix of "Input Layer → Hidden Layer" is set to W 1 . If the input layer dimension is N and the hidden layer dimension is m, then the weight matrix W 1 should be N rows * m columns. For example, if the size of the merchant dictionary is 100,000 and you want to use 100 features to represent a merchant, then the weight matrix W 1 should be 100,000 rows * 100 columns. In the calculation, it is necessary to multiply the input matrix of 1*N and the weight matrix of N*m. If the number of merchants is large, a large N will result in a lot of calculations.
通过观察,我们的输入向量虽然是N维的,但其实每个输入向量只有一位是1,而其他位全是0。这样一类,我们其实不用全量计算,只需要把N*m的权重矩阵看成一个表,当输入向量的第k维为1的时候,我们只需要提取出W1的第k行那个行向量就是我们需要的计算结果。比如下面1*4的矩阵与4*3的矩阵相乘,其中输入矩阵中只有第3位为1,那么计算结果正好是权重矩阵中的第3行。如下式所示:By observing, our input vector is N-dimensional, but in fact, only one bit of each input vector is 1, and the other bits are all 0. In this class, we don't actually need to calculate the whole amount. We only need to treat the weight matrix of N*m as a table. When the kth dimension of the input vector is 1, we only need to extract the row vector of the kth row of W1. The calculation results we need. For example, the matrix of 1*4 is multiplied by the matrix of 4*3, and only the third digit of the input matrix is 1, then the calculation result is exactly the third row in the weight matrix. As shown below:
Figure PCTCN2019076049-appb-000001
Figure PCTCN2019076049-appb-000001
其次,对于使用“负样本抽样”方法实现隐藏层到输出层的快速计算进行说明。Secondly, the fast calculation of the hidden layer to the output layer is described using the "negative sample sampling" method.
输出层是一个softmax回归分类器,其中每一个神经元将会输出一个0~1之间的概率值,所有输出层神经元结点的概率之和为1。Softmax的函数公式如下:The output layer is a softmax regression classifier in which each neuron will output a probability value between 0 and 1, and the sum of the probabilities of all output layer neuron nodes is one. The function formula of Softmax is as follows:
Figure PCTCN2019076049-appb-000002
Figure PCTCN2019076049-appb-000002
其中a j表示最后一层第j个神经元的输出;z j表示最后一层第j个神经元的输入,e是自然常数。 Where a j represents the output of the jth neuron of the last layer; z j represents the input of the jth neuron of the last layer, and e is a natural constant.
Figure PCTCN2019076049-appb-000003
表示对最后一层所有神经元的输入求和。这样,对于log似然代价函数为如下:
Figure PCTCN2019076049-appb-000003
Represents the summation of the inputs to all neurons in the last layer. Thus, the log likelihood cost function is as follows:
C=-∑ ky kloga k C = -Σ k y k loga k
其中,a k表示最后一层第k个神经元的输出值;y k第k个神经元对应的真实值,取值为0或1。我们的目标是最小化该代价函数。注意到代价函数里面有一个∑ k求和,也就是说,如果商户数目很大的话,该函数的优化计算过程又会非常耗时。 Where a k represents the output value of the kth neuron of the last layer; y k corresponds to the true value of the kth neuron, and the value is 0 or 1. Our goal is to minimize this cost function. Notice that there is a ∑ k summation in the cost function, which means that if the number of merchants is large, the optimization calculation process of the function will be very time consuming.
因此,这里,我们使用负样本抽样的方法,它不同于原本每个训练样本更新所有的权重,而是每次让一个训练样本仅仅更新一小部分的权重,这样就会降低梯度下降过程中的计算量。不过在这种策略下,我们的优化目标需要变为:最大化正样本的概率,同时最小化负样本的概率。负样本就是我们构造出来的,在训练数据中不存在的样本。Therefore, here, we use the method of negative sample sampling, which is different from the original weight of each training sample, but each time a training sample is updated with only a small part of the weight, which will reduce the gradient drop process. Calculated amount. However, under this strategy, our optimization goal needs to be: maximize the probability of positive samples while minimizing the probability of negative samples. Negative samples are samples that we construct that do not exist in the training data.
比如对于商户a来说,我们先通过上下文提取除了几个正样本,其余的不在上下文中的这些词都称之为负样本,例如上面的例子中,对于商户4,由于(商户4→商户2)就是正样本,而对于该输入商户4,我们会再构造几个原本在训练数据中不存在的样本,比如(商户4→商户25)、(商户4→商户342)、(商户4→商户1253)这些就叫做负样本。For example, for merchant a, we first extract a few positive samples by context, and the rest of the words that are not in the context are called negative samples. For example, in the above example, for merchant 4, because (businesser 4 → merchant 2 ) is a positive sample, and for the input merchant 4, we will construct several samples that did not exist in the training data, such as (Business 4 → Merchant 25), (Business 4 → Merchant 342), (Business 4 → Merchant) 1253) These are called negative samples.
这样,我们首先对我们的正样本进行权重更新,然后随机选择一小部分的负样本来更新对应的权重,对于大规模数据集来说负样本数量一般5个左右即可。In this way, we first update the weight of our positive samples, and then randomly select a small part of the negative samples to update the corresponding weights. For large-scale data sets, the number of negative samples is generally about 5 or so.
当然了,在抽样的时候,我们希望热门商户被选为负样本的概率要比冷门商户被选为负样本的概率大。要实现这个功能,在本发明中采用“随机打点法”进行挑选。也就是说,对于每一个商户k,我们都把它映射为一个长度以以下公式表示的线段:Of course, at the time of sampling, we hope that the probability that a popular merchant will be selected as a negative sample is greater than the probability that an unpopular merchant will be selected as a negative sample. To achieve this function, the "random dot method" is used in the present invention for selection. That is, for each merchant k, we map it to a line segment of length expressed by the following formula:
cnt(k)/∑ icnt(i) Cnt(k)/∑ i cnt(i)
其中,cnt(k)表示该商户k一共出现的次数,分母是对所有商户的次数统计的求和。我们把这些线段拼在一起,形成一个长度为1的完整线段,就得到如图5所示的线段,如果随机地往这个线段上去打点,该点落在那个线段区间上,结果就是该线段对应的商户。按照 图5所示,可以想象,热门商户对应的线段相对比较长,被打中的概率就大。Among them, cnt(k) indicates the number of times the merchant k appears in total, and the denominator is the sum of the statistics of the number of times of all merchants. We put these line segments together to form a complete line segment of length 1, and we get the line segment as shown in Figure 5. If you randomly click on this line segment, the point falls on that line segment interval, and the result is that the line segment corresponds to Merchants. As shown in Figure 5, it can be imagined that the line segment corresponding to the popular merchant is relatively long, and the probability of being hit is large.
最后,在步骤S7中,基于输出层概率分析的序列性推荐商户。具体地,在训练好上述神经网络之后,再将每个商户的OneHot编码作为输入,然后计算输出层,给定一个输入商户,输出商户词典中每个商户的概率值。也就是说,对于某个用户,将上一笔交易的商户作为神经网络的输入,那么输出概率越大的商户,应该越有可能出现在输入商户的上下文中。这样一来,当一个账户发生了一笔消费之后,我们可以利用该神经网络推测出接下来最有可能去消费的商户的排名,从高到低推荐给该用户。Finally, in step S7, the merchant is recommended based on the seriality of the output layer probability analysis. Specifically, after training the above neural network, each merchant's OneHot code is taken as an input, and then the output layer is calculated, given an input merchant, and the probability value of each merchant in the merchant dictionary is output. That is to say, for a user, the merchant of the last transaction is used as the input of the neural network, then the merchant with the higher output probability should be more likely to appear in the context of the input merchant. In this way, when an account has a consumption, we can use the neural network to infer the ranking of the merchants that are most likely to consume next, and recommend it to the user from high to low.
以上对于本发明的基于转移概率网络的商户推荐进行了说明,接着对于本发明的基于转移概率网络的商户推荐系统进行简单介绍。The above describes the merchant recommendation based on the transition probability network of the present invention, and then briefly introduces the merchant recommendation system based on the transition probability network of the present invention.
图6是表示本发明的基于转移概率网络的商户推荐系统的构造框图。Fig. 6 is a block diagram showing the construction of a merchant recommendation system based on a transition probability network of the present invention.
如图6所示,本发明的基于转移概率网络的商户推荐系统具备:As shown in FIG. 6, the merchant recommendation system based on the transition probability network of the present invention has:
OneHot编码模块100,对N个商户进行OneHot编码,其中,每个商户被映射为一个N维的稀疏向量;The OneHot encoding module 100 performs OneHot encoding on N merchants, wherein each merchant is mapped to an N-dimensional sparse vector;
消费商户序列构建模块200,对于规定账户,记录相关交易对应的商户代码并排序而构建消费商户序列,其中,所述商户代码以由所述OneHot编码步骤进行OneHot编码之后的向量表示;The consumer merchant sequence building module 200 constructs a consumer merchant sequence for the specified account, records the merchant codes corresponding to the related transactions, and sorts the merchant code, wherein the merchant code is represented by a vector after the OneHot encoding by the OneHot encoding step;
转移概率网络构建模块300,构建神经网络,其中,以每个商户的OneHot编码之后的向量作为输入层、以在该商户之后接下来可能出现的商户的商户出现概率分布作为输出层;以及The transition probability network building module 300 constructs a neural network, wherein a vector after the OneHot encoding of each merchant is used as an input layer, and a probability distribution of a merchant occurrence of a merchant that may appear next after the merchant is taken as an output layer;
商户推荐模块400,基于所述转移概率网络构建装置输出的所述商户出现概率向用户推荐商户。The merchant recommendation module 400 recommends the merchant to the user based on the merchant appearance probability output by the transition probability network construction device.
其中,所述转移概率网络构建模块300具备:The transition probability network construction module 300 has:
构建神经网络模型子模块310,构建包含具有输入层、隐藏层、输出层的三层神经网络;Constructing a neural network model sub-module 310, constructing a three-layer neural network including an input layer, a hidden layer, and an output layer;
生成训练样本子模块320,利用所述消费商户序列生成训练样本;以及Generating a training sample sub-module 320 for generating training samples using the consumer merchant sequence;
训练神经模型子模块330,基于规定算法训练该神经网络。The neural model sub-module 330 is trained to train the neural network based on a prescribed algorithm.
作为优先的方式,在训练神经模型子模块330中,设所述输入层的维度为N,所述隐藏层的维度为m,将输入层到隐藏层的权重矩阵记为W 1,则权重矩阵W 1记为N行*m列,当输入向量的第k维为1时,仅提取出W 1中的第k行的行向量作为输出。 In a preferred manner, in the training neural model sub-module 330, the dimension of the input layer is N, the dimension of the hidden layer is m, and the weight matrix of the input layer to the hidden layer is recorded as W 1, then the weight matrix W 1 is denoted as N rows * m columns, and when the kth dimension of the input vector is 1, only the row vector of the kth row in W 1 is extracted as an output.
进一步,在训练神经模型子模块330中,对正样本进行权重更新,随机选取一部分的负样本进行权重更新。Further, in the training neural model sub-module 330, the positive samples are weight-updated, and a part of the negative samples are randomly selected for weight update.
作为优选的方式,消费商户序列构建模块200统计在一段时间T内的消费次数大于阈值θ的账户,对于统计出的账户,记录每一笔交易对应的商户代码,将每一个所述账户该段规定时间内消费所在商户的商户代码按照依次排列。In a preferred manner, the consumer merchant sequence building module 200 counts the accounts whose consumption times in the time T is greater than the threshold θ, and for the account that is counted, records the merchant code corresponding to each transaction, and the segment of each of the accounts is The merchant codes of the merchants that consume the specified time are arranged in order.
具体地,生成训练样本子模块320对于所述消费商户序列,按照规定位置参数选取作为与输入层的商户位置相关的商户得到训练样本或者按照规定时间参数选取作为与输入层的商户时间相关的商户得到训练样本。Specifically, the generated training sample sub-module 320 selects a merchant that is related to the merchant location of the input layer according to the specified location parameter, obtains the training sample according to the specified location parameter, or selects the merchant as the merchant time associated with the input layer according to the specified time parameter. Get training samples.
进一步,本发明还提供一种计算机可读介质,其上存储有计算机程序,其特征在于,该计算机程序被处理器执行时实现上述本发明的基于转移概率网络的商户推荐方法。Further, the present invention further provides a computer readable medium having stored thereon a computer program, characterized in that the computer program is executed by a processor to implement the above-described transfer probability network-based merchant recommendation method of the present invention.
进一步,本发明还提供一种计算机设备,包括存储器、处理器以及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现上述本发明的基于转移概率网络的商户推荐方法。Further, the present invention also provides a computer device comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, wherein the processor implements the above-described invention when the computer program is executed A merchant recommendation method based on a transfer probability network.
本发明的基于转移概率网络的商户推荐方法以及基于转移概率网络的商户推荐系统抛弃了转移矩阵的思想,提出了转移概率三层神经网络的架构。该网络输入是一个商户的独热码,输出是接下来最可能出现的商户。由于中间加一个固定维度的隐藏层(一般不会太大,比如100维左右),由此能够避免海量商户之间的两列直接计算(比如10万*10万),取而代之的是“输入→隐藏层”的10万*100,以及“隐藏层→输出”的100*10万,这样,使得计算在可控范围内。The merchant recommendation method based on the transition probability network and the merchant recommendation system based on the transition probability network discard the idea of the transfer matrix, and propose a framework of the transition probability three-layer neural network. The network input is a merchant's unique heat code, and the output is the most likely merchant to appear next. Because a hidden layer with a fixed dimension is added in the middle (generally not too large, such as 100 dimensions), it is possible to avoid direct calculation of two columns between mass merchants (such as 100,000 * 100,000), instead of "input → The hidden layer "100,000 * 100, and the "hidden layer → output" of 100 * 100, so that the calculation is within the controllable range.
而且,在神经网络权重计算的过程中,进一步使用“查表法”以及“负样本抽样”法加速计算。其中,“查表法”可进一步避免“输入→隐藏层”的10万*100的矩阵运算,只需要进行索引即可,“负样本抽样”则在一定程度上加速了“隐藏层→输出”权重的计算。Moreover, in the process of calculating the weight of the neural network, the "check table method" and the "negative sample sampling" method are further used to accelerate the calculation. Among them, the "check table method" can further avoid the "input → hidden layer" of the matrix operation of 100,000 * 100, only need to index, "negative sample sampling" accelerates the "hidden layer → output" to some extent The calculation of the weight.
本发明的基于转移概率网络的商户推荐方法以及基于转移概率网络的商户推荐系统不依赖于“用户-商户评分矩阵”,而是根据用户的消费序列提取有效的商户对训练样本,避免了超大规模的“用户-商户”矩阵。The merchant recommendation method based on the transition probability network and the merchant recommendation system based on the transition probability network do not depend on the “user-business score matrix”, but extract effective merchant-pair training samples according to the user's consumption sequence, avoiding hyperscale The "user-business" matrix.
以上例子主要说明了本发明的基于转移概率网络的商户推荐 方法以及基于转移概率网络的商户推荐系统。尽管只对其中一些本发明的具体实施方式进行了描述,但是本领域普通技术人员应当了解,本发明可以在不偏离其主旨与范围内以许多其他的形式实施。因此,所展示的例子与实施方式被视为示意性的而非限制性的,在不脱离如所附各权利要求所定义的本发明精神及范围的情况下,本发明可能涵盖各种的修改与替换。The above examples mainly illustrate the merchant recommendation method based on the transition probability network of the present invention and the merchant recommendation system based on the transition probability network. Although only a few of the specific embodiments of the present invention have been described, it is understood that the invention may be embodied in many other forms without departing from the spirit and scope of the invention. Accordingly, the present invention is to be construed as illustrative and not restrictive, and the invention may cover various modifications without departing from the spirit and scope of the invention as defined by the appended claims With replacement.

Claims (16)

  1. 一种基于转移概率网络的商户推荐方法,其特征在于,包括:A merchant recommendation method based on a transition probability network, which is characterized in that it comprises:
    OneHot编码步骤,对N个商户进行OneHot编码,其中,每个商户被映射为一个N维的稀疏向量,N为自然数;The OneHot encoding step performs OneHot encoding on N merchants, wherein each merchant is mapped to an N-dimensional sparse vector, where N is a natural number;
    消费商户序列构建步骤,对于规定账户,记录相关交易对应的商户代码并排序而构建消费商户序列,其中,所述商户代码以由所述OneHot编码步骤进行OneHot编码之后的向量表示;以及a consumer merchant sequence construction step of constructing a consumer merchant sequence for a specified account, recording a business code corresponding to the related transaction, and sorting, wherein the merchant code is represented by a vector after OneHot encoding by the OneHot encoding step;
    转移概率网络构建步骤,构建神经网络,其中,以每个商户的OneHot编码之后的向量作为输入层、以在该商户之后接下来可能出现的商户的出现概率分布作为输出层。The transition probability network construction step constructs a neural network in which a vector after OneHot encoding of each merchant is used as an input layer, and an occurrence probability distribution of a merchant that may appear next after the merchant is used as an output layer.
  2. 如权利要求1所述的基于转移概率网络的商户推荐方法,其特征在于,在所述转移概率网络构建步骤之后进一步具备:The transition recommendation network-based merchant recommendation method according to claim 1, further comprising: after the transition probability network construction step:
    商户推荐步骤,基于所述转移概率网络构建步骤输出的所述出现概率向用户推荐商户。The merchant recommendation step recommends the merchant to the user based on the probability of occurrence of the output of the transition probability network construction step.
  3. 如权利要求1或2所述的基于转移概率网络的商户推荐方法,其特征在于,所述转移概率网络构建步骤包括下述子步骤:The transition recommendation network-based merchant recommendation method according to claim 1 or 2, wherein the transition probability network construction step comprises the following sub-steps:
    构建神经网络模型子步骤,构建包含具有输入层、隐藏层、输出层的三层神经网络;Constructing a neural network model sub-step to construct a three-layer neural network including an input layer, a hidden layer, and an output layer;
    生成训练样本子步骤,基于所述消费商户序列生成训练样本;以及Generating a training sample sub-step to generate a training sample based on the consumer merchant sequence;
    训练神经模型子步骤,基于规定算法训练该神经网络。The neural model substep is trained to train the neural network based on a prescribed algorithm.
  4. 如权利要求3所述的基于转移概率网络的商户推荐方法, 其特征在于,A merchant recommendation method based on a transition probability network according to claim 3, wherein
    在所述训练神经模型子步骤中,所述输入层的维度为N,所述隐藏层的维度为m,将输入层到隐藏层的权重矩阵记为W1,则权重矩阵W1记为N行*m列,当输入向量的第k维为1时,仅提取出W1中的第k行的行向量作为输出。In the training neural model sub-step, the dimension of the input layer is N, the dimension of the hidden layer is m, the weight matrix of the input layer to the hidden layer is recorded as W1, and the weight matrix W1 is recorded as N rows* In the m column, when the kth dimension of the input vector is 1, only the row vector of the kth row in W1 is extracted as an output.
  5. 如权利要求4所述的基于转移概率网络的商户推荐方法,其特征在于,A merchant recommendation method based on a transition probability network according to claim 4, wherein
    在所述训练神经模型子步骤中,对正样本进行权重更新,随机选取一部分的负样本进行权重更新。In the training neural model substep, the positive samples are weighted and the negative samples are randomly selected for weight update.
  6. 如权利要求3所述的基于转移概率网络的商户推荐方法,其特征在于,A merchant recommendation method based on a transition probability network according to claim 3, wherein
    在所述消费商户序列构建步骤中,统计规定时间内消费次数大于预设阈值的账户,对于统计出的账户,记录每一笔交易对应的商户代码,将每一个所述账户该段规定时间内消费所在商户的商户代码按照依次排列。In the consumer merchant sequence construction step, an account whose consumption times are greater than a preset threshold in a predetermined time period is counted, and for a statistical account, a merchant code corresponding to each transaction is recorded, and each of the accounts is within a specified time period of the segment. The merchant code of the merchant where the consumer is located is arranged in order.
  7. 如权利要求3所述的基于转移概率网络的商户推荐方法,其特征在于,A merchant recommendation method based on a transition probability network according to claim 3, wherein
    在所述生成训练样本子步骤中,对于所述消费商户序列,按照规定位置参数选取与作为输入层的商户位置相关的商户而得到训练样本、或者按照规定时间参数选取与作为输入层的商户时间相关的商户而得到训练样本。In the step of generating a training sample, for the consumer merchant sequence, selecting a merchant related to a merchant location as an input layer according to a specified location parameter to obtain a training sample, or selecting a merchant time as an input layer according to a predetermined time parameter Get training samples from relevant merchants.
  8. 一种基于转移概率网络的商户推荐系统,其特征在于,具备:A merchant recommendation system based on a transition probability network, characterized in that it has:
    OneHot编码模块,对N个商户进行OneHot编码,其中,每个 商户被映射为一个N维的稀疏向量,N为自然数;The OneHot encoding module performs OneHot encoding on N merchants, wherein each merchant is mapped to an N-dimensional sparse vector, where N is a natural number;
    消费商户序列构建模块,对于规定账户,记录相关交易对应的商户代码并排序而构建消费商户序列,其中,所述商户代码以由所述OneHot编码步骤进行OneHot编码之后的向量表示;以及a consumer merchant sequence building module, for a specified account, recording a merchant code corresponding to the related transaction and sorting to construct a consumer merchant sequence, wherein the merchant code is represented by a vector after OneHot encoding by the OneHot encoding step;
    转移概率网络构建模块,构建神经网络,其中,以每个商户的OneHot编码之后的向量作为输入层、以在该商户之后接下来可能出现的商户的出现概率分布作为输出层。The transition probability network construction module constructs a neural network in which a vector after OneHot encoding of each merchant is used as an input layer, and an occurrence probability distribution of a merchant that may appear next after the merchant is used as an output layer.
  9. 如权利要求8所述的基于转移概率网络的商户推荐系统,其特征在于,进一步具备:The transition recommendation network-based merchant recommendation system according to claim 8, further comprising:
    商户推荐模块,基于所述转移概率网络构建装置输出的所述出现概率向用户推荐商户。The merchant recommendation module recommends the merchant to the user based on the appearance probability output by the transition probability network construction device.
  10. 如权利要求6或7所述的基于转移概率网络的商户推荐系统,其特征在于,所述转移概率网络构建模块具备:The transition recommendation network-based merchant recommendation system according to claim 6 or 7, wherein the transition probability network construction module has:
    构建神经网络模型子模块,构建包含具有输入层、隐藏层、输出层的三层神经网络;Constructing a neural network model sub-module, and constructing a three-layer neural network including an input layer, a hidden layer, and an output layer;
    生成训练样本子模块,利用所述消费商户序列生成训练样本;以及Generating a training sample sub-module, generating a training sample using the consumer merchant sequence;
    训练神经模型子模块,基于规定算法训练该神经网络。The neural model sub-module is trained to train the neural network based on a prescribed algorithm.
  11. 如权利要求8所述的基于转移概率网络的商户推荐系统,其特征在于,A transition probability network-based merchant recommendation system according to claim 8, wherein
    在所述训练神经模型子模块中,设所述输入层的维度为N,所述隐藏层的维度为m,将输入层到隐藏层的权重矩阵记为W1,则权重矩阵W1记为N行*m列,当输入向量的第k维为1时,仅提取出W1中的第k行的行向量作为输出。In the training neural model sub-module, the dimension of the input layer is N, the dimension of the hidden layer is m, the weight matrix of the input layer to the hidden layer is recorded as W1, and the weight matrix W1 is recorded as N rows. *m column, when the kth dimension of the input vector is 1, only the row vector of the kth row in W1 is extracted as an output.
  12. 如权利要求11所述的基于转移概率网络的商户推荐系统,其特征在于,A merchant recommendation system based on a transition probability network according to claim 11, wherein
    所述训练神经模型子模块中,对正样本进行权重更新,随机选取一部分的负样本进行权重更新。In the training neural model sub-module, the positive samples are weighted and the negative samples are randomly selected for weight update.
  13. 如权利要求8所述的基于转移概率网络的商户推荐系统,其特征在于,A transition probability network-based merchant recommendation system according to claim 8, wherein
    所述消费商户序列构建模块统计规定时间内消费次数大于预设阈值的账户,对于统计出的账户,记录每一笔交易对应的商户代码,将每一个所述账户该段规定时间内消费所在商户的商户代码按照依次排列。The consumer merchant sequence building module counts accounts whose consumption times are greater than a preset threshold within a specified time period, and for the statistical accounts, records the merchant codes corresponding to each transaction, and stores the merchants in each of the accounts within the specified time period. The business code is arranged in order.
  14. 如权利要求10所述的基于转移概率网络的商户推荐系统,其特征在于,A transition probability network-based merchant recommendation system according to claim 10, wherein
    在所述生成训练样本子模块对于所述消费商户序列,按照规定位置参数选取与作为输入层的商户位置相关的商户而得到训练样本、或者按照规定时间参数选取作为与输入层的商户时间相关的商户而得到训练样本。And generating, by the generated training sample sub-module, the training sample according to the specified location parameter, selecting a merchant related to the merchant location as the input layer, or selecting the predetermined time parameter as the merchant time associated with the input layer. Trainers get training samples.
  15. 一种计算机可读介质,其上存储有计算机程序,其特征在于,该计算机程序被处理器执行时实现权利要求1~7中任意一项所述的基于转移概率网络的商户推荐方法。A computer readable medium having stored thereon a computer program, wherein the computer program is executed by a processor to implement the transition probability network based merchant recommendation method according to any one of claims 1-7.
  16. 一种计算机设备,包括存储器、处理器以及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求1~7中任意一项所述的基于转移概率网络的商户推荐方法。A computer device comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, wherein the processor executes the computer program to implement any one of claims 1-7 The merchant recommendation method based on the transition probability network.
PCT/CN2019/076049 2018-02-28 2019-02-25 Transition probability network based merchant recommendation method and system thereof WO2019165944A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810168455.2A CN108573399B (en) 2018-02-28 2018-02-28 Merchant recommendation method and system based on transition probability network
CN201810168455.2 2018-02-28

Publications (1)

Publication Number Publication Date
WO2019165944A1 true WO2019165944A1 (en) 2019-09-06

Family

ID=63576696

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/076049 WO2019165944A1 (en) 2018-02-28 2019-02-25 Transition probability network based merchant recommendation method and system thereof

Country Status (2)

Country Link
CN (1) CN108573399B (en)
WO (1) WO2019165944A1 (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110838020A (en) * 2019-09-16 2020-02-25 平安科技(深圳)有限公司 Recommendation method and device based on vector migration, computer equipment and storage medium
CN110851708A (en) * 2019-10-16 2020-02-28 中国平安人寿保险股份有限公司 Negative sample extraction method and device, computer equipment and storage medium
CN111274791A (en) * 2020-01-13 2020-06-12 江苏艾佳家居用品有限公司 Modeling method of user loss early warning model in online home decoration scene
CN111507726A (en) * 2020-04-07 2020-08-07 支付宝(杭州)信息技术有限公司 Message generation method, device and equipment
CN111563827A (en) * 2020-04-10 2020-08-21 杭州电子科技大学 Load decomposition method based on electrical appliance physical characteristics and residential electricity consumption behaviors
CN114943486A (en) * 2022-07-21 2022-08-26 浙江大学 Management system and management method based on optimal use efficiency of magnetron sputtering equipment
US20220300976A1 (en) * 2021-03-16 2022-09-22 Mastercard International Incorporated Methods and systems for detecting frauds by utilizing spend patterns of payment instruments of user
US11753608B2 (en) 2018-01-26 2023-09-12 The Procter & Gamble Company Water-soluble unit dose articles comprising perfume

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108573399B (en) * 2018-02-28 2022-03-18 中国银联股份有限公司 Merchant recommendation method and system based on transition probability network
US11604992B2 (en) * 2018-11-02 2023-03-14 Microsoft Technology Licensing, Llc Probabilistic neural network architecture generation
CN111079014B (en) * 2019-12-17 2024-02-09 携程计算机技术(上海)有限公司 Recommendation method, system, medium and electronic equipment based on tree structure
CN117094614A (en) * 2023-10-20 2023-11-21 深圳依时货拉拉科技有限公司 Loading and unloading point position recommendation method and device, computer equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106600347A (en) * 2017-01-17 2017-04-26 中国科学院自动化研究所 Method for constructing sequence forecasting model based on multi-visual-angle data and cycle network
CN106649774A (en) * 2016-12-27 2017-05-10 北京百度网讯科技有限公司 Artificial intelligence-based object pushing method and apparatus
CN106886846A (en) * 2017-04-26 2017-06-23 中南大学 A kind of bank outlets' excess reserve Forecasting Methodology that Recognition with Recurrent Neural Network is remembered based on shot and long term
CN106951489A (en) * 2017-03-13 2017-07-14 杭州师范大学 A kind of personalized recommendation method and device for sparse big data
CN108573399A (en) * 2018-02-28 2018-09-25 中国银联股份有限公司 Method and its system are recommended by trade company based on transition probability network

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105205689A (en) * 2015-08-26 2015-12-30 深圳市万音达科技有限公司 Method and system for recommending commercial tenant
US10176799B2 (en) * 2016-02-02 2019-01-08 Mitsubishi Electric Research Laboratories, Inc. Method and system for training language models to reduce recognition errors
CN106408343A (en) * 2016-09-23 2017-02-15 广州李子网络科技有限公司 Modeling method and device for user behavior analysis and prediction based on BP neural network
CN106980989B (en) * 2016-12-29 2021-01-19 中国银联股份有限公司 Merchant recommendation method based on user behavior characteristic analysis
CN107563801A (en) * 2017-08-23 2018-01-09 浙江大学城市学院 Consumer behavior Forecasting Methodology under a kind of consumer's line based on hidden Markov model
CN107705155A (en) * 2017-10-11 2018-02-16 北京三快在线科技有限公司 A kind of consuming capacity Forecasting Methodology, device, electronic equipment and readable storage medium storing program for executing

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106649774A (en) * 2016-12-27 2017-05-10 北京百度网讯科技有限公司 Artificial intelligence-based object pushing method and apparatus
CN106600347A (en) * 2017-01-17 2017-04-26 中国科学院自动化研究所 Method for constructing sequence forecasting model based on multi-visual-angle data and cycle network
CN106951489A (en) * 2017-03-13 2017-07-14 杭州师范大学 A kind of personalized recommendation method and device for sparse big data
CN106886846A (en) * 2017-04-26 2017-06-23 中南大学 A kind of bank outlets' excess reserve Forecasting Methodology that Recognition with Recurrent Neural Network is remembered based on shot and long term
CN108573399A (en) * 2018-02-28 2018-09-25 中国银联股份有限公司 Method and its system are recommended by trade company based on transition probability network

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11753608B2 (en) 2018-01-26 2023-09-12 The Procter & Gamble Company Water-soluble unit dose articles comprising perfume
CN110838020A (en) * 2019-09-16 2020-02-25 平安科技(深圳)有限公司 Recommendation method and device based on vector migration, computer equipment and storage medium
CN110838020B (en) * 2019-09-16 2023-06-23 平安科技(深圳)有限公司 Recommendation method and device based on vector migration, computer equipment and storage medium
CN110851708A (en) * 2019-10-16 2020-02-28 中国平安人寿保险股份有限公司 Negative sample extraction method and device, computer equipment and storage medium
CN110851708B (en) * 2019-10-16 2023-11-03 中国平安人寿保险股份有限公司 Negative sample extraction method, device, computer equipment and storage medium
CN111274791A (en) * 2020-01-13 2020-06-12 江苏艾佳家居用品有限公司 Modeling method of user loss early warning model in online home decoration scene
CN111274791B (en) * 2020-01-13 2023-08-18 江苏艾佳家居用品有限公司 Modeling method of user loss early warning model in online home decoration scene
CN111507726A (en) * 2020-04-07 2020-08-07 支付宝(杭州)信息技术有限公司 Message generation method, device and equipment
CN111507726B (en) * 2020-04-07 2022-06-24 支付宝(杭州)信息技术有限公司 Message generation method, device and equipment
CN111563827B (en) * 2020-04-10 2023-08-04 杭州电子科技大学 Load decomposition method based on physical characteristics of electrical appliance and electricity utilization behaviors of residents
CN111563827A (en) * 2020-04-10 2020-08-21 杭州电子科技大学 Load decomposition method based on electrical appliance physical characteristics and residential electricity consumption behaviors
US20220300976A1 (en) * 2021-03-16 2022-09-22 Mastercard International Incorporated Methods and systems for detecting frauds by utilizing spend patterns of payment instruments of user
CN114943486A (en) * 2022-07-21 2022-08-26 浙江大学 Management system and management method based on optimal use efficiency of magnetron sputtering equipment

Also Published As

Publication number Publication date
CN108573399A (en) 2018-09-25
CN108573399B (en) 2022-03-18

Similar Documents

Publication Publication Date Title
WO2019165944A1 (en) Transition probability network based merchant recommendation method and system thereof
CN111797321B (en) Personalized knowledge recommendation method and system for different scenes
CN112364976B (en) User preference prediction method based on session recommendation system
CN112232925A (en) Method for carrying out personalized recommendation on commodities by fusing knowledge maps
CN111310063B (en) Neural network-based article recommendation method for memory perception gated factorization machine
CN108563755A (en) A kind of personalized recommendation system and method based on bidirectional circulating neural network
CN112115377A (en) Graph neural network link prediction recommendation method based on social relationship
CN110737730B (en) User classification method, device, equipment and storage medium based on unsupervised learning
CN103914527B (en) Graphic image recognition and matching method based on genetic programming algorithms of novel coding modes
CN114511058B (en) Load element construction method and device for electric power user portrait
Long et al. Fedcon: A contrastive framework for federated semi-supervised learning
CN114971784B (en) Session recommendation method and system based on graph neural network by fusing self-attention mechanism
Long et al. Fedsiam: Towards adaptive federated semi-supervised learning
CN112612948A (en) Deep reinforcement learning-based recommendation system construction method
CN116167812A (en) Heterogeneous collaborative filtering method for multi-behavior recommendation
CN113342994B (en) Recommendation system based on non-sampling cooperative knowledge graph network
US20240037133A1 (en) Method and apparatus for recommending cold start object, computer device, and storage medium
CN114154060A (en) Content recommendation system and method fusing information age and dynamic graph neural network
CN112541128B (en) Personalized news recommendation method based on characteristic bidirectional dynamic cooperation
CN113409157A (en) Cross-social network user alignment method and device
CN111274791B (en) Modeling method of user loss early warning model in online home decoration scene
CN111159569A (en) Social network user behavior prediction method based on user personalized features
CN115495546A (en) Similar text retrieval method, system, device and storage medium
CN114996566A (en) Intelligent recommendation system and method for industrial internet platform
CN112487799A (en) Crowdsourcing task recommendation algorithm using extrinsic product attention

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19760394

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19760394

Country of ref document: EP

Kind code of ref document: A1