Material recommendation method, material recommendation device, and electronic device
By using a multi-tower material retrieval model that combines user and scenario features to generate a third fusion embedding vector, the retrieval problem of the dual-tower model in multiple scenarios is solved, and more accurate material recommendation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- VIVO MOBILE COMM CO LTD
- Filing Date
- 2023-03-01
- Publication Date
- 2026-05-29
Smart Images

Figure CN116226528B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of artificial intelligence technology, specifically relating to a material recommendation method, a material recommendation device, and an electronic device. Background Technology
[0002] With the application of recommendation systems in different scenarios, how to utilize data from multiple scenarios and break down the barriers to data exchange between them has become a focus of attention.
[0003] In information flow scenarios, recommendation systems are essentially information filtering systems, including recall, ranking, and re-ranking stages. Each stage uses predefined algorithms and strategies to filter materials layer by layer, ultimately selecting items that the user might be interested in from a massive material library and recommending them to the user. Currently, a dual-tower model structure is commonly used for material information recall and coarse ranking. The construction idea is to divide the model into a user-side model and an item-side model, and then use an interoperability layer to combine these two parts to generate a final similarity score, which is then used for ranking. Therefore, most existing recommendation systems are built using a dual-tower model based on a specific scenario.
[0004] While the dual-tower model can incorporate some scene features into the user-side model for training, it merely adds scene features to the existing user features. This inevitably results in a lack of personalized differences in user interaction behavior with the same items in other scenarios. Consequently, its recommendation results are not ideal and cannot meet the application requirements of multi-scenario modeling in the recall stage. Summary of the Invention
[0005] The purpose of this application is to provide a material recommendation method, a material recommendation device, and an electronic device that can solve the problem that the existing dual-tower model is only suitable for recalling items in a specific scenario and cannot meet the application of multi-scenario modeling in the recall stage.
[0006] To solve the above-mentioned technical problems, this application is implemented as follows:
[0007] In a first aspect, embodiments of this application provide a material recommendation method, comprising: acquiring user features and scenario features corresponding to a user; determining a first fusion embedding vector and a second fusion embedding vector by inputting the user features and scenario features into a multi-tower structure of a material retrieval model, wherein the first fusion embedding vector is a vector between the user features and the material features, and the second fusion embedding vector is a vector between the scenario features and the material features; the multi-tower structure includes a user tower structure, a scenario tower structure, and a material tower structure, and the material retrieval model pre-stores material features corresponding to multiple materials; concatenating the first fusion embedding vector and the second fusion embedding vector into a third fusion embedding vector; determining the similarity score between the third fusion embedding vector and the material embedding vector corresponding to the material features, and recommending materials whose similarity scores meet preset conditions to the user.
[0008] Secondly, embodiments of this application provide a material recommendation device, comprising: a feature acquisition module for acquiring user features and scene features corresponding to a user; a vector determination module for determining a first fusion embedding vector and a second fusion embedding vector by inputting the user features and scene features into a multi-tower structure of a material retrieval model, wherein the first fusion embedding vector is a vector between the user features and the material features, and the second fusion embedding vector is a vector between the scene features and the material features; the multi-tower structure includes a user tower structure, a scene tower structure, and a material tower structure, and the material retrieval model pre-stores material features corresponding to multiple materials; a vector concatenation module for concatenating the first fusion embedding vector and the second fusion embedding vector into a third fusion embedding vector; and a material recommendation module for determining the similarity score between the third fusion embedding vector and the material embedding vector corresponding to the material features, and recommending materials whose similarity scores meet preset conditions to the user.
[0009] Thirdly, embodiments of this application provide an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the material recommendation method as described in the first aspect above.
[0010] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the material recommendation method as described in the first aspect above.
[0011] According to the technical solution of this application embodiment, user features and scene features corresponding to the user are obtained; by inputting the user features and scene features into the multi-tower structure of the material recall model, a first fusion embedding vector and a second fusion embedding vector are determined. Since the first fusion embedding vector determined by the material recall model is a vector between user features and material features, and the second fusion embedding vector is a vector between scene features and material features, it simultaneously considers the personalized differences in the interaction behavior of user features and scene features with the same material features. Then, the first fusion embedding vector and the second fusion embedding vector are concatenated into a third fusion embedding vector; the similarity score between the third fusion embedding vector and the material embedding vector corresponding to the material features is determined, and materials with similarity scores that meet preset conditions are recommended to the user. This can obtain more accurate recommendation results for each scenario compared to using only a single model for multiple scenarios, thereby meeting the application requirements of multi-scenario modeling in the recall stage. Attached Figure Description
[0012] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 A flowchart illustrating a material recommendation method provided according to some embodiments of this application is shown;
[0014] Figure 2 A flowchart illustrating a material recall model training method according to some embodiments of this application is shown;
[0015] Figure 3 A schematic diagram of the network structure of a material recall model provided according to some embodiments of this application is shown;
[0016] Figure 4 A schematic block diagram of a material recommendation apparatus provided according to some embodiments of this application is shown; and
[0017] Figure 5 A schematic diagram of the hardware structure of an electronic device provided according to some embodiments of this application is shown. Detailed Implementation
[0018] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0019] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0020] Figure 1 A flowchart illustrating a material recommendation method according to some embodiments of this application is shown. This material recommendation method can be executed by an electronic device, and the electronic devices mentioned in the embodiments of this application include, but are not limited to, mobile phones, tablets, computers, wearable devices, and other electronic devices. (Refer to...) Figure 1 As shown, the material recommendation method includes steps S110, S120, S130, and S140. The following section details... Figure 1 The material recommendation method in the example embodiments will be described in detail.
[0021] Reference Figure 1 As shown, in step S110, the user characteristics and scene characteristics corresponding to the user are obtained.
[0022] In the example embodiment, when a material recommendation request initiated by a user is received, the user's corresponding user characteristics and scenario characteristics are queried based on the user's identity identifier and scenario information carried in the material recommendation request. The user identity identifier includes the International Mobile Equipment Identity (IMEI), device serial number, etc. User characteristics can be user attribute features stored in the cluster during user registration, such as gender and age, or historical behavioral features, such as exposure clicks, exposure without clicks, likes, favorites, comments, etc. Scenario characteristics include the request occurrence time, browser version, and method of accessing the browser, etc.
[0023] Next, in step S120, by inputting user features and scene features into the multi-tower structure of the material recall model, the first fusion embedding vector and the second fusion embedding vector are determined. The first fusion embedding vector is the vector between user features and material features, and the second fusion embedding vector is the vector between scene features and material features. The multi-tower structure includes a user tower structure, a scene tower structure and a material tower structure. The material recall model pre-stores material features corresponding to multiple materials.
[0024] In this example embodiment, unlike the existing dual-tower model structure, a multi-tower material retrieval model is adopted. This model includes a user tower structure, a scene tower structure, and a material tower structure. The acquired user features and scene features are processed by the multi-tower structure of the material retrieval model to obtain a first fusion embedding vector `user_item_embedding` between user features and material features, and a second fusion embedding vector `contex_item_embedding` between scene features and material features. Specifically, by inputting material features into the multi-tower structure of the material retrieval model, a material embedding vector `item_embedding` corresponding to the material features is obtained, and an index is generated and stored in the database. Typically, the material embedding vectors in the database are updated hourly.
[0025] Furthermore, in the example embodiment, the user tower structure, scene tower structure, and material tower structure are constructed based on the Wide&Deep neural network model. The Wide&Deep neural network model includes a wide part and a deep part. The wide part corresponds to a linear model, and the deep part corresponds to a DNN model. The output of the entire model is the superposition of the output of the linear model and the output of the DNN model. Unlike the existing dual-tower structure model, a scene tower structure that receives scene features is added.
[0026] In step S130, the first fusion embedding vector and the second fusion embedding vector are concatenated to form the third fusion embedding vector.
[0027] In the example embodiment, the first fused embedding vector user_item_embedding and the second fused embedding vector contex_item_embedding are concatenated to form the third fused embedding vector [user_item_embedding, contex_item_embedding].
[0028] Next, in step S140, the similarity score between the third fusion embedding vector and the material embedding vector corresponding to the material feature is determined, and materials whose similarity scores meet the preset conditions are recommended to the user.
[0029] In the example embodiment, the third fusion embedding vector [user_item_embedding, contex_item_embedding] is used as an index. By determining the similarity score between the third fusion embedding vector and the material embedding vector item_embedding corresponding to the material feature, materials whose similarity scores meet the preset conditions are queried and recommended to the user.
[0030] The similarity score between the third fusion embedding vector and the material embedding vector corresponding to the material feature can be determined by methods such as cosine similarity and inner product. In the example embodiment, determining the similarity score between the third fusion embedding vector and the material embedding vector corresponding to the material feature includes: for each material embedding vector, determining the inner product between the third fusion embedding vector and the material embedding vector as the similarity score between the third fusion embedding vector and the material embedding vector.
[0031] In contrast to existing dual-tower models that determine recommended items based on the similarity between user_embedding and item_embedding, this embodiment determines recommended items based on the similarity between a third fusion embedding vector [user_item_embedding, context_item_embedding] and item_embedding. Specifically, the third fusion embedding vector is generated by predicting and calling a material retrieval model based on the user's corresponding user features and scene features. This approach incorporates the personalized biases introduced by scene features across different scenarios, improving the processing effectiveness of material information and thus meeting the application requirements of multi-scene modeling in the retrieval stage.
[0032] Figure 2 A flowchart illustrating a material recall model training method provided according to some embodiments of this application is shown.
[0033] Reference Figure 2 As shown, before obtaining the user's corresponding user characteristics and scene characteristics, the process also includes:
[0034] Step S150: Obtain the model input vector of the material recall model within a preset time period. The model input vector includes user embedding vector, material embedding vector and scene embedding vector.
[0035] In the example embodiment, the model input features of the material recall model are first constructed, and the model input features are mapped to the model input vector through the embedding layer (i.e., a fully connected layer).
[0036] Furthermore, in the example embodiment, obtaining the model input vector of the material recall model within a preset time period includes: collecting model input features within the preset time period and determining the feature type corresponding to the model input features; the model input features include user features, material features and scenario features; and using a quantization strategy that matches the feature type to quantize the model input features to obtain the model input vector.
[0037] Among these features, model input features can be constructed according to business needs. Taking information flow recommendation as an example, user features include user attribute features and user historical behavior features (including exposure clicks, exposure without clicks, likes, favorites, comments, etc.), material features include basic material attribute features and posterior material features (including number of clicks, click-through rate, duration of each click, etc.), and scenario features are used to characterize the consumption behavior (including time, scenario module, material preference in that module, user preference in that scenario). Detailed scenario features are shown in Table 1:
[0038] Table 1 Examples of Scene Features
[0039]
[0040]
[0041] Furthermore, in the example embodiment, the feature type includes at least one or more of categorical features, numerical features, string features, and data structure features; the model input features are quantized using a quantization strategy matching the feature type to obtain the model input vector, including: when the model input feature is a categorical feature, encoding the model input feature to obtain the model input vector; or, when the model input feature is a numerical feature (float type), performing logarithmic normalization on the model input feature to obtain the model input vector; or, when the model input feature is a string feature (such as imei, news_id), hashing the model input feature, and to avoid array out-of-bounds errors caused by too many feature categories, mod processing is also performed on large-scale categorical features to obtain the model input vector; or, when the model input feature is a data structure feature (such as map features in scene features), performing sparse representation and sparse decomposition on the model input feature to obtain the model input vector.
[0042] Step S160: By inputting the model input vector into the multi-tower structure of the material recall model, the model output vector corresponding to the model input vector is obtained; the structure category of the multi-tower structure corresponds one-to-one with the vector category of the model input vector.
[0043] In example embodiments, such as Figure 3 As shown, after processing the model input features of different feature types, the model input vector is obtained and stored in the user tower structure, scene tower structure, and material tower structure according to different categories of user, material, and scene. Unlike the existing dual-tower model structure, a scene tower is added to receive scene features. The user tower structure, scene tower structure, and material tower structure can be constructed based on the Wide&Deep neural network model. The following section uses the scene tower as an example to describe the construction process in detail:
[0044] (1) Construct the wide part of the scene tower. This part mainly improves the first-order and second-order intersection capabilities of scene features. The calculation formula for this part is as follows:
[0045]
[0046] Among them, y wide Let w be the output vector of the wide part, w be the first-order weights of the wide part, x be the model input vector, <,> denote the dot product, V be the second-order weights of the wide part, and d be the length of the model input vector. j1 This represents the j1-th model input vector. The part before the plus sign in the formula is the first-order result of calculating scene features, and the part after the plus sign is the second-order result. The dimension of the output vector in the Wide part is set to 32.
[0047] (2) Constructing the deep part of the scene tower. This part mainly improves the high-order cross-connection capability of scene features. This part is consistent with the tower structure of the existing dual-tower model, where the tower structure is a three-layer fully connected network structure, with 128, 64, and 32 nodes in each layer. The calculation formula for this part is as follows:
[0048] l i =f(W i l i-1 +b i ), i = 1, ..., N-1;
[0049] y = f(W) N l N-1 +b N );
[0050] Among them, W i Let b represent the weight matrix of the i-th layer. i This represents the bias of the i-th layer. In particular, the bias of the first layer is 0. i Let represent the i-th layer of the tower, N represent the total number of layers in the tower, and y represent the output vector of the deep part.
[0051] (3) Connect the output vectors of the wide and deep parts to form the output of the scene tower. The dimension of the output vector after connection is 64, which is consistent with the output vectors of the user tower and the material tower.
[0052] (4) According to the number and complexity of features of different towers, different drop-off rates are set for the DNN network. For example, the drop-off rate of the user tower is set to 0.2, the drop-off rate of the material tower is set to 0.2, and the drop-off rate of the scene tower is set to 0.1. Finally, L2 regularization is performed on the output results of the three towers to prevent overfitting and obtain the user embedding vector user_embedding, the material embedding vector item_embedding, and the scene embedding vector context_embedding, respectively.
[0053] Step S170: Divide the model output vector into two sub-vectors of the same length, and multiply the sub-vectors corresponding to the model input vectors of different vector categories pairwise to obtain the product. The sum of the products is determined as the similarity value.
[0054] In the example embodiment, combined with the FFM paradigm, unlike the traditional two-tower model which directly multiplies the user output vector and material output vector cosine to calculate the output value, the three-tower model performs a preprocessing operation on the user, material, and scene-side embeddings of the three towers in the previous step—splitting them in half, i.e.
[0055] user_embedding=[user_item_embedding,user_contex_embedding],
[0056] item_embedding=[item_user_embedding,item_contex_embedding],
[0057] context_embedding=[context_user_embedding,contex_item_embedding].
[0058] Since the three output vectors are 64-dimensional, after splitting them in half, each sub-vector is 32-dimensional, where each sub-vector represents the cross-feature result of one of the three categories with the features of two of the categories.
[0059] The decomposition methods for the three features are similar; here, only one decomposition detail is described as follows:
[0060] Taking the scene output vector as an example, the 64-dimensional context_embedding[1-64] is split into two 32-dimensional vectors. Context_embedding[1-32] is the output vector context_user_embedding, which is the intersection of scene features and user features. Context_embedding[33-64] is the output vector context_item_embedding, which is the intersection of scene features and material features. Following this process, user, material, and scene features are each split into six pairwise intersecting sub-vectors.
[0061] Regarding output value calculation, traditional dual-tower features only have two towers: user and material. The training score calculation formula is to use the cosine similarity of the two vectors calculated by the cosine function, as follows:
[0062]
[0063] Among them, Embedding User Embedding Item Let |||·|| represent the user vector and the material vector, respectively, and ||·|| represent the magnitude of the vector. A larger Rate value indicates greater similarity between the user and material vectors. Therefore, the formula for calculating the similarity value logit for the corresponding three-tower model is:
[0064] logit=user_item_embedding*item_user_embedding+
[0065] user_context_embedding*context_user_embedding+
[0066] item_user_embedding*contex_item_embedding
[0067] The similarity value is obtained by multiplying each pair of the semi-segmented sub-vectors and summing the products. When building the index, this formula is used to find similar materials, equivalent to a nearest neighbor query with scene bias. However, this formula requires updating both material and scene features simultaneously when building an offline index. Scene features change very frequently; for example, clicking on a news article in any scene will cause the value of this feature to change, making it impossible to update scene features offline on an hourly basis. To solve this problem, a mathematical substitution formula is used to determine the similarity value, as shown below:
[0068] logit=user_item_embedding*item_user_embedding+
[0069] user_context_embedding*context_user_embedding+
[0070] item_user_embedding*contex_item_embedding
[0071] =item_user_embedding*user_item_embedding+
[0072] item_context_embedding*contex_etem_embedding
[0073] in,
[0074] item_user_embedding*user_item_embedding
[0075] +item_context_embedding*contex_etem_embedding
[0076] Equivalent to vector: a*b, where,
[0077] a=[item_user_embedding,item_context_embedding]
[0078] b=[user_item_embedding,contex_item_embedding]
[0079] Right now
[0080] logit=item_embedding*[user_item_embedding,contex_item_embedding].
[0081] By using mathematical substitution formulas, the output vector of the material is extracted separately, and the user vector and the scene vector are merged into a [user_item_embedding, context_item_embedding]. In this way, when updating the offline index, the original engineering architecture can still be used, and only the material vector is updated offline in batches. The user and scene features can be queried online Redis in real time to obtain the latest data, and then the vector is generated.
[0082] Step S180: Construct a loss function based on the similarity value, and iteratively train the model parameters by minimizing the loss function to obtain the material recall model.
[0083] In the example embodiment, the similarity value logit is a value between 0 and 1. A loss function loss is constructed based on logit, such as loss = 1 - logit. By continuously adjusting the model parameters of the material recall model, the function value of the loss function gradually converges to a preset range, thereby obtaining the material recall model. Furthermore, by inputting user features and scenario features into the trained material recall model, a first fusion embedding vector and a second fusion embedding vector can be output.
[0084] The three-tower structure provided in this application, compared to the existing two-tower structure, introduces scene bias by training the user vector along with scene features. This three-tower structure separates the user and scene output vectors, removing the user_context_embedding and context_user_embedding that interact with the scene features. The new "user-scene vector" [user_item_embedding, context_item_embedding] is then used for similarity indexing. Essentially, this transforms the previously implicitly trained scene features into explicitly participating in model training. Compared to the existing user-material tower structure, the three-tower structure provided in this application treats scene features as a single tower for centralized training, solving the problem of directly incorporating scene features in multi-scene modeling. Offline model training metrics and online business results show that the three-tower model incorporating scene features performs better than the existing two-tower structure, with an approximately 15% increase in single-channel exposure and a 20% increase in independent exposure in online metrics.
[0085] Figure 4 A schematic block diagram of a material recommendation apparatus according to some embodiments of this application is shown. (Refer to...) Figure 4As shown, the material recommendation device 400 includes: a feature acquisition module 410, a vector determination module 420, a vector concatenation module 430, and a material recommendation module 440. The feature acquisition module 410 acquires user features and scene features corresponding to the user. The vector determination module 420 determines a first fusion embedding vector and a second fusion embedding vector by inputting the user features and scene features into the multi-tower structure of the material retrieval model. The first fusion embedding vector is a vector between the user features and the material features, and the second fusion embedding vector is a vector between the scene features and the material features. The multi-tower structure includes a user tower structure, a scene tower structure, and a material tower structure. The material retrieval model pre-stores material features corresponding to multiple materials. The vector concatenation module 430 concatenates the first and second fusion embedding vectors into a third fusion embedding vector. The material recommendation module 440 determines the similarity score between the third fusion embedding vector and the material embedding vector corresponding to the material features, and recommends materials whose similarity scores meet preset conditions to the user.
[0086] In some embodiments of this application, based on the above scheme, the method further includes: an acquisition module, used to acquire the model input vector of the material recall model within a preset time period, the model input vector including user embedding vector, material embedding vector and scene embedding vector; an output module, used to obtain the model output vector corresponding to the model input vector by inputting the model input vector into the multi-tower structure of the material recall model; the structure category of the multi-tower structure corresponds one-to-one with the vector category of the model input vector; a segmentation module, used to segment the model output vector into two sub-vectors with the same length, and multiply the sub-vectors corresponding to the model input vectors of different vector categories pairwise to obtain a product, and determine the sum of each product as a similarity value; and a training module, used to construct a loss function based on the similarity value, and iteratively train the model parameters by minimizing the loss function to obtain the material recall model.
[0087] In some embodiments of this application, based on the above scheme, the acquisition module includes: a collection unit, used to collect model input features within a preset time period and determine the feature type corresponding to the model input features; the model input features include user features, material features and scene features; and a quantization unit, used to quantize the model input features using a quantization strategy that matches the feature type to obtain a model input vector.
[0088] In some embodiments of this application, based on the above scheme, the feature type includes at least one or more of categorical features, numerical features, string features, and data structure features; when the quantization unit is used to quantize the model input features using a quantization strategy matching the feature type to obtain the model input vector, it is specifically used to: encode the model input features to obtain the model input vector when the model input features are categorical features; or, log-normalize the model input features to obtain the model input vector when the model input features are numerical features; or, hash the model input features to obtain the model input vector when the model input features are string features; or, sparsely represent and sparsely decompose the model input features to obtain the model input vector when the model input features are data structure features.
[0089] In some embodiments of this application, based on the above scheme, the material recommendation module includes: a determining unit, used to determine the inner product between the third fusion embedding vector and the material embedding vector as the similarity score between the third fusion embedding vector and the material embedding vector for each material embedding vector.
[0090] Figure 5 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application, as shown below. Figure 5 As shown, the electronic device 500 includes, but is not limited to, components such as: a radio frequency unit 501, a network module 502, an audio output unit 503, an input unit 504, a sensor 505, a display unit 506, a user input unit 507, an interface unit 508, a memory 509, a processor 510, and a power supply 511. Those skilled in the art will understand that... Figure 5 The electronic device structures shown are not intended to limit the electronic device. An electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements. In the embodiments of this application, the electronic device includes, but is not limited to, mobile phones, tablets, laptops, PDAs, in-vehicle terminals, wearable devices, and pedometers.
[0091] The memory 509 stores a computer program that, when executed by the processor 510, performs the following steps: acquiring user features and scenario features corresponding to the user; inputting the user features and scenario features into the multi-tower structure of the material recall model to determine a first fusion embedding vector and a second fusion embedding vector, wherein the first fusion embedding vector is a vector between the user features and the material features, and the second fusion embedding vector is a vector between the scenario features and the material features; the multi-tower structure includes a user tower structure, a scenario tower structure, and a material tower structure, and the material recall model pre-stores material features corresponding to multiple materials; concatenating the first fusion embedding vector and the second fusion embedding vector into a third fusion embedding vector; determining the similarity score between the third fusion embedding vector and the material embedding vector corresponding to the material features, and recommending materials whose similarity scores meet preset conditions to the user.
[0092] Optionally, when the computer program is executed by the processor 510, it can implement the following process: before obtaining the user characteristics and scene characteristics corresponding to the user, it further includes: obtaining the model input vector of the material recall model within a preset time period, the model input vector including the user embedding vector, the material embedding vector and the scene embedding vector; by inputting the model input vector into the multi-tower structure of the material recall model, obtaining the model output vector corresponding to the model input vector; the structure category of the multi-tower structure corresponds one-to-one with the vector category of the model input vector; dividing the model output vector into two sub-vectors with the same length, and multiplying the sub-vectors corresponding to the model input vectors of different vector categories pairwise to obtain the product, and determining the sum of each product as the similarity value; constructing a loss function based on the similarity value, and iteratively training the model parameters by minimizing the loss function to obtain the material recall model.
[0093] Optionally, when the computer program is executed by the processor 510, it obtains the model input vector of the material recall model within a preset time period, including: collecting model input features within the preset time period and determining the feature type corresponding to the model input features; the model input features include user features, material features and scenario features; and quantizing the model input features using a quantization strategy that matches the feature type to obtain the model input vector.
[0094] Optionally, when the computer program is executed by the processor 510, the feature type includes at least one or more of categorical features, numerical features, string features, and data structure features; the model input features are quantized using a quantization strategy matching the feature type to obtain a model input vector, including: encoding the model input features to obtain a model input vector when the model input features are categorical features; or, performing logarithmic normalization on the model input features when the model input features are numerical features to obtain a model input vector; or, performing hashing on the model input features when the model input features are string features to obtain a model input vector; or, performing sparse representation and sparse decomposition on the model input features to obtain a model input vector when the model input features are data structure features.
[0095] Optionally, when the computer program is executed by the processor 510, it determines the similarity score between the third fusion embedding vector and the material embedding vectors corresponding to the pre-stored plurality of materials, including: for each material embedding vector, determining the inner product between the third fusion embedding vector and the material embedding vector as the similarity score between the third fusion embedding vector and the material embedding vector.
[0096] It should be understood that, in this embodiment, the radio frequency unit 501 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink data from the base station and processes it with the processor 510; additionally, it transmits uplink data to the base station. Typically, the radio frequency unit 501 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier, a duplexer, etc. Furthermore, the radio frequency unit 501 can also communicate with networks and other devices through a wireless communication system.
[0097] The electronic device provides users with wireless broadband internet access through the network module 502, such as helping users send and receive emails, browse web pages, and access streaming media.
[0098] The audio output unit 503 can convert audio data received by the radio frequency unit 501 or the network module 502 or stored in the memory 509 into audio signals and output them as sound. Furthermore, the audio output unit 503 can also provide audio output related to specific functions performed by the electronic device 500 (e.g., call signal reception sound, message reception sound, etc.). The audio output unit 503 includes a speaker, a buzzer, and a receiver, etc.
[0099] Input unit 504 is used to receive audio or video signals. Input unit 504 may include a graphics processing unit (GPU) 5041 and a microphone 5042. The GPU 5041 processes image data of still images or videos acquired by an image capture device (such as a camera) in video capture mode or image capture mode. The processed image frames can be displayed on display unit 506. The image frames processed by GPU 5041 can be stored in memory 509 (or other storage medium) or transmitted via radio frequency unit 501 or network module 502. Microphone 5042 can receive sound and process such sound into audio data. The processed audio data can be converted into a format that can be transmitted to a mobile communication base station via radio frequency unit 501 in telephone call mode.
[0100] The electronic device 500 also includes at least one sensor 505, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 5061 according to the ambient light level, and the proximity sensor can turn off the display panel 5061 and / or backlight when the electronic device 500 is moved to the ear. As a type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity and can be used to identify the posture of the electronic device (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc. The sensor 505 may also include a fingerprint sensor, pressure sensor, iris sensor, molecular sensor, gyroscope, barometer, hygrometer, thermometer, infrared sensor, etc., which will not be described in detail here.
[0101] The display unit 506 is used to display information input by the user or information provided to the user. The display unit 506 may include a display panel 5061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0102] User input unit 507 can be used to receive input numerical or character information, and to generate key signal inputs related to user settings and function control of electronic devices. Specifically, user input unit 507 includes a touch panel 5071 and other input devices 5072. Touch panel 5071, also known as a touch screen, can collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near touch panel 5071). Touch panel 5071 may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch position and the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 510, which receives and executes commands from the processor 510. In addition, touch panel 5071 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. Besides touch panel 5071, user input unit 507 may also include other input devices 5072. Specifically, other input devices 5072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, joysticks, etc., which will not be described in detail here.
[0103] Furthermore, the touch panel 5071 can cover the display panel 5061. When the touch panel 5071 detects a touch operation on or near it, it transmits the information to the processor 510 to determine the type of touch event. Subsequently, the processor 510 provides corresponding visual output on the display panel 5061 according to the type of touch event. Although the touch panel 5071 and the display panel 5061 are implemented as two independent components to realize the input and output functions of the electronic device, in some embodiments, the touch panel 5071 and the display panel 5061 can be integrated to realize the input and output functions of the electronic device. Specific details are not limited here.
[0104] Interface unit 508 serves as an interface for connecting external devices to electronic device 500. For example, external devices may include a wired or wireless headphone port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, and so on. Interface unit 508 can be used to receive input from external devices (e.g., data, power, etc.) and transmit the received input to one or more components within electronic device 500, or it can be used to transmit data between electronic device 500 and external devices.
[0105] The memory 509 can be used to store software programs and various data. The memory 509 may primarily include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function (such as sound playback, image playback, etc.), etc.; the data storage area may store data created based on the use of the mobile phone (such as audio data, phonebook, etc.). Furthermore, the memory 509 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0106] The processor 510 is the control center of the electronic device. It connects various parts of the electronic device via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 509, and by calling data stored in the memory 509, it performs various functions and processes data, thereby providing overall monitoring of the electronic device. The processor 510 may include one or more processing units; preferably, the processor 510 may integrate an application processor and a modem processor. The application processor mainly handles the operating system, user interface, and applications, while the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 510.
[0107] The electronic device 500 may also include a power supply 511 (such as a battery) for supplying power to various components. Preferably, the power supply 511 can be logically connected to the processor 510 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system.
[0108] In addition, the electronic device 500 includes some functional modules not shown, which will not be described in detail here.
[0109] The electronic device in this application embodiment can implement each process of the aforementioned material recommendation method and achieve the same effect and function, which will not be repeated here.
[0110] Furthermore, this application embodiment also provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the various processes of the above-described material recommendation method embodiment and achieves the same technical effects. To avoid repetition, it will not be described again here. The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.
[0111] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0112] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the above embodiments of this application.
[0113] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A material recommendation method, characterized in that, include: Obtain user characteristics and scenario characteristics corresponding to the user; By inputting the user features and scenario features into the multi-tower structure of the material retrieval model, a first fusion embedding vector and a second fusion embedding vector are determined, wherein the first fusion embedding vector is a vector between the user features and the material features, and the second fusion embedding vector is a vector between the scenario features and the material features; the multi-tower structure includes a user tower structure, a scenario tower structure, and a material tower structure, and the material retrieval model pre-stores material features corresponding to multiple materials. The first and second fusion embedding vectors are concatenated to form a third fusion embedding vector; Determine the similarity score between the third fusion embedding vector and the material embedding vector corresponding to the material feature, and recommend materials that meet the preset similarity score conditions from the pre-stored materials to the user; Before obtaining the user's corresponding user characteristics and scene characteristics, the method further includes: Obtain the model input vector of the material recall model within a preset time period. The model input vector includes user embedding vector, material embedding vector, and scenario embedding vector. By inputting the model input vector into the multi-tower structure of the material recall model, a model output vector corresponding to the model input vector is obtained; the structure category of the multi-tower structure corresponds one-to-one with the vector category of the model input vector. The model output vector is divided into two sub-vectors of the same length, and the sub-vectors corresponding to the model input vectors of different vector categories are multiplied pairwise to obtain the product. The sum of the products is determined as the similarity value. A loss function is constructed based on the similarity value, and the model parameters are iteratively trained by minimizing the loss function to obtain the material recall model.
2. The method according to claim 1, characterized in that, The step of obtaining the model input vector of the material recall model within a preset time period includes: Collect model input features within a preset time period and determine the feature types corresponding to the model input features; the model input features include user features, material features, and scene features; The model input features are quantized using a quantization strategy that matches the feature type to obtain the model input vector.
3. The method according to claim 2, characterized in that, The feature type includes at least one or more of categorical features, numerical features, string features, and data structure features; the step of quantizing the model input features using a quantization strategy matching the feature type to obtain the model input vector includes: When the model input features are categorical features, the model input features are encoded to obtain the model input vector; or, If the model input features are numerical features, the model input features are log-normalized to obtain the model input vector; or, If the model input features are string-type features, the model input features are hashed to obtain the model input vector; or, When the model input features are data structure features, the model input features are sparsely represented and sparsely decomposed to obtain the model input vector.
4. The method according to claim 1, characterized in that, Determining the similarity score between the third fused embedding vector and the material embedding vector corresponding to the material feature includes: For each material embedding vector, the inner product between the third fused embedding vector and the material embedding vector is determined as the similarity score between the third fused embedding vector and the material embedding vector.
5. A material recommendation device, characterized in that, include: The feature acquisition module is used to acquire user features and scene features corresponding to the user. The vector determination module is used to determine a first fusion embedding vector and a second fusion embedding vector by inputting the user features and scenario features into the multi-tower structure of the material retrieval model. The first fusion embedding vector is a vector between the user features and the material features, and the second fusion embedding vector is a vector between the scenario features and the material features. The multi-tower structure includes a user tower structure, a scenario tower structure, and a material tower structure. The material retrieval model pre-stores material features corresponding to multiple materials. The vector concatenation module is used to concatenate the first fused embedding vector and the second fused embedding vector into a third fused embedding vector. The material recommendation module is used to determine the similarity score between the third fusion embedding vector and the material embedding vector corresponding to the material feature, and recommend materials whose similarity scores meet preset conditions to the user. The acquisition module is used to acquire the model input vector of the material recall model within a preset time period. The model input vector includes user embedding vector, material embedding vector and scenario embedding vector. The output module is used to obtain a model output vector corresponding to the model input vector by inputting the model input vector into the multi-tower structure of the material recall model; the structure category of the multi-tower structure corresponds one-to-one with the vector category of the model input vector. The segmentation module is used to segment the model output vector into two sub-vectors with the same length, and multiply the sub-vectors corresponding to the model input vectors of different vector categories pairwise to obtain a product, and determine the sum of the products as the similarity value. The training module is used to construct a loss function based on the similarity value, and to iteratively train the model parameters by minimizing the loss function to obtain the material recall model.
6. The apparatus according to claim 5, characterized in that, The acquisition module includes: The data acquisition unit is used to acquire model input features within a preset time period and determine the feature type corresponding to the model input features; the model input features include user features, material features, and scene features; A quantization unit is used to quantize the model input features using a quantization strategy that matches the feature type, to obtain the model input vector.
7. The apparatus according to claim 6, characterized in that, The feature type includes at least one or more of categorical features, numerical features, string features, and data structure features; the quantization unit, when used to quantize the model input features using a quantization strategy matching the feature type to obtain the model input vector, is specifically used for: When the model input features are categorical features, the model input features are encoded to obtain the model input vector; or, If the model input features are numerical features, the model input features are log-normalized to obtain the model input vector; or, If the model input features are string-type features, the model input features are hashed to obtain the model input vector; or, When the model input features are data structure features, the model input features are sparsely represented and sparsely decomposed to obtain the model input vector.
8. The apparatus according to claim 5, characterized in that, The material recommendation module includes: The determining unit is used to determine the inner product between the third fused embedding vector and the material embedding vector for each material embedding vector as the similarity score between the third fused embedding vector and the material embedding vector.
9. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the material recommendation method as described in any one of claims 1 to 4.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the material recommendation method as described in any one of claims 1 to 4.