CN117892822A - Model reasoning method and device - Google Patents

Model reasoning method and device Download PDF

Info

Publication number
CN117892822A
CN117892822A CN202311769439.6A CN202311769439A CN117892822A CN 117892822 A CN117892822 A CN 117892822A CN 202311769439 A CN202311769439 A CN 202311769439A CN 117892822 A CN117892822 A CN 117892822A
Authority
CN
China
Prior art keywords
reasoning
resource
model
result
feature
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311769439.6A
Other languages
Chinese (zh)
Inventor
魏菱延
李剑戈
吴华普
刘菲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Securities Co Ltd
Original Assignee
China Securities Co Ltd
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 China Securities Co Ltd filed Critical China Securities Co Ltd
Priority to CN202311769439.6A priority Critical patent/CN117892822A/en
Publication of CN117892822A publication Critical patent/CN117892822A/en
Pending legal-status Critical Current

Links

Abstract

The embodiment of the invention provides a model reasoning method and device, which relate to the technical field of data processing, and specifically comprise the following steps: periodically acquiring user side characteristics of candidate resources related to a target user, and inputting the user side characteristics into a resource recommendation model; obtaining resource characteristics of the candidate resources which are irrelevant to users, and inputting the resource characteristics into the resource recommendation model; responding to the received resource recommendation request of the target user, and acquiring real-time characteristics aiming at the target user from the characteristics of the candidate resources; inputting the real-time features into the resource recommendation model; and obtaining the reference information of whether the candidate resource is recommended or not, which is output by the resource recommendation model based on the successfully obtained reasoning result. By applying the model reasoning scheme provided by the embodiment of the invention, the model reasoning efficiency can be improved.

Description

