CN111814051A - Resource type determination method and device - Google Patents
Resource type determination method and device Download PDFInfo
- Publication number
- CN111814051A CN111814051A CN202010652409.7A CN202010652409A CN111814051A CN 111814051 A CN111814051 A CN 111814051A CN 202010652409 A CN202010652409 A CN 202010652409A CN 111814051 A CN111814051 A CN 111814051A
- Authority
- CN
- China
- Prior art keywords
- resource
- vector
- user
- target user
- network
- Prior art date
- Legal status (The legal status 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 status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 59
- 239000013598 vector Substances 0.000 claims abstract description 463
- 238000013507 mapping Methods 0.000 claims abstract description 81
- 238000012545 processing Methods 0.000 claims abstract description 57
- 239000011159 matrix material Substances 0.000 claims description 38
- 230000006870 function Effects 0.000 claims description 24
- 238000004891 communication Methods 0.000 claims description 19
- 230000003044 adaptive effect Effects 0.000 claims description 17
- 238000004590 computer program Methods 0.000 claims description 14
- 230000004913 activation Effects 0.000 claims description 13
- 125000004122 cyclic group Chemical group 0.000 claims description 8
- 238000000605 extraction Methods 0.000 claims description 7
- 238000010606 normalization Methods 0.000 claims description 5
- 238000012549 training Methods 0.000 description 11
- 230000008569 process Effects 0.000 description 10
- 238000010586 diagram Methods 0.000 description 7
- 238000004422 calculation algorithm Methods 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000013500 data storage Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000004880 explosion Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 239000011435 rock Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000002123 temporal effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
- G06F16/9535—Search customisation based on user profiles and personalisation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Biomedical Technology (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- Health & Medical Sciences (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the invention provides a method and a device for determining resource types, which can map user identifications of target users to obtain first user vectors of the target users; determining a first number of first network resources among the network resources accessed by the target user; mapping respective resource identifiers of the first network resources to obtain respective first resource vectors of the first network resources; and processing the first user vector and each first resource vector based on a pre-trained probability prediction model to obtain the probability of the target user interested in each preset resource type output by the probability prediction model, and determining the resource type of the target user interested in based on the probability of the target user interested in each preset resource type. Based on the processing, the type of the resource which the target user is interested in can be determined, and the network resource recommendation is carried out on the target user based on the type of the resource which the target user is interested in, so that the effectiveness of the recommended network resource can be improved.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for determining a resource type.
Background
With the development of computer technology, the modern society is in an era of information explosion, and it is difficult for users to quickly select network resources of interest from massive network resources (such as movies, music, news, etc.).
In the prior art, network resources may be recommended to a target user, for example, for each preset network resource, the total number of times that each user accesses the network resource within a period of time (for example, one week) may be determined, then, from the preset network resources, a network resource with a large number of accesses (which may be referred to as a target network resource) is determined, and then, network resource recommendation may be performed to the target user according to the target network resource.
However, the target network resource is determined according to the number of times that each user accesses the network resource, and may not be the network resource that the target user is interested in, and recommendation is performed based on the determined target network resource, which may result in lower effectiveness of the recommended network resource.
Disclosure of Invention
The embodiment of the invention aims to provide a resource type determining method and device, which can determine the type of a resource which a target user is interested in, and subsequently recommend network resources to the target user according to the type of the resource which the target user is interested in, so that the effectiveness of the recommended network resources can be improved. The specific technical scheme is as follows:
in a first aspect of the present invention, there is provided a resource type determining method, where the method includes:
mapping the user identification of the target user to obtain a user vector of the target user as a first user vector;
determining a first number of network resources in the network resources accessed by the target user as first network resources;
mapping the respective resource identifier of the first network resource to obtain a respective resource vector of the first network resource as a first resource vector;
processing the first user vector and each first resource vector based on a pre-trained probability prediction model to obtain the probability of interest of the target user to each preset resource type, which is output by the probability prediction model;
and determining the resource types which are interested by the target user in the preset resource types based on the probability that the target user is interested in the preset resource types.
Optionally, before the pre-trained probability prediction model is used to process the first user vector and each of the first resource vectors to obtain the probability that the target user is interested in each preset resource type, which is output by the probability prediction model, the method further includes:
mapping the user identification of the sample user to obtain a user vector of the sample user as a second user vector;
selecting the first number of network resources from the network resources accessed by the sample user based on a preset sliding window to serve as second network resources; wherein the length of the sliding window is the first number;
mapping the respective resource identifier of the second network resource to obtain a respective resource vector of the second network resource as a second resource vector;
determining a resource type of a network resource after the access time of the second network resource according to the sequence of the access times, as a first resource type, wherein the first resource type belongs to the preset resource types;
setting the probability that the sample user is interested in the first resource type as a first numerical value, and setting the probability that the sample user is interested in other resource types except the first resource type in the preset resource types as a second numerical value to obtain the probability that the sample user is interested in the preset resource types;
and taking the second user vector and each second resource vector as input data of an initial probability prediction model, taking the probability of the sample user interested in each preset resource type as output data of the corresponding initial probability prediction model, and adjusting model parameters of the initial probability prediction model until a preset convergence condition is reached.
Optionally, the probabilistic predictive model includes: the system comprises a first full connection layer, a circulating gate control unit, an attention layer, an adaptive network, a second full connection layer and an output layer;
the processing the first user vector and each first resource vector based on a pre-trained probability prediction model to obtain the probability of interest of the target user to each preset resource type output by the probability prediction model comprises:
based on a first mapping matrix containing the network parameters of the first full connection layer, mapping the first user vector to obtain a characteristic vector corresponding to the first user vector as a first characteristic vector;
performing feature extraction on each first resource vector through the cyclic gate control unit to obtain respective feature vectors of the first network resources, wherein the feature vectors are used as second feature vectors;
weighting each second feature vector through the attention layer to obtain a feature vector representing the first network resource as a third feature vector;
weighting the first feature vector and the third feature vector through the adaptive network to obtain a feature vector representing the first network resource accessed by the target user, wherein the feature vector is used as a fourth feature vector;
mapping the fourth feature vector through the second full connection layer to obtain a corresponding vector as a fifth feature vector, wherein the number of elements contained in the fifth feature vector is the same as the number of the preset resource types;
and carrying out normalization processing on the fifth feature vector through the output layer to obtain the probability that the target user is interested in the preset resource types.
Optionally, the weighting, by the attention layer, each second feature vector to obtain a feature vector representing the first network resource, as a third feature vector, includes:
based on a first preset formula, performing weighting processing on each second feature vector to obtain a feature vector representing the first network resource, and using the feature vector as a third feature vector, wherein the first preset formula is as follows:
d represents the third feature vector, k represents the first number, hjA second feature vector, h, representing the jth of said first network resourcestA second feature vector, h, representing the tth of said first network resourceiA second eigenvector representing the ith said first network resource, σ () representing an activation function, W1Representing a first weight matrix, W2Represents the second weight matrix, m represents the first predetermined vector, and T represents the matrix transpose operator.
Optionally, the performing, by the adaptive network, a weighting process on the first feature vector and the third feature vector to obtain a feature vector representing the first network resource that the target user has accessed, as a fourth feature vector, includes:
based on a second preset formula, performing weighting processing on the first feature vector and the third feature vector to obtain a feature vector representing the first network resource accessed by the target user, and using the feature vector as a fourth feature vector, wherein the second preset formula is as follows:
c represents the fourth feature vector, s represents the first feature vector, d represents the third feature vector, W3Represents the second mapping matrix, n represents the second predetermined vector, T represents the matrix transpose operator, and σ () represents the activation function.
Optionally, the determining, in the preset resource types, the resource type in which the target user is interested based on the probability that the target user is interested in the preset resource types includes:
determining the resource type with the probability of interest of the target user being greater than a preset probability threshold from the preset resource types as the resource type of interest of the target user;
or,
determining a second number of resource types from the preset resource types as the resource types which are interested by the target user, wherein the probability that the target user is interested in the second number of resource types is greater than the probability that the target user is interested in other resource types except the second number of resource types in the preset resource types.
Optionally, after determining, in the preset resource types, the resource types in which the target user is interested based on the probability that the target user is interested in the preset resource types, the method further includes:
for each resource type which is interested by the target user, calculating the product of the probability that the target user is interested in the resource type and a third number as a fourth number, wherein the third number is the number of preset network resources which need to be recommended to the target user;
and selecting the fourth number of network resources from the network resources contained in the resource type, and recommending the network resources to the target user.
In a second aspect of the present invention, there is also provided a resource type determination apparatus, including:
the first mapping module is used for mapping the user identifier of the target user to obtain a user vector of the target user as a first user vector;
a first determining module, configured to determine, as a first network resource, a first number of network resources from the network resources that the target user has accessed;
a second mapping module, configured to perform mapping processing on respective resource identifiers of the first network resources to obtain respective resource vectors of the first network resources, where the respective resource vectors are used as first resource vectors;
the prediction module is used for processing the first user vector and each first resource vector based on a pre-trained probability prediction model to obtain the probability of interest of the target user in each preset resource type, wherein the probability is output by the probability prediction model;
and a second determining module, configured to determine, in the preset resource types, the resource types in which the target user is interested, based on the probability that the target user is interested in the preset resource types.
Optionally, the apparatus further comprises:
the third mapping module is used for mapping the user identification of the sample user to obtain a user vector of the sample user as a second user vector;
a third determining module, configured to select, based on a preset sliding window, the first number of network resources from the network resources that the sample user has accessed, as second network resources; wherein the length of the sliding window is the first number;
a fourth mapping module, configured to perform mapping processing on respective resource identifiers of the second network resources to obtain respective resource vectors of the second network resources, where the respective resource vectors are used as second resource vectors;
a fourth determining module, configured to determine, according to a sequence of access times, a resource type of a network resource after the access time of the second network resource at the access time as a first resource type, where the first resource type belongs to the preset resource types;
a fifth determining module, configured to set a probability that the sample user is interested in the first resource type to a first numerical value, and set a probability that the sample user is interested in other resource types except the first resource type in the preset resource types to a second numerical value, so as to obtain a probability that the sample user is interested in the preset resource types;
and the adjusting module is used for taking the second user vector and each second resource vector as input data of an initial probability prediction model, taking the probability that the sample user is interested in each preset resource type as output data of the corresponding initial probability prediction model, and adjusting the model parameters of the initial probability prediction model until a preset convergence condition is reached.
Optionally, the probabilistic predictive model includes: the system comprises a first full connection layer, a circulating gate control unit, an attention layer, an adaptive network, a second full connection layer and an output layer;
the prediction module is specifically configured to perform mapping processing on the first user vector based on a first mapping matrix including the network parameters of the first full connection layer to obtain a feature vector corresponding to the first user vector as a first feature vector;
performing feature extraction on each first resource vector through the cyclic gate control unit to obtain respective feature vectors of the first network resources, wherein the feature vectors are used as second feature vectors;
weighting each second feature vector through the attention layer to obtain a feature vector representing the first network resource as a third feature vector;
weighting the first feature vector and the third feature vector through the adaptive network to obtain a feature vector representing the first network resource accessed by the target user, wherein the feature vector is used as a fourth feature vector;
mapping the fourth feature vector through the second full connection layer to obtain a corresponding vector as a fifth feature vector, wherein the number of elements contained in the fifth feature vector is the same as the number of the preset resource types;
and carrying out normalization processing on the fifth feature vector through the output layer to obtain the probability that the target user is interested in the preset resource types.
Optionally, the prediction module is specifically configured to perform weighting processing on each second feature vector based on a first preset formula, to obtain a feature vector representing the first network resource, and use the feature vector as a third feature vector, where the first preset formula is:
d represents the third feature vector, k represents the first number, hjA second feature vector, h, representing the jth of said first network resourcestA second feature vector, h, representing the tth of said first network resourceiA second eigenvector representing the ith said first network resource, σ () representing an activation function, W1Representing a first weight matrix, W2Represents the second weight matrix, m represents the first predetermined vector, and T represents the matrix transpose operator.
Optionally, the prediction module is specifically configured to perform weighting processing on the first feature vector and the third feature vector based on a second preset formula, to obtain a feature vector representing the first network resource that the target user has accessed, and use the feature vector as a fourth feature vector, where the second preset formula is:
c represents the fourth feature vector, s represents the first feature vector, d represents the third feature vector, W3Representing a second mapping momentArray, n represents the second predetermined vector, T represents the matrix transpose operator, and σ () represents the activation function.
Optionally, the second determining module is specifically configured to determine, from the preset resource types, a resource type with the probability that the target user is interested in being greater than a preset probability threshold as the resource type that the target user is interested in;
or,
determining a second number of resource types from the preset resource types as the resource types which are interested by the target user, wherein the probability that the target user is interested in the second number of resource types is greater than the probability that the target user is interested in other resource types except the second number of resource types in the preset resource types.
Optionally, the apparatus further comprises:
a sixth determining module, configured to calculate, for each resource type that the target user is interested in, a product of a probability that the target user is interested in the resource type and a third number, where the third number is a number preset to be recommended to the target user, and is used as a fourth number;
and the recommending module is used for selecting the fourth number of network resources from the network resources contained in the resource type and recommending the network resources to the target user.
In another aspect of the present invention, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing any one of the steps of the resource type determination method when executing the program stored in the memory.
In yet another aspect of the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements any of the above-mentioned resource type determination method steps.
In yet another aspect of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the resource type determination methods described above.
In the method for determining resource types provided by the embodiment of the present invention, mapping is performed on a user identifier of a target user to obtain a user vector of the target user, which is used as a first user vector; determining a first number of network resources in the network resources accessed by the target user as first network resources; mapping respective resource identifiers of the first network resources to obtain respective resource vectors of the first network resources, wherein the respective resource vectors are used as first resource vectors; and processing the first user vector and each first resource vector based on a pre-trained probability prediction model to obtain the probability of interest of the target user to each preset resource type output by the probability prediction model, and determining the resource type of interest of the target user in each preset resource type based on the probability of interest of the target user to each preset resource type.
Based on the above processing, because the first network resource is a network resource that the target user has accessed, the first user vector of the target user and the first resource vector of the first network resource can reflect the real interest of the target user, based on the first user vector identification and the first resource vector, the determined probability that the target user is interested in each preset resource type can also reflect the real interest of the target user, based on the probability that the target user is interested in each preset resource type, the determined accuracy of the resource type that the target user is interested in is higher, and subsequently, based on the resource type that the target user is interested in, the network resource recommendation can be performed on the target user, and the effectiveness of the recommended network resource can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
Fig. 1 is a flowchart of a resource type determining method according to an embodiment of the present invention;
FIG. 2 is a block diagram of a probabilistic predictive model according to an embodiment of the present invention;
FIG. 3 is a flowchart of a probabilistic predictive model training method according to an embodiment of the present invention;
fig. 4 is a system block diagram of a resource type determining method according to an embodiment of the present invention;
fig. 5 is a block diagram of a resource type determining apparatus according to an embodiment of the present invention;
fig. 6 is a structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention.
Referring to fig. 1, fig. 1 is a flowchart of a resource type determining method according to an embodiment of the present invention, where the method may be applied to an electronic device, where the electronic device may be a server or a terminal, and the electronic device is used to determine a resource type that a user is interested in.
The method may comprise the steps of:
s101: and mapping the user identification of the target user to obtain a user vector of the target user as a first user vector.
S102: a first number of network resources among the network resources that have been accessed by the target user are determined as first network resources.
S103: and mapping the respective resource identifier of the first network resource to obtain a respective resource vector of the first network resource as a first resource vector.
S104: and processing the first user vector and each first resource vector based on a pre-trained probability prediction model to obtain the probability of interest of the target user to each preset resource type output by the probability prediction model.
S105: and determining the resource types which are interested by the target user in the preset resource types based on the probability that the target user is interested in the preset resource types.
Based on the resource type determination method provided by the embodiment of the invention, because the first network resource is a network resource which has been visited by the target user, the first user vector of the target user and the first resource vector of the first network resource can reflect the real interest of the target user, the determined probability of the target user interested in each preset resource type can also reflect the real interest of the target user based on the first user vector and the first resource vector, the determined accuracy of the resource type of the target user interested in is higher based on the probability of the target user interested in each preset resource type, and subsequently, the network resource recommendation can be performed on the target user based on the resource type of the target user interested in order to improve the effectiveness of the recommended network resource.
It is understood that, for each recommendation scenario, the preset resource types may be resource types of network resources (which may be referred to as third network resources) that can be currently provided by the electronic device in the recommendation scenario. For example, in a movie recommendation scenario, the third network resource is a movie resource, and the preset resource types may include: science fiction type, suspense type, comedy type, etc. Or, in the music recommendation scenario, the third network resource is a music resource, and the presetting of each resource type may include: popular types, ballad types, rock types, etc.
In step S101, for each recommendation scenario, the target user may be any user in the recommendation scenario.
The electronic device may obtain a user identifier of the target user, where the user identifier of the target user may be an identifier representing uniqueness of the target user, for example, when the target user is a registered user, the user identifier of the target user may be represented by a registered account of the target user, or the user identifier of the target user may also be represented by a user name of the target user. When the target user is an unregistered user, the user identification of the target user may be represented by a device ID of a terminal device used by the target user.
In One implementation, the electronic device may perform mapping processing on a user identifier of a target user based on a One-Hot Encoding (One-Hot Encoding) algorithm to obtain a user vector (i.e., a first user vector) of the target user.
The electronic device can sort the users according to a preset sequence, and the user identifiers of the sorted users are respective serial numbers.
The first user vector of the target user contains the same number of elements as the number of users. The electronic device may set an element with a sequence number that is the same as the sequence number of the target user in the first user vector to 1, and set other elements to 0, so as to obtain the first user vector.
Illustratively, if the number of each user is 3, the sequence numbers of each user are: 1. 2 and 3. If the sequence number of the target user is 1, the electronic device may set the 1 st element in the first user vector to 1, and set other elements to 0, resulting in the first user vector being [1, 0, 0 ]. Similarly, if the sequence number of the target user is 2, the first user vector is [0, 1, 0], and if the sequence number of the target user is 3, the first user vector is [0, 0, 1 ].
Similarly, if the number of sample users is 5, the electronic device may determine that the second user vector of sample user with index 1 is [1, 0, 0, 0, 0], the second user vector of sample user with index 2 is [0, 1, 0, 0, 0], the second user vector of sample user with index 3 is [0, 0, 1, 0, 0], the second user vector of sample user with index 4 is [0, 0, 0, 1, 0], and the second user vector of sample user with index 5 is [0, 0, 0, 0, 1 ].
It can be seen that if the number of users differs from the number of sample users, this results in a vector length of the first user vector differing from the vector length of the second user vector. The vector length of a vector indicates the number of elements that the vector contains.
Subsequently, before the first user vector is processed based on the trained probabilistic predictive model, the first user vector needs to be mapped again, so that the vector length of the first user vector is the same as the vector length of the second user vector.
In addition, when the number of each user is large, the vector length of the user vector of each user is large, for example, when the number of each user is 10000, the vector length of the user vector of each user is 10000, the calculation complexity of the electronic device for processing the vector with the large vector length is high, the processing time is long, and the efficiency of the resource type determining method is low.
In another implementation manner, in order to improve the efficiency of the resource type determining method, the electronic device may perform hash mapping processing on the user identifier of the target user based on the first preset length, so as to obtain a first user vector with a vector length of the first preset length.
The first preset length may be a vector length of the second user vector.
For example, if the vector length of the second user vector of the sample user is 5, the electronic device may perform Hash mapping processing on the user identifier of the target user according to the vector length of 5 through a Hash In Code (Hash mapping) module, so as to obtain the first user vector with the vector length of 5.
Therefore, the user identification of each user is mapped based on the Hash mapping algorithm, the user vector of each user with the first preset length can be directly obtained, and the user vector does not need to be mapped again before the first user vector is processed based on the trained probability prediction model, so that the vector length of each user vector is the same as that of the second user vector, and further, the efficiency of the resource type determination method can be improved.
In step S102, the electronic device may further determine the network resources that have been accessed by the target user, and further, the electronic device may select a first number of network resources (i.e., a first network resource) from the network resources that have been accessed by the target user.
The first number may be set by a technician according to the number of network resources that have been visited by the sample user and are included in the training sample when the technician trains the initial probability prediction model, and the number of network resources that have been visited by the sample user and are included in the training sample may be set by the technician according to experience.
It can be understood that in different recommendation scenes, the network resource that the target user has accessed is determined by the electronic device to be the network resource corresponding to the recommendation scene, for example, in a short video resource recommendation scene, the electronic device may determine the short video resource that the target user has accessed, or in a movie resource recommendation scene, the electronic device may determine the movie resource that the target user has accessed.
In one implementation, the electronic device may randomly select a first number of network resources from the network resources that the target user has accessed as the first network resources.
Illustratively, the first number may be 3. The network resources that the target user has accessed may include: network resource 1, network resource 2, network resource 3, network resource 4, network resource 5. The electronic device may determine network resource 1, network resource 4, and network resource 5 as the first network resource.
In another implementation manner, in order to improve accuracy of determining the resource type of interest of the target user, the electronic device may select, as the first network resource, a first number of network resources whose access time is closest to the current time from the network resources that the target user has accessed according to the sequence of the access times.
Illustratively, the first number may be 3. The network resources that the target user has accessed may include: network resource 1, network resource 2, network resource 3, network resource 4, network resource 5. The access time of the target user for accessing the network resource 1 is 10:00, the access time of the target user for accessing the network resource 2 is 9:30, the access time of the target user for accessing the network resource 3 is 11:00, the access time of the target user for accessing the network resource 4 is 9:15, and the access time of the target user for accessing the network resource 5 is 11: 30. According to the sequence of the access time, the network resources accessed by the target user are sequenced, and the following results can be obtained: network resource 4, network resource 2, network resource 1, network resource 3, network resource 5. The electronic device may determine network resource 1, network resource 3, and network resource 5 as the first network resource.
Based on the processing, the time sequence characteristics of the target user for accessing the network resources can be reflected by the first number of network resources which are closest to the current time in the network resources accessed by the target user, and then the accuracy of the determined resource type which is interested by the target user is higher based on the first number of network resources which are closest to the current time.
In step S103, the electronic device may obtain respective resource identifiers of the first network resources. The resource identifier of the network resource may be an identifier indicating uniqueness of the network resource, for example, the resource identifier of the network resource may be represented by a name of the network resource, or all the network resources may be sorted according to the same rule, and the resource identifier of the network resource may be represented by a sequence number corresponding to the sorted network resource.
Furthermore, the electronic device may perform mapping processing on the resource identifier of each first network resource to obtain a resource vector (i.e., a first resource vector) of each first network resource.
In one implementation, for each first network resource, the electronic device may perform mapping processing on a resource identifier of the first network resource based on a one-hot coding algorithm to obtain a first resource vector of the first network resource.
The network resources (i.e., the third network resources) that can be currently provided by the electronic device may be sorted according to a preset order, and the resource identifiers of the sorted network resources are respective serial numbers. It is understood that the third network resource that the electronic device is currently capable of providing includes the first network resource that the target user has accessed.
For each first network resource, the first resource vector of the first network resource contains the same number of elements as the number of third network resources. The electronic device may set an element with a sequence number that is the same as the sequence number of the first network resource in the first resource vector of the first network resource to 1, and set other elements to 0, so as to obtain the first resource vector of the first network resource.
Illustratively, if the number of the third network resources is 5, the sequence numbers of the third network resources are respectively: 1. 2, 3, 4 and 5. If the network resource with the sequence number of 1 is the first network resource, when the first resource vector of the first network resource is determined, the 1 st element in the first resource vector of the first network resource may be set to 1, and the other elements may be set to 0, so that the first resource vector of the first network resource may be obtained as [1, 0, 0, 0, 0 ]. Similarly, if the network resource with sequence number 3 is the first network resource, the first resource vector of the first network resource is [0, 0, 1, 0, 0], and if the network resource with sequence number 4 is the first network resource, the first resource vector of the first network resource is [0, 0, 0, 1, 0 ].
Similarly, if the number of the network resources that the sample user has accessed is 3, the sequence numbers of the network resources that the sample user has accessed are respectively: 1. 2 and 3. If the network resources with sequence numbers 1 and 2 are the second network resource, the electronic device may determine that the second resource vector of the second network resource with sequence number 1 is [1, 0, 0], and the second resource vector of the second network resource with sequence number 2 is [0, 1, 0 ].
It can be seen that if the number of third network resources is different from the number of network resources that the sample user has accessed, this results in a vector length of the first resource vector being different from the vector length of the second resource vector. Subsequently, before the first resource vector is processed based on the trained probabilistic predictive model, the first resource vector needs to be mapped again, so that the vector length of the first resource vector is the same as the vector length of the second resource vector.
In addition, when the number of the third network resources is large, the vector length of the first resource vector is large, for example, when the number of the third network resources is 10000, the vector length of each first resource vector is 10000, the calculation complexity of the electronic device for processing the vector with the large vector length is high, the processing time is long, and the efficiency of the resource type determining method is low.
In another implementation manner, in order to improve the efficiency of the resource type determining method, for each first network resource, the electronic device may perform hash mapping processing on the resource identifier of the first network resource based on a second preset length to obtain a resource vector of the first network resource, where the resource vector is used as the first resource vector, and the vector length of the first resource vector is the second preset length.
The second predetermined length may be a vector length of the second resource vector.
Exemplarily, if the vector length of the second resource vector of the second network resource is 3, the electronic device may perform Hash mapping processing on the resource identifier of the first network resource through the Hash In Code module according to the vector length of 3, so as to obtain the first resource vector with the vector length of 3.
Therefore, the resource identifier of each first network resource is mapped based on the Hash mapping algorithm, so that the resource vector of each first network resource with the second preset length can be directly obtained, and the resource vector does not need to be mapped again before the first resource vector is processed based on the trained probability prediction model, so that the vector length of the first resource vector is the same as that of the second resource vector, and further, the efficiency of the resource type determining method can be improved.
In step S104, after obtaining the first user vector and each first resource vector, the electronic device may process the first user vector and each first resource vector based on a pre-trained probability prediction model, so as to obtain a probability that a target user output by the probability prediction model is interested in each preset resource type.
In an embodiment of the present invention, referring to fig. 2, fig. 2 is a structural diagram of a probabilistic prediction model provided in an embodiment of the present invention, where the probabilistic prediction model may include: the system comprises a first full connection layer, a cyclic gating unit (Gated RecurrrentUnit), an attention layer, an adaptive network, a second full connection layer and an output layer.
Accordingly, step S104 may include the steps of:
step one, based on a first mapping matrix containing network parameters of a first full connection layer, mapping a first user vector to obtain a feature vector corresponding to the first user vector as a first feature vector.
The first full connection layer may perform mapping processing on the first user vector based on a third preset formula and the first mapping matrix to obtain a feature vector (i.e., a first feature vector) of the target user, and input the first feature vector to the adaptive network.
s=OWs
s denotes a first feature vector, O denotes a first user vector, WsRepresenting a first mapping matrix.
The initial elements in the first mapping matrix may be set empirically by a skilled person and subsequently adjusted during the training of the initial probabilistic predictive model.
And step two, performing feature extraction on each first resource vector through a circulating gate control unit to obtain respective feature vectors of the first network resources, wherein the feature vectors are used as second feature vectors.
For each first network resource, the cyclic gate control unit may perform feature extraction on a first resource vector corresponding to the first network resource to obtain a corresponding feature vector (i.e., a second feature vector), where the second feature vector may represent a temporal feature of the first network resource, and then each second feature vector may be input to the attention layer. The time characteristic of one first network resource can represent the sequence of the target user accessing the first network resource and the correlation between the first network resource and other first network resources.
And step three, weighting each second feature vector through the attention layer to obtain a feature vector representing the first network resource as a third feature vector.
In an embodiment of the present invention, the attention layer may perform weighting processing on each second feature vector based on a first preset formula to obtain a feature vector representing the first network resource as a third feature vector, and input the third feature vector to the adaptive network.
Wherein, the first preset formula is as follows:
d denotes a third feature vector, k denotes a first number, hjA second feature vector, h, representing the jth first network resourcetA second feature vector, h, representing the tth first network resourceiA second eigenvector representing the ith first network resource, sigma () representing the activation function, W1Representing a first weight matrix, W2Represents the second weight matrix, m represents the first predetermined vector, and T represents the matrix transpose operator.
The activation function may be set by a skilled person based on experience, for example, the activation function may be a sigmoid (S-shaped function) function, and the activation function may also be a ReLu (Rectified Linear Units) function, but is not limited thereto.
The initial elements in the first weight matrix, the second weight matrix and the first preset vector can be set by technicians according to experience, and then the initial elements in the first weight matrix, the second weight matrix and the first preset vector can be adjusted in the process of training the initial probability prediction model.
And step four, weighting the first feature vector and the third feature vector through the self-adaptive network to obtain a feature vector representing the first network resource accessed by the target user, wherein the feature vector is used as a fourth feature vector.
In an embodiment of the present invention, the adaptive network may perform weighting processing on the first feature vector and the third feature vector based on a second preset formula to obtain a feature vector representing the first network resource that the target user has accessed, as a fourth feature vector, and input the fourth feature vector to the second fully-connected layer.
Wherein the second predetermined formula is:
c denotes a fourth feature vector, s denotes a first feature vector, d denotes a third feature vector, W3Representing a second mapping matrix, n representingTwo predetermined vectors, T represents the matrix transpose operator, and σ () represents the activation function.
The initial elements in the second mapping matrix and the second predetermined vector may be set by a technician based on experience, and subsequently, the initial elements in the second mapping matrix and the second predetermined vector may be adjusted during the training of the initial probabilistic predictive model.
And step five, mapping the fourth feature vector through the second full-connection layer to obtain a corresponding vector as a fifth feature vector.
The number of elements included in the fifth feature vector is the same as the number of the preset resource types.
Since the number of elements included in the fourth eigenvector is not necessarily the same as the number of the preset resource types, the second fully-connected layer may perform mapping processing on the fourth eigenvector to obtain eigenvectors (i.e., fifth eigenvectors) whose number of elements is the same as the number of the preset resource types, and input the fifth eigenvectors to the output layer.
And step six, carrying out normalization processing on the fifth feature vector through an output layer to obtain the probability that the target user is interested in each preset resource type.
The output layer may process the fifth feature vector based on a softmax (normalized exponential function) function to obtain a vector representing a probability that the target user is interested in the preset resource types.
For example, presetting the resource types may include: resource type A, resource type B, resource type C, if the vector output by the probability prediction model is: [0.5, 0.3, 0.2], it means that the probability of the target user being interested in the resource type A is 0.5, the probability of the target user being interested in the resource type B is 0.3, and the probability of the target user being interested in the resource type C is 0.2.
Before determining the probability that the target user is interested in the preset resource types based on the trained probability prediction model, the electronic device can train the initial probability prediction model based on the preset training sample to obtain the trained probability prediction model.
The presetting of the training samples may include: the user vector of the sample user, the resource vector of each of the first number of second network resources that the sample user has visited, and the probability that the sample user is interested in each preset resource type.
In one embodiment of the present invention, referring to fig. 3, before step S102, the method may further include the steps of:
s301: and mapping the user identification of the sample user to obtain a user vector of the sample user as a second user vector.
In one implementation, the electronic device may obtain a user identifier of the sample user, and perform hash mapping on the user identifier of the sample user to obtain a user vector (i.e., a second user vector) of the sample user.
S302: and selecting a first number of network resources from the network resources accessed by the sample user as second network resources based on a preset sliding window.
The length of the sliding window is a first number, and the first number may be set by a technician according to experience, for example, the first number may be 5, or the first number may also be 6, but is not limited thereto. The length of the sliding window represents the number of network resources that the sliding window contains.
In one implementation, the electronic device may determine the network resources that have been accessed by the sample user, and select a first number of network resources (i.e., second network resources) from the network resources that have been accessed by the sample user based on a preset sliding window.
Illustratively, the length of the sliding window may be 3, and the network resources that the sample user has accessed may include: network resource 1, network resource 2, network resource 3, network resource 4, network resource 5, network resource 6.
The electronic device may determine that the second network resource includes: the network resource 1, the network resource 2, the network resource 3, or the electronic device may also determine that the second network resource includes: the network resource 2, the network resource 3, the network resource 4, or the electronic device may further determine that the second network resource includes: network resources 3, network resources 4, network resources 5.
S303: and mapping the respective resource identifier of the second network resource to obtain a respective resource vector of the second network resource as a second resource vector.
In one implementation, the electronic device may perform hash mapping on the respective resource identifier of the second network resource to obtain a resource vector (i.e., a second resource vector) of the second network resource.
S304: and determining the resource type of one network resource after the access time of the second network resource as the first resource type according to the sequence of the access times.
The first resource type belongs to preset resource types.
In one implementation manner, the electronic device may randomly select one network resource from the network resources after the access time of the second network resource according to the sequence of the access times, and determine the resource type of the network resource as the first resource type.
Illustratively, when the sliding window includes network resources (i.e. the second network resources) as follows: when the network resource 1, the network resource 2, and the network resource 3 are used, the electronic device may determine that one network resource behind the second network resource at the access time is the network resource 5, and then the electronic device may determine the resource type of the network resource 5 as the first resource type. When the network resources contained in the sliding window are: when the network resource 2, the network resource 3, and the network resource 4 are used, the electronic device may determine that a first network resource after a second network resource is the network resource 6 at the access time, and then the electronic device may determine a resource type of the network resource 6 as the first resource type.
In another implementation manner, in order to improve accuracy of determining the resource type of interest of the target user, the electronic device may determine, according to the sequence of the access times, the resource type of the first network resource after the access time of the second network resource at the access time as the first resource type.
Illustratively, when the sliding window includes network resources (i.e. the second network resources) as follows: when the network resource 1, the network resource 2, and the network resource 3 are used, the electronic device may determine that a first network resource after a second network resource is the network resource 4 at the access time, and then the electronic device may determine a resource type of the network resource 4 as the first resource type. When the network resources contained in the sliding window are: when the network resource 2, the network resource 3, and the network resource 4 are used, the electronic device may determine that a first network resource after a second network resource is the network resource 5 at the access time, and then the electronic device may determine a resource type of the network resource 5 as the first resource type.
Based on the processing, the second network resource and the first network resource with the access time behind the second network resource can embody the time sequence characteristics when the user accesses the network resource, subsequently, the probability pre-model is trained based on the second network resource and the first network resource with the access time behind the second network resource, so that the probability prediction model can determine the time sequence characteristics when the user accesses the network resource, and further, the accuracy of the determined resource type interested by the target user is higher based on the trained probability prediction model.
S305: setting the probability of the sample user interested in the first resource type as a first numerical value, and setting the probability of the sample user interested in other resource types except the first resource type in each preset resource type as a second numerical value to obtain the probability of the sample user interested in each preset resource type.
The first value and the second value can be set by a skilled person according to experience, for example, the first value can be 1, and the second value can be 0, but not limited thereto. In one implementation, the second value is less than the first value.
For example, the first value may be 1, the second value may be 0, the network resource that the sample user has accessed may be a movie resource, and the presetting of each resource type may include: science fiction type, suspense type, comedy type. When the first resource type includes: when the science fiction type is used, the electronic device may set the probability that the sample user is interested in the science fiction type to 1, set the probabilities that the sample user is interested in the suspense type and the comedy type to 0, and obtain probabilities (which may be referred to as first probabilities) that the sample user is interested in each preset resource type, where the probabilities are respectively: 1. 0 and 0. When the first resource type includes: when the science fiction type and the suspense type are used, the electronic device may set the probability that the sample user is interested in both the science fiction type and the suspense type to 1, set the probability that the sample user is interested in the comedy type to 0, and obtain first probabilities that: 1. 1 and 0.
S306: and taking the second user vector and each second resource vector as input data of the initial probability prediction model, taking the probability of the sample user interested in each preset resource type as output data of the corresponding initial probability prediction model, and adjusting the model parameters of the initial probability prediction model until a preset convergence condition is reached.
Wherein the preset convergence condition may be set by a technician according to experience.
In one implementation, the predetermined convergence condition may be that the training times of the initial probabilistic predictive model reach a predetermined number.
Wherein the preset number of times can be set by a technician according to experience.
In another implementation manner, in order to improve the accuracy of the probability that the target user determined by the trained probability prediction model is interested in the preset resource types, the preset convergence condition may be a loss function value calculated after the training, and the difference between the loss function value calculated for the fifth number of times before and the loss function value calculated for the fifth number of times before is smaller than the first difference.
Wherein the fifth number and the first difference value can be set by a technician according to experience.
The electronic device may input the second user vector and the second resource vector to the initial probability prediction model, and may obtain a probability (which may be referred to as a second probability) that the sample user output by the initial probability prediction model is interested in each preset resource type. Then, the electronic device may calculate a loss function value representing a difference between the first probability and the second probability, and adjust a model parameter of the initial probability prediction model based on the calculated loss function value until a preset convergence condition is reached, so as to obtain a trained probability prediction model.
In one implementation, step S105 may include the following steps:
and determining the resource type with the probability of interest of the target user being greater than a preset probability threshold from preset resource types as the resource type of interest of the target user.
Wherein the preset probability threshold may be set empirically by a skilled person.
In another implementation, step S105 may include the following steps:
and determining a second number of resource types from preset resource types as the resource types which are interested by the target user.
The probability that the target user is interested in the second number of resource types is greater than the probability that the target user is interested in other resource types except the second number of resource types in the preset resource types, and the second number can be set by technicians according to experience.
The electronic device may rank the preset resource types in an order from a large probability to a small probability of interest of the target user, and then, the electronic device may determine, from the ranking result, a second number of resource types before the target user is interested in as the resource types of interest of the target user.
In one embodiment of the present invention, after determining the type of resource of interest to the target user, the method may further comprise the steps of:
step 1, aiming at each resource type which is interested by the target user, calculating the product of the probability that the target user is interested in the resource type and the third number as a fourth number.
The third number is the number of preset network resources required to be recommended to the target user, and the third number can be set by technicians according to experience and service requirements.
For example, the third number may be 10, and in the movie recommendation scenario, the presetting of each resource type may include: science fiction type, suspense type, comedy type. If the target user is interested in the preset resource types, the probability is respectively as follows: 0.5, 0.3, 0.2, the electronic device may determine to recommend 5 science fiction type movies, 3 suspense type movies, and 2 comedy type movies to the target user.
And 2, selecting a fourth number of network resources from the network resources contained in the resource type, and recommending the network resources to the target user.
In one implementation, for each resource type in which the target user is interested, the electronic device may randomly select a fourth number of network resources from the network resources included in the resource type, and recommend the fourth number of network resources to the target user.
Based on the processing, the probability prediction model is obtained by training the probability of the sample user interested in the preset resource types based on the second network resources accessed by the sample user and the probability of the sample user interested in the preset resource types, and the accuracy of the determined probability of the target user interested in the preset resource types is higher based on the probability prediction model and the first network resources accessed by the target user.
Referring to fig. 4, fig. 4 is a system block diagram of a resource type determining method according to an embodiment of the present invention.
The electronic device can obtain the user identifier of the target user, and perform hash mapping on the user identifier of the target user through the first mapping module to obtain the first user vector. And inputting the first user vector to the first full-connection layer, and mapping the first user vector through the first full-connection layer to obtain a first feature vector representing the static interest of the target user. The electronic device may then input the first feature vector to the adaptive network.
The electronic device may further obtain resource identifiers of first network resources that the target user has accessed, and perform hash mapping processing on the resource identifiers of the first network resources through the second mapping module to obtain first resource vectors. The electronic device can also input each first resource vector to the cyclic gate control unit, perform feature extraction on each first resource vector through the cyclic gate control unit to obtain a second feature vector of each first network resource, and input each second feature vector to the attention layer. Then, the electronic device may perform weighting processing on each second feature vector through the attention layer to obtain a third feature vector representing the dynamic interest of the target user, and input the first user feature vector to the adaptive network.
Furthermore, the electronic device may perform weighting processing on the first feature vector and the third feature vector through the adaptive network to obtain a fourth feature vector representing the first network resource that the target user has accessed. The electronic equipment can also map the fourth feature vector through the second full-connection layer to obtain a corresponding fifth feature vector, and normalize the fifth feature vector through the output layer to obtain the probability that the target user is interested in each preset resource type.
Furthermore, the electronic device may determine the resource type of interest of the target user according to the probability of interest of the target user in each preset resource type.
Based on the above processing, because the first network resource is a network resource that the target user has accessed, the first user vector of the target user and the first resource vector of the first network resource can reflect the real interest of the target user, based on the first user vector and the first resource vector, the determined probability that the target user is interested in each preset resource type can also reflect the real interest of the target user, based on the probability that the target user is interested in each preset resource type, the determined accuracy of the resource type that the target user is interested in is higher, subsequently, based on the resource type that the target user is interested in, network resource recommendation can be performed on the target user, and the effectiveness of the recommended network resource can be improved.
Corresponding to the embodiment of the method in fig. 1, referring to fig. 5, fig. 5 is a block diagram of a resource type determining apparatus according to an embodiment of the present invention, where the apparatus includes:
a first mapping module 501, configured to perform mapping processing on a user identifier of a target user to obtain a user vector of the target user, where the user vector is used as a first user vector;
a first determining module 502, configured to determine, as a first network resource, a first number of network resources in the network resources that the target user has accessed;
a second mapping module 503, configured to perform mapping processing on respective resource identifiers of the first network resources to obtain respective resource vectors of the first network resources, where the respective resource vectors are used as first resource vectors;
a prediction module 504, configured to process the first user vector and each of the first resource vectors based on a pre-trained probability prediction model, so as to obtain a probability that the target user is interested in each preset resource type, where the probability is output by the probability prediction model;
a second determining module 505, configured to determine, in the preset resource types, a resource type in which the target user is interested, based on a probability that the target user is interested in the preset resource types.
Optionally, the apparatus further comprises:
the third mapping module is used for mapping the user identification of the sample user to obtain a user vector of the sample user as a second user vector;
a third determining module, configured to select, based on a preset sliding window, the first number of network resources from the network resources that the sample user has accessed, as second network resources; wherein the length of the sliding window is the first number;
a fourth mapping module, configured to perform mapping processing on respective resource identifiers of the second network resources to obtain respective resource vectors of the second network resources, where the respective resource vectors are used as second resource vectors;
a fourth determining module, configured to determine, according to a sequence of access times, a resource type of a network resource after the access time of the second network resource at the access time as a first resource type, where the first resource type belongs to the preset resource types;
a fifth determining module, configured to set a probability that the sample user is interested in the first resource type to a first numerical value, and set a probability that the sample user is interested in other resource types except the first resource type in the preset resource types to a second numerical value, so as to obtain a probability that the sample user is interested in the preset resource types;
and the adjusting module is used for taking the second user vector and each second resource vector as input data of an initial probability prediction model, taking the probability that the sample user is interested in each preset resource type as an output parameter of the corresponding initial probability prediction model, and adjusting the model parameters of the initial probability prediction model until a preset convergence condition is reached.
Optionally, the probabilistic predictive model includes: the system comprises a first full connection layer, a circulating gate control unit, an attention layer, an adaptive network, a second full connection layer and an output layer;
the prediction module 504 is specifically configured to perform mapping processing on the first user vector based on a first mapping matrix including the network parameter of the first full connection layer, so as to obtain a feature vector corresponding to the first user vector, and use the feature vector as a first feature vector;
performing feature extraction on each first resource vector through the cyclic gate control unit to obtain respective feature vectors of the first network resources, wherein the feature vectors are used as second feature vectors;
weighting each second feature vector through the attention layer to obtain a feature vector representing the first network resource as a third feature vector;
weighting the first feature vector and the third feature vector through the adaptive network to obtain a feature vector representing the first network resource accessed by the target user, wherein the feature vector is used as a fourth feature vector;
mapping the fourth feature vector through the second full connection layer to obtain a corresponding vector as a fifth feature vector, wherein the number of elements contained in the fifth feature vector is the same as the number of the preset resource types;
and carrying out normalization processing on the fifth feature vector through the output layer to obtain the probability that the target user is interested in the preset resource types.
Optionally, the prediction module 504 is specifically configured to perform weighting processing on each second feature vector based on a first preset formula, to obtain a feature vector representing the first network resource, and use the feature vector as a third feature vector, where the first preset formula is:
d represents the third feature vector, k represents the first number, hjA second feature vector, h, representing the jth of said first network resourcestA second feature vector, h, representing the tth of said first network resourceiA second eigenvector representing the ith said first network resource, σ () representing an activation function, W1Representing a first weight matrix, W2Represents the second weight matrix, m represents the first predetermined vector, and T represents the matrix transpose operator.
Optionally, the prediction module 504 is specifically configured to perform weighting processing on the first feature vector and the third feature vector based on a second preset formula, to obtain a feature vector representing the first network resource that the target user has accessed, and use the feature vector as a fourth feature vector, where the second preset formula is:
c represents the fourth feature vector, s represents the first feature vector, d represents the third feature vector, W3Represents the second mapping matrix, n represents the second predetermined vector, T represents the matrix transpose operator, and σ () represents the activation function.
Optionally, the second determining module 505 is specifically configured to determine, from the preset resource types, a resource type with the probability that the target user is interested in being greater than a preset probability threshold as the resource type that the target user is interested in;
or,
determining a second number of resource types from the preset resource types as the resource types which are interested by the target user, wherein the probability that the target user is interested in the second number of resource types is greater than the probability that the target user is interested in other resource types except the second number of resource types in the preset resource types.
Optionally, the apparatus further comprises:
a sixth determining module, configured to calculate, for each resource type that the target user is interested in, a product of a probability that the target user is interested in the resource type and a third number, where the third number is a number preset to be recommended to the target user, and is used as a fourth number;
and the recommending module is used for selecting the fourth number of network resources from the network resources contained in the resource type and recommending the network resources to the target user.
Based on the resource type determination device provided by the embodiment of the invention, because the first network resource is a network resource which is visited by the target user, the first user vector of the target user and the first resource vector of the first network resource can reflect the real interest of the target user, the determined probability of the target user interested in each preset resource type can also reflect the real interest of the target user based on the first user vector and the first resource vector, the determined accuracy of the resource type interested by the target user is higher based on the probability of the target user interested in each preset resource type, and subsequently, the network resource recommendation can be performed on the target user based on the resource type interested by the target user, so that the effectiveness of the recommended network resource can be improved.
An embodiment of the present invention further provides an electronic device, as shown in fig. 6, including a processor 601, a communication interface 602, a memory 603, and a communication bus 604, where the processor 601, the communication interface 602, and the memory 603 complete mutual communication through the communication bus 604,
a memory 603 for storing a computer program;
the processor 601 is configured to implement the following steps when executing the program stored in the memory 603:
mapping the user identification of the target user to obtain a user vector of the target user as a first user vector;
determining a first number of network resources in the network resources accessed by the target user as first network resources;
mapping the respective resource identifier of the first network resource to obtain a respective resource vector of the first network resource as a first resource vector;
processing the first user vector and each first resource vector based on a pre-trained probability prediction model to obtain the probability of interest of the target user to each preset resource type, which is output by the probability prediction model;
and determining the resource types which are interested by the target user in the preset resource types based on the probability that the target user is interested in the preset resource types.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
Based on the electronic device provided by the embodiment of the invention, because the first network resource is a network resource that the target user has visited, the first user vector of the target user and the first resource vector of the first network resource can reflect the real interest of the target user, the determined probability that the target user is interested in each preset resource type can also reflect the real interest of the target user based on the first user vector and the first resource vector, the determined accuracy of the resource type that the target user is interested in is higher based on the probability that the target user is interested in each preset resource type, and subsequently, the network resource recommendation can be performed on the target user based on the resource type that the target user is interested in, so that the effectiveness of the recommended network resource can be improved.
In yet another embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements any of the above-mentioned resource type determination method steps.
In yet another embodiment of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the resource type determination method of any of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, the electronic device, the computer-readable storage medium, and the computer program product embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.
Claims (10)
1. A method for resource type determination, the method comprising:
mapping the user identification of the target user to obtain a user vector of the target user as a first user vector;
determining a first number of network resources in the network resources accessed by the target user as first network resources;
mapping the respective resource identifier of the first network resource to obtain a respective resource vector of the first network resource as a first resource vector;
processing the first user vector and each first resource vector based on a pre-trained probability prediction model to obtain the probability of interest of the target user to each preset resource type, which is output by the probability prediction model;
and determining the resource types which are interested by the target user in the preset resource types based on the probability that the target user is interested in the preset resource types.
2. The method according to claim 1, wherein before the processing the first user vector and each first resource vector based on the pre-trained probabilistic predictive model to obtain the probability of interest of the target user in each preset resource type, which is output by the probabilistic predictive model, the method further comprises:
mapping the user identification of the sample user to obtain a user vector of the sample user as a second user vector;
selecting the first number of network resources from the network resources accessed by the sample user based on a preset sliding window to serve as second network resources; wherein the length of the sliding window is the first number;
mapping the respective resource identifier of the second network resource to obtain a respective resource vector of the second network resource as a second resource vector;
determining a resource type of a network resource after the access time of the second network resource according to the sequence of the access times, as a first resource type, wherein the first resource type belongs to the preset resource types;
setting the probability that the sample user is interested in the first resource type as a first numerical value, and setting the probability that the sample user is interested in other resource types except the first resource type in the preset resource types as a second numerical value to obtain the probability that the sample user is interested in the preset resource types;
and taking the second user vector and each second resource vector as input data of an initial probability prediction model, taking the probability of the sample user interested in each preset resource type as output data of the corresponding initial probability prediction model, and adjusting model parameters of the initial probability prediction model until a preset convergence condition is reached.
3. The method of claim 1, wherein the probabilistic predictive model comprises: the system comprises a first full connection layer, a circulating gate control unit, an attention layer, an adaptive network, a second full connection layer and an output layer;
the processing the first user vector and each first resource vector based on a pre-trained probability prediction model to obtain the probability of interest of the target user to each preset resource type output by the probability prediction model comprises:
based on a first mapping matrix containing the network parameters of the first full connection layer, mapping the first user vector to obtain a characteristic vector corresponding to the first user vector as a first characteristic vector;
performing feature extraction on each first resource vector through the cyclic gate control unit to obtain respective feature vectors of the first network resources, wherein the feature vectors are used as second feature vectors;
weighting each second feature vector through the attention layer to obtain a feature vector representing the first network resource as a third feature vector;
weighting the first feature vector and the third feature vector through the adaptive network to obtain a feature vector representing the first network resource accessed by the target user, wherein the feature vector is used as a fourth feature vector;
mapping the fourth feature vector through the second full connection layer to obtain a corresponding vector as a fifth feature vector, wherein the number of elements contained in the fifth feature vector is the same as the number of the preset resource types;
and carrying out normalization processing on the fifth feature vector through the output layer to obtain the probability that the target user is interested in the preset resource types.
4. The method according to claim 3, wherein the weighting, by the attention layer, each of the second eigenvectors to obtain an eigenvector representing the first network resource as a third eigenvector comprises:
based on a first preset formula, performing weighting processing on each second feature vector to obtain a feature vector representing the first network resource, and using the feature vector as a third feature vector, wherein the first preset formula is as follows:
d represents the third feature vector, k represents the first number, hjA second feature vector, h, representing the jth of said first network resourcestA second feature vector, h, representing the tth of said first network resourceiA second eigenvector representing the ith said first network resource, σ () representing an activation function, W1Representing a first weight matrix, W2Represents the second weight matrix, m represents the first predetermined vector, and T represents the matrix transpose operator.
5. The method according to claim 3, wherein the weighting the first feature vector and the third feature vector by the adaptive network to obtain a feature vector representing the first network resource that the target user has accessed as a fourth feature vector comprises:
based on a second preset formula, performing weighting processing on the first feature vector and the third feature vector to obtain a feature vector representing the first network resource accessed by the target user, and using the feature vector as a fourth feature vector, wherein the second preset formula is as follows:
c represents the fourth feature vector, s represents the first feature vector, d represents the third feature vector, W3Represents the second mapping matrix, n represents the second predetermined vector, T represents the matrix transpose operator, and σ () represents the activation function.
6. The method of claim 1, wherein the determining the resource types of interest to the target user among the preset resource types based on the probability of interest to the target user includes:
determining the resource type with the probability of interest of the target user being greater than a preset probability threshold from the preset resource types as the resource type of interest of the target user;
or,
determining a second number of resource types from the preset resource types as the resource types which are interested by the target user, wherein the probability that the target user is interested in the second number of resource types is greater than the probability that the target user is interested in other resource types except the second number of resource types in the preset resource types.
7. The method of claim 1, wherein after determining the resource types of interest to the target user among the preset resource types based on the probability of interest to the target user among the preset resource types, the method further comprises:
for each resource type which is interested by the target user, calculating the product of the probability that the target user is interested in the resource type and a third number as a fourth number, wherein the third number is the number of preset network resources which need to be recommended to the target user;
and selecting the fourth number of network resources from the network resources corresponding to the resource type, and recommending the network resources to the target user.
8. An apparatus for resource type determination, the apparatus comprising:
the first mapping module is used for mapping the user identifier of the target user to obtain a user vector of the target user as a first user vector;
a first determining module, configured to determine, as a first network resource, a first number of network resources from the network resources that the target user has accessed;
a second mapping module, configured to perform mapping processing on respective resource identifiers of the first network resources to obtain respective resource vectors of the first network resources, where the respective resource vectors are used as first resource vectors;
the prediction module is used for processing the first user vector and each first resource vector based on a pre-trained probability prediction model to obtain the probability of interest of the target user in each preset resource type, wherein the probability is output by the probability prediction model;
and a second determining module, configured to determine, in the preset resource types, the resource types in which the target user is interested, based on the probability that the target user is interested in the preset resource types.
9. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1 to 7 when executing a program stored in the memory.
10. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010652409.7A CN111814051B (en) | 2020-07-08 | 2020-07-08 | Resource type determining method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010652409.7A CN111814051B (en) | 2020-07-08 | 2020-07-08 | Resource type determining method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111814051A true CN111814051A (en) | 2020-10-23 |
CN111814051B CN111814051B (en) | 2023-07-28 |
Family
ID=72842953
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010652409.7A Active CN111814051B (en) | 2020-07-08 | 2020-07-08 | Resource type determining method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111814051B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113609266A (en) * | 2021-07-09 | 2021-11-05 | 阿里巴巴新加坡控股有限公司 | Resource processing method and device |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9311386B1 (en) * | 2013-04-03 | 2016-04-12 | Narus, Inc. | Categorizing network resources and extracting user interests from network activity |
CN106462626A (en) * | 2014-06-13 | 2017-02-22 | 微软技术许可有限责任公司 | Modeling interestingness with deep neural networks |
CN108304441A (en) * | 2017-11-14 | 2018-07-20 | 腾讯科技(深圳)有限公司 | Network resource recommended method, device, electronic equipment, server and storage medium |
CN108366012A (en) * | 2018-03-08 | 2018-08-03 | 北京奇艺世纪科技有限公司 | A kind of social networks method for building up, device and electronic equipment |
US10140315B1 (en) * | 2016-06-20 | 2018-11-27 | Shutterstock, Inc. | Identifying visual portions of visual media files responsive to visual portions of media files submitted as search queries |
CN110413877A (en) * | 2019-07-02 | 2019-11-05 | 阿里巴巴集团控股有限公司 | A kind of resource recommendation method, device and electronic equipment |
CN110765260A (en) * | 2019-10-18 | 2020-02-07 | 北京工业大学 | Information recommendation method based on convolutional neural network and joint attention mechanism |
CN110941727A (en) * | 2019-11-29 | 2020-03-31 | 北京达佳互联信息技术有限公司 | Resource recommendation method and device, electronic equipment and storage medium |
CN111369278A (en) * | 2020-02-19 | 2020-07-03 | 杭州电子科技大学 | Click rate prediction method based on long-term interest modeling of user |
-
2020
- 2020-07-08 CN CN202010652409.7A patent/CN111814051B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9311386B1 (en) * | 2013-04-03 | 2016-04-12 | Narus, Inc. | Categorizing network resources and extracting user interests from network activity |
CN106462626A (en) * | 2014-06-13 | 2017-02-22 | 微软技术许可有限责任公司 | Modeling interestingness with deep neural networks |
US10140315B1 (en) * | 2016-06-20 | 2018-11-27 | Shutterstock, Inc. | Identifying visual portions of visual media files responsive to visual portions of media files submitted as search queries |
CN108304441A (en) * | 2017-11-14 | 2018-07-20 | 腾讯科技(深圳)有限公司 | Network resource recommended method, device, electronic equipment, server and storage medium |
CN108366012A (en) * | 2018-03-08 | 2018-08-03 | 北京奇艺世纪科技有限公司 | A kind of social networks method for building up, device and electronic equipment |
CN110413877A (en) * | 2019-07-02 | 2019-11-05 | 阿里巴巴集团控股有限公司 | A kind of resource recommendation method, device and electronic equipment |
CN110765260A (en) * | 2019-10-18 | 2020-02-07 | 北京工业大学 | Information recommendation method based on convolutional neural network and joint attention mechanism |
CN110941727A (en) * | 2019-11-29 | 2020-03-31 | 北京达佳互联信息技术有限公司 | Resource recommendation method and device, electronic equipment and storage medium |
CN111369278A (en) * | 2020-02-19 | 2020-07-03 | 杭州电子科技大学 | Click rate prediction method based on long-term interest modeling of user |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113609266A (en) * | 2021-07-09 | 2021-11-05 | 阿里巴巴新加坡控股有限公司 | Resource processing method and device |
Also Published As
Publication number | Publication date |
---|---|
CN111814051B (en) | 2023-07-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110008397B (en) | A recommended model training method and device | |
CN110110139B (en) | Method and device for explaining recommendation result and electronic equipment | |
CN111159563B (en) | Method, device, equipment and storage medium for determining user interest point information | |
CN109165691B (en) | Training method and device for model for identifying cheating users and electronic equipment | |
CN110351299B (en) | Network connection detection method and device | |
CN116232656A (en) | Internet of vehicles intrusion detection model training method, detection method and equipment based on generation of countermeasure network | |
CN111984867B (en) | Network resource determining method and device | |
CN108805332B (en) | Feature evaluation method and device | |
CN115033777B (en) | Data recommendation method, electronic device and storage medium | |
CN118869561B (en) | Zero trust evaluation method, device, equipment and storage medium based on countermeasure training | |
CN111814051B (en) | Resource type determining method and device | |
CN117994611B (en) | Training method and device for image classification model and electronic equipment | |
CN116805039B (en) | Feature screening method, device, computer equipment and data disturbance method | |
CN110162535B (en) | Search method, apparatus, device and storage medium for performing personalization | |
CN110827078B (en) | Information recommendation method, device, equipment and storage medium | |
CN114741584B (en) | Method, device and equipment for acquiring user characteristic representation and target object recommendation | |
CN116128015A (en) | Entity relation prediction method, relation prediction model training method and related equipment | |
CN116305033A (en) | Abnormal account identification method and device and electronic equipment | |
CN115017362A (en) | Data processing method, electronic device and storage medium | |
CN113609363A (en) | A user search method and device | |
CN112507216A (en) | Data object recommendation method, device, equipment and storage medium | |
CN113326385B (en) | Target multimedia resource acquisition method and device, electronic equipment and storage medium | |
CN116501993B (en) | House source data recommendation method and device | |
CN113672783B (en) | Feature processing method, model training method and media resource processing method | |
CN110297974B (en) | Sorting processing method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |