WO2023236900A1 - 一种项目推荐方法及其相关设备 - Google Patents

一种项目推荐方法及其相关设备 Download PDF

Info

Publication number
WO2023236900A1
WO2023236900A1 PCT/CN2023/098289 CN2023098289W WO2023236900A1 WO 2023236900 A1 WO2023236900 A1 WO 2023236900A1 CN 2023098289 W CN2023098289 W CN 2023098289W WO 2023236900 A1 WO2023236900 A1 WO 2023236900A1
Authority
WO
WIPO (PCT)
Prior art keywords
information
model
user
interaction unit
item
Prior art date
Application number
PCT/CN2023/098289
Other languages
English (en)
French (fr)
Inventor
贾庆林
朱杰明
蔡国豪
唐睿明
董振华
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2023236900A1 publication Critical patent/WO2023236900A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2457Query processing with adaptation to user needs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • This application relates to the technical field of artificial intelligence (AI), and in particular to a project recommendation method and related equipment.
  • AI artificial intelligence
  • the neural network model provided by the related technology may include two branches.
  • the first branch may be called a first model
  • the second branch may be called a second model.
  • the first model may analyze input information (including user information).
  • the attribute information of the item and the attribute information of the item, etc.) are linearly operated.
  • the second model can perform nonlinear operations on the input information. Based on the results of these two model operations, the probability of each item being clicked by the user can be obtained. Therefore, the probability of each item being clicked by the user can be obtained. Items with higher probability are determined as items recommended to the user.
  • the first model mainly pays attention to the relationship between some frequently appearing items and users.
  • the second model mainly notices the relationship between some items that rarely appear and users. relationship between these two types of items, ignoring the relationship between other items other than these two types of items and users.
  • the neural network model can more accurately predict the probability of these two types of items being clicked by users, it cannot accurately predict the clicks of other items by users. The probability of clicking, so that the overall prediction accuracy of the neural network model is not high.
  • the embodiments of the present application provide an item recommendation method and related equipment, which can not only accurately predict the probability that some frequently appearing items and some items that almost never appear will be clicked by users, but also accurately predict the probability of items other than these two types. The probability that the remaining items will be clicked by the user, thereby improving the overall prediction accuracy of the model.
  • the first aspect of the embodiments of this application provides a project recommendation method, which method includes:
  • first information associated with the user can be obtained.
  • the first information at least includes the user's attribute information and the information that can be presented on the page of the application.
  • the attribute information of the project where the user's attribute information can include the user's name, age, gender, job and other information, and the project's attribute information can include the project's name, type, function, price and other information.
  • the first model (trained neural network model) can be obtained, and the first information can be input to the first model, so that the first model processes the first information and obtains the first processing result
  • the first processing result can be used to obtain the probability that the items presentable on the page of the application are clicked by the user, and these probabilities can be used to determine the items recommended to the user. (For example, among the items that can be presented on the page of the application, the item with a higher probability is determined as the item recommended to the user).
  • the process of processing the first information by the first model includes: first, the first model performs a linear operation on the first information to obtain the second information. Then, the first model performs nonlinear operations on the second information to obtain the third information. Finally, the first model obtains the first processing result based on the third information.
  • the nonlinear operation involved here usually refers to the operation of adding a nonlinear activation function on the basis of a linear operation.
  • the function characteristic of the nonlinear activation function is that there are discontinuous and differentiable points in the function space.
  • common nonlinear activation functions include ReLu, Sigmoid, tanh, etc.
  • the first information can be input to the first model for processing, thereby obtaining the first processing result, and the first processing result can be used To determine the probability of an item being clicked by the user.
  • the first model first performs a linear operation on the first information to obtain the second information, then performs a nonlinear operation on the first information and the second information to obtain the third information, and finally based on the second information and the third information Three information to obtain the first processing result.
  • the first model implements nonlinear operations on the basis of linear operations, which creates a connection between linear operations and nonlinear operations.
  • the first model can not only realize explicit information between Interaction and implicit interaction can also realize semi-explicit interaction between information. That is to say, during this operation process, the first model can not only notice the relationship between some frequently appearing items and users as well as some that are almost never The relationship between the items that appear and the user can also be noted, except for these two types of items, the relationship between the remaining items and the user. Therefore, the first model can accurately predict the probability of the two types of items being clicked by the user. It can also accurately predict the probability that the remaining items will be clicked by the user, thus improving the overall prediction accuracy of the model.
  • the first model is used to: perform linear operations on the first information to obtain the second information; perform nonlinear operations on the first information and the second information to obtain the third information; perform a linear operation on the second information. and the third information are fused to obtain the fourth information; based on the fourth information, the first processing result is obtained.
  • the interaction unit may include a linear layer, a nonlinear layer and a fusion layer, where the input end of the linear layer is the input end of the interaction unit.
  • the first input terminal of the nonlinear layer is the input terminal of the interactive unit
  • the first output terminal of the linear layer is connected to the second input terminal of the nonlinear layer
  • the second output terminal of the linear layer is connected to the input terminal of the fusion layer.
  • the output end of the nonlinear layer is connected to the input end of the fusion layer
  • the output end of the fusion layer is the output end of the interactive unit.
  • the linear layer can perform a linear operation on the first information to obtain a linear operation result of the linear layer (ie, the aforementioned second information), and input the linear operation result of the linear layer to the nonlinear layer and the fusion layer.
  • the nonlinear layer can perform nonlinear operations on the first information and the linear operation results of the linear layer to obtain the nonlinear operation results of the nonlinear layer (ie, the aforementioned third information), and use the nonlinear operation results of the nonlinear layer to input to the fusion layer.
  • the fusion layer can fuse the linear operation results of the linear layer and the nonlinear operation results of the nonlinear layer.
  • the fusion result i.e., the aforementioned fourth information
  • the method further includes: processing the first information through a second model to obtain a second processing result, and the second model is at least one of the following: multi-layer perceptron, convolutional network, attention force network, Squeeze-and-Excitation network and the same model as the first model; the first processing result and the second processing result are processed through the third model.
  • the processing results are fused, and the fused results are used to determine the items recommended to the user.
  • the foregoing implementation method provides a target model.
  • the target model includes a first model, a second model, and a third model. These three models are all trained neural network models.
  • the first model and the second model are two parallel branches, and the output end of the first model and the output end of the second model are both connected to the input end of the third model.
  • the input end of the first model and the second model The input terminal can be used to receive the first information, and the output terminal of the third model can output the probability that an item presentable on the page of the application is clicked by the user. Then, while the first information is input to the first model, the first information can also be input to the second model, so that the second model processes the first information and obtains the second processing result.
  • the first model After the first model obtains the first processing result and the second model obtains the second processing result, the first model can send the first processing result to the third model, and the second model can send the second processing result to the third model, so as to The third model is caused to fuse the first processing result and the second processing result.
  • the fused result is the probability that the items that can be presented on the page of the application are clicked by the user. Therefore, these probabilities can be used to determine the recommended items to the user. Items (for example, among the items that can be presented on the page of the application, the item with a higher probability is determined to be the item recommended to the user).
  • the second model can be at least one of a multi-layer perceptron, a convolutional network, an attention network, a Squeeze-and-Excitation network, and a model that is the same as the first model
  • the first model and the second model in the target model Models can form multiple types of model combinations, which helps the target model provide services for more business scenarios and has higher generalization performance.
  • the first model contains N interactive units connected in series.
  • the i-th interaction unit can include a linear layer, a non-linear layer and a fusion layer, where the input end of the linear layer of the i-th interaction unit is the input end of the i-th interaction unit, and the i-th interaction unit
  • the first input terminal of the nonlinear layer of the i-th interactive unit is the input terminal of the i-th interactive unit
  • the first output terminal of the linear layer of the i-th interactive unit is the second input of the nonlinear layer of the i-th interactive unit.
  • the second output terminal of the linear layer of the i-th interactive unit is connected to the input terminal of the fusion layer of the i-th interactive unit, and the output terminal of the nonlinear layer of the i-th interactive unit is fused with the i-th interactive unit
  • the input end of the layer is connected, and the output end of the fusion layer of the i-th interactive unit is the output end of the i-th interactive unit.
  • the i-th interaction unit receives the input of the i-th interaction unit (i.e., the output of the i-1th interaction unit), it can perform the following operations on the input of the i-th interaction unit: the linear function of the i-th interaction unit
  • the layer can perform linear operations on the input of the i-th interaction unit, obtain the linear operation result of the linear layer of the i-th interaction unit, and input the linear operation result of the linear layer of the i-th interaction unit into the i-th interaction unit.
  • the nonlinear layer and the fusion layer of the i-th interaction unit are examples of the i-th interaction unit.
  • the nonlinear layer of the i-th interaction unit can perform nonlinear operations on the input of the i-th interaction unit and the linear operation result of the linear layer of the i-th interaction unit to obtain the nonlinear operation result of the nonlinear layer of the i-th interaction unit.
  • the linear operation result, and the nonlinear operation result of the nonlinear layer of the i-th interaction unit is input to the fusion layer of the i-th interaction unit.
  • the fusion layer of the i-th interaction unit can fuse the linear operation results of the linear layer of the i-th interaction unit and the non-linear operation results of the nonlinear layer of the i-th interaction unit.
  • the fusion layer of the i-th interaction unit The fusion result of can be directly used as the output of the i-th interaction unit and input to the i+1-th interaction unit.
  • the input of the first interactive unit is the first information
  • the output of the Nth interactive unit is the first processing result.
  • the first model can contain N interactive units, each interactive unit can include a linear layer and a nonlinear layer, and there is a series relationship between these N interactive units. Use these N interactive units to By processing one piece of information, linear operations and nonlinear operations of a certain order of magnitude can be performed on the first information.
  • the first processing result obtained is a high-order information (that is, 2 ⁇ N order information). Based on this information, we can Or determine the final prediction result, that is, the probability of each item being clicked by the user, with high accuracy.
  • processing the first information through the first model to obtain the first processing result also includes: input to the i-th interaction unit through the i-th interaction unit and non-input of the i-th interaction unit.
  • the linear operation result is subjected to nonlinear operation to obtain a new nonlinear operation result of the i-th interaction unit; the linear operation result of the i-th interaction unit and the nonlinear operation result of the i-th interaction unit are processed through the i-th interaction unit.
  • the output of the i-th interaction unit includes: the linear operation result of the i-th interaction unit through the i-th interaction unit, the non-linear operation result of the i-th interaction unit, and the new non-linear operation of the i-th interaction unit
  • the operation results are fused to obtain the output of the i-th interactive unit.
  • the i-th interaction unit may include a linear layer, K-1 nonlinear layers (K is a positive integer greater than or equal to 3) and a fusion layer, where the input of the linear layer of the i-th interaction unit
  • the terminal is the input terminal of the i-th interactive unit.
  • the first input terminals of the K-1 nonlinear layers of the i-th interactive unit are all the input terminals of the i-th interactive unit.
  • the linear layer of the i-th interactive unit The first output terminal is connected to the second input terminal of the first nonlinear layer of the i-th interactive unit, and the first output terminal of the first nonlinear layer of the i-th interactive unit is connected to the second input terminal of the i-th interactive unit.
  • the second input end of the nonlinear layer is connected to,..., the first output end of the K-2th nonlinear layer of the ith interaction unit and the K-1th nonlinear layer of the ith interaction unit.
  • the second input terminal is connected, the second output terminal of the linear layer of the i-th interactive unit is connected to the input terminal of the fusion layer of the i-th interactive unit, and the second output of the K-1 nonlinear layer of the i-th interactive unit is connected.
  • the terminals are all connected to the input terminal of the fusion layer of the i-th interactive unit, and the output terminal of the fusion layer of the i-th interactive unit is the output terminal of the i-th interactive unit.
  • the i-th interaction unit receives the input of the i-th interaction unit (i.e., the output of the i-1th interaction unit), it can perform the following operations on the input of the i-th interaction unit: the linear function of the i-th interaction unit
  • the layer can perform linear operations on the input of the i-th interaction unit, obtain the linear operation result of the linear layer of the i-th interaction unit, and input the linear operation result of the linear layer of the i-th interaction unit into the i-th interaction unit.
  • the first nonlinear layer and the fusion layer of the i-th interaction unit is the input of the i-th interaction unit.
  • the first non-linear layer of the i-th interaction unit can perform non-linear operations on the input of the i-th interaction unit and the linear operation result of the linear layer of the i-th interaction unit to obtain the first non-linear operation of the i-th interaction unit.
  • the nonlinear operation result of the first nonlinear layer of the i-th interaction unit is input to the second nonlinear layer and the fusion layer of the i-th interaction unit.
  • the second nonlinear layer of the i-th interaction unit can perform nonlinear operations on the input of the i-th interaction unit and the nonlinear operation result of the first nonlinear layer of the i-th interaction unit to obtain the i-th
  • the nonlinear operation result of the second nonlinear layer of the i-th interaction unit is input to the third nonlinear layer of the i-th interaction unit and the fusion Layer,...
  • the K-1th nonlinear layer of the ith interaction unit can perform nonlinear operation results on the input of the ith interaction unit and the K-2th nonlinear layer of the ith interaction unit.
  • the fusion layer of the i-th interaction unit can fuse the linear operation results of the linear layer of the i-th interaction unit and the nonlinear operation results of the K-1 nonlinear layers of the i-th interaction unit.
  • the fusion result of the fusion layer of the unit can be directly used as the output of the i-th interactive unit and input to the i+1-th interactive unit.
  • the input of the first interactive unit is the first information
  • the output of the Nth interactive unit is the first processing result.
  • the first model can contain N interactive units, each interactive unit can include a linear layer and multiple nonlinear layers, and there is a series relationship between these N interactive units.
  • linear operations and nonlinear operations of a certain order of magnitude can be performed on the first information.
  • the obtained first processing result is a high-order information (i.e., K ⁇ N-order information). Based on this information, As or determining the final prediction result, that is, the probability of each item being clicked by the user, it has a high degree of accuracy.
  • the first information also includes: the user's operation information on the application and the attribute information of the application, and the application is used to provide items for the user.
  • the second aspect of the embodiment of the present application provides a model training method, which method includes: obtaining first information, the first information includes attribute information of the user and attribute information of the project; and performing the first information on the first model to be trained. Processing to obtain a first processing result.
  • the first processing result is used to determine the probability that an item is clicked by the user.
  • the probability that an item is clicked by the user is used to determine the item recommended to the user.
  • the first model to be trained is used to: perform the first information on Linear operation is performed to obtain the second information; linear operation is performed on the second information to obtain the third information; based on the third information, the first processing result is obtained; based on the probability of the item being clicked by the user and the real probability of the item being clicked by the user, the target is obtained Loss, the target loss is used to indicate the difference between the probability of the item being clicked by the user and the real probability of the item being clicked by the user; based on the target loss, the parameters of the first model to be trained are updated until the model training conditions are met, and the first Model.
  • the first model trained by the above method has the ability to predict user behavior. Specifically, after obtaining the first information including the user's attribute information and the item's attribute information, the first information can be input to the first model for processing, thereby obtaining the first processing result, and the first processing result can be used to determine that the item is The probability of a user clicking.
  • the first model first performs a linear operation on the first information to obtain the second information, then performs a nonlinear operation on the first information and the second information to obtain the third information, and finally based on the second information and the third information Three information to obtain the first processing result. It can be seen that the first model implements nonlinear operations on the basis of linear operations, which creates a connection between linear operations and nonlinear operations.
  • the first model can not only realize explicit information between Interaction and implicit interaction can also realize semi-explicit interaction between information. That is to say, during this operation process, the first model can not only notice the relationship between some frequently appearing items and users as well as some that are almost never The relationship between the items that appear and the user can also be noted, except for these two types of items, the relationship between the remaining items and the user. Therefore, the first model can accurately predict the probability of the two types of items being clicked by the user. It can also accurately predict the probability that the remaining items will be clicked by the user, thus improving the overall prediction accuracy of the model.
  • obtaining the first processing result based on the second information and the third information includes: fusing the second information and the third information to obtain the fourth information; obtaining the first processing result based on the fourth information. result.
  • the method further includes: processing the first information through a second model to be trained to obtain a second processing result, and the second model to be trained is at least one of the following: multi-layer perceptron, convolutional machine Product network, attention network, Squeeze-and-Excitation network and the same model as the first model to be trained; the first processing result and the second processing result are fused through the third model to be trained, and the fused result is: The probability that the item is clicked by the user.
  • the target loss is used to indicate the difference between the probability of the item being clicked by the user and the true probability of the item being clicked by the user, including: based on the probability of the item being clicked by the user, the true probability of the item being clicked by the user, the first processing result, and The second processing result, obtains the target loss, the target loss is used to indicate the difference between the probability of the item being clicked by the user and the real probability of the item being clicked by the user, the difference between the first processing result and the probability of the item being clicked by the user, The difference between the second processing result and the probability of the item being clicked by the user; based on the target loss, update the parameters of the first model to be trained until the model training conditions are met, and obtain the first model including: based on the target loss, update the parameters of the first model to be trained.
  • the parameters of the training model, the parameters of the second model to be trained, and the parameters of the third model to be trained are updated until the model training conditions are met, and the first model, the second model, and the third model are obtained correspondingly.
  • the aforementioned implementation method provides a new model training method, which can not only calculate the overall loss for the model to be trained, but also calculate the corresponding losses for different branch models in the model to be trained, so as to provide targeted guidance based on these losses.
  • the parameters of different branches in the model are updated to improve the performance of the trained neural network model.
  • the i-th interaction unit performs nonlinear operation on the input of the i-th interaction unit and the linear operation result of the i-th interaction unit to obtain the nonlinear operation result of the i-th interaction unit; the i-th interaction unit performs nonlinear operation on the i-th interaction unit
  • the linear operation results of the i interaction unit and the nonlinear operation results of the i-th interaction unit are fused to obtain the output of the i-th interaction unit; among which, the input of the first interaction model is the first information, and the input of the first interaction model is the first information.
  • the linear operation result of is the second information
  • the nonlinear operation result of the first interaction model is the third information
  • the output of the first interaction model is the fourth information
  • the output of the Nth interaction model is the first processing result.
  • processing the first information through the first to-be-trained model to obtain the first processing result also includes: input to the i-th interaction unit through the i-th interaction unit and the i-th interaction unit Perform nonlinear operation on the nonlinear operation result of the i-th interaction unit to obtain the new nonlinear operation result of the i-th interaction unit; use the i-th interaction unit to perform the linear operation result of the i-th interaction unit and the nonlinear operation of the i-th interaction unit
  • the results are fused, and the output of the i-th interaction unit includes: the linear operation result of the i-th interaction unit through the i-th interaction unit, the nonlinear operation result of the i-th interaction unit, and the new result of the i-th interaction unit.
  • the nonlinear operation results are fused to obtain the output of the i-th interactive unit.
  • the first information also includes: the user's operation information on the application and the attribute information of the application, and the application is used to provide items for the user.
  • the third aspect of the embodiment of the present application provides an item recommendation device.
  • the device includes: an acquisition module, used to acquire first information, where the first information includes user attribute information and item attribute information; a first processing module, The first information is processed through the first model to obtain the first processing result.
  • the first processing result is used to determine the probability of the item being clicked by the user.
  • the first model is used to perform linear operations on the first information to obtain the second information. ; Perform nonlinear operation on the second information to obtain the third information; obtain the first processing result based on the third information.
  • the first information can be input to the first model for processing, thereby obtaining the first processing result, and the first processing result can be used To determine the probability of an item being clicked by the user.
  • the first model first performs a linear operation on the first information to obtain the second information, then performs a nonlinear operation on the first information and the second information to obtain the third information, and finally based on the second information and The third information is to obtain the first processing result.
  • the first model implements nonlinear operations on the basis of linear operations, which creates a connection between linear operations and nonlinear operations.
  • the first model can not only realize explicit information between Interaction and implicit interaction can also realize semi-explicit interaction between information. That is to say, during this operation process, the first model can not only notice the relationship between some frequently appearing items and users as well as some that are almost never The relationship between the items that appear and the user can also be noted, except for these two types of items, the relationship between the remaining items and the user. Therefore, the first model can accurately predict the probability of the two types of items being clicked by the user. It can also accurately predict the probability that the remaining items will be clicked by the user, thus improving the overall prediction accuracy of the model.
  • the first model is used to: perform linear operations on the first information to obtain the second information; perform nonlinear operations on the first information and the second information to obtain the third information; perform a linear operation on the second information.
  • the information and the third information are fused to obtain the fourth information; based on the fourth information, the first processing result is obtained.
  • the device further includes: a second processing module, configured to process the first information through a second model to obtain a second processing result, and the second model is at least one of the following: multi-layer perception machine, convolutional network, attention network, Squeeze-and-Excitation network and the same model as the first model; the third processing module is used to fuse the first processing result and the second processing result through the third model to obtain The fused results are used to determine the items recommended to the user.
  • a second processing module configured to process the first information through a second model to obtain a second processing result
  • the second model is at least one of the following: multi-layer perception machine, convolutional network, attention network, Squeeze-and-Excitation network and the same model as the first model
  • the third processing module is used to fuse the first processing result and the second processing result through the third model to obtain The fused results are used to determine the items recommended to the user.
  • the first processing module is used to: perform linear operation on the input of the i-th interaction unit through the i-th interaction unit, and obtain the linear operation result of the i-th interaction unit; perform linear operation on the input of the i-th interaction unit through the i-th interaction unit.
  • the input and the linear operation result of the i-th interaction unit are subjected to non-linear operation to obtain the non-linear operation result of the i-th interaction unit; the linear operation result of the i-th interaction unit and the i-th interaction unit are processed through the i-th interaction unit
  • the nonlinear operation results are fused to obtain the output of the i-th interaction unit; among them, the input of the first interaction unit is the first information, the linear operation result of the first interaction model is the second information, and the The nonlinear operation result of is the third information, the output of the first interaction model is the fourth information, and the output of the Nth interaction model is the first processing result.
  • the first processing module is also used to perform nonlinear operations on the input of the i-th interaction unit and the non-linear operation result of the i-th interaction unit through the i-th interaction unit to obtain the i-th interaction unit.
  • the new nonlinear operation result of the i-th interaction unit; the first processing module is used to process the linear operation result of the i-th interaction unit, the nonlinear operation result of the i-th interaction unit and the i-th interaction through the i-th interaction unit
  • the new nonlinear operation results of the units are fused to obtain the output of the i-th interactive unit.
  • the first information also includes: the user's operation information on the application and the attribute information of the application, and the application is used to provide items for the user.
  • the fourth aspect of the embodiment of the present application provides a model training device.
  • the device includes: a first acquisition module for acquiring first information, where the first information includes user attribute information and project attribute information; a first processing module , used to process the first information through the first to-be-trained model to obtain the first processing result.
  • the first processing result is used to determine the probability of the item being clicked by the user.
  • the probability of the item being clicked by the user is used to determine the recommendation to the user.
  • the first model to be trained is used to: perform linear operations on the first information to obtain the second information; perform linear operations on the second information to obtain the third information; obtain the first processing result based on the third information; second
  • the acquisition module is used to obtain the target loss based on the probability of the item being clicked by the user and the real probability of the item being clicked by the user.
  • the target loss is used to indicate the probability of the item being clicked by the user and the item.
  • the difference between the real probability of the item being clicked by the user; the update module is used to update the parameters of the first model to be trained based on the target loss until the model training conditions are met and the first model is obtained.
  • the first model trained by the above device has the ability to predict user behavior. Specifically, after obtaining the first information including the user's attribute information and the item's attribute information, the first information can be input to the first model for processing, thereby obtaining the first processing result, and the first processing result can be used to determine that the item is The probability of a user clicking.
  • the first model first performs a linear operation on the first information to obtain the second information, then performs a nonlinear operation on the first information and the second information to obtain the third information, and finally based on the second information and the third information Three information to obtain the first processing result. It can be seen that the first model implements nonlinear operations on the basis of linear operations, which creates a connection between linear operations and nonlinear operations.
  • the first model can not only realize explicit information between Interaction and implicit interaction can also realize semi-explicit interaction between information. That is to say, during this operation process, the first model can not only notice the relationship between some frequently appearing items and users as well as some that are almost never The relationship between the items that appear and the user can also be noted, except for these two types of items, the relationship between the remaining items and the user. Therefore, the first model can accurately predict the probability of the two types of items being clicked by the user. It can also accurately predict the probability that the remaining items will be clicked by the user, thus improving the overall prediction accuracy of the model.
  • the device further includes: a second processing module, configured to process the first information through a second model to be trained to obtain a second processing result, and the second model to be trained is at least one of the following : Multi-layer perceptron, convolutional network, attention network, Squeeze-and-Excitation network and the same model as the first model to be trained; the third processing module is used to process the first processing result through the third model to be trained and The second processing results are fused, and the fused result is the probability of the item being clicked by the user.
  • a second processing module configured to process the first information through a second model to be trained to obtain a second processing result
  • the second model to be trained is at least one of the following : Multi-layer perceptron, convolutional network, attention network, Squeeze-and-Excitation network and the same model as the first model to be trained
  • the third processing module is used to process the first processing result through the third model to be trained and The second processing results are fused, and the fused result is the probability of the item being
  • the second acquisition module is used to obtain the target loss based on the probability of the item being clicked by the user, the real probability of the item being clicked by the user, the first processing result and the second processing result, and the target loss is used for Indicates the difference between the probability of the item being clicked by the user and the true probability of the item being clicked by the user, the difference between the first processing result and the probability of the item being clicked by the user, the difference between the second processing result and the probability of the item being clicked by the user Difference; update module, used to update the parameters of the first model to be trained, the parameters of the second model to be trained, and the parameters of the third model to be trained based on the target loss, until the model training conditions are met, corresponding to the first model, The second model and the third model.
  • the first model to be trained is used to: fuse the second information and the third information to obtain the fourth information; and obtain the first processing result based on the fourth information.
  • the input of the interaction unit and the linear operation result of the i-th interaction unit are subjected to non-linear operation to obtain the non-linear operation result of the i-th interaction unit; the linear operation result of the i-th interaction unit and the i-th interaction unit are processed through the i-th interaction unit
  • the nonlinear operation results of the first interaction unit are fused to obtain the output of the i-th interaction unit; among them, the input of the first interaction model is the first information, the linear operation result of the first interaction model is the second information, and the first
  • the nonlinear operation results of the first interaction model are the third information, the output of the first interaction model is the fourth information, and the output of the Nth interaction model is the first processing result.
  • the first processing module is also used to: perform nonlinear operations on the input of the ith interaction unit and the nonlinear operation result of the ith interaction unit through the ith interaction unit, to obtain the ith interaction unit.
  • the new nonlinear operation result of the i interaction unit; the first processing module is used to perform the linear operation of the i th interaction unit through the i th interaction unit.
  • the output of the i-th interaction unit is obtained by fusing the calculation result, the non-linear calculation result of the i-th interaction unit, and the new non-linear calculation result of the i-th interaction unit.
  • the first information also includes: the user's operation information on the application and the attribute information of the application, and the application is used to provide items for the user.
  • the fifth aspect of the embodiment of the present application provides an item recommendation device, which includes a memory and a processor; the memory stores code, and the processor is configured to execute the code.
  • the item recommendation device executes the first step The method described in any possible implementation manner of the aspect or the first aspect.
  • a sixth aspect of the embodiment of the present application provides a model training device, which includes a memory and a processor; the memory stores code, and the processor is configured to execute the code. When the code is executed, the model training device executes the second step. The method described in any possible implementation manner of the aspect or the second aspect.
  • a seventh aspect of the embodiment of the present application provides a circuit system.
  • the circuit system includes a processing circuit configured to perform the first aspect, any one of the possible implementations of the first aspect, the second aspect or The method described in any possible implementation manner in the second aspect.
  • An eighth aspect of the embodiments of the present application provides a chip system.
  • the chip system includes a processor for calling a computer program or computer instructions stored in a memory, so that the processor executes the steps described in the first aspect and the first aspect. any possible implementation manner, the second aspect, or the method described in any possible implementation manner in the second aspect.
  • the processor is coupled to the memory through an interface.
  • the chip system further includes a memory, and computer programs or computer instructions are stored in the memory.
  • a ninth aspect of the embodiments of the present application provides a computer storage medium.
  • the computer storage medium stores a computer program.
  • the program When the program is executed by a computer, it makes it possible for the computer to implement any one of the first aspect and the first aspect.
  • a tenth aspect of the embodiments of the present application provides a computer program product.
  • the computer program product stores instructions.
  • the instructions When the instructions are executed by a computer, the computer implements any one of the possible methods of the first aspect and the first aspect. The method described in the implementation, the second aspect, or any possible implementation of the second aspect.
  • the first information after obtaining the first information including the user's attribute information and the project's attribute information, the first information can be input to the first model for processing, thereby obtaining the first processing result, which can be used for Determine the probability of an item being clicked by the user.
  • the first model first performs a linear operation on the first information to obtain the second information, then performs a nonlinear operation on the first information and the second information to obtain the third information, and finally based on the second information and the third information Three information to obtain the first processing result. It can be seen that the first model implements nonlinear operations on the basis of linear operations, which creates a connection between linear operations and nonlinear operations.
  • the first model can not only realize explicit information between Interaction and implicit interaction can also realize semi-explicit interaction between information. That is to say, during this operation process, the first model can not only notice the relationship between some frequently appearing items and users as well as some that are almost never The relationship between the items that appear and the user can also be noted, except for these two types of items, the relationship between the remaining items and the user. Therefore, the first model can accurately predict the probability of the two types of items being clicked by the user. It can also accurately predict the probability that the remaining items will be clicked by the user, thus improving the overall prediction accuracy of the model.
  • Figure 1 is a structural schematic diagram of the main framework of artificial intelligence
  • Figure 2a is a schematic structural diagram of the project recommendation system provided by the embodiment of the present application.
  • Figure 2b is another structural schematic diagram of the project recommendation system provided by the embodiment of the present application.
  • Figure 2c is a schematic diagram of related equipment for project recommendation provided by the embodiment of the present application.
  • Figure 3 is a schematic diagram of the architecture of the system 100 provided by the embodiment of the present application.
  • Figure 4 is a schematic flow chart of the project recommendation method provided by the embodiment of the present application.
  • Figure 5 is a schematic structural diagram of the first model provided by the embodiment of the present application.
  • Figure 6 is another structural schematic diagram of the first model provided by the embodiment of the present application.
  • Figure 7 is another structural schematic diagram of the first model provided by the embodiment of the present application.
  • Figure 8 is another structural schematic diagram of the first model provided by the embodiment of the present application.
  • Figure 9 is another schematic flow chart of the project recommendation method provided by the embodiment of the present application.
  • Figure 10 is a schematic structural diagram of the target model provided by the embodiment of the present application.
  • Figure 11 is a schematic flow chart of the model training method in the embodiment of the present application.
  • Figure 12 is a schematic structural diagram of an item recommendation device provided by an embodiment of the present application.
  • Figure 13 is a schematic structural diagram of the model training device provided by the embodiment of the present application.
  • Figure 14 is a schematic structural diagram of an execution device provided by an embodiment of the present application.
  • Figure 15 is a schematic structural diagram of the training equipment provided by the embodiment of the present application.
  • Figure 16 is a schematic structural diagram of a chip provided by an embodiment of the present application.
  • the embodiments of the present application provide an item recommendation method and related equipment, which can not only accurately predict the probability that some frequently appearing items and some items that almost never appear will be clicked by users, but also accurately predict the probability of items other than these two types. The probability that the remaining items will be clicked by the user, thereby improving the overall prediction accuracy of the model.
  • the neural network model provided by the related technology may include two branches, the first branch may be called the first model, and the second branch may be called the second model. Then, when it is necessary to predict user behavior through the neural network model, the user's attribute information (for example, a student's name, age, gender, etc.) and the item's attribute information (for example, certain products type, price, function, etc.) as input to the model, so that the first model can perform linear operations on the input information, and the second model can perform nonlinear operations on the input information. Then, based on these two models As a result of the operation, the probability of each item being clicked by the user can be obtained.
  • the user's attribute information for example, a student's name, age, gender, etc.
  • the item's attribute information for example, certain products type, price, function, etc.
  • the first model can realize explicit interaction between the input information (features), and the first model will "remember" some common information (feature) combinations (that is, the first model performs the nonlinear operation in the nonlinear operation).
  • feature common information
  • the second model can realize the implicit interaction between the input information (features).
  • the second model will Find some rare or unseen information combinations (that is, during the linear operation process of the second model, it mainly notices the relationship between some items and users that have almost never appeared).
  • the neural network model of related technologies realizes the interaction between information in this way, and the efficiency is often relatively low, that is, the model does not pay enough attention to the relationship between other items and users except these two types of items.
  • the neural network The model can relatively accurately predict the probability of users clicking on these two types of items, but it cannot accurately predict the probability of users clicking on other items, so the overall prediction accuracy of the neural network model is not high.
  • the first model cannot fully realize the interaction between information, and the order of the information finally obtained from the interaction is often not high enough (for example, the first A model is usually equipped with three linear layers in series, which can realize three linear operations successively.
  • the order of the information finally obtained is usually 3rd order), because this information can often determine the final prediction result of the model, that is, the output of the model. The probability that certain items are clicked by users will cause these prediction results to be less accurate.
  • the first model and the second model are usually specific types of models that only serve certain specific business scenarios, and the generalization performance of the models is insufficient.
  • the neural network model provided by the related technology is trained based on the conventional model training method, that is, it guides the parameter update of the entire model as a whole, but cannot update the parameters of different branches in the model, resulting in the training results.
  • the performance of neural network models is poor.
  • AI technology is a technical discipline that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence. AI technology obtains the best results by perceiving the environment, acquiring knowledge and using knowledge.
  • artificial intelligence technology is a branch of computer science that attempts to understand the nature of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence.
  • Using artificial intelligence for data processing is a common application method of artificial intelligence.
  • Figure 1 is a structural schematic diagram of the main framework of artificial intelligence.
  • the following is from the “intelligent information chain” (horizontal axis) and “IT value chain” (vertical axis)
  • the above artificial intelligence theme framework is elaborated on in two dimensions.
  • the "intelligent information chain” reflects a series of processes from data acquisition to processing. For example, it can be the general process of intelligent information perception, intelligent information representation and formation, intelligent reasoning, intelligent decision-making, intelligent execution and output. In this process, the data has gone through the condensation process of "data-information-knowledge-wisdom".
  • the "IT value chain” reflects the value that artificial intelligence brings to the information technology industry, from the underlying infrastructure of human intelligence and information (providing and processing technology implementation) to the systematic industrial ecological process.
  • Infrastructure provides computing power support for artificial intelligence systems, enables communication with the external world, and supports it through basic platforms.
  • computing power is provided by smart chips (CPU, NPU, GPU, ASIC, FPGA and other hardware Software acceleration chip);
  • the basic platform includes distributed computing framework and network and other related platform guarantees and support, which can include cloud storage and computing, interconnection network, etc.
  • sensors communicate with the outside world to obtain data, which are provided to smart chips in the distributed computing system provided by the basic platform for calculation.
  • Data from the upper layer of the infrastructure is used to represent data sources in the field of artificial intelligence.
  • the data involves graphics, images, voice, and text, as well as IoT data of traditional devices, including business data of existing systems and sensory data such as force, displacement, liquid level, temperature, and humidity.
  • Data processing usually includes data training, machine learning, deep learning, search, reasoning, decision-making and other methods.
  • machine learning and deep learning can perform symbolic and formal intelligent information modeling, extraction, preprocessing, training, etc. on data.
  • Reasoning refers to the process of simulating human intelligent reasoning in computers or intelligent systems, using formal information to perform machine thinking and problem solving based on reasoning control strategies. Typical functions are search and matching.
  • Decision-making refers to the process of decision-making after intelligent information is reasoned, and usually provides functions such as classification, sorting, and prediction.
  • some general capabilities can be formed based on the results of further data processing, such as algorithms or a general system, such as translation, text analysis, computer vision processing, speech recognition, and image processing. identification, etc.
  • Intelligent products and industry applications refer to the products and applications of artificial intelligence systems in various fields. They are the encapsulation of overall artificial intelligence solutions, productizing intelligent information decision-making and realizing practical applications. Its application fields mainly include: intelligent terminals, intelligent transportation, Smart healthcare, autonomous driving, smart cities, etc.
  • FIG 2a is a schematic structural diagram of an item recommendation system provided by an embodiment of the present application.
  • the item recommendation system includes user equipment and data processing equipment.
  • user equipment includes smart terminals such as mobile phones, personal computers, or information processing centers.
  • the user equipment is the initiator of item recommendation. As the initiator of the item recommendation request, the user usually initiates the request through the user equipment.
  • the above-mentioned data processing equipment may be a cloud server, a network server, an application server, a management server, and other equipment or servers with data processing functions.
  • the data processing device receives the project recommendation request from the smart terminal through the interactive interface, and then performs information processing in the form of machine learning, deep learning, search, reasoning, decision-making, etc. through the memory for storing data and the processor for data processing.
  • the memory in the data processing device can be a general term, including local storage and a database that stores historical data.
  • the database can be on the data processing device or on other network servers.
  • the user device can receive instructions from the user. For example, the user device can obtain a piece of information input/selected by the user, and then initiate a request to the data processing device, so that the data processing device can respond to the information obtained by the user device.
  • the information execution project recommends applications to obtain the processing results for the information.
  • the user device can obtain a piece of information input by the user (which may include the user's attribute information, the attribute information of the project, the attribute information of the application used to present the project, etc.), and then initiate an information processing request to the data processing device,
  • the data processing device processes the information based on item recommendation, thereby obtaining the processing result of the information, that is, the probability that the item is clicked by the user.
  • the rate can be used to determine which items can ultimately be recommended to the user (for example, a portion of the items with a higher probability are used as recommended items to the user).
  • the data processing device can execute the item recommendation method according to the embodiment of the present application.
  • Figure 2b is another structural schematic diagram of the item recommendation system provided by the embodiment of the present application.
  • the user equipment directly serves as a data processing equipment.
  • the user equipment can directly obtain input from the user and directly process it by the hardware of the user equipment itself. Processing, the specific process is similar to Figure 2a, please refer to the above description, and will not be repeated here.
  • the user equipment can receive the user's instructions. For example, the user equipment can obtain a piece of information selected by the user in the user equipment, and then the user equipment itself performs item recommendation-based processing on the information. , thereby obtaining the processing result for this information, that is, the probability that the item is clicked by the user. These probabilities can be used to determine which items can be finally recommended to the user (for example, a part of the items with higher probability are used as recommended items to the user).
  • the user equipment itself can execute the item recommendation method according to the embodiment of the present application.
  • Figure 2c is a schematic diagram of related equipment for project recommendation provided by the embodiment of the present application.
  • the user equipment in Figure 2a and Figure 2b can be the local device 301 or the local device 302 in Figure 2c
  • the data processing device in Figure 2a can be the execution device 210 in Figure 2c
  • the data storage system 250 can To store the data to be processed by the execution device 210, the data storage system 250 can be integrated on the execution device 210, or can be set up on the cloud or other network servers.
  • the processors in Figure 2a and Figure 2b can perform data training/machine learning/deep learning through neural network models or other models (for example, models based on support vector machines), and use the final trained or learned model to execute on the image using the data Image processing applications to obtain corresponding processing results.
  • neural network models or other models for example, models based on support vector machines
  • Figure 3 is a schematic diagram of the architecture of the system 100 provided by the embodiment of the present application.
  • the execution device 110 is configured with an input/output (I/O) interface 112 for data interaction with external devices.
  • the user Data can be input to the I/O interface 112 through the client device 140.
  • the input data may include: various to-be-scheduled tasks, callable resources, and other parameters.
  • the execution device 110 When the execution device 110 preprocesses the input data, or when the calculation module 111 of the execution device 110 performs calculation and other related processing (such as implementing the function of the neural network in this application), the execution device 110 can call the data storage system 150
  • the data, codes, etc. in the system can be used for corresponding processing, and the data, instructions, etc. obtained by corresponding processing can also be stored in the data storage system 150 .
  • the I/O interface 112 returns the processing results to the client device 140, thereby providing them to the user.
  • the training device 120 can generate corresponding target models/rules based on different training data for different goals or different tasks, and the corresponding target models/rules can be used to achieve the above goals or complete the above tasks. , thereby providing users with the desired results.
  • the training data may be stored in the database 130 and come from training samples collected by the data collection device 160 .
  • the user can manually enter the input data, and the manual input can be operated through the interface provided by the I/O interface 112 .
  • the client device 140 can automatically send input data to the I/O interface 112. If requiring the client device 140 to automatically send input data requires the user's authorization, the user can set corresponding permissions in the client device 140.
  • the user can view the results output by the execution device 110 on the client device 140, and the specific presentation form may be display, sound, action, etc.
  • the client device 140 can also be used as a data collection end to collect the input data of the input I/O interface 112 and the output results of the output I/O interface 112 as new sample data, and store them in the database 130 .
  • the I/O interface 112 directly stores the input data input to the I/O interface 112 and the output result outputted from the I/O interface 112 as new sample data as shown in the figure. Enter database 130.
  • Figure 3 is only a schematic diagram of a system architecture provided by an embodiment of the present application.
  • the positional relationship between the devices, devices, modules, etc. shown in the figure does not constitute any limitation.
  • the data The storage system 150 is an external memory relative to the execution device 110. In other cases, the data storage system 150 can also be placed in the execution device 110.
  • the neural network can be trained according to the training device 120.
  • An embodiment of the present application also provides a chip, which includes a neural network processor NPU.
  • the chip can be disposed in the execution device 110 as shown in FIG. 3 to complete the calculation work of the calculation module 111.
  • the chip can also be installed in the training device 120 as shown in Figure 3 to complete the training work of the training device 120 and output the target model/rules.
  • Neural network processor NPU is mounted on the main central processing unit (CPU) (host CPU) as a co-processor, and the main CPU allocates tasks.
  • the core part of the NPU is the arithmetic circuit.
  • the controller controls the arithmetic circuit to extract the data in the memory (weight memory or input memory) and perform operations.
  • the computing circuit includes multiple processing units (PE).
  • the arithmetic circuit is a two-dimensional systolic array.
  • the arithmetic circuit may also be a one-dimensional systolic array or other electronic circuit capable of performing mathematical operations such as multiplication and addition.
  • the arithmetic circuit is a general-purpose matrix processor.
  • the arithmetic circuit fetches the corresponding data of matrix B from the weight memory and caches it on each PE in the arithmetic circuit.
  • the operation circuit takes matrix A data and matrix B from the input memory to perform matrix operations, and the partial result or final result of the obtained matrix is stored in the accumulator (accumulator).
  • the vector calculation unit can further process the output of the arithmetic circuit, such as vector multiplication, vector addition, exponential operation, logarithmic operation, size comparison, etc.
  • the vector computing unit can be used for network calculations in non-convolutional/non-FC layers in neural networks, such as pooling, batch normalization, local response normalization, etc.
  • the vector computation unit can store the processed output vector into a unified buffer.
  • the vector calculation unit may apply a nonlinear function to the output of the arithmetic circuit, such as a vector of accumulated values, to generate activation values.
  • the vector computation unit generates normalized values, merged values, or both.
  • the processed output vector can be used as an activation input to an arithmetic circuit, such as for use in a subsequent layer in a neural network.
  • Unified memory is used to store input data and output data.
  • the weight data directly transfers the input data in the external memory to the input memory and/or the unified memory through the storage unit access controller (direct memory access controller, DMAC), stores the weight data in the external memory into the weight memory, and transfers the weight data to the unified memory.
  • DMAC direct memory access controller
  • the bus interface unit (BIU) is used to realize the interaction between the main CPU, DMAC and instruction memory through the bus.
  • the instruction fetch buffer connected to the controller is used to store instructions used by the controller
  • the controller is used to call instructions cached in the memory to control the working process of the computing accelerator.
  • the unified memory, input memory, weight memory and instruction memory are all on-chip memories, and the external memory is a memory outside the NPU.
  • the external memory can be a double data rate synchronous dynamic random access memory (double data rate). rate synchronous dynamic random access memory (DDR SDRAM), high bandwidth memory (high bandwidth memory, HBM) or other readable and writable memory.
  • DDR SDRAM rate synchronous dynamic random access memory
  • HBM high bandwidth memory
  • the neural network can be composed of neural units.
  • the neural unit can refer to an arithmetic unit that takes xs and intercept 1 as input.
  • the output of the arithmetic unit can be:
  • s 1, 2,...n, n is a natural number greater than 1
  • Ws is the weight of xs
  • b is the bias of the neural unit.
  • f is the activation function of the neural unit, which is used to introduce nonlinear characteristics into the neural network to convert the input signal in the neural unit into an output signal. The output signal of this activation function can be used as the input of the next convolutional layer.
  • the activation function can be a sigmoid function.
  • a neural network is a network formed by connecting many of the above-mentioned single neural units together, that is, the output of one neural unit can be the input of another neural unit.
  • the input of each neural unit can be connected to the local receptive field of the previous layer to extract the features of the local receptive field.
  • the local receptive field can be an area composed of several neural units.
  • W is a weight vector, and each value in the vector represents the weight value of a neuron in the neural network of this layer.
  • This vector W determines the spatial transformation from the input space to the output space described above, that is, the weight W of each layer controls how to transform the space.
  • the purpose of training a neural network is to finally obtain the weight matrix of all layers of the trained neural network (a weight matrix formed by the vector W of many layers). Therefore, the training process of neural network is essentially to learn how to control spatial transformation, and more specifically, to learn the weight matrix.
  • weight vector (of course, there is usually an initialization process before the first update, that is, pre-configuring parameters for each layer in the neural network). For example, if the predicted value of the network is high, adjust the weight vector to make it predict lower Some, constant adjustments are made until the neural network can predict the truly desired target value. Therefore, it is necessary to define in advance "how to compare the difference between the predicted value and the target value". This is the loss function (loss function) or objective function (objective function), which is used to measure the difference between the predicted value and the target value. Important equations. Among them, taking the loss function as an example, the higher the output value (loss) of the loss function, the greater the difference. Then the training of the neural network becomes a process of reducing this loss as much as possible.
  • the neural network can use the error back propagation (BP) algorithm to modify the size of the parameters in the initial neural network model during the training process, so that the reconstruction error loss of the neural network model becomes smaller and smaller. Specifically, forward pass Passing the input signal until the output will produce an error loss, and the parameters in the initial neural network model are updated by backpropagating the error loss information, so that the error loss converges.
  • the backpropagation algorithm is a backpropagation movement dominated by error loss, aiming to obtain the optimal parameters of the neural network model, such as the weight matrix.
  • the model training method provided by the embodiment of the present application involves the processing of data sequences, and can be specifically applied to data training, machine learning, deep learning and other methods.
  • training data for example, the first step of the model training method provided by the embodiment of the present application is information
  • the trained neural network such as the first model, the second model and the third model of the model training method provided by the embodiment of the present application.
  • the item recommendation method provided by the embodiment of the present application can use the above-trained neural network to input the input data (for example, the first information of the item recommendation method provided by the embodiment of the present application) into the training In a good neural network, output data (such as the probability of an item being clicked by the user in the user behavior prediction method provided in the embodiment of this application, etc.) is obtained.
  • the model training method and the project recommendation method provided in the embodiments of this application are inventions based on the same concept, and can also be understood as two parts of a system, or two stages of an overall process: such as model training phase and model application phase.
  • FIG 4 is a schematic flow chart of the project recommendation method provided by the embodiment of the present application. As shown in Figure 4, the method includes:
  • the first information includes user attribute information and project attribute information.
  • the first user-associated Information (can also be called original characteristics associated with the user), the first information at least includes the user's attribute information and attribute information of items that can be presented on the page of the application, where the user's attribute information may include the user's name, Information such as age, gender, and job.
  • the attribute information of the project may include the name, type, function, price, and other information of the project. It should be noted that the attribute information of the user can also be understood as the original characteristics of the user, and the attribute information of the item can be understood as the original characteristics of the item.
  • the first information may also include the user's operation information on the application and the attribute information of the application.
  • the page of the application is used to provide (present) one or more items (for example, merchandise, software, etc.) to the user.
  • the user's operation information on the application may include requests entered by the user on the page of the application, etc.
  • the attribute information of the application may include the name, type, function, size, etc. of the application. It should be noted that both the user's operation information on the application and the attribute information of the application can be understood as the original features of the context.
  • the first model is used to: perform linear operations on the first information to obtain the second information; Perform nonlinear operations on the first information and the second information to obtain the third information; obtain the first processing result based on the second information and the third information.
  • the first model (trained neural network model) can be obtained, and the first information can be input to the first model, so that the first model processes the first information and obtains the first processing result.
  • the first model may include at least one interactive unit. Then, the first model may process the first information in a variety of ways to obtain the first processing result:
  • the interaction unit may include a linear layer, a nonlinear layer layer and a fusion layer, where the input end of the linear layer is the input end of the interactive unit, the first input end of the nonlinear layer is the input end of the interactive unit, and the first output end of the linear layer is the same as the input end of the nonlinear layer.
  • the second input terminal of is connected, the second output terminal of the linear layer is connected to the input terminal of the fusion layer, the output terminal of the nonlinear layer is connected to the input terminal of the fusion layer, and the output terminal of the fusion layer is the interactive unit. the output terminal.
  • the first information is input to the interactive unit in the first model, and both the linear layer in the interactive unit and the nonlinear layer in the interactive unit can receive the first information.
  • the linear layer can perform a linear operation on the first information to obtain a linear operation result of the linear layer (ie, the aforementioned second information), and input the linear operation result of the linear layer to the nonlinear layer and the fusion layer.
  • x l is the first information
  • w 0 and b 0 are the parameters of the linear layer (ie, the weight and bias of the linear layer)
  • h o is the linear operation result of the linear layer.
  • the nonlinear layer can perform nonlinear operations on the first information and the linear operation results of the linear layer to obtain the nonlinear operation results of the nonlinear layer (ie, the aforementioned third information), and use the nonlinear operation results of the nonlinear layer to input to the fusion layer.
  • w 1 and b 1 are the parameters of the nonlinear layer (that is, the weight and bias of the linear layer), and ⁇ is the activation function (for example, ReLU, tanh, PReLu, etc.), h 1 is the nonlinear operation result of the nonlinear layer.
  • the fusion layer can fuse the linear operation results of the linear layer and the nonlinear operation results of the nonlinear layer.
  • the fusion result i.e., the aforementioned fourth information
  • the fusion result can be directly used as the output of the interactive unit, which is the output of the first model. , that is, the first processing result of the first model for the first information.
  • the fusion process is shown in the following formula:
  • x l+1 is the output of the interactive unit, that is, the first processing result of the first model output.
  • the interaction unit can be regarded as a 2-order interaction unit, and the first information is regarded as 1-order information (1-order features), then the first processing result output by the first model is 2-order information. (Characteristics of level 2).
  • the interaction unit may include a linear layer, K- 1 nonlinear layer (K is a positive integer greater than or equal to 3) and a fusion layer, where the input terminal of the linear layer is the input terminal of the interactive unit, and the first input terminals of K-1 nonlinear layers are all is the input terminal of the interactive unit, the first output terminal of the linear layer is connected to the second input terminal of the first nonlinear layer, and the first output terminal of the first nonlinear layer is connected to the second terminal of the second nonlinear layer.
  • the input terminal is connected,..., the first output terminal of the K-2th nonlinear layer is connected to the second input terminal of the K-1th nonlinear layer, and the second output terminal of the linear layer is connected to the input terminal of the fusion layer. connection, the second output terminals of the K-1 nonlinear layers are all connected to the input terminal of the fusion layer, and the output terminal of the fusion layer is the output terminal of the interactive unit.
  • the first information is input to the interaction unit in the first model, the linear layer in the interaction unit and the interaction unit All K-1 nonlinear layers in the element can receive the first information.
  • the linear layer can perform a linear operation on the first information to obtain the linear operation result of the linear layer (ie, the aforementioned second information), and input the linear operation result of the linear layer to the first nonlinear layer and the fusion layer.
  • the process of linear operation is shown in formula (2), which will not be described again here.
  • the first nonlinear layer can perform nonlinear operations on the first information and the linear operation results of the linear layer to obtain the nonlinear operation results of the first nonlinear layer (i.e., the aforementioned third information), and convert the first The nonlinear operation results of the first nonlinear layer are input to the second nonlinear layer and the fusion layer.
  • the second nonlinear layer can perform nonlinear operations on the first information and the nonlinear operation results of the first nonlinear layer to obtain the nonlinear operation results of the second nonlinear layer, and convert the second nonlinear operation results into
  • the nonlinear operation results of the layer are input to the third nonlinear layer and the fusion layer,...
  • the K-1th nonlinear layer can perform the nonlinear operation results on the first information and the K-2nd nonlinear layer.
  • Nonlinear operation obtain the nonlinear operation result of the K-1th nonlinear layer, and input the nonlinear operation result of the K-1th nonlinear layer to the fusion layer.
  • h 1 h o * ⁇ (w 1 x l +b 1 ) ...
  • h j h j-1 * ⁇ (w j x l +b j ) ...
  • h K-1 h K-2 * ⁇ (w K-1 x l +b K-1 ) (5)
  • h j-1 is the nonlinear operation result of the j-1th nonlinear layer
  • h j is the nonlinear operation result of the jth nonlinear layer
  • w j and b j are the jth nonlinear layer
  • j 1,...,K-1.
  • the fusion layer can fuse the linear operation results of the linear layer and the nonlinear operation results of K-1 nonlinear layers.
  • the fusion result can be directly used as the output of the interactive unit, which is the output of the first model, that is, the first The first processing result of the model for the first information.
  • the fusion process is shown in the following formula:
  • x l+1 is the output of the interactive unit, that is, the first processing result of the first model output.
  • the interaction unit can be regarded as a K-order interaction unit, and the first information is regarded as 1-order information (1-order features), then the first processing result output by the first model is K-order information. (Characteristics of K-order).
  • Figure 7 is another structural schematic diagram of the first model provided by the embodiment of the present application
  • the first model contains N interactive units connected in series (N is a positive integer greater than or equal to 2 )
  • the i-th interaction unit can include a linear layer, a A nonlinear layer and a fusion layer, where the input end of the linear layer of the i-th interactive unit is the input end of the i-th interactive unit, and the first input end of the nonlinear layer of the i-th interactive unit is the i-th
  • the input terminal of the i-th interactive unit is connected to the first output terminal of the linear layer of the i-th interactive unit and the second input terminal of the non-linear layer of the i-th interactive unit
  • the second output terminal of the linear layer of the i-th interactive unit is connected to the input terminal of the fusion layer of the i-th interactive unit, and the output terminal of
  • the first interaction unit receives the input of the first interaction unit, it can perform the following operations on the input of the first interaction unit: the linear layer of the first interaction unit can perform linear operations on the input of the first interaction unit, Obtain the linear operation result of the linear layer of the first interactive unit (that is, the aforementioned second information), and input the linear operation result of the linear layer of the first interactive unit to the nonlinear layer of the first interactive unit and the first The fusion layer of interactive units.
  • the process of linear operation performed by the first interactive unit is shown in formula (2), which will not be described again here.
  • the nonlinear layer of the first interaction unit can perform nonlinear operations on the input of the first interaction unit and the linear operation result of the linear layer of the first interaction unit to obtain the nonlinear operation result of the first interaction unit.
  • the linear operation result i.e., the aforementioned third information
  • the nonlinear operation result of the nonlinear layer of the first interaction unit is input to the fusion layer of the first interaction unit.
  • the process of nonlinear operation of the first interactive unit is shown in formula (3), which will not be described again here.
  • the fusion layer of the first interaction unit can fuse the linear operation results of the linear layer of the first interaction unit and the nonlinear operation results of the nonlinear layer of the first interaction unit.
  • the fusion layer of the first interaction unit The fusion result (i.e., the aforementioned fourth information) can be directly used as the output of the first interactive unit and input to the second interactive unit, that is, as the input of the second interactive unit.
  • the fusion process of the first interactive unit is shown in formula (4), which will not be described again here.
  • the operation performed by the second interaction unit on the input of the second interaction unit is similar to the operation performed by the first interaction unit on the input of the first interaction unit. , will not be repeated here.
  • the operations performed by the third interaction unit on the input of the third interaction unit..., and the operations performed by the Nth interaction unit on the input of the Nth interaction unit are all related to the aforementioned first interaction unit.
  • the operations performed by the unit on the input of the first interactive unit are similar and will not be described again here. It can be understood that the fusion result obtained by the fusion layer of the Nth interaction unit, that is, the output of the Nth interaction unit, can be used as the output of the first model, that is, the first processing result of the first model for the first information. .
  • each of the N interaction units can be regarded as a second-order interaction unit, and the first information is regarded as first-order information (first-order characteristics), then the first processing of the first model output The result is information of order 2 ⁇ N (features of order 2 ⁇ N).
  • Figure 8 is another structural schematic diagram of the first model provided by the embodiment of the present application
  • the first model contains N interactive units connected in series (N is a positive integer greater than or equal to 2 )
  • the i-th interaction unit can include a linear layer, K -1 nonlinear layer (K is a positive integer greater than or equal to 3) and a fusion layer, where the input end of the linear layer of the i-th interaction unit is the input end of the i-th interaction unit, and the i-th interaction
  • K is a positive integer greater than or equal to 3
  • the first input terminals of the K-1 nonlinear layers of the unit are all the input terminals of the i-th interactive unit, and the first output terminal of the linear layer of the i-th interactive unit is the same as the first nonlinear layer of the i-th interactive unit.
  • the second input terminal of the layer is connected, and the first output terminal of the first nonlinear layer of the i-th interactive unit is connected to the second input terminal of the second nonlinear layer of the i-th interactive unit,...,th K-2 of i interaction unit
  • the first output terminal of the nonlinear layer is connected to the second input terminal of the K-1 nonlinear layer of the i-th interactive unit
  • the second output terminal of the linear layer of the i-th interactive unit is connected to the second input terminal of the K-1 nonlinear layer of the i-th interactive unit.
  • the input end of the fusion layer is connected, the second output ends of the K-1 nonlinear layers of the i-th interactive unit are connected to the input end of the fusion layer of the i-th interactive unit, and the second output end of the fusion layer of the i-th interactive unit is connected.
  • the output terminal is the output terminal of the i-th interactive unit.
  • the first interaction unit receives the input of the first interaction unit, it can perform the following operations on the input of the first interaction unit: the linear layer of the first interaction unit can perform linear operations on the input of the first interaction unit, Obtain the linear operation result of the linear layer of the first interactive unit (i.e., the aforementioned second information), and input the linear operation result of the linear layer of the first interactive unit to the first nonlinear layer of the first interactive unit And the fusion layer of the first interactive unit.
  • the process of linear operation performed by the first interactive unit is shown in formula (2), which will not be described again here.
  • the first nonlinear layer of the first interaction unit can perform nonlinear operations on the input of the first interaction unit and the linear operation result of the linear layer of the first interaction unit to obtain the first
  • the nonlinear operation result of the first nonlinear layer i.e., the aforementioned third information
  • the nonlinear operation result of the first nonlinear layer of the first interaction unit is input to the second nonlinear operation result of the first interaction unit layer and fusion layer.
  • the second nonlinear layer of the first interaction unit can perform nonlinear operations on the input of the first interaction unit and the nonlinear operation result of the first nonlinear layer of the first interaction unit to obtain the first
  • the nonlinear operation result of the second nonlinear layer of the interaction unit, and the nonlinear operation result of the second nonlinear layer of the first interaction unit is input to the third nonlinear layer of the first interaction unit and the fusion Layer,...
  • the K-1th nonlinear layer of the 1st interaction unit can perform nonlinear operation on the input of the 1st interaction unit and the nonlinear operation result of the K-2th nonlinear layer of the 1st interaction unit.
  • Nonlinear operation obtain the nonlinear operation result of the K-1th nonlinear layer of the first interaction unit, and input the nonlinear operation result of the K-1th nonlinear layer of the first interaction unit to the first The fusion layer of interactive units.
  • the process of nonlinear operation of the first interactive unit is shown in formula (5), which will not be described again here.
  • the fusion layer of the first interaction unit can fuse the linear operation results of the linear layer of the first interaction unit and the nonlinear operation results of the K-1 nonlinear layers of the first interaction unit.
  • the fusion result of the fusion layer of the unit can be directly used as the output of the first interaction unit and input to the second interaction unit, that is, as the input of the second interaction unit.
  • the fusion process of the first interactive unit is shown in formula (6), which will not be described again here.
  • the operation performed by the second interaction unit on the input of the second interaction unit is similar to the operation performed by the first interaction unit on the input of the first interaction unit. , will not be repeated here.
  • the operations performed by the third interaction unit on the input of the third interaction unit..., and the operations performed by the Nth interaction unit on the input of the Nth interaction unit are all related to the aforementioned first interaction unit.
  • the operations performed by the unit on the input of the first interactive unit are similar and will not be described again here. It can be understood that the fusion result obtained by the fusion layer of the Nth interaction unit, that is, the output of the Nth interaction unit, can be used as the output of the first model, that is, the first processing result of the first model for the first information. .
  • each of the N interaction units can be regarded as a K-order interaction unit, and the first information is regarded as 1-order information (1-order characteristics), then the first processing of the first model output The result is information of order K ⁇ N (features of order K ⁇ N).
  • the first processing result After obtaining the first processing result output by the first model, the first processing result can be directly displayed on the page of the application. Then, these probabilities can be used to determine the items recommended to the user.
  • the linear operation result of the linear layer of the i-th interaction unit can be regarded as The aforementioned "linear operation result of the i-th interaction unit", the linear operation result of the first non-linear layer of the i-th interaction unit to the linear operation result of the K-2 non-linear layer of the i-th interaction unit can be Considered as the aforementioned "nonlinear operation result of the ith interaction unit", the linear operation result of the 2nd nonlinear layer of the ith interaction unit to the linear operation result of the K-1th nonlinear layer of the ith interaction unit The operation result can be regarded as the aforementioned "new nonlinear operation result of the i-th interaction unit".
  • the N interaction units all contain the same number of nonlinear layers for schematic introduction. In actual applications, among these N interaction units, Different interaction units can contain the same number of nonlinear layers or different numbers of nonlinear layers.
  • the first information after obtaining the first information including the user's attribute information and the project's attribute information, the first information can be input to the first model for processing, thereby obtaining the first processing result, which can be used for Determine the probability of an item being clicked by the user.
  • the first model first performs a linear operation on the first information to obtain the second information, then performs a nonlinear operation on the first information and the second information to obtain the third information, and finally based on the second information and the third information Three information to obtain the first processing result. It can be seen that the first model implements nonlinear operations on the basis of linear operations, which creates a connection between linear operations and nonlinear operations.
  • the first model can not only realize explicit information between Interaction and implicit interaction can also realize semi-explicit interaction between information. That is to say, during this operation process, the first model can not only notice the relationship between some frequently appearing items and users as well as some that are almost never The relationship between the items that appear and the user can also be noted, except for these two types of items, the relationship between the remaining items and the user. Therefore, the first model can accurately predict the probability of the two types of items being clicked by the user. It can also accurately predict the probability that the remaining items will be clicked by the user, thus improving the overall prediction accuracy of the model.
  • the first model may include N interactive units, each interactive unit may include a linear layer and at least one nonlinear layer, and the N interactive units are in a series relationship, and the N interactive units are used to By processing one piece of information, a certain number of linear operations and nonlinear operations can be performed on the first information, and the first processing result obtained is a high-order information (i.e., 2 ⁇ N order information or K ⁇ N information) , based on this information, the final prediction result is used or determined, that is, the probability of each item being clicked by the user, with high accuracy.
  • a high-order information i.e., 2 ⁇ N order information or K ⁇ N information
  • FIG 9 is another schematic flow chart of the project recommendation method provided by the embodiment of the present application. As shown in Figure 9, the method includes:
  • the first information includes user attribute information and project attribute information.
  • the first model is used to: perform linear operations on the first information to obtain the second information; perform nonlinear operations on the first information and the second information. , obtain the third information; based on the second information and the third information, obtain the first processing result.
  • a target model is provided, as shown in Figure 10 ( Figure 10 is a structural schematic diagram of the target model provided by the embodiment of the present application).
  • the target model includes a first model (which can be Figure 5, Figure 6, Figure 7 Or the first model shown in Figure 8), the second model and the third model, these three models are all trained neural network models.
  • the first model and The second model serves as two parallel branches, and the output terminal of the first model and the output terminal of the second model are both connected to the input terminal of the third model.
  • the input terminal of the first model and the input terminal of the second model can be used to receive the third model.
  • the output terminal of the third model can output the probability that an item presentable on a page of a certain application is clicked by the user.
  • steps 901 to 902 please refer to the relevant description of steps 401 to 402 in the embodiment shown in Figure 4. It should be noted that the difference between step 902 and step 402 is that the first processing result in step 402 The first processing result in step 902 can be used to indirectly obtain the probability that an item presentable on the page of the application is clicked by the user.
  • the first information can also be input to the second model, so that the second model processes the first information and obtains the second processing result.
  • the second model may be at least one of the following: a multi-layer perceptron, a convolutional network, an attention network, a Squeeze-and-Excitation network, and a model that is the same as the first model.
  • the first model After the first model obtains the first processing result and the second model obtains the second processing result, the first model can send the first processing result to the third model, and the second model can send the second processing result to the third model, so as to Let the third model fuse the first processing result and the second processing result (for example, perform a weighted sum, etc.), and the fused result obtained is the probability that the items presentable on the page of the application are clicked by the user, then , these probabilities can be used to determine which items to recommend to the user.
  • the target model only includes two branches (the first model and the second model) for schematic introduction, and does not limit the number of branches included in the target model in this application.
  • the model provided in “Embodiment 1 of the present application” in Table 1 is the aforementioned target model, and the model provided in “Embodiment 2 of the present application” is only the aforementioned first model.
  • the model provided by the embodiment of this application can Achieving the best performance demonstrates the superiority of the embodiment of the present application.
  • the target model achieved the best results
  • the first model achieved suboptimal results, which shows that both the first model and the target model provided by the embodiments of the present application can improve the accuracy of click-through rate estimation.
  • the target model provided by the embodiment of this application can be applied to various business scenarios, and can achieve obvious effects and obtain business recognition. Its online effects are shown in Table 2:
  • the first information after obtaining the first information including the user's attribute information and the project's attribute information, the first information can be input to the first model for processing, thereby obtaining the first processing result, which can be used for Determine the probability of an item being clicked by the user.
  • the first model first performs a linear operation on the first information to obtain the second information, then performs a nonlinear operation on the first information and the second information to obtain the third information, and finally based on the second information and the third information Three information to obtain the first processing result. It can be seen that the first model implements nonlinear operations on the basis of linear operations, which creates a connection between linear operations and nonlinear operations.
  • the first model can not only realize explicit information between Interaction and implicit interaction can also realize semi-explicit interaction between information. That is to say, during this operation process, the first model can not only notice the relationship between some frequently appearing items and users as well as some that are almost never The relationship between the items that appear and the user can also be noted, except for these two types of items, the relationship between the remaining items and the user. Therefore, the first model can accurately predict the probability of the two types of items being clicked by the user. It can also accurately predict the probability that the remaining items will be clicked by the user, thus improving the overall prediction accuracy of the model.
  • the first model may include N interactive units, each interactive unit may include a linear layer and multiple nonlinear layers, and the N interactive units are in a series relationship, and the N interactive units are used to By processing one piece of information, a certain number of linear operations and nonlinear operations can be performed on the first information, and the first processing result obtained is a high-order information (i.e., 2 ⁇ N order information or K ⁇ N information) , based on this information, the final prediction result is used or determined, that is, the probability of each item being clicked by the user, with high accuracy.
  • a high-order information i.e., 2 ⁇ N order information or K ⁇ N information
  • first model and the second model in the target model can constitute multiple types of model combinations, which helps the target model provide services for more business scenarios and has higher generalization performance.
  • Figure 11 is a schematic flow chart of the model training method in the embodiment of the present application. As shown in Figure 11, the method includes:
  • the first information includes the user's attribute information and the project's attribute information.
  • a batch of training data may be obtained first.
  • the batch of training data includes first information, and the first information includes attribute information of the user and certain Property information of items that can be presented on the page of an application.
  • the true probability of an item being clicked by the user that can be presented on the page of the application is known (hereinafter referred to as the true probability of the item being clicked by the user), and these probabilities are used to determine the real items recommended to the user.
  • the first information also includes: the user's operation information on the application and the attribute information of the application, and the application is used to provide items for the user.
  • the first processing result is used to determine the probability of the item being clicked by the user.
  • the first to-be-trained model is used to: perform linear operations on the first information. , obtain the second information; perform a linear operation on the first information and the second information to obtain the third information; obtain the first processing result based on the second information and the third information.
  • the first information can be input to the first model to be trained, so that the first model to be trained processes the first information and obtains the first processing result.
  • the first processing result is used to obtain the page of the application.
  • Predicted probabilities of an item being clicked by a user hereinafter referred to as predicted probabilities of an item being clicked by a user
  • these probabilities can be used to determine the (predicted) items to recommend to the user.
  • the processing performed by the first model to be trained includes: performing linear operations on the first information to obtain the second information; performing linear operations on the first information and the second information to obtain the third information; based on the second information and the third information , obtain the first processing result.
  • the first information can also be input to the second model to be trained. model, so that the second to-be-trained model processes the first information and obtains the second processing result.
  • the second to-be-trained model is at least one of the following: multi-layer perceptron, convolutional network, attention network, Squeeze-and- Excitation network and the same model as the first model to be trained. Then, the first processing result and the second processing result are fused through the third model to be trained, and the obtained fused result is the predicted probability of the item being clicked by the user.
  • obtaining the first processing result based on the second information and the third information includes: fusing the second information and the third information to obtain the fourth information; obtaining the first processing result based on the fourth information. result.
  • the i-th interaction unit performs nonlinear operation on the input of the i-th interaction unit and the linear operation result of the i-th interaction unit to obtain the nonlinear operation result of the i-th interaction unit; the i-th interaction unit performs nonlinear operation on the i-th interaction unit
  • the linear operation results of the i interaction unit and the nonlinear operation results of the i-th interaction unit are fused to obtain the output of the i-th interaction unit; among which, the input of the first interaction model is the first information, and the input of the first interaction model is the first information.
  • the linear operation result of is the second information
  • the nonlinear operation result of the first interaction model is the third information
  • the output of the first interaction model is the fourth information
  • the output of the Nth interaction model is the first processing result.
  • processing the first information through the first to-be-trained model to obtain the first processing result also includes: input to the i-th interaction unit through the i-th interaction unit and the i-th interaction unit Perform nonlinear operation on the nonlinear operation result of the i-th interaction unit to obtain the new nonlinear operation result of the i-th interaction unit; use the i-th interaction unit to perform the linear operation result of the i-th interaction unit and the nonlinear operation of the i-th interaction unit The results are fused to obtain the i-th
  • the output of an interaction unit includes: fusing the linear operation result of the i-th interaction unit, the non-linear operation result of the i-th interaction unit and the new non-linear operation result of the i-th interaction unit through the i-th interaction unit, Get the output of the i-th interaction unit.
  • the target loss is used to indicate the difference between the probability of the item being clicked by the user and the true probability of the item being clicked by the user.
  • the predicted probability of the item being clicked by the user and the real probability of the item being clicked can be calculated through the preset first loss function to obtain the first loss, which is used to indicate the item.
  • the first loss can be directly used as the target loss.
  • the preset The second loss function calculates the predicted probability of the item being clicked by the user and the first processing result to obtain the second loss, and calculates the predicted probability of the item being clicked by the user and the second processing result through the preset second loss function , got the third loss.
  • the second loss is used to indicate the difference between the predicted probability that the item is clicked by the user and the first processing result
  • the third loss is used to indicate the difference between the predicted probability that the item is clicked by the user and the second processing result.
  • the target loss can be constructed based on the first loss, the second loss, and the third loss (for example, adding the first loss, the second loss, and the third loss, etc.), so the target loss can be used to indicate that the item was clicked by the user.
  • the parameters of the first model to be trained can be updated based on the target loss constructed only from the first loss, and the next batch of training data can be used to continue to update the parameters after updating the parameters.
  • the first model to be trained is trained until the model training conditions are met (for example, the target loss reaches convergence, etc.), and the first model in the embodiment shown in Figure 4 is obtained.
  • the method can be based on the first loss, the second loss and the third model.
  • the target loss constructed by the loss is to update the parameters of the first model to be trained, the parameters of the second model to be trained, and the parameters of the third model to be trained, and use the next batch of training data to continue to update the parameters of the first model to be trained.
  • the training model, the second model to be trained after updated parameters, and the third model to be trained after updated parameters are trained until the model training conditions are met, corresponding to the first model, the second model and the third model in the embodiment shown in Figure 9.
  • the third model is the target model in the embodiment shown in Figure 9.
  • the first model trained in the embodiment of this application has the ability to predict user behavior. Specifically, after obtaining the first information including the user's attribute information and the item's attribute information, the first information can be input to the first model for processing, thereby obtaining the first processing result, and the first processing result can be used to determine that the item is The probability of a user clicking.
  • the first model first performs a linear operation on the first information to obtain the second information, then performs a nonlinear operation on the first information and the second information to obtain the third information, and finally based on the second information and the third information Three information to obtain the first processing result. It can be seen that the first model implements nonlinear operations on the basis of linear operations, which creates a connection between linear operations and nonlinear operations.
  • the first model can not only realize explicit information between interactions as well as implicit interactions, and also Semi-explicit interaction between information can be achieved, that is to say, during this operation process, the first model can not only notice the relationship between some frequently appearing items and users, but also the relationship between some items that rarely appear and users. relationship, we can also notice the relationship between other items except these two types of items and users. Therefore, the first model can accurately predict the probability that these two types of items are clicked by users, and can also accurately predict the remaining items. The probability of being clicked by the user, thereby improving the overall prediction accuracy of the model.
  • the first model trained in the embodiment of the present application may include N interactive units.
  • Each interactive unit may include a linear layer and multiple nonlinear layers, and there is a series relationship between these N interactive units.
  • Use These N interactive units process the first information and can perform linear operations and nonlinear operations of a certain order of magnitude on the first information.
  • the first processing result obtained is a high-order information (i.e., 2 ⁇ N-order information or K ⁇ N information), based on this information to serve as or determine the final prediction result, that is, the probability of each item being clicked by the user, with high accuracy.
  • first model and the second model in the target model trained in the embodiments of this application can constitute multiple types of model combinations, which is beneficial to the target model providing services for more business scenarios and having higher generalization performance.
  • embodiments of the present application provide a new model training method, which can not only calculate the overall loss for the model to be trained, but also calculate the corresponding losses for different branch models in the model to be trained, so that based on these losses, there are Targetedly guide the parameters of different branches in the model to be updated, thereby improving the performance of the trained neural network model.
  • Figure 12 is a schematic structural diagram of an item recommendation device provided by an embodiment of the present application. As shown in Figure 12, the device includes:
  • the acquisition module 1201 is used to acquire first information, where the first information includes the user's attribute information and the project's attribute information;
  • the first processing module 1202 is used to process the first information through the first model to obtain the first processing result.
  • the first processing result is used to determine the items recommended to the user.
  • the first model is used to: process the first information Perform linear operation to obtain the second information; perform nonlinear operation on the second information to obtain the third information; obtain the first processing result based on the third information.
  • the first information after obtaining the first information including the user's attribute information and the project's attribute information, the first information can be input to the first model for processing, thereby obtaining the first processing result, which can be used for Determine the probability of an item being clicked by the user.
  • the first model first performs a linear operation on the first information to obtain the second information, then performs a nonlinear operation on the first information and the second information to obtain the third information, and finally based on the second information and the third information Three information to obtain the first processing result. It can be seen that the first model implements nonlinear operations on the basis of linear operations, which creates a connection between linear operations and nonlinear operations.
  • the first model can not only realize explicit information between Interaction and implicit interaction can also realize semi-explicit interaction between information. That is to say, during this operation process, the first model can not only notice the relationship between some frequently appearing items and users as well as some that are almost never The relationship between the items that appear and the user can also be noted, except for these two types of items, the relationship between the remaining items and the user. Therefore, the first model can accurately predict the probability of the two types of items being clicked by the user. It can also accurately predict the probability that the remaining items will be clicked by the user, thus improving the overall prediction accuracy of the model.
  • the first model is used to: perform linear operations on the first information to obtain the second information; perform nonlinear operations on the first information and the second information to obtain the third information; perform a linear operation on the second information.
  • the information and the third information are fused to obtain the fourth information; based on the fourth information, the first processing result is obtained.
  • the device further includes: a second processing module, configured to process the first information through a second model to obtain a second processing result, and the second model is at least one of the following: multi-layer perception machine, convolutional network, attention force network, Squeeze-and-Excitation network and the same model as the first model; the third processing module is used to fuse the first processing result and the second processing result through the third model, and the fused result is used for Determine which items are recommended to users.
  • a second processing module configured to process the first information through a second model to obtain a second processing result
  • the second model is at least one of the following: multi-layer perception machine, convolutional network, attention force network, Squeeze-and-Excitation network and the same model as the first model
  • the third processing module is used to fuse the first processing result and the second processing result through the third model, and the fused result is used for Determine which items are recommended to users.
  • the first processing module is used to: perform linear operation on the input of the i-th interaction unit through the i-th interaction unit, and obtain the linear operation result of the i-th interaction unit; perform linear operation on the input of the i-th interaction unit through the i-th interaction unit.
  • the input and the linear operation result of the i-th interaction unit are subjected to non-linear operation to obtain the non-linear operation result of the i-th interaction unit; the linear operation result of the i-th interaction unit and the i-th interaction unit are processed through the i-th interaction unit
  • the nonlinear operation results are fused to obtain the output of the i-th interaction unit; among them, the input of the first interaction unit is the first information, the linear operation result of the first interaction model is the second information, and the The nonlinear operation result of is the third information, the output of the first interaction model is the fourth information, and the output of the Nth interaction model is the first processing result.
  • the first processing module is also used to perform nonlinear operations on the input of the i-th interaction unit and the non-linear operation result of the i-th interaction unit through the i-th interaction unit to obtain the i-th interaction unit.
  • the new nonlinear operation result of the i-th interaction unit; the first processing module is used to process the linear operation result of the i-th interaction unit, the nonlinear operation result of the i-th interaction unit and the i-th interaction through the i-th interaction unit
  • the new nonlinear operation results of the units are fused to obtain the output of the i-th interactive unit.
  • the first information also includes: the user's operation information on the application and the attribute information of the application, and the application is used to provide items for the user.
  • Figure 13 is a schematic structural diagram of a model training device provided by an embodiment of the present application. As shown in Figure 13, the device includes:
  • the first acquisition module 1301 is used to acquire the first information, which includes the user's attribute information and the project's attribute information;
  • the first processing module 1302 is used to process the first information through the first to-be-trained model to obtain a first processing result.
  • the first processing result is used to determine the probability that the item is clicked by the user.
  • the probability that the item is clicked by the user is used to determine
  • the first to-be-trained model is used to: perform linear operations on the first information to obtain the second information; perform linear operations on the second information to obtain the third information; and obtain the first processing result based on the third information. ;
  • the second acquisition module 1303 is used to obtain the target loss based on the probability of the item being clicked by the user and the real probability of the item being clicked by the user.
  • the target loss is used to indicate the difference between the probability of the item being clicked by the user and the real probability of the item being clicked by the user. difference;
  • the update module 1304 is used to update the parameters of the first model to be trained based on the target loss until the model training conditions are met to obtain the first model.
  • the first model trained in the embodiment of this application has the ability to predict user behavior. Specifically, after obtaining the first information including the user's attribute information and the item's attribute information, the first information can be input to the first model for processing, thereby obtaining the first processing result, and the first processing result can be used to determine that the item is The probability of a user clicking.
  • the first model first performs a linear operation on the first information to obtain the second information, then performs a nonlinear operation on the first information and the second information to obtain the third information, and finally based on the second information and the third information Three information to obtain the first processing result. It can be seen that the first model implements nonlinear operations on the basis of linear operations, causing a gap between linear operations and nonlinear operations.
  • the first model can not only realize explicit interaction and implicit interaction between information, but also realize semi-explicit interaction between information. That is to say, during this operation process, The first model can not only notice the relationship between some frequently appearing items and users and the relationship between some items that rarely appear and users, but also the relationship between other items and users except these two types of items. relationship, so the first model can accurately predict the probability that these two types of items are clicked by the user, and can also accurately predict the probability of the remaining items being clicked by the user, thereby improving the overall prediction accuracy of the model.
  • the device further includes: a second processing module, configured to process the first information through a second model to be trained to obtain a second processing result, and the second model to be trained is at least one of the following : Multi-layer perceptron, convolutional network, attention network, Squeeze-and-Excitation network and the same model as the first model to be trained; the third processing module is used to process the first processing result through the third model to be trained and The second processing results are fused, and the fused result is the probability of the item being clicked by the user.
  • a second processing module configured to process the first information through a second model to be trained to obtain a second processing result
  • the second model to be trained is at least one of the following : Multi-layer perceptron, convolutional network, attention network, Squeeze-and-Excitation network and the same model as the first model to be trained
  • the third processing module is used to process the first processing result through the third model to be trained and The second processing results are fused, and the fused result is the probability of the item being
  • the second acquisition module is used to obtain the target loss based on the probability of the item being clicked by the user, the real probability of the item being clicked by the user, the first processing result and the second processing result, and the target loss is used for Indicates the difference between the probability of the item being clicked by the user and the true probability of the item being clicked by the user, the difference between the first processing result and the probability of the item being clicked by the user, the difference between the second processing result and the probability of the item being clicked by the user Difference; update module, used to update the parameters of the first model to be trained, the parameters of the second model to be trained, and the parameters of the third model to be trained based on the target loss, until the model training conditions are met, corresponding to the first model, The second model and the third model.
  • the first model to be trained is used to: fuse the second information and the third information to obtain the fourth information; and obtain the first processing result based on the fourth information.
  • the input of the interaction unit and the linear operation result of the i-th interaction unit are subjected to non-linear operation to obtain the non-linear operation result of the i-th interaction unit; the linear operation result of the i-th interaction unit and the i-th interaction unit are processed through the i-th interaction unit
  • the nonlinear operation results of the first interaction unit are fused to obtain the output of the i-th interaction unit; among them, the input of the first interaction model is the first information, the linear operation result of the first interaction model is the second information, and the first
  • the nonlinear operation results of the first interaction model are the third information, the output of the first interaction model is the fourth information, and the output of the Nth interaction model is the first processing result.
  • the first processing module 1302 is also configured to: perform nonlinear operation on the input of the ith interaction unit and the nonlinear operation result of the ith interaction unit through the ith interaction unit, to obtain The new nonlinear operation result of the i-th interaction unit; the first processing module 1302 is used to use the i-th interaction unit to process the linear operation result of the i-th interaction unit, the nonlinear operation result of the i-th interaction unit and the The new nonlinear operation results of the i interactive units are fused to obtain the output of the i-th interactive unit.
  • the first information also includes: the user's operation information on the application and the attribute information of the application, and the application is used to provide items for the user.
  • FIG. 14 is a schematic structural diagram of the execution device provided by the embodiment of the present application.
  • the execution device 1400 can be embodied as a mobile phone, a tablet, a laptop, a smart wearable device, a server, etc., and is not limited here.
  • the project recommendation device described in the corresponding embodiment of FIG. 12 may be deployed on the execution device 1400 to implement the project recommendation function in the corresponding embodiment of FIG. 4 or FIG. 9 .
  • the execution device 1400 includes: a receiver 1401, a transmitter 1402, a processor 1403 and a memory 1404 (the number of processors 1403 in the execution device 1400 can be one or more, one processor is taken as an example in Figure 14) , wherein the processor 1403 may include an application processor 14031 and a communication processor 14032.
  • the receiver 1401, the transmitter 1402, the processor 1403, and the memory 1404 may be connected by a bus or other means.
  • Memory 1404 may include read-only memory and random access memory and provides instructions and data to processor 1403 .
  • a portion of memory 1404 may also include non-volatile random access memory (NVRAM).
  • NVRAM non-volatile random access memory
  • the memory 1404 stores processor and operating instructions, executable modules or data structures, or a subset thereof, or an extended set thereof, where the operating instructions may include various operating instructions for implementing various operations.
  • the processor 1403 controls the execution of operations of the device.
  • various components of the execution device are coupled together through a bus system.
  • the bus system may also include a power bus, a control bus, a status signal bus, etc.
  • various buses are called bus systems in the figure.
  • the methods disclosed in the above embodiments of the present application can be applied to the processor 1403 or implemented by the processor 1403.
  • the processor 1403 may be an integrated circuit chip with signal processing capabilities. During the implementation process, each step of the above method can be completed by instructions in the form of hardware integrated logic circuits or software in the processor 1403 .
  • the above-mentioned processor 1403 can be a general-purpose processor, a digital signal processor (DSP), a microprocessor or a microcontroller, and can further include an application specific integrated circuit (ASIC), a field programmable Gate array (field-programmable gate array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • DSP digital signal processor
  • ASIC application specific integrated circuit
  • FPGA field-programmable gate array
  • the processor 1403 can implement or execute each method, step and logical block diagram disclosed in the embodiment of this application.
  • a general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
  • the steps of the method disclosed in conjunction with the embodiments of the present application can be directly implemented by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other mature storage media in this field.
  • the storage medium is located in the memory 1404.
  • the processor 1403 reads the information in the memory 1404 and completes the steps of the above method in combination with its hardware.
  • the receiver 1401 may be configured to receive input numeric or character information and generate signal inputs related to performing relevant settings and functional controls of the device.
  • the transmitter 1402 can be used to output numeric or character information through the first interface; the transmitter 1402 can also be used to send instructions to the disk group through the first interface to modify the data in the disk group; the transmitter 1402 can also include a display device such as a display screen .
  • the processor 1403 is configured to recommend items for information associated with the user through the first model in the corresponding embodiment of FIG. 4 or the target model in the corresponding embodiment of FIG. 9 .
  • FIG. 15 is a schematic structural diagram of the training device provided by the embodiment of the present application.
  • the training device 1500 is implemented by one or more servers.
  • the training device 1500 may vary greatly due to different configurations or performance, and may include one or more central processing units (CPUs) 1514. (e.g., one or more processors) and memory 1532, one or more storage applications Storage medium 1530 (eg, one or more mass storage devices) using programs 1542 or data 1544.
  • the memory 1532 and the storage medium 1530 may be short-term storage or persistent storage.
  • the program stored in the storage medium 1530 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the training device. Furthermore, the central processor 1514 may be configured to communicate with the storage medium 1530 and execute a series of instruction operations in the storage medium 1530 on the training device 1500 .
  • the training device 1500 may also include one or more power supplies 1526, one or more wired or wireless network interfaces 1550, one or more input and output interfaces 1558; or, one or more operating systems 1541, such as Windows ServerTM, Mac OS XTM , UnixTM, LinuxTM, FreeBSDTM and so on.
  • operating systems 1541 such as Windows ServerTM, Mac OS XTM , UnixTM, LinuxTM, FreeBSDTM and so on.
  • the training device can execute the model training method in the corresponding embodiment of Figure 11.
  • Embodiments of the present application also relate to a computer storage medium.
  • the computer-readable storage medium stores a program for performing signal processing.
  • the program When the program is run on a computer, it causes the computer to perform the steps performed by the aforementioned execution device, or, The computer is caused to perform the steps performed by the aforementioned training device.
  • Embodiments of the present application also relate to a computer program product that stores instructions that, when executed by a computer, cause the computer to perform the steps performed by the foregoing execution device, or cause the computer to perform the steps performed by the foregoing training device. A step of.
  • the execution device, training device or terminal device provided by the embodiment of the present application may specifically be a chip.
  • the chip includes: a processing unit and a communication unit.
  • the processing unit may be, for example, a processor.
  • the communication unit may be, for example, an input/output interface. Pins or circuits, etc.
  • the processing unit can execute the computer execution instructions stored in the storage unit, so that the chip in the execution device executes the data processing method described in the above embodiment, or so that the chip in the training device executes the data processing method described in the above embodiment.
  • the storage unit is a storage unit within the chip, such as a register, cache, etc.
  • the storage unit may also be a storage unit located outside the chip in the wireless access device, such as Read-only memory (ROM) or other types of static storage devices that can store static information and instructions, random access memory (random access memory, RAM), etc.
  • ROM Read-only memory
  • RAM random access memory
  • Figure 16 is a schematic structural diagram of a chip provided by an embodiment of the present application.
  • the chip can be represented as a neural network processor NPU 1600.
  • the NPU 1600 serves as a co-processor and is mounted to the host CPU (Host CPU). ), tasks are allocated by the Host CPU.
  • the core part of the NPU is the arithmetic circuit 1603.
  • the arithmetic circuit 1603 is controlled by the controller 1604 to extract the matrix data in the memory and perform multiplication operations.
  • the computing circuit 1603 includes multiple processing units (Process Engine, PE).
  • arithmetic circuit 1603 is a two-dimensional systolic array.
  • the arithmetic circuit 1603 may also be a one-dimensional systolic array or other electronic circuit capable of performing mathematical operations such as multiplication and addition.
  • arithmetic circuit 1603 is a general-purpose matrix processor.
  • the arithmetic circuit obtains the corresponding data of matrix B from the weight memory 1602 and caches it on each PE in the arithmetic circuit.
  • the operation circuit takes matrix A data and matrix B from the input memory 1601 to perform matrix operations, and the partial result or final result of the matrix is stored in an accumulator (accumulator) 1608 .
  • the unified memory 1606 is used to store input data and output data.
  • the weight data directly passes through the storage unit access controller (Direct Memory Access Controller, DMAC) 1605, and the DMAC is transferred to the weight memory 1602.
  • Input data is also transferred to unified memory 1606 via DMAC.
  • DMAC Direct Memory Access Controller
  • BIU is the Bus Interface Unit, that is, the bus interface unit 1613, which is used for the interaction between the AXI bus and the DMAC and the Instruction Fetch Buffer (IFB) 1609.
  • IFB Instruction Fetch Buffer
  • the bus interface unit 1613 (Bus Interface Unit, BIU for short) is used to fetch the memory 1609 to obtain instructions from the external memory, and is also used for the storage unit access controller 1605 to obtain the original data of the input matrix A or the weight matrix B from the external memory.
  • BIU Bus Interface Unit
  • DMAC is mainly used to transfer the input data in the external memory DDR to the unified memory 1606 or the weight data to the weight memory 1602 or the input data to the input memory 1601 .
  • the vector calculation unit 1607 includes multiple arithmetic processing units, and if necessary, further processes the output of the arithmetic circuit 1603, such as vector multiplication, vector addition, exponential operation, logarithmic operation, size comparison, etc. It is mainly used for non-convolutional/fully connected layer network calculations in neural networks, such as Batch Normalization, pixel-level summation, upsampling of predicted label planes, etc.
  • vector calculation unit 1607 can store the processed output vectors to unified memory 1606 .
  • the vector calculation unit 1607 can apply a linear function; or a nonlinear function to the output of the operation circuit 1603, such as linear interpolation on the prediction label plane extracted by the convolution layer, or a vector of accumulated values, to generate an activation value.
  • vector calculation unit 1607 generates normalized values, pixel-wise summed values, or both.
  • the processed output vector can be used as an activation input to the arithmetic circuit 1603, such as for use in a subsequent layer in a neural network.
  • the instruction fetch buffer 1609 connected to the controller 1604 is used to store instructions used by the controller 1604;
  • the unified memory 1606, the input memory 1601, the weight memory 1602 and the fetch memory 1609 are all On-Chip memories. External memory is private to the NPU hardware architecture.
  • the processor mentioned in any of the above places can be a general central processing unit, a microprocessor, an ASIC, or one or more integrated circuits used to control the execution of the above programs.
  • the device embodiments described above are only illustrative.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physically separate.
  • the physical unit can be located in one place, or it can be distributed across multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • the connection relationship between modules indicates that there are communication connections between them, which can be specifically implemented as one or more communication buses or signal lines.
  • the present application can be implemented by software plus necessary general hardware. Of course, it can also be implemented by dedicated hardware including dedicated integrated circuits, dedicated CPUs, dedicated memories, Special components, etc. to achieve. In general, all functions performed by computer programs can be easily implemented with corresponding hardware. Moreover, the specific hardware structures used to implement the same function can also be diverse, such as analog circuits, digital circuits or special-purpose circuits. circuit etc. However, for this application, software program implementation is a better implementation in most cases. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence or that contributes to the existing technology.
  • the computer software product is stored in a readable storage medium, such as a computer floppy disk. , U disk, mobile hard disk, ROM, RAM, magnetic disk or optical disk, etc., including several instructions to cause a computer device (which can be a personal computer, training device, or network device, etc.) to execute the steps described in various embodiments of this application. method.
  • a computer device which can be a personal computer, training device, or network device, etc.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, the computer instructions may be transferred from a website, computer, training device, or data
  • the center transmits to another website site, computer, training equipment or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) means.
  • wired such as coaxial cable, optical fiber, digital subscriber line (DSL)
  • wireless such as infrared, wireless, microwave, etc.
  • the computer-readable storage medium may be any available medium that a computer can store, or a data storage device such as a training device or a data center integrated with one or more available media.
  • the available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, DVD), or semiconductor media (eg, solid state disk (Solid State Disk, SSD)), etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Databases & Information Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Biophysics (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Biomedical Technology (AREA)
  • Artificial Intelligence (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

本申请公开了一种项目推荐方法及其相关设备,既可准确预测一些频繁出现的项目以及一些几乎未曾出现的项目被用户点击之间的概率,还可准确预测除这两类项目之外的其余项目被用户点击的概率,从而提高模型的整体预测精度。本申请的方法包括:获取第一信息,第一信息包含用户的属性信息以及项目的属性信息;通过第一模型对第一信息进行处理,得到第一处理结果,第一处理结果用于确定推荐给用户的项目,第一模型用于:对第一信息进行线性运算,得到第二信息;对第二信息进行非线性运算,得到第三信息;基于第三信息,获取第一处理结果。

Description

一种项目推荐方法及其相关设备
本申请要求于2022年6月8日提交中国专利局、申请号为202210641372.7、发明名称为“一种项目推荐方法及其相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及人工智能(artificial intelligence,AI)技术领域,尤其涉及一种项目推荐方法及其相关设备。
背景技术
随着计算机技术的快速发展,为了满足用户的上网需求,开发商越来越倾向于在应用的页面上展现用户感兴趣的内容。基于此,针对于某个应用的页面,往往需要预测用户会点击该页面上所展示的哪个或哪些项目(item),即预测用户针对该页面的行为,进而修改该页面上所需呈现的项目,以为用户推荐其感兴趣的项目。
目前,可利用AI技术的神经网络模型来预测应用页面上的项目被用户点击的概率。具体地,相关技术提供的神经网络模型可包含两个分支,可将第一个分支称为第一模型,将第二个分支称为第二模型,第一模型可对输入的信息(包含用户的属性信息以及项目的属性信息等等)进行线性运算,第二模型可对输入的信息进行非线性运算,基于这两个模型运算的结果,可得到各个项目被用户点击的概率,故可将概率较大的项目确定为推荐给用户的项目。
然而,第一模型在线性运算的过程中,主要注意到一些频繁出现的项目与用户之间的关系,第二模型在非线性运算的过程中,主要注意到一些几乎未曾出现的项目与用户之间的关系,忽略了这两类项目之外的其余项目与用户之间的关系,虽然神经网络模型能够较为准确预测地这两类项目被用户点击的概率,但无法准确地预测其余项目被用户点击的概率,以致于神经网络模型的整体预测精度不高。
发明内容
本申请实施例提供了一种项目推荐方法及其相关设备,既可准确预测一些频繁出现的项目以及一些几乎未曾出现的项目被用户点击之间的概率,还可准确预测除这两类项目之外的其余项目被用户点击的概率,从而提高模型的整体预测精度。
本申请实施例的第一方面提供了一种项目推荐方法,该方法包括:
当用户在使用某个应用时,为了预测用户在该应用的页面上的行为,可先获取与用户相关联的第一信息,第一信息至少包含用户的属性信息以及该应用的页面上可呈现的项目的属性信息,其中,用户的属性信息可包含用户的姓名、年龄、性别以及工作等信息,项目的属性信息可包含项目的名称、类型、功能以及价格等信息。
得到第一信息后,可获取第一模型(已训练好的神经网络模型),并将第一信息输入至第一模型,以使得第一模型对第一信息进行处理,得到第一处理结果,第一处理结果可用于获取该应用的页面上可呈现的项目被用户点击的概率,而这些概率可用于确定推荐给用户的项 目(例如,在该应用的页面上可呈现的项目中,将概率较大的项目确定为推荐给用户的项目)。其中,第一模型处理第一信息的过程包括:首先,第一模型对第一信息进行线性运算,得到第二信息。然后,第一模型对第二信息进行非线性运算,得到第三信息。最后,第一模型基于第三信息,获取第一处理结果。
需要说明的是,此处所涉及的线性运算,通常指仅包含加法以及数量乘法的运算,例如,y=wx+b,其中,x为输入的信息(向量),y为计算后的信息,w为权重,b为常数。此处所涉及的非线性运算,通常指在线性运算的基础上,添加非线性激活函数的运算,非线性激活函数的函数特点是在函数空间上存在不连续可导的点。例如,常见的非线性激活函数有ReLu,Sigmoid,tanh等等。
从上述方法可以看出:在获取包含用户的属性信息以及项目的属性信息的第一信息后,可将第一信息输入至第一模型进行处理,从而得到第一处理结果,第一处理结果可用于确定项目被用户点击的概率。在处理第一信息时,第一模型先对第一信息进行线性运算,得到第二信息,再对第一信息和第二信息进行非线性运算,得到第三信息,最后基于第二信息以及第三信息,获取第一处理结果。由此可见,第一模型在线性运算的基础上实现了非线性运算,令线性运算和非线性运算之间产生了联系,在这个运算过程中,第一模型不仅可实现信息之间的显式交互以及隐式交互,还可实现信息之间的半显式交互,也就是说,在这个运算过程中,第一模型不仅可以注意到一些频繁出现的项目与用户之间的关系以及一些几乎未曾出现的项目与用户之间的关系,还可注意到除这两类项目之外的其余项目与用户之间的关系,故第一模型既可准确地预测这两类项目被用户点击的概率,也可准确地预测其余项目被用户点击的概率,从而提高模型的整体预测精度。
在一种可能的实现方式中,第一模型用于:对第一信息进行线性运算,得到第二信息;对第一信息和第二信息进行非线性运算,得到第三信息;对第二信息以及第三信息进行融合,得到第四信息;基于第四信息,获取第一处理结果。前述实现方式中,设第一模型中仅包含一个交互单元,该交互单元可包含一个线性层、一个非线性层以及一个融合层,其中,线性层的输入端即为该交互单元的输入端,非线性层的第一输入端即为该交互单元的输入端,线性层的第一输出端与非线性层的第二输入端连接,线性层的第二输出端与融合层的输入端连接,非线性层的输出端与融合层的输入端连接,融合层的输出端即为该交互单元的输出端。那么,将第一信息输入至第一模型中的该交互单元,该交互单元中的线性层和该交互单元中的非线性层均可接收到第一信息。接着,线性层可对第一信息进行线性运算,得到线性层的线性运算结果(即前述的第二信息),并将线性层的线性运算结果输入至非线性层以及融合层。然后,非线性层可对第一信息以及线性层的线性运算结果进行非线性运算,得到非线性层的非线性运算结果(即前述的第三信息),并将非线性层的非线性运算结果输入至融合层。最后,融合层可将线性层的线性运算结果以及非线性层的非线性运算结果进行融合,融合结果(即前述的第四信息)可直接作为该交互单元的输出,也就是第一模型的输出,即第一模型针对第一信息的第一处理结果。
在一种可能的实现方式中,该方法还包括:通过第二模型对第一信息进行处理,得到第二处理结果,第二模型为以下至少一种:多层感知机、卷积网络、注意力网络、Squeeze-and-Excitation网络以及与第一模型相同的模型;通过第三模型对第一处理结果以及第二处 理结果进行融合,得到的融合后的结果用于确定推荐给用户的项目。前述实现方式提供了一个目标模型,目标模型包含第一模型、第二模型以及第三模型,这三个模型均为已训练的神经网络模型。其中,第一模型和第二模型作为并行的两个分支,且第一模型的输出端和第二模型的输出端均和第三模型的输入端连接,第一模型的输入端和第二模型输入端可用于接收第一信息,第三模型的输出端可输出该应用的页面上可呈现的项目被用户点击的概率。那么,在将第一信息输入至第一模型的同时,还可将第一信息输入至第二模型,以使得第二模型对第一信息进行处理,得到第二处理结果。第一模型得到第一处理结果以及第二模型得到第二处理结果后,第一模型可将第一处理结果发送至第三模型,第二模型可将第二处理结果发送至第三模型,以使得第三模型将第一处理结果和第二处理结果进行融合,得到的融合后的结果即为该应用的页面上可呈现的项目被用户点击的概率,故这些概率可用于确定推荐给用户的项目(例如,在该应用的页面上可呈现的项目中,将概率较大的项目确定为推荐给用户的项目)。由于第二模型可以为多层感知机、卷积网络、注意力网络、Squeeze-and-Excitation网络以及与第一模型相同的模型中的至少一种,故目标模型中的第一模型和第二模型可构成多种类型的模型组合,有利于目标模型为更多业务场景提供服务,具备较高的泛化性能。
在一种可能的实现方式中,第一模型包含N个交互单元,第i个交互单元的输入为第i-1个交互单元的输出,N≥1,i=1,...,N,通过第一模型对第一信息进行处理,得到第一处理结果包括:通过第i个交互单元对第i个交互单元的输入进行线性运算,得到第i个交互单元的线性运算结果;通过第i个交互单元对第i个交互单元的输入以及第i个交互单元的线性运算结果进行非线性运算,得到第i个交互单元的非线性运算结果;通过第i个交互单元对第i个交互单元的线性运算结果以及第i个交互单元的非线性运算结果进行融合,得到第i个交互单元的输出;其中,第1个交互单元的输入为第一信息,第1个交互模型的线性运算结果为第二信息,第1个交互模型的非线性运算结果为第三信息,第1个交互模型的输出为第四信息,第N个交互模型的输出为第一处理结果。前述实现方式中,设第一模型中包含串联的N个交互单元,对于这N个交互单元中的任意一个交互单元而言,即对于第i个交互单元而言(i=1,...,N),第i个交互单元可包含一个线性层、一个非线性层以及一个融合层,其中,第i个交互单元的线性层的输入端即为第i个交互单元的输入端,第i个交互单元的非线性层的第一输入端即为第i个交互单元的输入端,第i个交互单元的线性层的第一输出端与第i个交互单元的非线性层的第二输入端连接,第i个交互单元的线性层的第二输出端与第i个交互单元的融合层的输入端连接,第i个交互单元的非线性层的输出端与第i个交互单元的融合层的输入端连接,第i个交互单元的融合层的输出端即为第i个交互单元的输出端。对于除第i个交互单元之外的其余交互单元而言,其余交互单元内部的结构也是如此,此处不再赘述。那么,第i个交互单元接收到第i个交互单元的输入(即第i-1个交互单元的输出)后,可对第i个交互单元的输入执行以下操作:第i个交互单元的线性层可对第i个交互单元的输入进行线性运算,得到第i个交互单元的线性层的线性运算结果,并将第i个交互单元的线性层的线性运算结果输入至第i个交互单元的非线性层以及第i个交互单元的融合层。然后,第i个交互单元的非线性层可对第i个交互单元的输入以及第i个交互单元的线性层的线性运算结果进行非线性运算,得到第i个交互单元的非线性层的非线性运算结果,并将第i个交互单元的非线性层的非线性运算结果输入至第i个交互单元的融合层。 随后,第i个交互单元的融合层可将第i个交互单元的线性层的线性运算结果以及第i个交互单元的非线性层的非线性运算结果进行融合,第i个交互单元的融合层的融合结果可直接作为第i个交互单元的输出,并输入至第i+1个交互单元。需要说明的是,第1个交互单元的输入为第一信息,第N个交互单元的输出为第一处理结果。由此可见,第一模型中可包含N个交互单元,每个交互单元可包含一个线性层和一个非线性层,且这N个交互单元之间呈串联关系,使用这N个交互单元对第一信息进行处理,可对第一信息实现一定数量级次数的线性运算和非线性运算,所得到的第一处理结果为一个高阶的信息(即2^N阶的信息),基于此信息来作为或确定最终的预测结果,即各个项目被用户点击的概率,具备较高的准确度。
在一种可能的实现方式中,通过第一模型对第一信息进行处理,得到第一处理结果还包括:通过第i个交互单元对第i个交互单元的输入以及第i个交互单元的非线性运算结果进行非线性运算,得到第i个交互单元的新的非线性运算结果;通过第i个交互单元对第i个交互单元的线性运算结果以及第i个交互单元的非线性运算结果进行融合,得到第i个交互单元的输出包括:通过第i个交互单元对第i个交互单元的线性运算结果、第i个交互单元的非线性运算结果以及第i个交互单元的新的非线性运算结果进行融合,得到第i个交互单元的输出。前述实现方式中,设第一模型中包含串联的N个交互单元,对于这N个交互单元中的任意一个交互单元而言,即对于第i个交互单元而言(i=1,...,N),第i个交互单元可包含一个线性层、K-1个非线性层(K为大于或等于3的正整数)以及一个融合层,其中,第i个交互单元的线性层的输入端即为第i个交互单元的输入端,第i个交互单元的K-1个非线性层的第一输入端均为第i个交互单元的输入端,第i个交互单元的线性层的第一输出端与第i个交互单元的第1个非线性层的第二输入端连接,第i个交互单元的第1个非线性层的第一输出端与第i个交互单元的第2个非线性层的第二输入端连接,...,第i个交互单元的第K-2个非线性层的第一输出端与第i个交互单元的第K-1个非线性层的第二输入端连接,第i个交互单元的线性层的第二输出端与第i个交互单元的融合层的输入端连接,第i个交互单元的K-1个非线性层的第二输出端均与第i个交互单元的融合层的输入端连接,第i个交互单元的融合层的输出端即为第i个交互单元的输出端。对于除第i个交互单元之外的其余交互单元而言,其余交互单元内部的结构也是如此,此处不再赘述。那么,第i个交互单元接收到第i个交互单元的输入(即第i-1个交互单元的输出)后,可对第i个交互单元的输入执行以下操作:第i个交互单元的线性层可对第i个交互单元的输入进行线性运算,得到第i个交互单元的线性层的线性运算结果,并将第i个交互单元的线性层的线性运算结果输入至第i个交互单元的第1个非线性层以及第i个交互单元的融合层。然后,第i个交互单元的第1个非线性层可对第i个交互单元的输入以及第i个交互单元的线性层的线性运算结果进行非线性运算,得到第i个交互单元的第1个非线性层的非线性运算结果,并将第i个交互单元的第1个非线性层的非线性运算结果输入至第i个交互单元的第2个非线性层以及融合层。随后,第i个交互单元的第2个非线性层可对第i个交互单元的输入以及第i个交互单元的第1个非线性层的非线性运算结果进行非线性运算,得到第i个交互单元的第2个非线性层的非线性运算结果,并将第i个交互单元的第2个非线性层的非线性运算结果输入至第i个交互单元的第3个非线性层以及融合层,...,第i个交互单元的第K-1个非线性层可对第i个交互单元的输入以及第i个交互单元的第K-2个非线性层的非线性运算结果进 行非线性运算,得到第i个交互单元的第K-1个非线性层的非线性运算结果,并将第i个交互单元的第K-1个非线性层的非线性运算结果输入至第i个交互单元的融合层。随后,第i个交互单元的融合层可将第i个交互单元的线性层的线性运算结果以及第i个交互单元的K-1个非线性层的非线性运算结果进行融合,第i个交互单元的融合层的融合结果可直接作为第i个交互单元的输出,并输入至第i+1个交互单元。需要说明的是,第1个交互单元的输入为第一信息,第N个交互单元的输出为第一处理结果。由此可见,第一模型中可包含N个交互单元,每个交互单元可包含一个线性层和多个非线性层,且这N个交互单元之间呈串联关系,使用这N个交互单元对第一信息进行处理,可对第一信息实现一定数量级次数的线性运算和非线性运算,所得到的第一处理结果为一个高阶的信息(即K^N阶的信息),基于此信息来作为或确定最终的预测结果,即各个项目被用户点击的概率,具备较高的准确度。
在一种可能的实现方式中,第一信息还包含:用户对应用的操作信息以及应用的属性信息,应用用于为用户提供项目。
本申请实施例的第二方面提供了一种模型训练方法,该方法包括:获取第一信息,第一信息包含用户的属性信息以及项目的属性信息;通过第一待训练模型对第一信息进行处理,得到第一处理结果,第一处理结果用于确定项目被用户点击的概率,项目被用户点击的概率用于确定推荐给用户的项目,第一待训练模型用于:对第一信息进行线性运算,得到第二信息;对第二信息进行线性运算,得到第三信息;基于第三信息,获取第一处理结果;基于项目被用户点击的概率以及项目被用户点击的真实概率,获取目标损失,目标损失用于指示项目被用户点击的概率以及项目被用户点击的真实概率之间的差异;基于目标损失,对第一待训练模型的参数进行更新,直至满足模型训练条件,得到第一模型。
上述方法训练得到的第一模型,具备对用户行为进行预测的能力。具体地,在获取包含用户的属性信息以及项目的属性信息的第一信息后,可将第一信息输入至第一模型进行处理,从而得到第一处理结果,第一处理结果可用于确定项目被用户点击的概率。在处理第一信息时,第一模型先对第一信息进行线性运算,得到第二信息,再对第一信息和第二信息进行非线性运算,得到第三信息,最后基于第二信息以及第三信息,获取第一处理结果。由此可见,第一模型在线性运算的基础上实现了非线性运算,令线性运算和非线性运算之间产生了联系,在这个运算过程中,第一模型不仅可实现信息之间的显式交互以及隐式交互,还可实现信息之间的半显式交互,也就是说,在这个运算过程中,第一模型不仅可以注意到一些频繁出现的项目与用户之间的关系以及一些几乎未曾出现的项目与用户之间的关系,还可注意到除这两类项目之外的其余项目与用户之间的关系,故第一模型既可准确地预测这两类项目被用户点击的概率,也可准确地预测其余项目被用户点击的概率,从而提高模型的整体预测精度。
在一种可能的实现方式中,基于第二信息以及第三信息,获取第一处理结果包括:对第二信息以及第三信息进行融合,得到第四信息;基于第四信息,获取第一处理结果。
在一种可能的实现方式中,该方法还包括:通过第二待训练模型对第一信息进行处理,得到第二处理结果,第二待训练模型为以下至少一种:多层感知机、卷积网络、注意力网络、Squeeze-and-Excitation网络以及与第一待训练模型相同的模型;通过第三待训练模型对第一处理结果以及第二处理结果进行融合,得到的融合后的结果为项目被用户点击的概率。
在一种可能的实现方式中,基于项目被用户点击的概率以及项目被用户点击的真实概率, 获取目标损失,目标损失用于指示项目被用户点击的概率以及项目被用户点击的真实概率之间的差异包括:基于项目被用户点击的概率、项目被用户点击的真实概率、第一处理结果以及第二处理结果,获取目标损失,目标损失用于指示项目被用户点击的概率以及项目被用户点击的真实概率之间的差异,第一处理结果与项目被用户点击的概率之间的差异,第二处理结果与项目被用户点击的概率之间的差异;基于目标损失,对第一待训练模型的参数进行更新,直至满足模型训练条件,得到第一模型包括:基于目标损失,对第一待训练模型的参数、第二待训练模型的参数以及第三待训练模型的参数进行更新,直至满足模型训练条件,对应得到第一模型、第二模型以及第三模型。前述实现方式提供了一种新的模型训练方式,不仅可针对待训练模型计算整体的损失,还可针对待训练模型中的不同分支模型计算相应的损失,从而基于这些损失,有针对性地指导模型中不同分支的参数进行更新,从而提高训练得到的神经网络模型的性能。
在一种可能的实现方式中,第一待训练模型包含N个交互单元,第i个交互单元的输入为第i-1个交互单元的输出,N≥1,i=1,...,N,通过第一待训练模型对第一信息进行处理,得到第一处理结果包括:通过第i个交互单元对第i个交互单元的输入进行线性运算,得到第i个交互单元的线性运算结果;通过第i个交互单元对第i个交互单元的输入以及第i个交互单元的线性运算结果进行非线性运算,得到第i个交互单元的非线性运算结果;通过第i个交互单元对第i个交互单元的线性运算结果以及第i个交互单元的非线性运算结果进行融合,得到第i个交互单元的输出;其中,第1个交互模型的输入为第一信息,第1个交互模型的线性运算结果为第二信息,第1个交互模型的非线性运算结果为第三信息,第1个交互模型的输出为第四信息,第N个交互模型的输出为第一处理结果。
在一种可能的实现方式中,通过第一待训练模型对第一信息进行处理,得到第一处理结果还包括:通过第i个交互单元对第i个交互单元的输入以及第i个交互单元的非线性运算结果进行非线性运算,得到第i个交互单元的新的非线性运算结果;通过第i个交互单元对第i个交互单元的线性运算结果以及第i个交互单元的非线性运算结果进行融合,得到第i个交互单元的输出包括:通过第i个交互单元对第i个交互单元的线性运算结果、第i个交互单元的非线性运算结果以及第i个交互单元的新的非线性运算结果进行融合,得到第i个交互单元的输出。
在一种可能的实现方式中,第一信息还包含:用户对应用的操作信息以及应用的属性信息,应用用于为用户提供项目。
本申请实施例的第三方面提供了一种项目推荐装置,该装置包括:获取模块,用于获取第一信息,第一信息包含用户的属性信息以及项目的属性信息;第一处理模块,用于通过第一模型对第一信息进行处理,得到第一处理结果,第一处理结果用于确定项目被用户点击的概率,第一模型用于:对第一信息进行线性运算,得到第二信息;对第二信息进行非线性运算,得到第三信息;基于第三信息,获取第一处理结果。
从上述装置可以看出:在获取包含用户的属性信息以及项目的属性信息的第一信息后,可将第一信息输入至第一模型进行处理,从而得到第一处理结果,第一处理结果可用于确定项目被用户点击的概率。在处理第一信息时,第一模型先对第一信息进行线性运算,得到第二信息,再对第一信息和第二信息进行非线性运算,得到第三信息,最后基于第二信息以及 第三信息,获取第一处理结果。由此可见,第一模型在线性运算的基础上实现了非线性运算,令线性运算和非线性运算之间产生了联系,在这个运算过程中,第一模型不仅可实现信息之间的显式交互以及隐式交互,还可实现信息之间的半显式交互,也就是说,在这个运算过程中,第一模型不仅可以注意到一些频繁出现的项目与用户之间的关系以及一些几乎未曾出现的项目与用户之间的关系,还可注意到除这两类项目之外的其余项目与用户之间的关系,故第一模型既可准确地预测这两类项目被用户点击的概率,也可准确地预测其余项目被用户点击的概率,从而提高模型的整体预测精度。
在一种可能的实现方式中,第一模型,用于:对第一信息进行线性运算,得到第二信息;对第一信息和第二信息进行非线性运算,得到第三信息;对第二信息以及第三信息进行融合,得到第四信息;基于第四信息,获取第一处理结果。
在一种可能的实现方式中,该装置还包括:第二处理模块,用于通过第二模型对第一信息进行处理,得到第二处理结果,第二模型为以下至少一种:多层感知机、卷积网络、注意力网络、Squeeze-and-Excitation网络以及与第一模型相同的模型;第三处理模块,用于通过第三模型对第一处理结果以及第二处理结果进行融合,得到的融合后的结果用于确定推荐给所述用户的项目。
在一种可能的实现方式中,第一模型包含N个交互单元,第i个交互单元的输入为第i-1个交互单元的输出,N≥1,i=1,...,N,第一处理模块,用于:通过第i个交互单元对第i个交互单元的输入进行线性运算,得到第i个交互单元的线性运算结果;通过第i个交互单元对第i个交互单元的输入以及第i个交互单元的线性运算结果进行非线性运算,得到第i个交互单元的非线性运算结果;通过第i个交互单元对第i个交互单元的线性运算结果以及第i个交互单元的非线性运算结果进行融合,得到第i个交互单元的输出;其中,第1个交互单元的输入为第一信息,第1个交互模型的线性运算结果为第二信息,第1个交互模型的非线性运算结果为第三信息,第1个交互模型的输出为第四信息,第N个交互模型的输出为第一处理结果。
在一种可能的实现方式中,第一处理模块,还用于通过第i个交互单元对第i个交互单元的输入以及第i个交互单元的非线性运算结果进行非线性运算,得到第i个交互单元的新的非线性运算结果;第一处理模块,用于通过第i个交互单元对第i个交互单元的线性运算结果、第i个交互单元的非线性运算结果以及第i个交互单元的新的非线性运算结果进行融合,得到第i个交互单元的输出。
在一种可能的实现方式中,第一信息还包含:用户对应用的操作信息以及应用的属性信息,应用用于为用户提供项目。
本申请实施例的第四方面提供了一种模型训练装置,该装置包括:第一获取模块,用于获取第一信息,第一信息包含用户的属性信息以及项目的属性信息;第一处理模块,用于通过第一待训练模型对第一信息进行处理,得到第一处理结果,第一处理结果用于确定项目被用户点击的概率,所述项目被用户点击的概率用于确定推荐给用户的项目,第一待训练模型用于:对第一信息进行线性运算,得到第二信息;对第二信息进行线性运算,得到第三信息;基于第三信息,获取第一处理结果;第二获取模块,用于基于项目被用户点击的概率以及项目被用户点击的真实概率,获取目标损失,目标损失用于指示项目被用户点击的概率以及项 目被用户点击的真实概率之间的差异;更新模块,用于基于目标损失,对第一待训练模型的参数进行更新,直至满足模型训练条件,得到第一模型。
上述装置训练得到的第一模型,具备对用户行为进行预测的能力。具体地,在获取包含用户的属性信息以及项目的属性信息的第一信息后,可将第一信息输入至第一模型进行处理,从而得到第一处理结果,第一处理结果可用于确定项目被用户点击的概率。在处理第一信息时,第一模型先对第一信息进行线性运算,得到第二信息,再对第一信息和第二信息进行非线性运算,得到第三信息,最后基于第二信息以及第三信息,获取第一处理结果。由此可见,第一模型在线性运算的基础上实现了非线性运算,令线性运算和非线性运算之间产生了联系,在这个运算过程中,第一模型不仅可实现信息之间的显式交互以及隐式交互,还可实现信息之间的半显式交互,也就是说,在这个运算过程中,第一模型不仅可以注意到一些频繁出现的项目与用户之间的关系以及一些几乎未曾出现的项目与用户之间的关系,还可注意到除这两类项目之外的其余项目与用户之间的关系,故第一模型既可准确地预测这两类项目被用户点击的概率,也可准确地预测其余项目被用户点击的概率,从而提高模型的整体预测精度。
在一种可能的实现方式中,该装置还包括:第二处理模块,用于通过第二待训练模型对第一信息进行处理,得到第二处理结果,第二待训练模型为以下至少一种:多层感知机、卷积网络、注意力网络、Squeeze-and-Excitation网络以及与第一待训练模型相同的模型;第三处理模块,用于通过第三待训练模型对第一处理结果以及第二处理结果进行融合,得到的融合后的结果为项目被用户点击的概率。
在一种可能的实现方式中,第二获取模块,用于基于项目被用户点击的概率、项目被用户点击的真实概率、第一处理结果以及第二处理结果,获取目标损失,目标损失用于指示项目被用户点击的概率以及项目被用户点击的真实概率之间的差异,第一处理结果与项目被用户点击的概率之间的差异,第二处理结果与项目被用户点击的概率之间的差异;更新模块,用于基于目标损失,对第一待训练模型的参数、第二待训练模型的参数以及第三待训练模型的参数进行更新,直至满足模型训练条件,对应得到第一模型、第二模型以及第三模型。
在一种可能的实现方式中,第一待训练模型,用于:对第二信息以及第三信息进行融合,得到第四信息;基于第四信息,获取第一处理结果。
在一种可能的实现方式中,第一待训练模型包含N个交互单元,第i个交互单元的输入为第i-1个交互单元的输出,N≥1,i=1,...,N,第一处理模块1302,用于:通过第i个交互单元对第i个交互单元的输入进行线性运算,得到第i个交互单元的线性运算结果;通过第i个交互单元对第i个交互单元的输入以及第i个交互单元的线性运算结果进行非线性运算,得到第i个交互单元的非线性运算结果;通过第i个交互单元对第i个交互单元的线性运算结果以及第i个交互单元的非线性运算结果进行融合,得到第i个交互单元的输出;其中,第1个交互模型的输入为第一信息,第1个交互模型的线性运算结果为第二信息,第1个交互模型的非线性运算结果为第三信息,第1个交互模型的输出为第四信息,第N个交互模型的输出为第一处理结果。
在一种可能的实现方式中,第一处理模块,还用于:通过第i个交互单元对第i个交互单元的输入以及第i个交互单元的非线性运算结果进行非线性运算,得到第i个交互单元的新的非线性运算结果;第一处理模块,用于通过第i个交互单元对第i个交互单元的线性运 算结果、第i个交互单元的非线性运算结果以及第i个交互单元的新的非线性运算结果进行融合,得到第i个交互单元的输出。
在一种可能的实现方式中,第一信息还包含:用户对应用的操作信息以及应用的属性信息,应用用于为用户提供项目。
本申请实施例的第五方面提供了一种项目推荐装置,该装置包括存储器和处理器;存储器存储有代码,处理器被配置为执行代码,当代码被执行时,项目推荐装置执行如第一方面或第一方面中任意一种可能的实现方式所述的方法。
本申请实施例的第六方面提供了一种模型训练装置,该装置包括存储器和处理器;存储器存储有代码,处理器被配置为执行代码,当代码被执行时,模型训练装置执行如第二方面或第二方面中任意一种可能的实现方式所述的方法。
本申请实施例的第七方面提供了一种电路系统,该电路系统包括处理电路,该处理电路配置为执行如第一方面、第一方面中的任意一种可能的实现方式、第二方面或第二方面中任意一种可能的实现方式所述的方法。
本申请实施例的第八方面提供了一种芯片系统,该芯片系统包括处理器,用于调用存储器中存储的计算机程序或计算机指令,以使得该处理器执行如第一方面、第一方面中的任意一种可能的实现方式、第二方面或第二方面中任意一种可能的实现方式所述的方法。
在一种可能的实现方式中,该处理器通过接口与存储器耦合。
在一种可能的实现方式中,该芯片系统还包括存储器,该存储器中存储有计算机程序或计算机指令。
本申请实施例的第九方面提供了一种计算机存储介质,该计算机存储介质存储有计算机程序,该程序在由计算机执行时,使得计算机实施如第一方面、第一方面中的任意一种可能的实现方式、第二方面或第二方面中任意一种可能的实现方式所述的方法。
本申请实施例的第十方面提供了一种计算机程序产品,该计算机程序产品存储有指令,该指令在由计算机执行时,使得计算机实施如第一方面、第一方面中的任意一种可能的实现方式、第二方面或第二方面中任意一种可能的实现方式所述的方法。
本申请实施例中,在获取包含用户的属性信息以及项目的属性信息的第一信息后,可将第一信息输入至第一模型进行处理,从而得到第一处理结果,第一处理结果可用于确定项目被用户点击的概率。在处理第一信息时,第一模型先对第一信息进行线性运算,得到第二信息,再对第一信息和第二信息进行非线性运算,得到第三信息,最后基于第二信息以及第三信息,获取第一处理结果。由此可见,第一模型在线性运算的基础上实现了非线性运算,令线性运算和非线性运算之间产生了联系,在这个运算过程中,第一模型不仅可实现信息之间的显式交互以及隐式交互,还可实现信息之间的半显式交互,也就是说,在这个运算过程中,第一模型不仅可以注意到一些频繁出现的项目与用户之间的关系以及一些几乎未曾出现的项目与用户之间的关系,还可注意到除这两类项目之外的其余项目与用户之间的关系,故第一模型既可准确地预测这两类项目被用户点击的概率,也可准确地预测其余项目被用户点击的概率,从而提高模型的整体预测精度。
附图说明
图1为人工智能主体框架的一种结构示意图;
图2a为本申请实施例提供的项目推荐系统的一个结构示意图;
图2b为本申请实施例提供的项目推荐系统的另一结构示意图;
图2c为本申请实施例提供的项目推荐的相关设备的一个示意图;
图3为本申请实施例提供的系统100架构的一个示意图;
图4为本申请实施例提供的项目推荐方法的一个流程示意图;
图5为本申请实施例提供的第一模型的一个结构示意图;
图6为本申请实施例提供的第一模型的另一结构示意图;
图7为本申请实施例提供的第一模型的另一结构示意图;
图8为本申请实施例提供的第一模型的另一结构示意图;
图9为本申请实施例提供的项目推荐方法的另一流程示意图;
图10为本申请实施例提供的目标模型的一个结构示意图;
图11为本申请实施例中的模型训练方法的一个流程示意图;
图12为本申请实施例提供的项目推荐装置的一个结构示意图;
图13为本申请实施例提供的模型训练装置的一个结构示意图;
图14为本申请实施例提供的执行设备的一个结构示意图;
图15为本申请实施例提供的训练设备的一个结构示意图;
图16为本申请实施例提供的芯片的一个结构示意图。
具体实施方式
本申请实施例提供了一种项目推荐方法及其相关设备,既可准确预测一些频繁出现的项目以及一些几乎未曾出现的项目被用户点击之间的概率,还可准确预测除这两类项目之外的其余项目被用户点击的概率,从而提高模型的整体预测精度。
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的术语在适当情况下可以互换,这仅仅是描述本申请的实施例中对相同属性的对象在描述时所采用的区分方式。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,以便包含一系列单元的过程、方法、系统、产品或设备不必限于那些单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它单元。
随着计算机技术的快速发展,为了满足用户的上网需求,开发商越来越倾向于在应用的页面上展现用户感兴趣的内容。基于此,针对于某个应用的页面,往往需要预测用户会点击该页面上所展示的哪个或哪些项目(例如,预测某个男性用户会点击操作系统页面中的哪些软件,又如,预测某个学生会点击购物软件页面中的哪个商品等等),即预测用户针对该页面的行为,进而修改该页面上所需呈现的项目,以为用户推荐其感兴趣的项目。
目前,可利用AI技术的神经网络模型来预测应用页面上的项目被用户点击的概率。具体地,相关技术提供的神经网络模型可包含两个分支,可将第一个分支称为第一模型,将第二个分支称为第二模型。那么,当需要通过该神经网络模型预测用户行为时,可将用户的属性信息((例如,某个学生的姓名、年龄以及性别等等)以及项目的属性信息(例如,某些商品 的类型、价格以及功能等等)等信息作为模型的输入,以使得第一模型可对输入的信息进行线性运算,第二模型可对输入的信息进行非线性运算,那么,基于这两个模型运算的结果,可得到各个项目被用户点击的概率。
在线性运算的过程中,第一模型可实现输入的信息(特征)之间的显式交互,第一模型会“记住”一些常见的信息(特征)组合(即第一模型在非线性运算的过程中,主要注意到一些频繁出现的项目与用户之间的关系),在非线性运算的过程中,第二模型可实现输入的信息(特征)之间的隐式交互,第二模型会寻找到一些少见或未曾见过的信息组合(即第二模型在线性运算的过程中,主要注意到一些几乎未曾出现的项目与用户之间的关系)。因此,相关技术的神经网络模型以此种方式来实现信息之间的交互,效率往往较为低下,即模型对除这两类项目之外的其余项目与用户之间的关系不够关注,虽然神经网络模型能够较为准确地预测这两类项目被用户点击的概率,但无法准确地预测其余项目被用户点击的概率,以致于神经网络模型的整体预测精度不高。
进一步地,相关技术提供的神经网络模型中,受限于第一模型自身的结构,第一模型无法充分实现信息之间的交互,交互最终所得到的信息的阶数往往不够高(例如,第一模型通常设置有串联的3个线性层,可先后实现3次线性运算,最终得到的信息的阶数通常为3阶),由于将该信息往往可确定模型最终的预测结果,即模型输出的某些项目被用户点击的概率,会导致这些预测结果的准确度不够高。
更进一步地,相关技术提供的神经网络模型中,第一模型和第二模型通常为特定类型的模型,仅服务于某些特定的业务场景,模型的泛化性能不够。
更进一步地,相关技术提供的神经网络模型是基于常规的模型训练方式进行训练得到的,即从整体上指导整个模型的参数更新,而无法针对模型中不同分支的参数进行更新,导致训练得到的神经网络模型的性能较差。
为了解决上述问题,本申请实施例提供了一种项目推荐方法,该方法可结合人工智能(artificial intelligence,AI)技术实现。AI技术是利用数字计算机或者数字计算机控制的机器模拟、延伸和扩展人的智能的技术学科,AI技术通过感知环境、获取知识并使用知识获得最佳结果。换句话说,人工智能技术是计算机科学的一个分支,它企图了解智能的实质,并生产出一种新的能以人类智能相似的方式做出反应的智能机器。利用人工智能进行数据处理是人工智能常见的一个应用方式。
首先对人工智能系统总体工作流程进行描述,请参见图1,图1为人工智能主体框架的一种结构示意图,下面从“智能信息链”(水平轴)和“IT价值链”(垂直轴)两个维度对上述人工智能主题框架进行阐述。其中,“智能信息链”反映从数据的获取到处理的一列过程。举例来说,可以是智能信息感知、智能信息表示与形成、智能推理、智能决策、智能执行与输出的一般过程。在这个过程中,数据经历了“数据—信息—知识—智慧”的凝练过程。“IT价值链”从人智能的底层基础设施、信息(提供和处理技术实现)到系统的产业生态过程,反映人工智能为信息技术产业带来的价值。
(1)基础设施
基础设施为人工智能系统提供计算能力支持,实现与外部世界的沟通,并通过基础平台实现支撑。通过传感器与外部沟通;计算能力由智能芯片(CPU、NPU、GPU、ASIC、FPGA等硬 件加速芯片)提供;基础平台包括分布式计算框架及网络等相关的平台保障和支持,可以包括云存储和计算、互联互通网络等。举例来说,传感器和外部沟通获取数据,这些数据提供给基础平台提供的分布式计算系统中的智能芯片进行计算。
(2)数据
基础设施的上一层的数据用于表示人工智能领域的数据来源。数据涉及到图形、图像、语音、文本,还涉及到传统设备的物联网数据,包括已有系统的业务数据以及力、位移、液位、温度、湿度等感知数据。
(3)数据处理
数据处理通常包括数据训练,机器学习,深度学习,搜索,推理,决策等方式。
其中,机器学习和深度学习可以对数据进行符号化和形式化的智能信息建模、抽取、预处理、训练等。
推理是指在计算机或智能系统中,模拟人类的智能推理方式,依据推理控制策略,利用形式化的信息进行机器思维和求解问题的过程,典型的功能是搜索与匹配。
决策是指智能信息经过推理后进行决策的过程,通常提供分类、排序、预测等功能。
(4)通用能力
对数据经过上面提到的数据处理后,进一步基于数据处理的结果可以形成一些通用的能力,比如可以是算法或者一个通用系统,例如,翻译,文本的分析,计算机视觉的处理,语音识别,图像的识别等等。
(5)智能产品及行业应用
智能产品及行业应用指人工智能系统在各领域的产品和应用,是对人工智能整体解决方案的封装,将智能信息决策产品化、实现落地应用,其应用领域主要包括:智能终端、智能交通、智能医疗、自动驾驶、智慧城市等。
接下来介绍几种本申请的应用场景。
图2a为本申请实施例提供的项目推荐系统的一个结构示意图,该项目推荐系统包括用户设备以及数据处理设备。其中,用户设备包括手机、个人电脑或者信息处理中心等智能终端。用户设备为项目推荐的发起端,作为项目推荐请求的发起方,通常由用户通过用户设备发起请求。
上述数据处理设备可以是云服务器、网络服务器、应用服务器以及管理服务器等具有数据处理功能的设备或服务器。数据处理设备通过交互接口接收来自智能终端的项目推荐请求,再通过存储数据的存储器以及数据处理的处理器环节进行机器学习,深度学习,搜索,推理,决策等方式的信息处理。数据处理设备中的存储器可以是一个统称,包括本地存储以及存储历史数据的数据库,数据库可以在数据处理设备上,也可以在其它网络服务器上。
在图2a所示的项目推荐系统中,用户设备可以接收用户的指令,例如用户设备可以获取用户输入/选择的一个信息,然后向数据处理设备发起请求,使得数据处理设备针对用户设备得到的该信息执行项目推荐应用,从而得到针对该信息的处理结果。示例性的,用户设备可以获取用户输入的一个信息(可包含用户的属性信息、项目的属性信息、用于呈现项目的应用的属性信息等等),然后向数据处理设备发起信息的处理请求,使得数据处理设备对该信息进行基于项目推荐的处理,从而得到该信息的处理结果,即项目被用户点击的概率,这些概 率可用于确定哪些项目可最终推荐给用户(例如,将概率较大的一部分项目作为推荐给用户的项目)。
在图2a中,数据处理设备可以执行本申请实施例的项目推荐方法。
图2b为本申请实施例提供的项目推荐系统的另一结构示意图,在图2b中,用户设备直接作为数据处理设备,该用户设备能够直接获取来自用户的输入并直接由用户设备本身的硬件进行处理,具体过程与图2a相似,可参考上面的描述,在此不再赘述。
在图2b所示的项目推荐系统中,用户设备可以接收用户的指令,例如用户设备可以获取用户在用户设备中所选择的一个信息,然后再由用户设备自身针对该信息执行基于项目推荐的处理,从而得到针对该信息的处理结果,即项目被用户点击的概率,这些概率可用于确定哪些项目可最终推荐给用户(例如,将概率较大的一部分项目作为推荐给用户的项目)。
在图2b中,用户设备自身就可以执行本申请实施例的项目推荐方法。
图2c为本申请实施例提供的项目推荐的相关设备的一个示意图。
上述图2a和图2b中的用户设备具体可以是图2c中的本地设备301或者本地设备302,图2a中的数据处理设备具体可以是图2c中的执行设备210,其中,数据存储系统250可以存储执行设备210的待处理数据,数据存储系统250可以集成在执行设备210上,也可以设置在云上或其它网络服务器上。
图2a和图2b中的处理器可以通过神经网络模型或者其它模型(例如,基于支持向量机的模型)进行数据训练/机器学习/深度学习,并利用数据最终训练或者学习得到的模型针对图像执行图像处理应用,从而得到相应的处理结果。
图3为本申请实施例提供的系统100架构的一个示意图,在图3中,执行设备110配置输入/输出(input/output,I/O)接口112,用于与外部设备进行数据交互,用户可以通过客户设备140向I/O接口112输入数据,所述输入数据在本申请实施例中可以包括:各个待调度任务、可调用资源以及其他参数。
在执行设备110对输入数据进行预处理,或者在执行设备110的计算模块111执行计算等相关的处理(比如进行本申请中神经网络的功能实现)过程中,执行设备110可以调用数据存储系统150中的数据、代码等以用于相应的处理,也可以将相应处理得到的数据、指令等存入数据存储系统150中。
最后,I/O接口112将处理结果返回给客户设备140,从而提供给用户。
值得说明的是,训练设备120可以针对不同的目标或称不同的任务,基于不同的训练数据生成相应的目标模型/规则,该相应的目标模型/规则即可以用于实现上述目标或完成上述任务,从而为用户提供所需的结果。其中,训练数据可以存储在数据库130中,且来自于数据采集设备160采集的训练样本。
在图3中所示情况下,用户可以手动给定输入数据,该手动给定可以通过I/O接口112提供的界面进行操作。另一种情况下,客户设备140可以自动地向I/O接口112发送输入数据,如果要求客户设备140自动发送输入数据需要获得用户的授权,则用户可以在客户设备140中设置相应权限。用户可以在客户设备140查看执行设备110输出的结果,具体的呈现形式可以是显示、声音、动作等具体方式。客户设备140也可以作为数据采集端,采集如图所示输入I/O接口112的输入数据及输出I/O接口112的输出结果作为新的样本数据,并存入数据库130。当然, 也可以不经过客户设备140进行采集,而是由I/O接口112直接将如图所示输入I/O接口112的输入数据及输出I/O接口112的输出结果,作为新的样本数据存入数据库130。
值得注意的是,图3仅是本申请实施例提供的一种系统架构的示意图,图中所示设备、器件、模块等之间的位置关系不构成任何限制,例如,在图3中,数据存储系统150相对执行设备110是外部存储器,在其它情况下,也可以将数据存储系统150置于执行设备110中。如图3所示,可以根据训练设备120训练得到神经网络。
本申请实施例还提供的一种芯片,该芯片包括神经网络处理器NPU。该芯片可以被设置在如图3所示的执行设备110中,用以完成计算模块111的计算工作。该芯片也可以被设置在如图3所示的训练设备120中,用以完成训练设备120的训练工作并输出目标模型/规则。
神经网络处理器NPU,NPU作为协处理器挂载到主中央处理器(central processing unit,CPU)(host CPU)上,由主CPU分配任务。NPU的核心部分为运算电路,控制器控制运算电路提取存储器(权重存储器或输入存储器)中的数据并进行运算。
在一些实现中,运算电路内部包括多个处理单元(process engine,PE)。在一些实现中,运算电路是二维脉动阵列。运算电路还可以是一维脉动阵列或者能够执行例如乘法和加法这样的数学运算的其它电子线路。在一些实现中,运算电路是通用的矩阵处理器。
举例来说,假设有输入矩阵A,权重矩阵B,输出矩阵C。运算电路从权重存储器中取矩阵B相应的数据,并缓存在运算电路中每一个PE上。运算电路从输入存储器中取矩阵A数据与矩阵B进行矩阵运算,得到的矩阵的部分结果或最终结果,保存在累加器(accumulator)中。
向量计算单元可以对运算电路的输出做进一步处理,如向量乘,向量加,指数运算,对数运算,大小比较等等。例如,向量计算单元可以用于神经网络中非卷积/非FC层的网络计算,如池化(pooling),批归一化(batch normalization),局部响应归一化(local response normalization)等。
在一些实现种,向量计算单元能将经处理的输出的向量存储到统一缓存器。例如,向量计算单元可以将非线性函数应用到运算电路的输出,例如累加值的向量,用以生成激活值。在一些实现中,向量计算单元生成归一化的值、合并值,或二者均有。在一些实现中,处理过的输出的向量能够用作到运算电路的激活输入,例如用于在神经网络中的后续层中的使用。
统一存储器用于存放输入数据以及输出数据。
权重数据直接通过存储单元访问控制器(direct memory access controller,DMAC)将外部存储器中的输入数据搬运到输入存储器和/或统一存储器、将外部存储器中的权重数据存入权重存储器,以及将统一存储器中的数据存入外部存储器。
总线接口单元(bus interface unit,BIU),用于通过总线实现主CPU、DMAC和取指存储器之间进行交互。
与控制器连接的取指存储器(instruction fetch buffer),用于存储控制器使用的指令;
控制器,用于调用指存储器中缓存的指令,实现控制该运算加速器的工作过程。
一般地,统一存储器,输入存储器,权重存储器以及取指存储器均为片上(On-Chip)存储器,外部存储器为该NPU外部的存储器,该外部存储器可以为双倍数据率同步动态随机存储器(double data rate synchronous dynamic random access memory,DDR SDRAM)、高带宽存储器(high bandwidth memory,HBM)或其他可读可写的存储器。
由于本申请实施例涉及大量神经网络的应用,为了便于理解,下面先对本申请实施例涉及的相关术语及神经网络等相关概念进行介绍。
(1)神经网络
神经网络可以是由神经单元组成的,神经单元可以是指以xs和截距1为输入的运算单元,该运算单元的输出可以为:
其中,s=1、2、……n,n为大于1的自然数,Ws为xs的权重,b为神经单元的偏置。f为神经单元的激活函数(activation functions),用于将非线性特性引入神经网络中,来将神经单元中的输入信号转换为输出信号。该激活函数的输出信号可以作为下一层卷积层的输入。激活函数可以是sigmoid函数。神经网络是将许多个上述单一的神经单元联结在一起形成的网络,即一个神经单元的输出可以是另一个神经单元的输入。每个神经单元的输入可以与前一层的局部接受域相连,来提取局部接受域的特征,局部接受域可以是由若干个神经单元组成的区域。
神经网络中的每一层的工作可以用数学表达式y=a(Wx+b)来描述:从物理层面神经网络中的每一层的工作可以理解为通过五种对输入空间(输入向量的集合)的操作,完成输入空间到输出空间的变换(即矩阵的行空间到列空间),这五种操作包括:1、升维/降维;2、放大/缩小;3、旋转;4、平移;5、“弯曲”。其中1、2、3的操作由Wx完成,4的操作由+b完成,5的操作则由a()来实现。这里之所以用“空间”二字来表述是因为被分类的对象并不是单个事物,而是一类事物,空间是指这类事物所有个体的集合。其中,W是权重向量,该向量中的每一个值表示该层神经网络中的一个神经元的权重值。该向量W决定着上文所述的输入空间到输出空间的空间变换,即每一层的权重W控制着如何变换空间。训练神经网络的目的,也就是最终得到训练好的神经网络的所有层的权重矩阵(由很多层的向量W形成的权重矩阵)。因此,神经网络的训练过程本质上就是学习控制空间变换的方式,更具体的就是学习权重矩阵。
因为希望神经网络的输出尽可能的接近真正想要预测的值,所以可以通过比较当前网络的预测值和真正想要的目标值,再根据两者之间的差异情况来更新每一层神经网络的权重向量(当然,在第一次更新之前通常会有初始化的过程,即为神经网络中的各层预先配置参数),比如,如果网络的预测值高了,就调整权重向量让它预测低一些,不断的调整,直到神经网络能够预测出真正想要的目标值。因此,就需要预先定义“如何比较预测值和目标值之间的差异”,这便是损失函数(loss function)或目标函数(objective function),它们是用于衡量预测值和目标值的差异的重要方程。其中,以损失函数举例,损失函数的输出值(loss)越高表示差异越大,那么神经网络的训练就变成了尽可能缩小这个loss的过程。
(2)反向传播算法
神经网络可以采用误差反向传播(back propagation,BP)算法在训练过程中修正初始的神经网络模型中参数的大小,使得神经网络模型的重建误差损失越来越小。具体地,前向传 递输入信号直至输出会产生误差损失,通过反向传播误差损失信息来更新初始的神经网络模型中参数,从而使误差损失收敛。反向传播算法是以误差损失为主导的反向传播运动,旨在得到最优的神经网络模型的参数,例如权重矩阵。
下面从神经网络的训练侧和神经网络的应用侧对本申请提供的方法进行描述。
本申请实施例提供的模型训练方法,涉及数据序列的处理,具体可以应用于数据训练、机器学习、深度学习等方法,对训练数据(例如,将本申请实施例提供的模型训练方法的第一信息)进行符号化和形式化的智能信息建模、抽取、预处理、训练等,最终得到训练好的神经网络(如本申请实施例提供的模型训练方法的第一模型、第二模型以及第三模型);并且,本申请实施例提供的项目推荐方法可以运用上述训练好的神经网络,将输入数据(例如,将本申请实施例提供的项目推荐方法的第一信息)输入到所述训练好的神经网络中,得到输出数据(如本申请实施例提供的户行为预测方法的项目被用户点击的概率等等)。需要说明的是,本申请实施例提供的模型训练方法和项目推荐方法是基于同一个构思产生的发明,也可以理解为一个系统中的两个部分,或一个整体流程的两个阶段:如模型训练阶段和模型应用阶段。
图4为本申请实施例提供的项目推荐方法的一个流程示意图,如图4所示,该方法包括:
401、获取第一信息,第一信息包含用户的属性信息以及项目的属性信息。
本实施例中,当用户在使用某个应用(例如,某个操作系统或某个软件等等)时,为了预测用户在该应用的页面上的行为,可先获取与用户相关联的第一信息(也可以称为与用户相关联的原始特征),第一信息至少包含用户的属性信息以及该应用的页面上可呈现的项目的属性信息,其中,用户的属性信息可包含用户的姓名、年龄、性别以及工作等信息,项目的属性信息可包含项目的名称、类型、功能以及价格等信息。需要说明的是,用户的属性信息也可以理解为用户的原始特征,项目的属性信息可理解为项目的原始特征。
此外,第一信息还可包含用户对该应用的操作信息以及该应用的属性信息,该应用的页面用于为用户提供(呈现)一个或多个项目(例如,商品、软件等等)。其中,用户对该应用的操作信息可包含用户在该应用的页面上所输入的请求等等,该应用的属性信息可包含该应用的名称、类型、功能以及大小等等。需要说明的是,用户对该应用的操作信息以及该应用的属性信息均可理解为上下文的原始特征。
402、通过第一模型对第一信息进行处理,得到第一处理结果,第一处理结果作为项目被用户点击的概率,第一模型用于:对第一信息进行线性运算,得到第二信息;对第一信息和第二信息进行非线性运算,得到第三信息;基于第二信息以及第三信息,获取第一处理结果。
得到第一信息后,可获取第一模型(已训练好的神经网络模型),并将第一信息输入至第一模型,以使得第一模型对第一信息进行处理,得到第一处理结果。
具体地,第一模型可包含至少一个交互单元,那么,第一模型可通过多种方式来对第一信息进行处理,从而获取第一处理结果:
(1)如图5所示(图5为本申请实施例提供的第一模型的一个结构示意图),设第一模型中仅包含一个交互单元,该交互单元可包含一个线性层、一个非线性层以及一个融合层,其中,线性层的输入端即为该交互单元的输入端,非线性层的第一输入端即为该交互单元的输入端,线性层的第一输出端与非线性层的第二输入端连接,线性层的第二输出端与融合层的输入端连接,非线性层的输出端与融合层的输入端连接,融合层的输出端即为该交互单元 的输出端。
那么,将第一信息输入至第一模型中的该交互单元,该交互单元中的线性层和该交互单元中的非线性层均可接收到第一信息。接着,线性层可对第一信息进行线性运算,得到线性层的线性运算结果(即前述的第二信息),并将线性层的线性运算结果输入至非线性层以及融合层。其中,线性运算的过程如以下公式所示:
ho=w0xl+b0          (2)
上式中,xl为第一信息,w0和b0为线性层的参数(即线性层的权重和偏置),ho为线性层的线性运算结果。
然后,非线性层可对第一信息以及线性层的线性运算结果进行非线性运算,得到非线性层的非线性运算结果(即前述的第三信息),并将非线性层的非线性运算结果输入至融合层。其中,非线性运算的过程如以下公式所示:
h1=ho*σ(w1xl+b1)              (3)
上式中,w1和b1为非线性层的参数(即线性层的权重和偏置),σ为特定层中(包含非线性层和融合层)的激活函数(例如,ReLU、tanh、PReLu等),h1为非线性层的非线性运算结果。
最后,融合层可将线性层的线性运算结果以及非线性层的非线性运算结果进行融合,融合结果(即前述的第四信息)可直接作为该交互单元的输出,也就是第一模型的输出,即第一模型针对第一信息的第一处理结果。其中,融合的过程如以下公式所示:
上式中,为融合层的参数(即融合层中用于实现加权求和的权重),xl+1为该交互单元的输出,即第一模型输出的第一处理结果。需要说明的是,该交互单元可以视为一个2阶的交互单元,将第一信息视为1阶的信息(1阶的特征),则第一模型输出的第一处理结果为2阶的信息(2阶的特征)。
(2)如图6所示(图6为本申请实施例提供的第一模型的另一结构示意图),设第一模型中仅包含一个交互单元,该交互单元可包含一个线性层、K-1个非线性层(K为大于或等于3的正整数)以及一个融合层,其中,线性层的输入端即为该交互单元的输入端,K-1个非线性层的第一输入端均为该交互单元的输入端,线性层的第一输出端与第1个非线性层的第二输入端连接,第1个非线性层的第一输出端与第2个非线性层的第二输入端连接,...,第K-2个非线性层的第一输出端与第K-1个非线性层的第二输入端连接,线性层的第二输出端与融合层的输入端连接,K-1个非线性层的第二输出端均与融合层的输入端连接,融合层的输出端即为该交互单元的输出端。
那么,将第一信息输入至第一模型中的该交互单元,该交互单元中的线性层和该交互单 元中的K-1个非线性层均可接收到第一信息。接着,线性层可对第一信息进行线性运算,得到线性层的线性运算结果(即前述的第二信息),并将线性层的线性运算结果输入至第1个非线性层以及融合层。其中,线性运算的过程如公式(2)所示,此处不再赘述。
然后,第1个非线性层可对第一信息以及线性层的线性运算结果进行非线性运算,得到第1个非线性层的非线性运算结果(即前述的第三信息),并将第1个非线性层的非线性运算结果输入至第2个非线性层以及融合层。随后,第2个非线性层可对第一信息以及第1个非线性层的非线性运算结果进行非线性运算,得到第2个非线性层的非线性运算结果,并将第2个非线性层的非线性运算结果输入至第3个非线性层以及融合层,...,第K-1个非线性层可对第一信息以及第K-2个非线性层的非线性运算结果进行非线性运算,得到第K-1个非线性层的非线性运算结果,并将第K-1个非线性层的非线性运算结果输入至融合层。其中,K-1个非线性层的非线性运算的过程如以下公式所示:
h1=ho*σ(w1xl+b1)
...
hj=hj-1*σ(wjxl+bj)
...
hK-1=hK-2*σ(wK-1xl+bK-1)        (5)
上式中,hj-1为第j-1个非线性层的非线性运算结果,hj为第j个非线性层的非线性运算结果,wj和bj为第j个非线性层的参数,j=1,...,K-1。
最后,融合层可将线性层的线性运算结果以及K-1个非线性层的非线性运算结果进行融合,融合结果可直接作为该交互单元的输出,也就是第一模型的输出,即第一模型针对第一信息的第一处理结果。其中,融合的过程如以下公式所示:
上式中,为融合层的参数(即融合层中用于实现加权求和的权重),xl+1为该交互单元的输出,即第一模型输出的第一处理结果。需要说明的是,该交互单元可以视为一个K阶的交互单元,将第一信息视为1阶的信息(1阶的特征),则第一模型输出的第一处理结果为K阶的信息(K阶的特征)。
(3)如图7所示(图7为本申请实施例提供的第一模型的另一结构示意图),设第一模型中包含串联的N个交互单元(N为大于或等于2的正整数),对于这N个交互单元中的任意一个交互单元而言,即对于第i个交互单元而言(i=1,...,N),第i个交互单元可包含一个线性层、一个非线性层以及一个融合层,其中,第i个交互单元的线性层的输入端即为第i个交互单元的输入端,第i个交互单元的非线性层的第一输入端即为第i个交互单元的输入端,第i个交互单元的线性层的第一输出端与第i个交互单元的非线性层的第二输入端连接, 第i个交互单元的线性层的第二输出端与第i个交互单元的融合层的输入端连接,第i个交互单元的非线性层的输出端与第i个交互单元的融合层的输入端连接,第i个交互单元的融合层的输出端即为第i个交互单元的输出端。对于除第i个交互单元之外的其余交互单元而言,其余交互单元内部的结构也是如此,此处不再赘述。
那么,将第一信息输入至第一模型中的第1个交互单元,下文将第一信息称为第1个交互单元的输入。第1个交互单元接收到第1个交互单元的输入后,可对第1个交互单元的输入执行以下操作:第1个交互单元的线性层可对第1个交互单元的输入进行线性运算,得到第1个交互单元的线性层的线性运算结果(即前述的第二信息),并将第1个交互单元的线性层的线性运算结果输入至第1个交互单元的非线性层以及第1个交互单元的融合层。其中,第1个交互单元进行线性运算的过程如公式(2)所示,此处不再赘述。
然后,第1个交互单元的非线性层可对第1个交互单元的输入以及第1个交互单元的线性层的线性运算结果进行非线性运算,得到第1个交互单元的非线性层的非线性运算结果(即前述的第三信息),并将第1个交互单元的非线性层的非线性运算结果输入至第1个交互单元的融合层。其中,第1个交互单元进行非线性运算的过程如公式(3)所示,此处不再赘述。
随后,第1个交互单元的融合层可将第1个交互单元的线性层的线性运算结果以及第1个交互单元的非线性层的非线性运算结果进行融合,第1个交互单元的融合层的融合结果(即前述的第四信息)可直接作为第1个交互单元的输出,并输入至第2个交互单元,即作为第2个交互单元的输入。其中,第1个交互单元进行融合的过程如公式(4)所示,此处不再赘述。
接收到第2个交互单元的输入后,第2个交互单元对第2个交互单元的输入所执行的操作,与前述第1个交互单元对第1个交互单元的输入所执行的操作是类似的,此处不再赘述。同样地,第3个交互单元对第3个交互单元的输入所执行的操作,...,第N个交互单元对第N个交互单元的输入所执行的操作,均与前述第1个交互单元对第1个交互单元的输入所执行的操作是类似的,此处也不赘述。可以理解的是,第N个交互单元的融合层所得到的融合结果,也就是第N个交互单元的输出,可作为第一模型的输出,即第一模型针对第一信息的第一处理结果。
需要说明的是,对于N个交互单元中每个交互单元可以视为2阶的交互单元,将第一信息视为1阶的信息(1阶的特征),则第一模型输出的第一处理结果为2^N阶的信息(2^N阶的特征)。
(4)如图8所示(图8为本申请实施例提供的第一模型的另一结构示意图),设第一模型中包含串联的N个交互单元(N为大于或等于2的正整数),对于这N个交互单元中的任意一个交互单元而言,即对于第i个交互单元而言(i=1,...,N),第i个交互单元可包含一个线性层、K-1个非线性层(K为大于或等于3的正整数)以及一个融合层,其中,第i个交互单元的线性层的输入端即为第i个交互单元的输入端,第i个交互单元的K-1个非线性层的第一输入端均为第i个交互单元的输入端,第i个交互单元的线性层的第一输出端与第i个交互单元的第1个非线性层的第二输入端连接,第i个交互单元的第1个非线性层的第一输出端与第i个交互单元的第2个非线性层的第二输入端连接,...,第i个交互单元的第K-2 个非线性层的第一输出端与第i个交互单元的第K-1个非线性层的第二输入端连接,第i个交互单元的线性层的第二输出端与第i个交互单元的融合层的输入端连接,第i个交互单元的K-1个非线性层的第二输出端均与第i个交互单元的融合层的输入端连接,第i个交互单元的融合层的输出端即为第i个交互单元的输出端。对于除第i个交互单元之外的其余交互单元而言,其余交互单元内部的结构也是如此,此处不再赘述。
那么,将第一信息输入至第一模型中的第1个交互单元,下文将第一信息称为第1个交互单元的输入。第1个交互单元接收到第1个交互单元的输入后,可对第1个交互单元的输入执行以下操作:第1个交互单元的线性层可对第1个交互单元的输入进行线性运算,得到第1个交互单元的线性层的线性运算结果(即前述的第二信息),并将第1个交互单元的线性层的线性运算结果输入至第1个交互单元的第1个非线性层以及第1个交互单元的融合层。其中,第1个交互单元进行线性运算的过程如公式(2)所示,此处不再赘述。
然后,第1个交互单元的第1个非线性层可对第1个交互单元的输入以及第1个交互单元的线性层的线性运算结果进行非线性运算,得到第1个交互单元的第1个非线性层的非线性运算结果(即前述的第三信息),并将第1个交互单元的第1个非线性层的非线性运算结果输入至第1个交互单元的第2个非线性层以及融合层。随后,第1个交互单元的第2个非线性层可对第1个交互单元的输入以及第1个交互单元的第1个非线性层的非线性运算结果进行非线性运算,得到第1个交互单元的第2个非线性层的非线性运算结果,并将第1个交互单元的第2个非线性层的非线性运算结果输入至第1个交互单元的第3个非线性层以及融合层,...,第1个交互单元的第K-1个非线性层可对第1个交互单元的输入以及第1个交互单元的第K-2个非线性层的非线性运算结果进行非线性运算,得到第1个交互单元的第K-1个非线性层的非线性运算结果,并将第1个交互单元的第K-1个非线性层的非线性运算结果输入至第1个交互单元的融合层。其中,第1个交互单元进行非线性运算的过程如公式(5)所示,此处不再赘述。
随后,第1个交互单元的融合层可将第1个交互单元的线性层的线性运算结果以及第1个交互单元的K-1个非线性层的非线性运算结果进行融合,第1个交互单元的融合层的融合结果可直接作为第1个交互单元的输出,并输入至第2个交互单元,即作为第2个交互单元的输入。其中,第1个交互单元进行融合的过程如公式(6)所示,此处不再赘述。
接收到第2个交互单元的输入后,第2个交互单元对第2个交互单元的输入所执行的操作,与前述第1个交互单元对第1个交互单元的输入所执行的操作是类似的,此处不再赘述。同样地,第3个交互单元对第3个交互单元的输入所执行的操作,...,第N个交互单元对第N个交互单元的输入所执行的操作,均与前述第1个交互单元对第1个交互单元的输入所执行的操作是类似的,此处也不赘述。可以理解的是,第N个交互单元的融合层所得到的融合结果,也就是第N个交互单元的输出,可作为第一模型的输出,即第一模型针对第一信息的第一处理结果。
需要说明的是,对于N个交互单元中每个交互单元可以视为K阶的交互单元,将第一信息视为1阶的信息(1阶的特征),则第一模型输出的第一处理结果为K^N阶的信息(K^N阶的特征)。
得到第一模型输出的第一处理结果后,第一处理结果即可直接作为该应用的页面上可呈 现的项目被用户点击的概率,那么,这些概率可用于确定推荐给用户的项目。
应理解,对于前述的情况(1)和情况(3),对于任意一个交互单元而言,即对于第i个交互单元而言,第i个交互单元的线性层的线性运算结果可视为前述的“第i个交互单元的线性运算结果”,第i个交互单元的非线性层的线性运算结果可视为前述的“第i个交互单元的非线性运算结果”。
还应理解,对于前述的情况(2)和情况(4),对于任意一个交互单元而言,即对于第i个交互单元而言,第i个交互单元的线性层的线性运算结果可视为前述的“第i个交互单元的线性运算结果”,第i个交互单元的第1个非线性层的线性运算结果至第i个交互单元的第K-2个非线性层的线性运算结果可视为前述的“第i个交互单元的非线性运算结果”,第i个交互单元的第2个非线性层的线性运算结果至第i个交互单元的第K-1个非线性层的线性运算结果可视为前述的“第i个交互单元的新的非线性运算结果”。
还应理解,前述的情况(3)和情况(4)中,仅以N个交互单元中均包含相同数量的非线性层进行示意性介绍,在实际应用中,在这N个交互单元中,不同的交互单元既可以包含相同数量的非线性层,也可以包含不同数量的非线性层。
本申请实施例中,在获取包含用户的属性信息以及项目的属性信息的第一信息后,可将第一信息输入至第一模型进行处理,从而得到第一处理结果,第一处理结果可用于确定项目被用户点击的概率。在处理第一信息时,第一模型先对第一信息进行线性运算,得到第二信息,再对第一信息和第二信息进行非线性运算,得到第三信息,最后基于第二信息以及第三信息,获取第一处理结果。由此可见,第一模型在线性运算的基础上实现了非线性运算,令线性运算和非线性运算之间产生了联系,在这个运算过程中,第一模型不仅可实现信息之间的显式交互以及隐式交互,还可实现信息之间的半显式交互,也就是说,在这个运算过程中,第一模型不仅可以注意到一些频繁出现的项目与用户之间的关系以及一些几乎未曾出现的项目与用户之间的关系,还可注意到除这两类项目之外的其余项目与用户之间的关系,故第一模型既可准确地预测这两类项目被用户点击的概率,也可准确地预测其余项目被用户点击的概率,从而提高模型的整体预测精度。
进一步地,第一模型中可包含N个交互单元,每个交互单元可包含一个线性层和至少一个非线性层,且这N个交互单元之间呈串联关系,使用这N个交互单元对第一信息进行处理,可对第一信息实现一定数量级次数的线性运算和非线性运算,所得到的第一处理结果为一个高阶的信息(即2^N阶的信息或K^N的信息),基于此信息来作为或确定最终的预测结果,即各个项目被用户点击的概率,具备较高的准确度。
图9为本申请实施例提供的项目推荐方法的另一流程示意图,如图9所示,该方法包括:
901、获取第一信息,第一信息包含用户的属性信息以及项目的属性信息。
902、通过第一模型对第一信息进行处理,得到第一处理结果,第一模型用于:对第一信息进行线性运算,得到第二信息;对第一信息和第二信息进行非线性运算,得到第三信息;基于第二信息以及第三信息,获取第一处理结果。
本实施例中,提供了一个目标模型,如图10所示(图10为本申请实施例提供的目标模型的一个结构示意图)目标模型包含第一模型(可以是图5、图6、图7或图8中所示的第一模型)、第二模型以及第三模型,这三个模型均为已训练的神经网络模型。其中,第一模型和 第二模型作为并行的两个分支,且第一模型的输出端和第二模型的输出端均和第三模型的输入端连接,第一模型的输入端和第二模型输入端可用于接收第一信息,第三模型的输出端可输出某个应用的页面上可呈现的项目被用户点击的概率。
关于步骤901至步骤902的介绍,可参考图4所示实施例中步骤401至步骤402的相关说明部分,需要说明的是,步骤902与步骤402的区别在于,步骤402中的第一处理结果可直接作为该应用的页面上可呈现的项目被用户点击的概率,步骤902中的第一处理结果可用于间接地得到该应用的页面上可呈现的项目被用户点击的概率。
903、通过第二模型对第一息进行处理,得到第二处理结果。
得到第一信息后,在将第一信息输入至第一模型的同时,还可将第一信息输入至第二模型,以使得第二模型对第一信息进行处理,得到第二处理结果。其中,第二模型可以为以下至少一种:多层感知机、卷积网络、注意力网络、Squeeze-and-Excitation网络以及与第一模型相同的模型。信
904、通过第三模型对第一处理结果以及第二处理结果进行融合,得到项目被用户点击的概率。
第一模型得到第一处理结果以及第二模型得到第二处理结果后,第一模型可将第一处理结果发送至第三模型,第二模型可将第二处理结果发送至第三模型,以使得第三模型将第一处理结果和第二处理结果进行融合(例如,进行加权求和等等),得到融合后的结果即为该应用的页面上可呈现的项目被用户点击的概率,那么,这些概率可用于确定推荐给用户的项目。
应理解,本实施例中,仅以目标模型包含两个分支(第一模型和第二模型)进行示意性介绍,并不对本申请中目标模型中包含的分支的数量构成限制。
此外,还可将本申请实施例提供的神经网络模型与相关技术提供的神经网络模型在多个数据集上展示的性能进行比较,比较结果如表1所示:
表1
需要说明的是,表1中“本申请实施例一”提供的模型为前述的目标模型,“本申请实施例二”提供的模型仅为前述的第一模型。从表1中可以看出,本申请实施例提供的模型可以 取得最好的性能,显示了本申请实施例的优越性。其中,目标模型取得了最好的效果,第一模型取得了次优的效果,这表明本申请实施例提供的第一模型和目标模型均可以提高点击率预估的准确性。
进一步地,本申请实施例提供的目标模型,可适用于各种业务场景,且能取得明显效果,获得业务认可,其线上效果如表2所示:
表2
本申请实施例中,在获取包含用户的属性信息以及项目的属性信息的第一信息后,可将第一信息输入至第一模型进行处理,从而得到第一处理结果,第一处理结果可用于确定项目被用户点击的概率。在处理第一信息时,第一模型先对第一信息进行线性运算,得到第二信息,再对第一信息和第二信息进行非线性运算,得到第三信息,最后基于第二信息以及第三信息,获取第一处理结果。由此可见,第一模型在线性运算的基础上实现了非线性运算,令线性运算和非线性运算之间产生了联系,在这个运算过程中,第一模型不仅可实现信息之间的显式交互以及隐式交互,还可实现信息之间的半显式交互,也就是说,在这个运算过程中,第一模型不仅可以注意到一些频繁出现的项目与用户之间的关系以及一些几乎未曾出现的项目与用户之间的关系,还可注意到除这两类项目之外的其余项目与用户之间的关系,故第一模型既可准确地预测这两类项目被用户点击的概率,也可准确地预测其余项目被用户点击的概率,从而提高模型的整体预测精度。
进一步地,第一模型中可包含N个交互单元,每个交互单元可包含一个线性层和多个非线性层,且这N个交互单元之间呈串联关系,使用这N个交互单元对第一信息进行处理,可对第一信息实现一定数量级次数的线性运算和非线性运算,所得到的第一处理结果为一个高阶的信息(即2^N阶的信息或K^N的信息),基于此信息来作为或确定最终的预测结果,即各个项目被用户点击的概率,具备较高的准确度。
更进一步地,目标模型中的第一模型和第二模型可构成多种类型的模型组合,有利于目标模型为更多业务场景提供服务,具备较高的泛化性能。
以上是对本申请实施例提供的项目推荐方法所进行详细说明,以下将对本申请实施例提供的模型训练方法进行介绍。图11为本申请实施例中的模型训练方法的一个流程示意图,如图11所示,该方法包括:
1101、获取第一信息,第一信息包含用户的属性信息以及项目的属性信息。
本实施例中,当需要对待训练模型(至少包含第一待训练模型)进行训练时,可先获取一批训练数据,该批训练数据包含第一信息,第一信息包含用户的属性信息以及某个应用的页面上可呈现的项目的属性信息。需要说明的是,该应用的页面上可呈现的项目被用户点击的真实概率是已知的(下文称为项目被用户点击的真实概率),这些概率用于确定推荐给用户的真实项目。
在一种可能的实现方式中,第一信息还包含:用户对应用的操作信息以及应用的属性信息,应用用于为用户提供项目。
1102、通过第一待训练模型对第一信息进行处理,得到第一处理结果,第一处理结果用于确定项目被用户点击的概率,第一待训练模型用于:对第一信息进行线性运算,得到第二信息;对第一信息和第二信息进行线性运算,得到第三信息;基于第二信息以及第三信息,获取第一处理结果。
得到第一信息后,可将第一信息输入至第一待训练模型,以使得第一待训练模型对第一信息进行处理,得到第一处理结果,第一处理结果用于获取该应用的页面上可呈现的项目被用户点击的预测概率(下文称为项目被用户点击的预测概率),这些概率可用于确定推荐给用户的(预测)项目。其中,第一待训练模型所进行处理包括:对第一信息进行线性运算,得到第二信息;对第一信息和第二信息进行线性运算,得到第三信息;基于第二信息以及第三信息,获取第一处理结果。
在一种可能的实现方式中,若前述的待训练模型不仅包含第一待训练模型,还包含第二待训练模型以及第三待训练模型,故还可将第一信息输入至第二待训练模型,以使得第二待训练模型对第一信息进行处理,得到第二处理结果,第二待训练模型为以下至少一种:多层感知机、卷积网络、注意力网络、Squeeze-and-Excitation网络以及与第一待训练模型相同的模型。然后,通过第三待训练模型对第一处理结果以及第二处理结果进行融合,得到的融合后的结果即为项目被用户点击的预测概率。
在一种可能的实现方式中,基于第二信息以及第三信息,获取第一处理结果包括:对第二信息以及第三信息进行融合,得到第四信息;基于第四信息,获取第一处理结果。
在一种可能的实现方式中,第一待训练模型包含N个交互单元,第i个交互单元的输入为第i-1个交互单元的输出,N≥1,i=1,...,N,通过第一待训练模型对第一信息进行处理,得到第一处理结果包括:通过第i个交互单元对第i个交互单元的输入进行线性运算,得到第i个交互单元的线性运算结果;通过第i个交互单元对第i个交互单元的输入以及第i个交互单元的线性运算结果进行非线性运算,得到第i个交互单元的非线性运算结果;通过第i个交互单元对第i个交互单元的线性运算结果以及第i个交互单元的非线性运算结果进行融合,得到第i个交互单元的输出;其中,第1个交互模型的输入为第一信息,第1个交互模型的线性运算结果为第二信息,第1个交互模型的非线性运算结果为第三信息,第1个交互模型的输出为第四信息,第N个交互模型的输出为第一处理结果。
在一种可能的实现方式中,通过第一待训练模型对第一信息进行处理,得到第一处理结果还包括:通过第i个交互单元对第i个交互单元的输入以及第i个交互单元的非线性运算结果进行非线性运算,得到第i个交互单元的新的非线性运算结果;通过第i个交互单元对第i个交互单元的线性运算结果以及第i个交互单元的非线性运算结果进行融合,得到第i 个交互单元的输出包括:通过第i个交互单元对第i个交互单元的线性运算结果、第i个交互单元的非线性运算结果以及第i个交互单元的新的非线性运算结果进行融合,得到第i个交互单元的输出。
1103、基于项目被用户点击的概率以及项目被用户点击的真实概率,获取目标损失,目标损失用于指示项目被用户点击的概率以及项目被用户点击的真实概率之间的差异。
得到项目被用户点击的预测概率后,可通过预置的第一损失函数对项目被用户点击的预测概率以及项目被用户点击的真实概率进行计算,得到第一损失,第一损失用于指示项目被用户点击的概率以及项目被用户点击的真实概率之间的差异。那么,若前述的待训练模型仅包含第一待训练模型,可将第一损失直接作为目标损失。
在一种可能的实现方式中,若前述的待训练模型不仅包含第一待训练模型,还包含第二待训练模型以及第三待训练模型,在计算第一损失的同时,还可通过预置的第二损失函数对项目被用户点击的预测概率以及第一处理结果进行计算,得到第二损失,并通过预置的第二损失函数对项目被用户点击的预测概率以及第二处理结果进行计算,得到第三损失。其中,第二损失用于指示项目被用户点击的预测概率以及第一处理结果之间的差异,第三损失用于指示项目被用户点击的预测概率以及第二处理结果之间的差异。那么,可基于第一损失、第二损失和第三损失构建目标损失(例如,将第一损失、第二损失和第三损失进行相加等等),故目标损失可用于指示项目被用户点击的概率以及项目被用户点击的真实概率之间的差异,第一处理结果与项目被用户点击的预测概率之间的差异,第二处理结果与项目被用户点击的预测概率之间的差异。
1104、基于目标损失,对第一待训练模型的参数进行更新,直至满足模型训练条件,得到第一模型。
若前述的待训练模型仅包含第一待训练模型,可基于仅由第一损失构建的目标损失,对第一待训练模型的参数进行更新,并利用下一批训练数据继续对更新参数后的第一待训练模型进行训练,直至满足模型训练条件(例如,目标损失达到收敛等等),得到图4所示实施例中的第一模型。
在一种可能的实现方式中,若前述的待训练模型不仅包含第一待训练模型,还包含第二待训练模型以及第三待训练模型,可基于由第一损失、第二损失以及第三损失构建的目标损失,对对第一待训练模型的参数、第二待训练模型的参数以及第三待训练模型的参数进行更新,并利用下一批训练数据继续对更新参数后的第一待训练模型、更新参数后的第二待训练模型、更新参数后的第三待训练模型进行训练,直至满足模型训练条件,对应得到图9所示实施例中的第一模型、第二模型以及第三模型,即图9所示实施例中的目标模型。
本申请实施例训练得到的第一模型,具备对用户行为进行预测的能力。具体地,在获取包含用户的属性信息以及项目的属性信息的第一信息后,可将第一信息输入至第一模型进行处理,从而得到第一处理结果,第一处理结果可用于确定项目被用户点击的概率。在处理第一信息时,第一模型先对第一信息进行线性运算,得到第二信息,再对第一信息和第二信息进行非线性运算,得到第三信息,最后基于第二信息以及第三信息,获取第一处理结果。由此可见,第一模型在线性运算的基础上实现了非线性运算,令线性运算和非线性运算之间产生了联系,在这个运算过程中,第一模型不仅可实现信息之间的显式交互以及隐式交互,还 可实现信息之间的半显式交互,也就是说,在这个运算过程中,第一模型不仅可以注意到一些频繁出现的项目与用户之间的关系以及一些几乎未曾出现的项目与用户之间的关系,还可注意到除这两类项目之外的其余项目与用户之间的关系,故第一模型既可准确地预测这两类项目被用户点击的概率,也可准确地预测其余项目被用户点击的概率,从而提高模型的整体预测精度。
进一步地,本申请实施例训练得到的第一模型中可包含N个交互单元,每个交互单元可包含一个线性层和多个非线性层,且这N个交互单元之间呈串联关系,使用这N个交互单元对第一信息进行处理,可对第一信息实现一定数量级次数的线性运算和非线性运算,所得到的第一处理结果为一个高阶的信息(即2^N阶的信息或K^N的信息),基于此信息来作为或确定最终的预测结果,即各个项目被用户点击的概率,具备较高的准确度。
更进一步地,本申请实施例训练得到的目标模型中的第一模型和第二模型可构成多种类型的模型组合,有利于目标模型为更多业务场景提供服务,具备较高的泛化性能
进一步地,本申请实施例提供了一种新的模型训练方式,不仅可针对待训练模型计算整体的损失,还可针对待训练模型中的不同分支模型计算相应的损失,从而基于这些损失,有针对性地指导模型中不同分支的参数进行更新,从而提高训练得到的神经网络模型的性能。
以上是对本申请实施例提供的模型训练方法所进行的详细说明,以下将对本申请实施例提供的项目推荐装置以及模型训练装置进行介绍。图12为本申请实施例提供的项目推荐装置的一个结构示意图,如图12所示,该装置包括:
获取模块1201,用于获取第一信息,第一信息包含用户的属性信息以及项目的属性信息;
第一处理模块1202,用于通过第一模型对第一信息进行处理,得到第一处理结果,第一处理结果用于确定推荐给所述用户的项目,第一模型用于:对第一信息进行线性运算,得到第二信息;对第二信息进行非线性运算,得到第三信息;基于第三信息,获取第一处理结果。
本申请实施例中,在获取包含用户的属性信息以及项目的属性信息的第一信息后,可将第一信息输入至第一模型进行处理,从而得到第一处理结果,第一处理结果可用于确定项目被用户点击的概率。在处理第一信息时,第一模型先对第一信息进行线性运算,得到第二信息,再对第一信息和第二信息进行非线性运算,得到第三信息,最后基于第二信息以及第三信息,获取第一处理结果。由此可见,第一模型在线性运算的基础上实现了非线性运算,令线性运算和非线性运算之间产生了联系,在这个运算过程中,第一模型不仅可实现信息之间的显式交互以及隐式交互,还可实现信息之间的半显式交互,也就是说,在这个运算过程中,第一模型不仅可以注意到一些频繁出现的项目与用户之间的关系以及一些几乎未曾出现的项目与用户之间的关系,还可注意到除这两类项目之外的其余项目与用户之间的关系,故第一模型既可准确地预测这两类项目被用户点击的概率,也可准确地预测其余项目被用户点击的概率,从而提高模型的整体预测精度。
在一种可能的实现方式中,第一模型,用于:对第一信息进行线性运算,得到第二信息;对第一信息和第二信息进行非线性运算,得到第三信息;对第二信息以及第三信息进行融合,得到第四信息;基于第四信息,获取第一处理结果。
在一种可能的实现方式中,该装置还包括:第二处理模块,用于通过第二模型对第一信息进行处理,得到第二处理结果,第二模型为以下至少一种:多层感知机、卷积网络、注意 力网络、Squeeze-and-Excitation网络以及与第一模型相同的模型;第三处理模块,用于通过第三模型对第一处理结果以及第二处理结果进行融合,得到的融合后的结果用于确定推荐给用户的项目。
在一种可能的实现方式中,第一模型包含N个交互单元,第i个交互单元的输入为第i-1个交互单元的输出,N≥1,i=1,...,N,第一处理模块,用于:通过第i个交互单元对第i个交互单元的输入进行线性运算,得到第i个交互单元的线性运算结果;通过第i个交互单元对第i个交互单元的输入以及第i个交互单元的线性运算结果进行非线性运算,得到第i个交互单元的非线性运算结果;通过第i个交互单元对第i个交互单元的线性运算结果以及第i个交互单元的非线性运算结果进行融合,得到第i个交互单元的输出;其中,第1个交互单元的输入为第一信息,第1个交互模型的线性运算结果为第二信息,第1个交互模型的非线性运算结果为第三信息,第1个交互模型的输出为第四信息,第N个交互模型的输出为第一处理结果。
在一种可能的实现方式中,第一处理模块,还用于通过第i个交互单元对第i个交互单元的输入以及第i个交互单元的非线性运算结果进行非线性运算,得到第i个交互单元的新的非线性运算结果;第一处理模块,用于通过第i个交互单元对第i个交互单元的线性运算结果、第i个交互单元的非线性运算结果以及第i个交互单元的新的非线性运算结果进行融合,得到第i个交互单元的输出。
在一种可能的实现方式中,第一信息还包含:用户对应用的操作信息以及应用的属性信息,应用用于为用户提供项目。
图13为本申请实施例提供的模型训练装置的一个结构示意图,如图13所示,该装置包括:
第一获取模块1301,用于获取第一信息,第一信息包含用户的属性信息以及项目的属性信息;
第一处理模块1302,用于通过第一待训练模型对第一信息进行处理,得到第一处理结果,第一处理结果用于确定项目被用户点击的概率,项目被用户点击的概率用于确定推荐给用户的项目,第一待训练模型用于:对第一信息进行线性运算,得到第二信息;对第二信息进行线性运算,得到第三信息;基于第三信息,获取第一处理结果;
第二获取模块1303,用于基于项目被用户点击的概率以及项目被用户点击的真实概率,获取目标损失,目标损失用于指示项目被用户点击的概率以及项目被用户点击的真实概率之间的差异;
更新模块1304,用于基于目标损失,对第一待训练模型的参数进行更新,直至满足模型训练条件,得到第一模型。
本申请实施例训练得到的第一模型,具备对用户行为进行预测的能力。具体地,在获取包含用户的属性信息以及项目的属性信息的第一信息后,可将第一信息输入至第一模型进行处理,从而得到第一处理结果,第一处理结果可用于确定项目被用户点击的概率。在处理第一信息时,第一模型先对第一信息进行线性运算,得到第二信息,再对第一信息和第二信息进行非线性运算,得到第三信息,最后基于第二信息以及第三信息,获取第一处理结果。由此可见,第一模型在线性运算的基础上实现了非线性运算,令线性运算和非线性运算之间产 生了联系,在这个运算过程中,第一模型不仅可实现信息之间的显式交互以及隐式交互,还可实现信息之间的半显式交互,也就是说,在这个运算过程中,第一模型不仅可以注意到一些频繁出现的项目与用户之间的关系以及一些几乎未曾出现的项目与用户之间的关系,还可注意到除这两类项目之外的其余项目与用户之间的关系,故第一模型既可准确地预测这两类项目被用户点击的概率,也可准确地预测其余项目被用户点击的概率,从而提高模型的整体预测精度。
在一种可能的实现方式中,该装置还包括:第二处理模块,用于通过第二待训练模型对第一信息进行处理,得到第二处理结果,第二待训练模型为以下至少一种:多层感知机、卷积网络、注意力网络、Squeeze-and-Excitation网络以及与第一待训练模型相同的模型;第三处理模块,用于通过第三待训练模型对第一处理结果以及第二处理结果进行融合,得到的融合后的结果为项目被用户点击的概率。
在一种可能的实现方式中,第二获取模块,用于基于项目被用户点击的概率、项目被用户点击的真实概率、第一处理结果以及第二处理结果,获取目标损失,目标损失用于指示项目被用户点击的概率以及项目被用户点击的真实概率之间的差异,第一处理结果与项目被用户点击的概率之间的差异,第二处理结果与项目被用户点击的概率之间的差异;更新模块,用于基于目标损失,对第一待训练模型的参数、第二待训练模型的参数以及第三待训练模型的参数进行更新,直至满足模型训练条件,对应得到第一模型、第二模型以及第三模型。
在一种可能的实现方式中,第一待训练模型,用于:对第二信息以及第三信息进行融合,得到第四信息;基于第四信息,获取第一处理结果。
在一种可能的实现方式中,第一待训练模型包含N个交互单元,第i个交互单元的输入为第i-1个交互单元的输出,N≥1,i=1,...,N,第一处理模块1302,用于:通过第i个交互单元对第i个交互单元的输入进行线性运算,得到第i个交互单元的线性运算结果;通过第i个交互单元对第i个交互单元的输入以及第i个交互单元的线性运算结果进行非线性运算,得到第i个交互单元的非线性运算结果;通过第i个交互单元对第i个交互单元的线性运算结果以及第i个交互单元的非线性运算结果进行融合,得到第i个交互单元的输出;其中,第1个交互模型的输入为第一信息,第1个交互模型的线性运算结果为第二信息,第1个交互模型的非线性运算结果为第三信息,第1个交互模型的输出为第四信息,第N个交互模型的输出为第一处理结果。
在一种可能的实现方式中,第一处理模块1302,还用于:通过第i个交互单元对第i个交互单元的输入以及第i个交互单元的非线性运算结果进行非线性运算,得到第i个交互单元的新的非线性运算结果;第一处理模块1302,用于通过第i个交互单元对第i个交互单元的线性运算结果、第i个交互单元的非线性运算结果以及第i个交互单元的新的非线性运算结果进行融合,得到第i个交互单元的输出。
在一种可能的实现方式中,第一信息还包含:用户对应用的操作信息以及应用的属性信息,应用用于为用户提供项目。
需要说明的是,上述装置各模块/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其带来的技术效果与本申请方法实施例相同,具体内容可参考本申请实施例前述所示的方法实施例中的叙述,此处不再赘述。
本申请实施例还涉及一种执行设备,图14为本申请实施例提供的执行设备的一个结构示意图。如图14所示,执行设备1400具体可以表现为手机、平板、笔记本电脑、智能穿戴设备、服务器等,此处不做限定。其中,执行设备1400上可部署有图12对应实施例中所描述的项目推荐装置,用于实现图4或图9对应实施例中项目推荐的功能。具体的,执行设备1400包括:接收器1401、发射器1402、处理器1403和存储器1404(其中执行设备1400中的处理器1403的数量可以一个或多个,图14中以一个处理器为例),其中,处理器1403可以包括应用处理器14031和通信处理器14032。在本申请的一些实施例中,接收器1401、发射器1402、处理器1403和存储器1404可通过总线或其它方式连接。
存储器1404可以包括只读存储器和随机存取存储器,并向处理器1403提供指令和数据。存储器1404的一部分还可以包括非易失性随机存取存储器(non-volatile random access memory,NVRAM)。存储器1404存储有处理器和操作指令、可执行模块或者数据结构,或者它们的子集,或者它们的扩展集,其中,操作指令可包括各种操作指令,用于实现各种操作。
处理器1403控制执行设备的操作。具体的应用中,执行设备的各个组件通过总线系统耦合在一起,其中总线系统除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图中将各种总线都称为总线系统。
上述本申请实施例揭示的方法可以应用于处理器1403中,或者由处理器1403实现。处理器1403可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器1403中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器1403可以是通用处理器、数字信号处理器(digital signal processing,DSP)、微处理器或微控制器,还可进一步包括专用集成电路(application specific integrated circuit,ASIC)、现场可编程门阵列(field-programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。该处理器1403可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器1404,处理器1403读取存储器1404中的信息,结合其硬件完成上述方法的步骤。
接收器1401可用于接收输入的数字或字符信息,以及产生与执行设备的相关设置以及功能控制有关的信号输入。发射器1402可用于通过第一接口输出数字或字符信息;发射器1402还可用于通过第一接口向磁盘组发送指令,以修改磁盘组中的数据;发射器1402还可以包括显示屏等显示设备。
本申请实施例中,在一种情况下,处理器1403,用于通过图4对应实施例中的第一模型或图9对应实施例中的目标模型,对与用户相关联的信息进行项目推荐。
本申请实施例还涉及一种训练设备,图15为本申请实施例提供的训练设备的一个结构示意图。如图15所示,训练设备1500由一个或多个服务器实现,训练设备1500可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上中央处理器(central processing units,CPU)1514(例如,一个或一个以上处理器)和存储器1532,一个或一个以上存储应 用程序1542或数据1544的存储介质1530(例如一个或一个以上海量存储设备)。其中,存储器1532和存储介质1530可以是短暂存储或持久存储。存储在存储介质1530的程序可以包括一个或一个以上模块(图示没标出),每个模块可以包括对训练设备中的一系列指令操作。更进一步地,中央处理器1514可以设置为与存储介质1530通信,在训练设备1500上执行存储介质1530中的一系列指令操作。
训练设备1500还可以包括一个或一个以上电源1526,一个或一个以上有线或无线网络接口1550,一个或一个以上输入输出接口1558;或,一个或一个以上操作系统1541,例如Windows ServerTM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM等等。
具体的,训练设备可以执行图11对应实施例中的模型训练方法。
本申请实施例还涉及一种计算机存储介质,该计算机可读存储介质中存储有用于进行信号处理的程序,当其在计算机上运行时,使得计算机执行如前述执行设备所执行的步骤,或者,使得计算机执行如前述训练设备所执行的步骤。
本申请实施例还涉及一种计算机程序产品,该计算机程序产品存储有指令,该指令在由计算机执行时使得计算机执行如前述执行设备所执行的步骤,或者,使得计算机执行如前述训练设备所执行的步骤。
本申请实施例提供的执行设备、训练设备或终端设备具体可以为芯片,芯片包括:处理单元和通信单元,所述处理单元例如可以是处理器,所述通信单元例如可以是输入/输出接口、管脚或电路等。该处理单元可执行存储单元存储的计算机执行指令,以使执行设备内的芯片执行上述实施例描述的数据处理方法,或者,以使训练设备内的芯片执行上述实施例描述的数据处理方法。可选地,所述存储单元为所述芯片内的存储单元,如寄存器、缓存等,所述存储单元还可以是所述无线接入设备端内的位于所述芯片外部的存储单元,如只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)等。
具体的,请参阅图16,图16为本申请实施例提供的芯片的一个结构示意图,所述芯片可以表现为神经网络处理器NPU 1600,NPU 1600作为协处理器挂载到主CPU(Host CPU)上,由Host CPU分配任务。NPU的核心部分为运算电路1603,通过控制器1604控制运算电路1603提取存储器中的矩阵数据并进行乘法运算。
在一些实现中,运算电路1603内部包括多个处理单元(Process Engine,PE)。在一些实现中,运算电路1603是二维脉动阵列。运算电路1603还可以是一维脉动阵列或者能够执行例如乘法和加法这样的数学运算的其它电子线路。在一些实现中,运算电路1603是通用的矩阵处理器。
举例来说,假设有输入矩阵A,权重矩阵B,输出矩阵C。运算电路从权重存储器1602中取矩阵B相应的数据,并缓存在运算电路中每一个PE上。运算电路从输入存储器1601中取矩阵A数据与矩阵B进行矩阵运算,得到的矩阵的部分结果或最终结果,保存在累加器(accumulator)1608中。
统一存储器1606用于存放输入数据以及输出数据。权重数据直接通过存储单元访问控制器(Direct Memory Access Controller,DMAC)1605,DMAC被搬运到权重存储器1602中。输入数据也通过DMAC被搬运到统一存储器1606中。
BIU为Bus Interface Unit即,总线接口单元1613,用于AXI总线与DMAC和取指存储器(Instruction Fetch Buffer,IFB)1609的交互。
总线接口单元1613(Bus Interface Unit,简称BIU),用于取指存储器1609从外部存储器获取指令,还用于存储单元访问控制器1605从外部存储器获取输入矩阵A或者权重矩阵B的原数据。
DMAC主要用于将外部存储器DDR中的输入数据搬运到统一存储器1606或将权重数据搬运到权重存储器1602中或将输入数据数据搬运到输入存储器1601中。
向量计算单元1607包括多个运算处理单元,在需要的情况下,对运算电路1603的输出做进一步处理,如向量乘,向量加,指数运算,对数运算,大小比较等等。主要用于神经网络中非卷积/全连接层网络计算,如Batch Normalization(批归一化),像素级求和,对预测标签平面进行上采样等。
在一些实现中,向量计算单元1607能将经处理的输出的向量存储到统一存储器1606。例如,向量计算单元1607可以将线性函数;或,非线性函数应用到运算电路1603的输出,例如对卷积层提取的预测标签平面进行线性插值,再例如累加值的向量,用以生成激活值。在一些实现中,向量计算单元1607生成归一化的值、像素级求和的值,或二者均有。在一些实现中,处理过的输出的向量能够用作到运算电路1603的激活输入,例如用于在神经网络中的后续层中的使用。
控制器1604连接的取指存储器(instruction fetch buffer)1609,用于存储控制器1604使用的指令;
统一存储器1606,输入存储器1601,权重存储器1602以及取指存储器1609均为On-Chip存储器。外部存储器私有于该NPU硬件架构。
其中,上述任一处提到的处理器,可以是一个通用中央处理器,微处理器,ASIC,或一个或多个用于控制上述程序执行的集成电路。
另外需说明的是,以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。另外,本申请提供的装置实施例附图中,模块之间的连接关系表示它们之间具有通信连接,具体可以实现为一条或多条通信总线或信号线。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到本申请可借助软件加必需的通用硬件的方式来实现,当然也可以通过专用硬件包括专用集成电路、专用CPU、专用存储器、专用元器件等来实现。一般情况下,凡由计算机程序完成的功能都可以很容易地用相应的硬件来实现,而且,用来实现同一功能的具体硬件结构也可以是多种多样的,例如模拟电路、数字电路或专用电路等。但是,对本申请而言更多情况下软件程序实现是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在可读取的存储介质中,如计算机的软盘、U盘、移动硬盘、ROM、RAM、磁碟或者光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,训练设备,或者网络设备等)执行本申请各个实施例所述的方法。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。
所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、训练设备或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、训练设备或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存储的任何可用介质或者是包含一个或多个可用介质集成的训练设备、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘(Solid State Disk,SSD))等。

Claims (21)

  1. 一种项目推荐方法,其特征在于,所述方法包括:
    获取第一信息,所述第一信息包含用户的属性信息以及项目的属性信息;
    通过第一模型对所述第一信息进行处理,得到第一处理结果,所述第一处理结果用于确定推荐给所述用户的项目,所述第一模型用于:对所述第一信息进行线性运算,得到第二信息;对所述第二信息进行非线性运算,得到第三信息;基于所述第三信息,获取所述第一处理结果。
  2. 根据权利要求1所述的方法,其特征在于,所述第一模型用于:
    对所述第一信息进行线性运算,得到第二信息;
    对所述第一信息和所述第二信息进行非线性运算,得到第三信息;
    对所述第二信息以及所述第三信息进行融合,得到第四信息;
    基于所述第四信息,获取所述第一处理结果。
  3. 根据权利要求1或2所述的方法,其特征在于,所述方法还包括:
    通过第二模型对所述第一信息进行处理,得到第二处理结果,所述第二模型为以下至少一种:多层感知机、卷积网络、注意力网络、Squeeze-and-Excitation网络以及与所述第一模型相同的模型;
    通过第三模型对所述第一处理结果以及所述第二处理结果进行融合,得到的融合后的结果用于确定推荐给所述用户的项目。
  4. 根据权利要求2所述的方法,其特征在于,所述第一模型包含N个交互单元,第i个交互单元的输入为第i-1个交互单元的输出,N≥1,i=1,...,N,所述通过第一模型对所述第一信息进行处理,得到所述第一处理结果包括:
    通过所述第i个交互单元对所述第i个交互单元的输入进行线性运算,得到所述第i个交互单元的线性运算结果;
    通过所述第i个交互单元对所述第i个交互单元的输入以及所述第i个交互单元的线性运算结果进行非线性运算,得到所述第i个交互单元的非线性运算结果;
    通过所述第i个交互单元对所述第i个交互单元的线性运算结果以及所述第i个交互单元的非线性运算结果进行融合,得到所述第i个交互单元的输出;
    其中,第1个交互单元的输入为所述第一信息,所述第1个交互模型的线性运算结果为所述第二信息,所述第1个交互模型的非线性运算结果为所述第三信息,所述第1个交互模型的输出为所述第四信息,第N个交互模型的输出为所述第一处理结果。
  5. 根据权利要求4所述的方法,其特征在于,所述通过第一模型对所述第一信息进行处理,得到所述第一处理结果还包括:
    通过所述第i个交互单元对所述第i个交互单元的输入以及所述第i个交互单元的非线性运算结果进行非线性运算,得到所述第i个交互单元的新的非线性运算结果;
    所述通过所述第i个交互单元对所述第i个交互单元的线性运算结果以及所述第i个交互单元的非线性运算结果进行融合,得到所述第i个交互单元的输出包括:
    通过所述第i个交互单元对所述第i个交互单元的线性运算结果、所述第i个交互单元的非线性运算结果以及所述第i个交互单元的新的非线性运算结果进行融合,得到所述第i 个交互单元的输出。
  6. 根据权利要求1至5任意一项所述的方法,其特征在于,所述第一信息还包含:所述用户对应用的操作信息以及所述应用的属性信息,所述应用用于为所述用户提供所述项目。
  7. 一种模型训练方法,其特征在于,所述方法包括:
    获取第一信息,所述第一信息包含用户的属性信息以及项目的属性信息;
    通过第一待训练模型对所述第一信息进行处理,得到第一处理结果,所述第一处理结果用于确定所述项目被用户点击的概率,所述项目被用户点击的概率用于确定推荐给用户的项目,所述第一待训练模型用于:对所述第一信息进行线性运算,得到第二信息;对所述第二信息进行线性运算,得到第三信息;基于所述第三信息,获取所述第一处理结果;
    基于所述项目被用户点击的概率以及所述项目被用户点击的真实概率,获取目标损失,所述目标损失用于指示所述项目被用户点击的概率以及所述项目被用户点击的真实概率之间的差异;
    基于所述目标损失,对所述第一待训练模型的参数进行更新,直至满足模型训练条件,得到第一模型。
  8. 根据权利要求7所述的方法,其特征在于,所述方法还包括:
    通过第二待训练模型对所述第一信息进行处理,得到第二处理结果,所述第二待训练模型为以下至少一种:多层感知机、卷积网络、注意力网络、Squeeze-and-Excitation网络以及与所述第一待训练模型相同的模型;
    通过第三待训练模型对所述第一处理结果以及所述第二处理结果进行融合,得到的融合后的结果为所述项目被用户点击的概率。
  9. 根据权利要求8所述的方法,其特征在于,所述基于所述项目被用户点击的概率以及所述项目被用户点击的真实概率,获取目标损失,所述目标损失用于指示所述项目被用户点击的概率以及所述项目被用户点击的真实概率之间的差异包括:
    基于所述项目被用户点击的概率、所述项目被用户点击的真实概率、所述第一处理结果以及所述第二处理结果,获取目标损失,所述目标损失用于指示所述项目被用户点击的概率以及所述项目被用户点击的真实概率之间的差异,所述第一处理结果与所述项目被用户点击的概率之间的差异,所述第二处理结果与所述项目被用户点击的概率之间的差异;
    所述基于所述目标损失,对所述第一待训练模型的参数进行更新,直至满足模型训练条件,得到第一模型包括:
    基于所述目标损失,对所述第一待训练模型的参数、所述第二待训练模型的参数以及所述第三待训练模型的参数进行更新,直至满足模型训练条件,对应得到第一模型、第二模型以及第三模型。
  10. 一种项目推荐装置,其特征在于,所述装置包括:
    获取模块,用于获取第一信息,所述第一信息包含用户的属性信息以及项目的属性信息;
    第一处理模块,用于通过第一模型对所述第一信息进行处理,得到第一处理结果,所述第一处理结果用于确定推荐给所述用户的项目,所述第一模型用于:对所述第一信息进行线性运算,得到第二信息;对所述第二信息进行非线性运算,得到第三信息;基于所述第三信息,获取所述第一处理结果。
  11. 根据权利要求10所述的装置,其特征在于,所述第一模型,用于:
    对所述第一信息进行线性运算,得到第二信息;
    对所述第一信息和所述第二信息进行非线性运算,得到第三信息;
    对所述第二信息以及所述第三信息进行融合,得到第四信息;
    基于所述第四信息,获取所述第一处理结果。
  12. 根据权利要求10或11所述的装置,其特征在于,所述装置还包括:
    第二处理模块,用于通过第二模型对所述第一信息进行处理,得到第二处理结果,所述第二模型为以下至少一种:多层感知机、卷积网络、注意力网络、Squeeze-and-Excitation网络以及与所述第一模型相同的模型;
    第三处理模块,用于通过第三模型对所述第一处理结果以及所述第二处理结果进行融合,得到的融合后的结果用于确定推荐给所述用户的项目。
  13. 根据权利要求11所述的装置,其特征在于,所述第一模型包含N个交互单元,第i个交互单元的输入为第i-1个交互单元的输出,N≥1,i=1,...,N,所述第一处理模块,用于:
    通过所述第i个交互单元对所述第i个交互单元的输入进行线性运算,得到所述第i个交互单元的线性运算结果;
    通过所述第i个交互单元对所述第i个交互单元的输入以及所述第i个交互单元的线性运算结果进行非线性运算,得到所述第i个交互单元的非线性运算结果;
    通过所述第i个交互单元对所述第i个交互单元的线性运算结果以及所述第i个交互单元的非线性运算结果进行融合,得到所述第i个交互单元的输出;
    其中,第1个交互单元的输入为所述第一信息,所述第1个交互模型的线性运算结果为所述第二信息,所述第1个交互模型的非线性运算结果为所述第三信息,所述第1个交互模型的输出为所述第四信息,第N个交互模型的输出为所述第一处理结果。
  14. 根据权利要求13所述的装置,其特征在于,所述第一处理模块,还用于通过所述第i个交互单元对所述第i个交互单元的输入以及所述第i个交互单元的非线性运算结果进行非线性运算,得到所述第i个交互单元的新的非线性运算结果;
    所述第一处理模块,用于通过所述第i个交互单元对所述第i个交互单元的线性运算结果、所述第i个交互单元的非线性运算结果以及所述第i个交互单元的新的非线性运算结果进行融合,得到所述第i个交互单元的输出。
  15. 根据权利要求10至14任意一项所述的装置,其特征在于,所述第一信息还包含:所述用户对应用的操作信息以及所述应用的属性信息,所述应用用于为所述用户提供所述项目。
  16. 一种模型训练装置,其特征在于,所述装置包括:
    第一获取模块,用于获取第一信息,所述第一信息包含用户的属性信息以及项目的属性信息;
    第一处理模块,用于通过第一待训练模型对所述第一信息进行处理,得到第一处理结果,所述第一处理结果用于确定所述项目被用户点击的概率,所述项目被用户点击的概率用于确定推荐给用户的项目,所述第一待训练模型用于:对所述第一信息进行线性运算,得到第二信息;对所述第二信息进行线性运算,得到第三信息;基于所述第三信息,获取所述第一处理结果;
    第二获取模块,用于基于所述项目被用户点击的概率以及所述项目被用户点击的真实概率,获取目标损失,所述目标损失用于指示所述项目被用户点击的概率以及所述项目被用户点击的真实概率之间的差异;
    更新模块,用于基于所述目标损失,对所述第一待训练模型的参数进行更新,直至满足模型训练条件,得到第一模型。
  17. 根据权利要求16所述的装置,其特征在于,所述装置还包括:
    第二处理模块,用于通过第二待训练模型对所述第一信息进行处理,得到第二处理结果,所述第二待训练模型为以下至少一种:多层感知机、卷积网络、注意力网络、Squeeze-and-Excitation网络以及与所述第一待训练模型相同的模型;
    第三处理模块,用于通过第三待训练模型对所述第一处理结果以及所述第二处理结果进行融合,得到的融合后的结果为所述项目被用户点击的概率。
  18. 根据权利要求17所述的装置,其特征在于,所述第二获取模块,用于基于所述项目被用户点击的概率、所述项目被用户点击的真实概率、所述第一处理结果以及所述第二处理结果,获取目标损失,所述目标损失用于指示所述项目被用户点击的概率以及所述项目被用户点击的真实概率之间的差异,所述第一处理结果与所述项目被用户点击的概率之间的差异,所述第二处理结果与所述项目被用户点击的概率之间的差异;
    所述更新模块,用于基于所述目标损失,对所述第一待训练模型的参数、所述第二待训练模型的参数以及所述第三待训练模型的参数进行更新,直至满足模型训练条件,对应得到第一模型、第二模型以及第三模型。
  19. 一种项目推荐装置,其特征在于,所述装置包括存储器和处理器;所述存储器存储有代码,所述处理器被配置为执行所述代码,当所述代码被执行时,所述项目推荐装置执行如权利要求1至9任意一项所述的方法。
  20. 一种计算机存储介质,其特征在于,所述计算机存储介质存储有一个或多个指令,所述指令在由一个或多个计算机执行时使得所述一个或多个计算机实施权利要求1至9任一所述的方法。
  21. 一种计算机程序产品,其特征在于,所述计算机程序产品存储有指令,所述指令在由计算机执行时,使得所述计算机实施权利要求1至9任意一项所述的方法。
PCT/CN2023/098289 2022-06-08 2023-06-05 一种项目推荐方法及其相关设备 WO2023236900A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210641372.7A CN117251487A (zh) 2022-06-08 2022-06-08 一种项目推荐方法及其相关设备
CN202210641372.7 2022-06-08

Publications (1)

Publication Number Publication Date
WO2023236900A1 true WO2023236900A1 (zh) 2023-12-14

Family

ID=89117533

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/098289 WO2023236900A1 (zh) 2022-06-08 2023-06-05 一种项目推荐方法及其相关设备

Country Status (2)

Country Link
CN (1) CN117251487A (zh)
WO (1) WO2023236900A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080300986A1 (en) * 2007-06-01 2008-12-04 Nhn Corporation Method and system for contextual advertisement
CN110033342A (zh) * 2019-01-30 2019-07-19 阿里巴巴集团控股有限公司 一种推荐模型的训练方法及装置、一种推荐方法及装置
CN110851713A (zh) * 2019-11-06 2020-02-28 腾讯科技(北京)有限公司 信息处理方法、推荐方法及相关设备
CN113508378A (zh) * 2019-10-31 2021-10-15 华为技术有限公司 推荐模型的训练方法、推荐方法、装置及计算机可读介质
CN114117216A (zh) * 2021-11-23 2022-03-01 广州博冠信息科技有限公司 推荐概率预测方法及装置、计算机存储介质和电子设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080300986A1 (en) * 2007-06-01 2008-12-04 Nhn Corporation Method and system for contextual advertisement
CN110033342A (zh) * 2019-01-30 2019-07-19 阿里巴巴集团控股有限公司 一种推荐模型的训练方法及装置、一种推荐方法及装置
CN113508378A (zh) * 2019-10-31 2021-10-15 华为技术有限公司 推荐模型的训练方法、推荐方法、装置及计算机可读介质
CN110851713A (zh) * 2019-11-06 2020-02-28 腾讯科技(北京)有限公司 信息处理方法、推荐方法及相关设备
CN114117216A (zh) * 2021-11-23 2022-03-01 广州博冠信息科技有限公司 推荐概率预测方法及装置、计算机存储介质和电子设备

Also Published As

Publication number Publication date
CN117251487A (zh) 2023-12-19

Similar Documents

Publication Publication Date Title
WO2021047593A1 (zh) 推荐模型的训练方法、预测选择概率的方法及装置
US20220383078A1 (en) Data processing method and related device
WO2022022274A1 (zh) 一种模型训练方法及装置
US20230229898A1 (en) Data processing method and related device
WO2023221928A1 (zh) 一种推荐方法、训练方法以及装置
WO2021129668A1 (zh) 训练神经网络的方法和装置
WO2023274052A1 (zh) 一种图像分类方法及其相关设备
WO2022179586A1 (zh) 一种模型训练方法及其相关联设备
WO2024001806A1 (zh) 一种基于联邦学习的数据价值评估方法及其相关设备
WO2023185925A1 (zh) 一种数据处理方法及相关装置
WO2024002167A1 (zh) 一种操作预测方法及相关装置
WO2023246735A1 (zh) 一种项目推荐方法及其相关设备
WO2023197910A1 (zh) 一种用户行为预测方法及其相关设备
WO2024046144A1 (zh) 一种视频处理方法及其相关设备
CN114169393A (zh) 一种图像分类方法及其相关设备
WO2023185541A1 (zh) 一种模型训练方法及其相关设备
WO2023197857A1 (zh) 一种模型切分方法及其相关设备
CN113627421A (zh) 一种图像处理方法、模型的训练方法以及相关设备
US20230117973A1 (en) Data processing method and apparatus
CN116739154A (zh) 一种故障预测方法及其相关设备
WO2023050143A1 (zh) 一种推荐模型训练方法及装置
WO2023236900A1 (zh) 一种项目推荐方法及其相关设备
WO2024061123A1 (zh) 一种图像处理方法及其相关设备
WO2023231796A1 (zh) 一种视觉任务处理方法及其相关设备
WO2023045949A1 (zh) 一种模型训练方法及其相关设备

Legal Events

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

Ref document number: 23819065

Country of ref document: EP

Kind code of ref document: A1