Model reasoning method and device
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a model reasoning method and apparatus.
Background
In the resource recommendation process, a server responds to a resource recommendation request, acquires information of candidate resources, inputs the information of the candidate resources into a resource recommendation model, performs model reasoning on the basis of the information of the candidate resources, and outputs reference information of whether the candidate resources are recommended or not, so that the server determines resources to be recommended to a user based on the reference information corresponding to each candidate resource, and feeds back the information of the determined resources to a client used by the user.
In order to ensure the accuracy of recommending resources to users, the information processed by the resource recommendation model is usually high-dimensional and large-data-volume information, so that the calculation amount of model reasoning in the resource recommendation process is large and the efficiency is low.
Disclosure of Invention
The embodiment of the invention aims to provide a model reasoning method and device so as to improve the efficiency of model reasoning. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a model reasoning method, where the method includes:
periodically acquiring user side characteristics of candidate resources related to a target user, inputting the user side characteristics into a resource recommendation model, so that the resource recommendation model performs model reasoning based on the user side characteristics to obtain a first reasoning result representing recommendation priority of the candidate resources, and caching the first reasoning result;
obtaining resource characteristics of the candidate resources, which are irrelevant to users, and inputting the resource characteristics into the resource recommendation model so that the resource recommendation model performs model reasoning based on the resource characteristics to obtain a second reasoning result representing the recommendation priority of the candidate resources, and caching the second reasoning result;
Responding to the received resource recommendation request of the target user, and acquiring real-time characteristics aiming at the target user from the characteristics of the candidate resources;
inputting the real-time features into the resource recommendation model so that the resource recommendation model performs model reasoning based on the real-time features to obtain a third reasoning result representing the recommendation priority of the candidate resources;
obtaining reference information of whether to recommend the candidate resource, which is output by the resource recommendation model based on successfully obtained reasoning results, wherein the successfully obtained reasoning results comprise: and successfully obtained reasoning results in the first reasoning result and the third reasoning result and the second reasoning result.
In one embodiment of the present invention, the obtaining the reference information of whether to recommend the candidate resource, which is output by the resource recommendation model based on the successfully obtained reasoning result, includes:
and obtaining the reference information of whether the candidate resource is recommended or not, wherein the reference information is obtained by adding the resource recommendation model based on each successfully obtained reasoning result.
In one embodiment of the present invention, the resource recommendation model performs model reasoning as follows:
And carrying out weighted summation on the feature values of each feature dimension in the input features according to the weight coefficients corresponding to the input features of the model to obtain an inference result.
In one embodiment of the present invention, the weighting and summing the feature values of each feature dimension in the input features according to the weight coefficient corresponding to the input features of the model to obtain the reasoning result includes:
under the condition that the input characteristics are the user side characteristics, carrying out timeliness division on the user side characteristics to obtain sub-characteristics belonging to each preset timeliness type;
for each time effect type, weighting and summing characteristic values of sub-characteristics of the time effect type according to sub-weight coefficients corresponding to the time effect type to obtain a sub-reasoning result;
and adding and processing the sub-reasoning results corresponding to each aging type to obtain the first reasoning result.
In one embodiment of the present invention, the aging type includes a history feature type, a near-line feature type, and a real-time feature type, wherein feature aging corresponding to the history feature type is lower than feature aging corresponding to the near-line feature type, and feature aging corresponding to the near-line feature type is lower than feature aging corresponding to the real-time feature type.
In one embodiment of the present invention, the periodically acquiring the user-side feature of the candidate resource related to the target user includes:
and periodically acquiring user side characteristics of candidate resources related to the target user under the condition that the target user is an active user.
In one embodiment of the invention, the resource recommendation model comprises a data calculation layer, a data cache layer and an online reasoning layer;
the step of inputting the user-side features into a resource recommendation model comprises the following steps:
inputting the user-side features into the data computation layer;
the resource recommendation model performs model reasoning based on the user side characteristics to obtain a first reasoning result representing recommendation priority of the candidate resource, and caches the first reasoning result, and the method comprises the following steps:
the data calculation layer performs model reasoning based on the user side characteristics to obtain a first reasoning result representing the recommendation priority of the candidate resources, and the first reasoning result is stored in the data caching layer;
the inputting the resource characteristics into the resource recommendation model includes:
inputting the resource characteristics into the data calculation layer;
the resource recommendation model performs model reasoning based on the resource characteristics to obtain a second reasoning result representing the recommendation priority of the candidate resource, caches the second reasoning result, and comprises the following steps:
The data calculation layer performs model reasoning based on the resource characteristics to obtain a second reasoning result representing the recommendation priority of the candidate resources, and the second reasoning result is stored in the data caching layer;
the inputting the real-time features into the resource recommendation model includes:
storing the real-time features to the data caching layer;
the resource recommendation model performs model reasoning based on the real-time characteristics to obtain a third reasoning result representing the recommendation priority of the candidate resource, and the method comprises the following steps:
the online reasoning layer acquires the real-time features from the data cache layer, and performs model reasoning based on the real-time features to obtain a third reasoning result representing the recommendation priority of the candidate resources;
the obtaining the reference information of whether to recommend the candidate resource, which is output by the resource recommendation model based on the successfully obtained reasoning result, includes:
and obtaining the reference information of whether the candidate resource is recommended or not, which is output by the online reasoning layer based on the successfully obtained reasoning result.
In a second aspect, an embodiment of the present invention provides a model inference apparatus, including:
the first acquisition module is used for periodically acquiring user side characteristics of candidate resources related to a target user, inputting the user side characteristics into a resource recommendation model, so that the resource recommendation model performs model reasoning based on the user side characteristics to obtain a first reasoning result representing recommendation priority of the candidate resources, and caching the first reasoning result;
The second acquisition module is used for acquiring the resource characteristics of the candidate resources, which are irrelevant to the user, and inputting the resource characteristics into the resource recommendation model so that the resource recommendation model performs model reasoning based on the resource characteristics to acquire a second reasoning result representing the recommendation priority of the candidate resources, and caching the second reasoning result;
the third acquisition module is used for responding to the received resource recommendation request of the target user and acquiring real-time characteristics aiming at the target user from the characteristics of the candidate resources;
the feature input module is used for inputting the real-time features into the resource recommendation model so that the resource recommendation model performs model reasoning based on the real-time features to obtain a third reasoning result representing the recommendation priority of the candidate resources;
the information obtaining module is used for obtaining reference information of whether the candidate resource is recommended or not, which is output by the resource recommendation model based on successfully obtained reasoning results, wherein the successfully obtained reasoning results comprise: and successfully obtained reasoning results in the first reasoning result and the third reasoning result and the second reasoning result.
In one embodiment of the present invention, the information obtaining module is specifically configured to:
and obtaining the reference information of whether the candidate resource is recommended or not, wherein the reference information is obtained by adding the resource recommendation model based on each successfully obtained reasoning result.
In one embodiment of the present invention, the resource recommendation model performs model reasoning as follows:
and carrying out weighted summation on the feature values of each feature dimension in the input features according to the weight coefficients corresponding to the input features of the model to obtain an inference result.
In one embodiment of the present invention, the weighting and summing the feature values of each feature dimension in the input features according to the weight coefficient corresponding to the input features of the model to obtain the reasoning result includes:
under the condition that the input characteristics are the user side characteristics, carrying out timeliness division on the user side characteristics to obtain sub-characteristics belonging to each preset timeliness type;
for each time effect type, weighting and summing characteristic values of sub-characteristics of the time effect type according to sub-weight coefficients corresponding to the time effect type to obtain a sub-reasoning result;
and adding and processing the sub-reasoning results corresponding to each aging type to obtain the first reasoning result.
In one embodiment of the present invention, the aging type includes a history feature type, a near-line feature type, and a real-time feature type, wherein feature aging corresponding to the history feature type is lower than feature aging corresponding to the near-line feature type, and feature aging corresponding to the near-line feature type is lower than feature aging corresponding to the real-time feature type.
In one embodiment of the present invention, the first obtaining module is specifically configured to:
and periodically acquiring user side characteristics of candidate resources related to the target user under the condition that the target user is an active user.
In one embodiment of the invention, the resource recommendation model comprises a data calculation layer, a data cache layer and an online reasoning layer;
the first obtaining module is specifically configured to:
inputting the user-side features into the data computation layer;
the resource recommendation model performs model reasoning based on the user side characteristics to obtain a first reasoning result representing recommendation priority of the candidate resource, and caches the first reasoning result, and the method comprises the following steps:
the data calculation layer performs model reasoning based on the user side characteristics to obtain a first reasoning result representing the recommendation priority of the candidate resources, and the first reasoning result is stored in the data caching layer;
The second obtaining module is specifically configured to:
inputting the resource characteristics into the data calculation layer;
the resource recommendation model performs model reasoning based on the resource characteristics to obtain a second reasoning result representing the recommendation priority of the candidate resource, caches the second reasoning result, and comprises the following steps:
the data calculation layer performs model reasoning based on the resource characteristics to obtain a second reasoning result representing the recommendation priority of the candidate resources, and the second reasoning result is stored in the data caching layer;
the third obtaining module is specifically configured to:
storing the real-time features to the data caching layer;
the resource recommendation model performs model reasoning based on the real-time characteristics to obtain a third reasoning result representing the recommendation priority of the candidate resource, and the method comprises the following steps:
the online reasoning layer acquires the real-time features from the data cache layer, and performs model reasoning based on the real-time features to obtain a third reasoning result representing the recommendation priority of the candidate resources;
the information obtaining module is specifically configured to:
and obtaining the reference information of whether the candidate resource is recommended or not, which is output by the online reasoning layer based on the successfully obtained reasoning result.
In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of the above first aspects when executing a program stored on a memory.
In a fourth aspect, embodiments of the present invention provide a computer-readable storage medium having a computer program stored therein, which when executed by a processor, implements the method steps of any of the first aspects described above.
The embodiment of the invention has the beneficial effects that:
in the above, when the scheme provided by the embodiment of the invention is applied to model reasoning, before the server responds to the resource recommendation request, the resource recommendation model is cached with the first reasoning result obtained based on the user side characteristics and the second reasoning result obtained based on the resource characteristics, so that in the process of responding to the resource recommendation request, namely, in the process of carrying out resource recommendation, the resource recommendation model only needs to process a small amount of real-time characteristics to obtain the third reasoning result, and reference information is output based on the successfully obtained reasoning result, and a large amount of user side characteristics and resource characteristics do not need to be processed in the process, therefore, the model reasoning scheme provided by the embodiment of the invention can reduce the processing capacity of the resource recommendation model in the process of resource recommendation on the premise of realizing real-time recommendation, thereby improving the efficiency of model reasoning.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the invention, and other embodiments may be obtained according to these drawings to those skilled in the art.
FIG. 1 is a flow chart of a first model reasoning method provided in an embodiment of the present invention;
fig. 2 is a schematic flow chart of a feature classification method according to an embodiment of the present invention;
fig. 3 is a flow chart of a method for storing reasoning results according to an embodiment of the present invention;
fig. 4 is a flow chart of a user dividing method according to an embodiment of the present invention;
FIG. 5 is a flowchart of a second model reasoning method according to an embodiment of the present invention;
FIG. 6 is a schematic flow chart of a feature updating method according to an embodiment of the present invention;
FIG. 7 is a schematic structural diagram of a resource recommendation model according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a model inference device according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by the person skilled in the art based on the present invention are included in the scope of protection of the present invention.
First, an application scenario of the solution provided by the embodiment of the present invention is described.
In the resource recommendation process, the server can acquire information of each candidate resource, process the information of each candidate resource by utilizing the resource recommendation model to acquire reference information which is output by the resource recommendation model and is used for recommending each candidate resource, determine the resource recommended to the target user from each candidate resource according to the reference information corresponding to each candidate resource, and recommend the determined resource to the target user. The process of the resource recommendation model for processing the information of the candidate resources is called model reasoning.
Next, a detailed description is given of the model reasoning method and device provided by the embodiment of the present invention.
Referring to fig. 1, a flow chart of a model reasoning method is provided, and in this embodiment, the method includes the following steps S101-S105.
Step S101: periodically acquiring user side characteristics of candidate resources related to a target user, inputting the user side characteristics into a resource recommendation model, enabling the resource recommendation model to conduct model reasoning based on the user side characteristics, obtaining a first reasoning result representing recommendation priority of the candidate resources, and caching the first reasoning result.
The candidate resource may be product information of the financial product, or information related to the financial product, such as video, audio, image, etc.
The user-side features are features determined according to behavior information of the target user on the recommended resources and resource information of the candidate resources.
The resource recommendation model is a model which is trained in advance, and the model training process can be referred to in the following embodiments, which are not described in detail herein.
The first reasoning result characterizes the recommended priority of the candidate resource and can be understood as a priority parameter of the candidate resource. And, the first inference result is determined according to the user-side features related to the target user, so the first inference result can be further understood as a priority parameter of the candidate resource determined in consideration of the resource browsing preference of the target user.
Specifically, when the target user browses the resources by using the client, the client can record the behavior information of the target user on the recommended resources and send the recorded behavior information to the server, so that the server can acquire the behavior information of the target user, and the server can also record the resource information of each candidate resource to be recommended to the user, so that the server can acquire the user side characteristics of the candidate resource related to the target user based on the behavior information of the target user and the resource information of the candidate resource.
When obtaining the user-side features according to the behavior information of the target user and the resource information of the candidate resource, the server can input the two kinds of information into a feature extractor (such as Kafka) or a feature extraction network model contained in the server, so that the features output by the feature extractor or the feature extraction network model are obtained and serve as the user-side features.
In one embodiment of the present invention, the server may periodically obtain the behavior information of the target user sent by the client, so as to obtain the user-side feature according to the behavior information of the target user and the resource information of the candidate resource.
Or the server can obtain the behavior information of the target user sent by the client in real time, and periodically obtain the user side characteristics according to the behavior information of the target user and the resource information of the candidate resource.
After the server acquires the user side features, the user side features are input into the resource recommendation model. The resource recommendation model performs model reasoning based on the user side characteristics to obtain a first reasoning result, and the first reasoning result is cached.
The manner in which the resource recommendation model performs model reasoning can be found in the following embodiments, which are not described in detail herein.
Because the server periodically acquires the user side characteristics, the resource recommendation model also periodically performs model reasoning based on the user side characteristics to obtain a first reasoning result, so that the first reasoning result stored in the cache can be updated to the obtained first reasoning result every time the resource recommendation model obtains the first reasoning result.
In order to prevent data loss, the resource recommendation model may not only cache the first inference result, but also backup the first inference result after obtaining the first inference result, for example, store the first inference result in a distributed file system (Hadoop Distributed File System, HDFS) for backup.
Step S102: and obtaining the resource characteristics of the candidate resources which are irrelevant to the user, inputting the resource characteristics into a resource recommendation model, so that the resource recommendation model performs model reasoning based on the resource characteristics to obtain a second reasoning result representing the recommendation priority of the candidate resources, and caching the second reasoning result.
The resource feature is a feature unrelated to the user, that is, the resource feature is not only unrelated to the target user, but also unrelated to other users, and is only related to the information of the candidate resource, so that the resource feature is a feature determined according to the information of the resource information of the candidate resource.
In addition, the resource information of the candidate resources is also used when the user side features are calculated, so that the feature extractor or the feature extraction network model can directly output the features of the candidate resources, and when the server obtains the user side features and the resource features, the feature extractor or the feature extraction network model can obtain the features output by the feature extractor or the feature extraction network model, and the features are divided to obtain the user side features and the resource features.
For example, as shown in fig. 2, if the server obtains 1000-dimensional features, the 1000-dimensional features may be divided, with the first 200-dimensional features being user-side features and the second 800-dimensional features being resource features.
The second reasoning result, which is the same as the first reasoning result, also characterizes the recommended priority of the candidate resource, and can be understood as a priority parameter of the candidate resource. And, the second inference result is determined according to the resource information of the candidate resource, and thus, the above-mentioned second inference result can be further understood as a priority parameter of the candidate resource determined in consideration of the information of the candidate resource itself.
Specifically, the server may manage a large number of resources, and when determining that the managed resources are candidate resources, may obtain resource information of the resources, and obtain the above resource characteristics according to the resource information of the resources; or the equipment for generating the resource uploads the characteristics of the resource together when uploading the resource to the server, so that the server can directly obtain the resource characteristics of the candidate resource after determining the candidate resource.
After the server acquires the resource characteristics, the resource characteristics are input into a resource recommendation model. The resource recommendation model performs model reasoning based on the resource characteristics to obtain a second reasoning result, and caches the second reasoning result.
Likewise, the resource recommendation model may also back up the second inference result.
For example, referring to fig. 3, after the resource recommendation model performs model reasoning based on the resource characteristics to obtain a second reasoning result, on one hand, the second reasoning result is cached, and on the other hand, the second reasoning result is stored in the HDFS for backup.
Step S103: and responding to the received resource recommendation request of the target user, and acquiring real-time characteristics aiming at the target user in the characteristics of the candidate resources.
The real-time feature belongs to a feature related to the target user, and can be understood as a feature determined according to real-time behavior information of the target user on the recommended resources and resource information of the candidate resources.
For example, the target user performs a resource refreshing operation in the process of browsing the resource by using the client, and the client can send the real-time behavior information of the target user and the resource recommendation request to the server, so that the server responds to the resource recommendation request and acquires the real-time characteristics of the candidate resource according to the real-time behavior information of the target user and the resource information of the candidate resource.
Step S104: inputting the real-time features into a resource recommendation model, so that the resource recommendation model performs model reasoning based on the real-time features, and obtaining a third reasoning result representing the recommendation priority of the candidate resources.
The specific implementation of model reasoning based on real-time features of the resource recommendation model can be found in the following embodiments, which are not described in detail herein.
Step S105: and obtaining the reference information of whether to recommend the candidate resource, which is output by the resource recommendation model based on the successfully obtained reasoning result.
The reference information may be understood as information predicted by the resource recommendation model and representing the interest degree of the target user in the candidate resource.
The successfully obtained reasoning results comprise: and successfully obtained reasoning results and second reasoning results in the first reasoning result and the third reasoning result.
In the case that the target user is a new user, the server may not recommend any resources to the target user, so that the server is difficult to obtain the behavior information of the target user on any resources, so that the server is difficult to obtain the user side features, and the first reasoning result is not cached in the resource recommendation model.
In the case that the target user is a historical user, that is, the target user has not browsed the resource in a last period of time, the server is difficult to obtain real-time behavior information of the target user on the recommended resource, so that the server is difficult to obtain the real-time characteristics, and further, the resource recommendation model is difficult to infer to obtain a third inference result.
In addition, because the resource characteristics are irrelevant to the user and are only relevant to the content of the candidate resource, the server obtains the resource characteristics without being influenced by the behavior of the target user, and no matter which type of user the target user is, the server can obtain the resource characteristics of the candidate resource, so that the resource characteristics are input into the resource recommendation model, and the resource recommendation model is enabled to infer and cache the second reasoning result.
In view of the above, the resource recommendation model may not obtain one or both of the first and third inference results, and thus, when the server responds to the resource recommendation request, the resource recommendation model outputs the reference information according to the result successfully obtained from the first and third inference results and the second inference result.
In one embodiment of the invention, when the server obtains the reference information, the server can obtain the reference information of whether to recommend candidate resources, wherein the reference information is obtained by adding the resource recommendation model based on each successfully obtained reasoning result.
For example, if the resource recommendation model successfully obtains the first inference result, the second inference result and the third inference result, the resource recommendation model adds and processes the three inference results to obtain an added result and outputs the added result.
If the resource recommendation model successfully obtains the first reasoning result and the second reasoning result, the resource recommendation model adds the two reasoning results to obtain an addition result and outputs the addition result.
If the resource recommendation model successfully obtains the second reasoning result and the third reasoning result, the resource recommendation model adds the two reasoning results to obtain an addition result and outputs the addition result.
If the resource recommendation model successfully obtains the second reasoning result, the resource recommendation model directly outputs the second reasoning result.
In the scheme, the resource recommendation model adds and processes each successfully obtained reasoning result, so that a final result can be obtained by considering various factors as much as possible, and the accuracy of the reference information can be improved as much as possible.
In another embodiment of the present invention, when the server obtains the reference information, the server may obtain the inference result with the highest value selected by the resource recommendation model from the successfully obtained inference results, as the reference information of whether to recommend the candidate resource.
In the above, when the scheme provided by the embodiment of the invention is applied to model reasoning, before the server responds to the resource recommendation request, the resource recommendation model is cached with the first reasoning result obtained based on the user side characteristics and the second reasoning result obtained based on the resource characteristics, so that in the process of responding to the resource recommendation request, namely, in the process of carrying out resource recommendation, the resource recommendation model only needs to process a small amount of real-time characteristics to obtain the third reasoning result, and reference information is output based on the successfully obtained reasoning result, and a large amount of user side characteristics and resource characteristics do not need to be processed in the process, therefore, the model reasoning scheme provided by the embodiment of the invention can reduce the processing capacity of the resource recommendation model in the process of resource recommendation on the premise of realizing real-time recommendation, thereby improving the efficiency of model reasoning.
In addition, in the scheme, model reasoning is carried out by utilizing different features before and after the resource recommendation request is responded, and finally, reference information is output based on successfully obtained reasoning results, so that various features can be synthesized as much as possible, the fact that information cannot be lost in the whole model reasoning process is ensured, the accuracy of model reasoning can be improved, and the resource recommendation is more in line with interests and demands of users.
As can be seen from the above description of step S105, it may be difficult for the server to obtain the user-side characteristics of the target user.
With respect to this possibility, when periodically acquiring the user-side features, the server may periodically acquire the user-side features of the candidate resource related to the target user again in the case that the target user is an active user.
Specifically, the server may determine whether the target user is an active user according to the use condition of the target user using the client, and if the target user is determined to be an active user, periodically acquire the user side feature; if the target user is judged to be the inactive user, the step of acquiring the user side characteristics is not executed.
For example, as shown in fig. 4, the server may determine which of the active user, the historical user, and the new user the target user belongs to through a near line grouping policy.
From the above, when the scheme provided by the embodiment of the invention is applied to model reasoning, the server periodically acquires the user side characteristics only when the target user is an active user, the resource recommendation model caches the first reasoning result obtained based on the characteristic reasoning acquired by the server, and for the inactive user, the server does not need to periodically execute the step of acquiring the user side characteristics, so that the resource of the server can be saved, the operation cost of the server is reduced, and the operation and maintenance of resource recommendation are simpler and more convenient.
The manner in which the model reasoning is performed for the resource recommendation model is described below.
In one embodiment of the invention, the resource recommendation model performs weighted summation on the characteristic values of the input characteristics according to the weight coefficients corresponding to the input characteristics of the model to obtain an inference result.
The input features may be the user-side features, resource features, and real-time features.
The model reasoning mode will be described below taking the input feature as an example of the user-side feature.
And under the condition that the input features are user side features, the resource recommendation model performs weighted summation on the feature values of the user side features according to the weight coefficients corresponding to the user side features to obtain an inference result, namely a first inference result.
Specifically, the dimension of the user side feature may be preset, and the server may acquire the feature of the preset dimension when acquiring the user side feature. The dimension of the user side characteristic is the same as the dimension of the corresponding weight coefficient, and the resource recommendation model can be trained to obtain the weight coefficient corresponding to the user side characteristic with the preset dimension during training. When the resource recommendation model carries out model reasoning based on the user side features, the feature values of the user side features can be weighted and summed according to the weight coefficients which are obtained through training and correspond to the user side features, and a weighted summation result is obtained and is used as a reasoning result.
For example, the user side feature is preset to be a 200-dimensional feature, the weight coefficient corresponding to the user side feature is also a 200-dimensional coefficient, when the server acquires the user side feature, the server acquires the 200-dimensional feature related to the target user, and when the resource recommendation model performs weighted summation on the feature value of the user side feature, the server performs weighted summation on the 200-dimensional feature and the 200-dimensional weight coefficient.
The model reasoning mode when the input features are resource features or real-time features is similar to the model reasoning mode when the input features are user-side features, and will not be described again here.
From the above, when the scheme provided by the embodiment of the invention is applied to model reasoning, the resource recommendation model performs weighted summation on the characteristic values of the input characteristics according to the weight coefficients corresponding to the input characteristics, so that the reasoning results corresponding to the input characteristics can be accurately obtained, namely, under the condition that the input characteristics are the user side characteristics, the resource characteristics and the real-time characteristics respectively, the first reasoning result, the second reasoning result and the third reasoning result can be accurately obtained, the resource recommendation model outputs the reference information based on the more accurate reasoning results, and the accuracy of the reference information can be improved, namely, the accuracy of model reasoning is improved.
The user-side feature is determined according to the behavior information of the target user, and the behavior information of the target user reflects the interest degree of the target user in the candidate resource, so that the user-side feature can represent the interest degree of the target user in the candidate resource, for example, the more times the target user browses the resource of the same type as the candidate resource, the more interested the target user is in the resource of the same type, the higher the interest degree of the target user in the candidate resource is, and the user-side feature can represent the higher interested degree of the target user in the candidate resource.
However, the degree of interest of the user in the resource is continuously changed along with time, for example, the more times the target user browses the resource of the same type as the candidate resource in a previous period of time, the higher the degree of interest of the target user in the candidate resource in the period of time is, the user side characteristic determined according to the behavior information can only characterize that the target user has the higher degree of interest in the candidate resource in the period of time. It can be seen that the user-side features are time-efficient.
In view of this, in one embodiment of the present invention, in the case that the input feature is a user side feature, the resource recommendation model performs time-efficiency division on the user side feature to obtain sub-features belonging to each preset time-efficiency type; for each time effect type, weighting and summing characteristic values of sub-characteristics of the time effect type according to sub-weight coefficients corresponding to the time effect type to obtain a sub-reasoning result; and adding and processing the sub-reasoning results corresponding to each aging type to obtain a first reasoning result.
Specifically, the dimension of the user side feature may be preset, or the dimension corresponding to the feature value belonging to each aging type in the user side feature may be preset, for example, if the user side feature is a 200-dimensional feature, it may be set that the feature value of the first 50-dimensional feature belongs to the first aging type, the feature values of the middle 51-150-dimensional feature belongs to the second failure type, and the feature value of the last 50-dimensional feature belongs to the third aging type, so that when the server acquires the user side feature, the server may acquire the user side feature according to a preset feature value dividing mode.
After the server inputs the obtained user side features into the resource recommendation model, the resource recommendation model can split the user side features, so that the sub-features belonging to each aging type are obtained.
After the resource recommendation model obtains the sub-features belonging to each time effect type, the characteristic values of the sub-features of each time effect type are subjected to weighted summation aiming at the sub-weight coefficient corresponding to each time effect type, so that a weighted summation result is obtained and is used as a sub-reasoning result corresponding to each time effect type. And finally, adding and processing the sub-reasoning results corresponding to each aging type to obtain a first reasoning result.
For example, if the aging types are three, the characteristic values of the sub-features of the three aging types are weighted and summed to obtain three sub-reasoning results, and then the three sub-reasoning results are summed to obtain a first reasoning result.
From the above, when the scheme provided by the embodiment of the invention is applied to model reasoning, the user side features are divided in timeliness, and weights are distributed for each type of sub-features, so that the model reasoning is performed by utilizing the feature values and the weight coefficients of each type, the influence of the timeliness of the features on the model reasoning is fully considered, and the accuracy of the model reasoning can be improved.
In an embodiment of the present invention, the aging types include a history feature type, a near-line feature type, and a real-time feature type, where feature aging corresponding to the history feature type is lower than feature aging corresponding to the near-line feature type, and feature aging corresponding to the near-line feature type is lower than feature aging corresponding to the real-time feature type.
Referring to fig. 5, a model reasoning process is shown, in fig. 5, a resource recommendation model firstly performs time-efficient division on user side features to obtain sub-features belonging to a history feature type, a near line feature type and a real-time feature type respectively, then performs weighted summation on feature values of the three sub-features respectively to obtain a first sub-reasoning result, a second sub-reasoning result and a third sub-reasoning result, and then performs summation processing on the three sub-reasoning results to obtain the first reasoning result.
In addition, if the resource recommendation model also successfully obtains the second reasoning result and the third reasoning result, the first reasoning result, the second reasoning result and the third reasoning result are added to obtain a model output result.
In the scheme, three characteristic types of history, near line and real time are divided, weights are distributed for the three characteristic values with different timeliness, so that model reasoning is carried out by utilizing the characteristic values and weight coefficients of all the types, the influence of the characteristic timeliness on the model reasoning is fully considered, and the accuracy of the model reasoning can be improved.
In one embodiment of the invention, after the resource recommendation model performs time-efficient division on the user side features, the sub-features of three feature types, namely, history, near line and real time, cached by the model can be updated according to the features obtained by division, and then the resource recommendation model performs reasoning based on the sub-features in the cache.
For example, as shown in fig. 6, when the sub-feature in the cache is updated by the resource recommendation model, the update operation may not be performed for the history feature type, the update cache operation may be performed for the near-line and real-time feature types, and the sub-feature of the real-time feature type that is continuously updated in the cache may directly participate in online reasoning as the real-time feature when the server responds to the resource recommendation request, and calculation of the third reasoning result may be performed.
The structure of the resource recommendation model is described below.
In an embodiment of the present invention, referring to fig. 7, a schematic structure diagram of a resource recommendation model is provided, where in this embodiment, the resource recommendation model includes a data calculation layer, a data cache layer, and an online reasoning layer.
The data calculation layer is used for processing user side characteristics and resource characteristics, and can be constructed based on Spark clusters.
The data caching layer is used for caching reasoning results and characteristics, and can be constructed based on Redis cache equipment.
The online reasoning layer is used for processing real-time characteristics and reasoning results.
Specifically, when the server inputs the user side features into the resource recommendation model, the user side features are input into the data calculation layer, the data calculation layer performs model reasoning based on the user side features to obtain a first reasoning result, and the first reasoning result is stored in the data caching layer.
Similarly, when the server inputs the resource characteristics into the resource recommendation model, the resource characteristics are input into the data calculation layer, the data calculation layer performs model reasoning based on the resource characteristics to obtain a second reasoning result, and the second reasoning result is stored into the value data caching layer.
When the server inputs the real-time features into the resource recommendation model, the real-time features are directly stored into the data caching layer. And then the online reasoning layer acquires real-time features from the data cache layer, performs model reasoning based on the real-time features to obtain a third reasoning result, and then obtains and outputs a final result based on the successfully obtained reasoning result by adding, selecting a result with the largest numerical value and the like, so that the server can also output reference information of whether candidate resources are recommended or not based on the successfully obtained reasoning result.
The manner in which the data calculation layer obtains the first inference result and the second inference result, and the manner in which the online inference layer obtains the third inference result can be referred to the foregoing embodiments, and will not be described herein again.
From the above, when the scheme provided by the embodiment of the invention is applied to model reasoning, the resource recommendation model comprises a data calculation layer, a data cache layer and an online reasoning layer, and after the server inputs the user side characteristics, the resource characteristics and the real-time characteristics into the model, the resource recommendation model can accurately output reference information through the mutual coordination among the data calculation layer, the data cache layer and the online reasoning layer, so that the accuracy of recommending resources for users can be improved.
The training process of the resource recommendation model is described below.
Upon training the initial recommendation model, four sample sets may be obtained, wherein:
the first sample set comprises first sample user side characteristics, first sample resource characteristics, first sample real-time characteristics and first sample reference information;
the second sample set comprises second sample user side characteristics, second sample resource characteristics and second sample reference information;
the third sample set comprises a third sample resource characteristic, a second sample real-time characteristic and third sample reference information;
the fourth sample set includes fourth sample resource characteristics and fourth sample reference information.
When any one of the four sample sets is used for model training, the characteristics in the set can be used as model input to obtain a result obtained by model reasoning based on the model input, and then model parameters are adjusted according to the obtained result and sample reference information in the same set.
When the resource recommendation model performs model reasoning in a weighted summation mode, the weight coefficient corresponding to each feature belongs to parameters in the model, and thus when the model parameters are adjusted according to the obtained result and sample reference information in the same set, the weight coefficient corresponding to each feature is adjusted according to the two information.
Corresponding to the model reasoning method, the embodiment of the invention also provides a model reasoning device.
In one embodiment of the present invention, referring to fig. 8, there is provided a schematic structural diagram of a model inference apparatus, in this embodiment, the apparatus includes:
a first obtaining module 801, configured to periodically obtain a user side feature of a candidate resource related to a target user, and input the user side feature into a resource recommendation model, so that the resource recommendation model performs model reasoning based on the user side feature to obtain a first reasoning result representing a recommendation priority of the candidate resource, and cache the first reasoning result;
a second obtaining module 802, configured to obtain a resource feature of the candidate resource that is irrelevant to a user, and input the resource feature into the resource recommendation model, so that the resource recommendation model performs model reasoning based on the resource feature to obtain a second reasoning result that characterizes a recommendation priority of the candidate resource, and cache the second reasoning result;
a third obtaining module 803, configured to obtain, in response to receiving a resource recommendation request of the target user, a real-time feature for the target user from the features of the candidate resource;
The feature input module 804 is configured to input the real-time feature into the resource recommendation model, so that the resource recommendation model performs model reasoning based on the real-time feature, and obtains a third reasoning result that characterizes the recommendation priority of the candidate resource;
an information obtaining module 805, configured to obtain reference information that is output by the resource recommendation model based on successfully obtained reasoning results, where the successfully obtained reasoning results include: and successfully obtained reasoning results in the first reasoning result and the third reasoning result and the second reasoning result.
In the above, when the scheme provided by the embodiment of the invention is applied to model reasoning, before the server responds to the resource recommendation request, the resource recommendation model is cached with the first reasoning result obtained based on the user side characteristics and the second reasoning result obtained based on the resource characteristics, so that in the process of responding to the resource recommendation request, namely, in the process of carrying out resource recommendation, the resource recommendation model only needs to process a small amount of real-time characteristics to obtain the third reasoning result, and reference information is output based on the successfully obtained reasoning result, and a large amount of user side characteristics and resource characteristics do not need to be processed in the process, therefore, the model reasoning scheme provided by the embodiment of the invention can reduce the processing capacity of the resource recommendation model in the process of resource recommendation on the premise of realizing real-time recommendation, thereby improving the efficiency of model reasoning.
In addition, in the scheme, model reasoning is carried out by utilizing different features before and after the resource recommendation request is responded, and finally, reference information is output based on successfully obtained reasoning results, so that various features can be synthesized as much as possible, the fact that information cannot be lost in the whole model reasoning process is ensured, the accuracy of model reasoning can be improved, and the resource recommendation is more in line with interests and demands of users.
In one embodiment of the present invention, the information obtaining module 805 is specifically configured to:
and obtaining the reference information of whether the candidate resource is recommended or not, wherein the reference information is obtained by adding the resource recommendation model based on each successfully obtained reasoning result.
In the scheme, the resource recommendation model adds and processes each successfully obtained reasoning result, so that a final result can be obtained by considering various factors as much as possible, and the accuracy of the reference information can be improved as much as possible.
In one embodiment of the present invention, the resource recommendation model performs model reasoning as follows:
and carrying out weighted summation on the feature values of each feature dimension in the input features according to the weight coefficients corresponding to the input features of the model to obtain an inference result.
From the above, when the scheme provided by the embodiment of the invention is applied to model reasoning, the resource recommendation model performs weighted summation on the characteristic values of the input characteristics according to the weight coefficients corresponding to the input characteristics, so that the reasoning results corresponding to the input characteristics can be accurately obtained, namely, under the condition that the input characteristics are the user side characteristics, the resource characteristics and the real-time characteristics respectively, the first reasoning result, the second reasoning result and the third reasoning result can be accurately obtained, the resource recommendation model outputs the reference information based on the more accurate reasoning results, and the accuracy of the reference information can be improved, namely, the accuracy of model reasoning is improved.
In one embodiment of the present invention, the weighting and summing the feature values of each feature dimension in the input features according to the weight coefficient corresponding to the input features of the model to obtain the reasoning result includes:
under the condition that the input characteristics are the user side characteristics, carrying out timeliness division on the user side characteristics to obtain sub-characteristics belonging to each preset timeliness type;
for each time effect type, weighting and summing characteristic values of sub-characteristics of the time effect type according to sub-weight coefficients corresponding to the time effect type to obtain a sub-reasoning result;
And adding and processing the sub-reasoning results corresponding to each aging type to obtain the first reasoning result.
From the above, when the scheme provided by the embodiment of the invention is applied to model reasoning, the user side features are divided in timeliness, and weights are distributed for each type of sub-features, so that the model reasoning is performed by utilizing the feature values and the weight coefficients of each type, the influence of the timeliness of the features on the model reasoning is fully considered, and the accuracy of the model reasoning can be improved.
In one embodiment of the present invention, the aging type includes a history feature type, a near-line feature type, and a real-time feature type, wherein feature aging corresponding to the history feature type is lower than feature aging corresponding to the near-line feature type, and feature aging corresponding to the near-line feature type is lower than feature aging corresponding to the real-time feature type.
In the scheme, three characteristic types of history, near line and real time are divided, weights are distributed for the three characteristic values with different timeliness, so that model reasoning is carried out by utilizing the characteristic values and weight coefficients of all the types, the influence of the characteristic timeliness on the model reasoning is fully considered, and the accuracy of the model reasoning can be improved.
In one embodiment of the present invention, the first obtaining module 801 is specifically configured to:
and periodically acquiring user side characteristics of candidate resources related to the target user under the condition that the target user is an active user.
From the above, when the scheme provided by the embodiment of the invention is applied to model reasoning, the server periodically acquires the user side characteristics only when the target user is an active user, the resource recommendation model caches the first reasoning result obtained based on the characteristic reasoning acquired by the server, and for the inactive user, the server does not need to periodically execute the step of acquiring the user side characteristics, so that the resource of the server can be saved, the operation cost of the server is reduced, and the operation and maintenance of resource recommendation are simpler and more convenient.
In one embodiment of the invention, the resource recommendation model comprises a data calculation layer, a data cache layer and an online reasoning layer;
the first obtaining module 801 is specifically configured to:
inputting the user-side features into the data computation layer;
the resource recommendation model performs model reasoning based on the user side characteristics to obtain a first reasoning result representing recommendation priority of the candidate resource, and caches the first reasoning result, and the method comprises the following steps:
The data calculation layer performs model reasoning based on the user side characteristics to obtain a first reasoning result representing the recommendation priority of the candidate resources, and the first reasoning result is stored in the data caching layer;
the second obtaining module 802 is specifically configured to:
inputting the resource characteristics into the data calculation layer;
the resource recommendation model performs model reasoning based on the resource characteristics to obtain a second reasoning result representing the recommendation priority of the candidate resource, caches the second reasoning result, and comprises the following steps:
the data calculation layer performs model reasoning based on the resource characteristics to obtain a second reasoning result representing the recommendation priority of the candidate resources, and the second reasoning result is stored in the data caching layer;
the third obtaining module 803 is specifically configured to:
storing the real-time features to the data caching layer;
the resource recommendation model performs model reasoning based on the real-time characteristics to obtain a third reasoning result representing the recommendation priority of the candidate resource, and the method comprises the following steps:
the online reasoning layer acquires the real-time features from the data cache layer, and performs model reasoning based on the real-time features to obtain a third reasoning result representing the recommendation priority of the candidate resources;
The information obtaining module 805 is specifically configured to:
and obtaining the reference information of whether the candidate resource is recommended or not, which is output by the online reasoning layer based on the successfully obtained reasoning result.
From the above, when the scheme provided by the embodiment of the invention is applied to model reasoning, the resource recommendation model comprises a data calculation layer, a data cache layer and an online reasoning layer, and after the server inputs the user side characteristics, the resource characteristics and the real-time characteristics into the model, the resource recommendation model can accurately output reference information through the mutual coordination among the data calculation layer, the data cache layer and the online reasoning layer, so that the accuracy of recommending resources for users can be improved.
The embodiment of the present invention also provides an electronic device, as shown in fig. 9, including a processor 901, a communication interface 902, a memory 903, and a communication bus 904, where the processor 901, the communication interface 902, and the memory 903 perform communication with each other through the communication bus 904,
a memory 903 for storing a computer program;
the processor 901 is configured to execute a program stored in the memory 903, and implement the following steps:
periodically acquiring user side characteristics of candidate resources related to a target user, inputting the user side characteristics into a resource recommendation model, so that the resource recommendation model performs model reasoning based on the user side characteristics to obtain a first reasoning result representing recommendation priority of the candidate resources, and caching the first reasoning result;
Obtaining resource characteristics of the candidate resources, which are irrelevant to users, and inputting the resource characteristics into the resource recommendation model so that the resource recommendation model performs model reasoning based on the resource characteristics to obtain a second reasoning result representing the recommendation priority of the candidate resources, and caching the second reasoning result;
responding to the received resource recommendation request of the target user, and acquiring real-time characteristics aiming at the target user from the characteristics of the candidate resources;
inputting the real-time features into the resource recommendation model so that the resource recommendation model performs model reasoning based on the real-time features to obtain a third reasoning result representing the recommendation priority of the candidate resources;
obtaining reference information of whether to recommend the candidate resource, which is output by the resource recommendation model based on successfully obtained reasoning results, wherein the successfully obtained reasoning results comprise: and successfully obtained reasoning results in the first reasoning result and the third reasoning result and the second reasoning result.
The processor 901 may refer to the foregoing method embodiments for executing other schemes of program implementation model reasoning stored in the memory 903, and will not be described herein.
The communication bus mentioned above for the electronic devices may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In yet another embodiment of the present invention, there is also provided a computer readable storage medium having stored therein a computer program which, when executed by a processor, implements the steps of any of the model reasoning methods described above.
In yet another embodiment of the present invention, there is also provided a computer program product containing instructions that, when run on a computer, cause the computer to perform the model reasoning method of any of the above embodiments.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for an apparatus, an electronic device, a computer readable storage medium, a computer program product embodiment, the description is relatively simple, as it is substantially similar to the method embodiment, as relevant see the partial description of the method embodiment.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims (16)

1. A method of model reasoning, the method comprising:
periodically acquiring user side characteristics of candidate resources related to a target user, inputting the user side characteristics into a resource recommendation model, so that the resource recommendation model performs model reasoning based on the user side characteristics to obtain a first reasoning result representing recommendation priority of the candidate resources, and caching the first reasoning result;
obtaining resource characteristics of the candidate resources, which are irrelevant to users, and inputting the resource characteristics into the resource recommendation model so that the resource recommendation model performs model reasoning based on the resource characteristics to obtain a second reasoning result representing the recommendation priority of the candidate resources, and caching the second reasoning result;
responding to the received resource recommendation request of the target user, and acquiring real-time characteristics aiming at the target user from the characteristics of the candidate resources;
Inputting the real-time features into the resource recommendation model so that the resource recommendation model performs model reasoning based on the real-time features to obtain a third reasoning result representing the recommendation priority of the candidate resources;
obtaining reference information of whether to recommend the candidate resource, which is output by the resource recommendation model based on successfully obtained reasoning results, wherein the successfully obtained reasoning results comprise: and successfully obtained reasoning results in the first reasoning result and the third reasoning result and the second reasoning result.
2. The method of claim 1, wherein the obtaining the reference information of whether to recommend the candidate resource, which is output by the resource recommendation model based on the successfully obtained inference result, comprises:
and obtaining the reference information of whether the candidate resource is recommended or not, wherein the reference information is obtained by adding the resource recommendation model based on each successfully obtained reasoning result.
3. The method according to claim 1 or 2, characterized in that the resource recommendation model performs model reasoning as follows:
and carrying out weighted summation on the feature values of each feature dimension in the input features according to the weight coefficients corresponding to the input features of the model to obtain an inference result.
4. A method according to claim 3, wherein the step of performing weighted summation on feature values of feature dimensions in the input features according to weight coefficients corresponding to the input features of the model to obtain an inference result includes:
under the condition that the input characteristics are the user side characteristics, carrying out timeliness division on the user side characteristics to obtain sub-characteristics belonging to each preset timeliness type;
for each time effect type, weighting and summing characteristic values of sub-characteristics of the time effect type according to sub-weight coefficients corresponding to the time effect type to obtain a sub-reasoning result;
and adding and processing the sub-reasoning results corresponding to each aging type to obtain the first reasoning result.
5. The method of claim 4, wherein the aging type comprises a history feature type, a near line feature type, and a real-time feature type, wherein the history feature type corresponds to a feature aging that is lower than a feature aging that corresponds to the near line feature type, and wherein the near line feature type corresponds to a feature aging that is lower than a feature aging that corresponds to the real-time feature type.
6. The method according to claim 1 or 2, wherein the periodically acquiring user-side features of the candidate resource related to the target user comprises:
And periodically acquiring user side characteristics of candidate resources related to the target user under the condition that the target user is an active user.
7. The method of claim 1, wherein the resource recommendation model comprises a data calculation layer, a data cache layer, and an online reasoning layer;
the step of inputting the user-side features into a resource recommendation model comprises the following steps:
inputting the user-side features into the data computation layer;
the resource recommendation model performs model reasoning based on the user side characteristics to obtain a first reasoning result representing recommendation priority of the candidate resource, and caches the first reasoning result, and the method comprises the following steps:
the data calculation layer performs model reasoning based on the user side characteristics to obtain a first reasoning result representing the recommendation priority of the candidate resources, and the first reasoning result is stored in the data caching layer;
the inputting the resource characteristics into the resource recommendation model includes:
inputting the resource characteristics into the data calculation layer;
the resource recommendation model performs model reasoning based on the resource characteristics to obtain a second reasoning result representing the recommendation priority of the candidate resource, caches the second reasoning result, and comprises the following steps:
The data calculation layer performs model reasoning based on the resource characteristics to obtain a second reasoning result representing the recommendation priority of the candidate resources, and the second reasoning result is stored in the data caching layer;
the inputting the real-time features into the resource recommendation model includes:
storing the real-time features to the data caching layer;
the resource recommendation model performs model reasoning based on the real-time characteristics to obtain a third reasoning result representing the recommendation priority of the candidate resource, and the method comprises the following steps:
the online reasoning layer acquires the real-time features from the data cache layer, and performs model reasoning based on the real-time features to obtain a third reasoning result representing the recommendation priority of the candidate resources;
the obtaining the reference information of whether to recommend the candidate resource, which is output by the resource recommendation model based on the successfully obtained reasoning result, includes:
and obtaining the reference information of whether the candidate resource is recommended or not, which is output by the online reasoning layer based on the successfully obtained reasoning result.
8. A model reasoning apparatus, the apparatus comprising:
the first acquisition module is used for periodically acquiring user side characteristics of candidate resources related to a target user, inputting the user side characteristics into a resource recommendation model, so that the resource recommendation model performs model reasoning based on the user side characteristics to obtain a first reasoning result representing recommendation priority of the candidate resources, and caching the first reasoning result;
The second acquisition module is used for acquiring the resource characteristics of the candidate resources, which are irrelevant to the user, and inputting the resource characteristics into the resource recommendation model so that the resource recommendation model performs model reasoning based on the resource characteristics to acquire a second reasoning result representing the recommendation priority of the candidate resources, and caching the second reasoning result;
the third acquisition module is used for responding to the received resource recommendation request of the target user and acquiring real-time characteristics aiming at the target user from the characteristics of the candidate resources;
the feature input module is used for inputting the real-time features into the resource recommendation model so that the resource recommendation model performs model reasoning based on the real-time features to obtain a third reasoning result representing the recommendation priority of the candidate resources;
the information obtaining module is used for obtaining reference information of whether the candidate resource is recommended or not, which is output by the resource recommendation model based on successfully obtained reasoning results, wherein the successfully obtained reasoning results comprise: and successfully obtained reasoning results in the first reasoning result and the third reasoning result and the second reasoning result.
9. The apparatus of claim 8, wherein the information obtaining module is specifically configured to:
and obtaining the reference information of whether the candidate resource is recommended or not, wherein the reference information is obtained by adding the resource recommendation model based on each successfully obtained reasoning result.
10. The apparatus of claim 8 or 9, wherein the resource recommendation model performs model reasoning as follows:
and carrying out weighted summation on the feature values of each feature dimension in the input features according to the weight coefficients corresponding to the input features of the model to obtain an inference result.
11. The apparatus of claim 10, wherein the weighting and summing the feature values of each feature dimension in the input features according to the weight coefficients corresponding to the input features of the model to obtain the inference result comprises:
under the condition that the input characteristics are the user side characteristics, carrying out timeliness division on the user side characteristics to obtain sub-characteristics belonging to each preset timeliness type;
for each time effect type, weighting and summing characteristic values of sub-characteristics of the time effect type according to sub-weight coefficients corresponding to the time effect type to obtain a sub-reasoning result;
And adding and processing the sub-reasoning results corresponding to each aging type to obtain the first reasoning result.
12. The apparatus of claim 11, wherein the aging type comprises a history feature type, a near line feature type, and a real-time feature type, the history feature type corresponding to a feature aging that is lower than a feature aging corresponding to the near line feature type, the near line feature type corresponding to a feature aging that is lower than a feature aging corresponding to the real-time feature type.
13. The apparatus according to claim 8 or 9, wherein the first acquisition module is specifically configured to:
and periodically acquiring user side characteristics of candidate resources related to the target user under the condition that the target user is an active user.
14. The apparatus of claim 8, wherein the resource recommendation model comprises a data calculation layer, a data caching layer, and an online reasoning layer;
the first obtaining module is specifically configured to:
inputting the user-side features into the data computation layer;
the resource recommendation model performs model reasoning based on the user side characteristics to obtain a first reasoning result representing recommendation priority of the candidate resource, and caches the first reasoning result, and the method comprises the following steps:
The data calculation layer performs model reasoning based on the user side characteristics to obtain a first reasoning result representing the recommendation priority of the candidate resources, and the first reasoning result is stored in the data caching layer;
the second obtaining module is specifically configured to:
inputting the resource characteristics into the data calculation layer;
the resource recommendation model performs model reasoning based on the resource characteristics to obtain a second reasoning result representing the recommendation priority of the candidate resource, caches the second reasoning result, and comprises the following steps:
the data calculation layer performs model reasoning based on the resource characteristics to obtain a second reasoning result representing the recommendation priority of the candidate resources, and the second reasoning result is stored in the data caching layer;
the third obtaining module is specifically configured to:
storing the real-time features to the data caching layer;
the resource recommendation model performs model reasoning based on the real-time characteristics to obtain a third reasoning result representing the recommendation priority of the candidate resource, and the method comprises the following steps:
the online reasoning layer acquires the real-time features from the data cache layer, and performs model reasoning based on the real-time features to obtain a third reasoning result representing the recommendation priority of the candidate resources;
The information obtaining module is specifically configured to:
and obtaining the reference information of whether the candidate resource is recommended or not, which is output by the online reasoning layer based on the successfully obtained reasoning result.
15. The electronic equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for carrying out the method steps of any one of claims 1-7 when executing a program stored on a memory.
16. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored therein a computer program which, when executed by a processor, implements the method steps of any of claims 1-7.
CN202311769439.6A 2023-12-21 2023-12-21 Model reasoning method and device Pending CN117892822A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311769439.6A CN117892822A (en) 2023-12-21 2023-12-21 Model reasoning method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311769439.6A CN117892822A (en) 2023-12-21 2023-12-21 Model reasoning method and device

Publications (1)

Publication Number Publication Date
CN117892822A true CN117892822A (en) 2024-04-16

Family

ID=90646139

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311769439.6A Pending CN117892822A (en) 2023-12-21 2023-12-21 Model reasoning method and device

Country Status (1)

Country Link
CN (1) CN117892822A (en)

Similar Documents

Publication Publication Date Title
CN110263921B (en) Method and device for training federated learning model
US9691035B1 (en) Real-time updates to item recommendation models based on matrix factorization
WO2020135535A1 (en) Recommendation model training method and related apparatus
CN110399728B (en) Edge computing node trust evaluation method, device, equipment and storage medium
CN109921950B (en) Network bandwidth demand prediction method and device and electronic equipment
US20160132904A1 (en) Influence score of a brand
US10133775B1 (en) Run time prediction for data queries
CN112579194B (en) Block chain consensus task unloading method and device based on time delay and transaction throughput
US20180341681A1 (en) Search results based on a search history
CN108366012B (en) Social relationship establishing method and device and electronic equipment
US10284664B2 (en) Application testing
CN112819258A (en) Bank branch to store customer quantity prediction method and device
CN113918438A (en) Method and device for detecting server abnormality, server and storage medium
US9053197B2 (en) Suggesting websites
CN117892822A (en) Model reasoning method and device
CN113076487B (en) User interest characterization and content recommendation method, device and equipment
CN110134575B (en) Method and device for calculating service capacity of server cluster
CN111598390B (en) Method, device, equipment and readable storage medium for evaluating high availability of server
CN116308721B (en) Information supervision and management method and device, electronic equipment and storage medium
CN112347394A (en) Method and device for acquiring webpage information, computer equipment and storage medium
CN110705736A (en) Macroscopic economy prediction method and device, computer equipment and storage medium
CN112667398B (en) Resource scheduling method and device, electronic equipment and storage medium
CN116187094B (en) Quality work prediction system based on real-time analysis of working conditions
US20230066193A1 (en) Determining content output session outliers
US20230169345A1 (en) Multiscale dimensional reduction of data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination