Information recommendation method and storage medium
By obtaining table and text sample data in personalized recommendations of Internet TV, iteratively updates the collaborative and semantic models, and combining semantic knowledge, the problem of discarding feature semantic information in traditional recommendation models is solved, achieving more efficient recommendation effects and user experience.
Patent Information
- Application Number
- CN202411973459.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-29
AI Technical Summary
Due to the single feature encoding process in the traditional Internet TV personalized recommendation sorting model, the semantic information between the original features is discarded, and there is a problem that the recommendation effect is not ideal.
By obtaining the table sample data and text sample data, input the initial collaborative model and the initial semantic model for feature processing, iteratively update the model to generate the target collaborative model, and combining semantic knowledge to improve recommendation efficiency and effect.
Through fine-grained modal cross-knowledge alignment, semantic knowledge is introduced, feature relationships are enhanced, the accuracy and efficiency of the recommended model are improved, the user experience is improved, and the calculation cost and reasoning time are reduced.
Smart Images

Figure CN119903235A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data recommendation, and in particular to an information recommendation method and a storage medium. Background Art
[0002] Ranking models are an important part of digital marketing, which determine the order of content and recommendations that users see on various platforms. In the field of Internet TV, the role of personalized recommendation ranking models is particularly critical, which directly affects user satisfaction with content and viewing behavior.
[0003] The traditional personalized recommendation ranking model of Internet TV is mainly based on the CTR prediction model, which predicts the probability of users clicking on certain content in the future by analyzing their historical click data.
[0004] However, this processing method performs one-hot encoding on the original table data, and the feature encoding process is single, which causes the semantic information between the original features to be discarded, resulting in unsatisfactory recommendation effects. Summary of the invention
[0005] The purpose of this application is to provide an information recommendation method and a storage medium to address the deficiencies in the above-mentioned prior art, so as to solve the problem that the recommendation effect in the prior art is not ideal.
[0006] To achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
[0007] In a first aspect, an embodiment of the present application provides an information recommendation method, the method comprising:
[0008] Acquire table sample data and text sample data, wherein the table sample data and the text sample data are obtained through the same original data;
[0009] Input the table sample data into the initial collaborative model for table feature processing to obtain first feature data, wherein the first feature data includes a plurality of first vectors; input the text sample data into the initial semantic model for semantic feature processing to obtain second feature data, wherein the second feature data includes a plurality of second vectors;
[0010] Iteratively updating the initial collaborative model and the initial semantic model according to the first feature data, the second feature data, and a preset bidirectional loss calculation strategy, and taking the initial collaborative model at the end of the iteration as the target collaborative model;
[0011] According to the target collaborative model, an initial click rate prediction model is constructed, and the table sample data is input into the initial click rate prediction model for prediction to obtain the predicted value of the table sample data;
[0012] Iteratively updating the initial click rate prediction model according to the table sample data and the predicted value, and using the initial click rate prediction model at the end of the iteration as the target click rate prediction model;
[0013] Target table data is generated according to the historical operation data of the target user, and the target table data is input into the target click rate prediction model for prediction to obtain a prediction result, and information is recommended to the target user according to the prediction result.
[0014] In a possible implementation, the initial collaborative model includes: a collaborative module and a first linear projection layer;
[0015] The step of inputting the table sample data into the initial collaborative model to process the table features to obtain first feature data includes:
[0016] Inputting the table sample data into the collaborative module to perform table feature extraction and encoding processing to obtain multiple intermediate first vectors;
[0017] Each of the intermediate first vectors is input into the first linear projection layer for dimensional transformation to obtain the first feature data.
[0018] In a possible implementation, the initial semantic model includes: a semantic module and a second linear projection layer;
[0019] The step of inputting the text sample data into the initial semantic model for semantic feature processing to obtain second feature data includes:
[0020] Inputting the text sample data into the semantic module for semantic feature extraction and encoding processing to obtain a plurality of intermediate second vectors;
[0021] Each of the intermediate second vectors is input into the second linear projection layer for dimensional transformation to obtain the second feature data.
[0022] In a possible implementation, iteratively updating the initial collaborative model and the initial semantic model according to the first feature data, the second feature data, and a preset bidirectional loss calculation strategy includes:
[0023] Projecting each of the first vectors to a plurality of subspaces to obtain a first component of each of the first vectors in each of the subspaces, and projecting each of the second vectors to a plurality of subspaces to obtain a second component of each of the second vectors in each of the subspaces;
[0024] Determine similarity data between each first vector and each second vector according to the first component of each first vector in each subspace and the second component of each second vector in each subspace;
[0025] A first contrast loss and a second contrast loss are calculated according to the similarity data between each first vector and each second vector, a first contrast loss function, and a second contrast loss function, wherein the first contrast loss is used to indicate the loss of the text sample data relative to the table sample data, and the second contrast loss is used to indicate the loss of the table sample data relative to the text sample data;
[0026] The initial collaborative model and the initial semantic model are iteratively updated according to the first contrast loss and the second contrast loss.
[0027] In a possible implementation, determining the similarity data between each first vector and each second vector according to the first component of each first vector in each subspace and the second component of each second vector in each subspace includes:
[0028] Transposing a first component of the first vector in the current subspace to obtain a transposed component;
[0029] respectively calculating the product of the transposed component and the second component of the second vector in each subspace to obtain a plurality of products;
[0030] Taking the maximum value among the multiple products as the target value of the first vector in the current subspace;
[0031] The target values of the first vector in all subspaces are summed to obtain similarity data between the first vector and the second vector.
[0032] In a possible implementation manner, the iteratively updating the initial collaborative model and the initial semantic model according to the first contrast loss and the second contrast loss includes:
[0033] Calculating a bidirectional loss of the first feature data and the second feature data according to the first contrast loss and the second contrast loss;
[0034] According to the bidirectional loss, the initial collaborative model and the initial semantic model are iteratively updated through a back-propagation algorithm.
[0035] In a possible implementation, constructing an initial click rate prediction model according to the target collaboration model includes:
[0036] The preset fully connected layer and the preset output layer are sequentially spliced on the top of the target collaborative model to construct the initial click rate prediction model.
[0037] In a possible implementation, inputting the table sample data into an initial click rate prediction model for prediction to obtain a predicted value of the table sample data includes:
[0038] Inputting the table sample data into the target collaborative model to perform table feature processing to obtain target feature data;
[0039] Inputting the target feature data into the fully connected layer for linear transformation to obtain initial output data;
[0040] The initial output data is input into the output layer for processing to obtain the predicted value of the table sample data.
[0041] In a possible implementation, the obtaining of table sample data and text sample data includes:
[0042] Get table sample data;
[0043] The table sample data is input into a pre-constructed structured text template to generate the text sample data.
[0044] In a second aspect, another embodiment of the present application provides an information recommendation device, the device comprising:
[0045] An acquisition module, used for acquiring table sample data and text sample data, wherein the table sample data and the text sample data are obtained through the same original data;
[0046] A feature processing module, used for inputting the table sample data into an initial collaborative model to perform table feature processing to obtain first feature data, wherein the first feature data includes a plurality of first vectors;
[0047] A feature processing module, used for inputting the text sample data into an initial semantic model for semantic feature processing to obtain second feature data, wherein the second feature data includes a plurality of second vectors;
[0048] A first iterative updating module, configured to iteratively update the initial collaborative model and the initial semantic model according to the first feature data, the second feature data, and a preset bidirectional loss calculation strategy, and use the initial collaborative model at the end of the iteration as a target collaborative model;
[0049] A construction module, used to construct an initial click rate prediction model according to the target collaborative model, input the table sample data into the initial click rate prediction model for prediction, and obtain the predicted value of the table sample data;
[0050] A second iterative updating module, configured to iteratively update the initial click rate prediction model according to the table sample data and the predicted value, and use the initial click rate prediction model at the end of the iteration as the target click rate prediction model;
[0051] The prediction module is used to generate target table data according to the historical operation data of the target user, input the target table data into the target click rate prediction model for prediction, obtain the prediction result, and recommend information to the target user according to the prediction result.
[0052] In the third aspect, another embodiment of the present application provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to perform the steps of any method described in the first aspect above.
[0053] In a fourth aspect, another embodiment of the present application provides a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any method described in the first aspect are executed.
[0054] The beneficial effects of the present application are as follows: by acquiring table sample data and text sample data, and inputting the table sample data and the text sample data into the initial collaborative model and the initial semantic model respectively, the first feature data and the second feature data are obtained, and according to the first feature data, the second feature data and the preset bidirectional loss calculation strategy, the initial collaborative model and the initial semantic model are iteratively updated, and the initial collaborative model at the end of the iteration is used as the target collaborative model, fine-grained modal cross-knowledge alignment can be performed based on the table sample data and the text sample data, and semantic knowledge is introduced into the target collaborative model, so that the relationship between the features is mutually reinforced, thereby improving the recommendation efficiency and recommendation effect of the obtained target collaborative model, on this basis, according to the target collaborative model, an initial click-through rate prediction model is constructed, and the initial click-through rate prediction model is iteratively updated based on the table sample data to obtain the target click-through rate prediction model, and the supervision signal can be introduced into the initial click-through rate prediction model, and the initial click-through rate prediction model is fine-tuned, thereby ensuring the recommendation effect of the obtained target click-through rate prediction model, and recommending information to the target user through the target click-through rate prediction model, further improving the recommendation effect of recommending information to the target user, and improving the user experience of the target user. At the same time, when applying, you only need to deploy the target click-through rate prediction model to make recommendations to target users, which can significantly reduce computing costs, reduce reasoning time, ensure efficient online reasoning efficiency, and make it easier to deploy, expand and apply in various industrial scenarios, and easier to maintain and update. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0056] Figure 1 A schematic diagram of a flow chart of an information recommendation method provided in an embodiment of the present application;
[0057] Figure 2 A schematic diagram of an information recommendation method provided in an embodiment of the present application;
[0058] Figure 3 A schematic diagram of the structure of an initial collaborative model in the information recommendation method provided in an embodiment of the present application;
[0059] Figure 4 A schematic diagram of a process for obtaining first characteristic data in the information recommendation method provided in an embodiment of the present application;
[0060] Figure 5 A schematic diagram of the structure of an initial semantic model in the information recommendation method provided in an embodiment of the present application;
[0061] Figure 6 A schematic diagram of a flow chart for obtaining second characteristic data in the information recommendation method provided in an embodiment of the present application;
[0062] Figure 7 A schematic diagram of a process for iteratively updating an initial collaborative model and an initial semantic model in the information recommendation method provided in an embodiment of the present application;
[0063] Figure 8 A schematic diagram of a process for determining similarity data between each first vector and each second vector in the information recommendation method provided in an embodiment of the present application;
[0064] Fig. 9 Another flowchart of iteratively updating an initial collaborative model and an initial semantic model in the information recommendation method provided in an embodiment of the present application;
[0065] Fig.10 A schematic diagram of a structure of an initial click rate prediction model in the information recommendation method provided in an embodiment of the present application;
[0066] Fig.11 A schematic diagram of a flow chart for obtaining predicted values of table sample data in the information recommendation method provided in an embodiment of the present application;
[0067] Fig.12 A schematic diagram of an information recommendation device provided in an embodiment of the present application;
[0068] Fig.13 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0069] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.
[0070] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0071] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0072] The traditional personalized recommendation ranking model of Internet TV is mainly based on the CTR prediction model, which predicts the probability of users clicking on certain content in the future by analyzing their historical click data.
[0073] However, this processing method performs one-hot encoding on the original table data, and the feature encoding process is single, which causes the semantic information between the original features to be discarded, resulting in unsatisfactory recommendation effects.
[0074] Based on the above problems, an embodiment of the present application proposes an information recommendation method, which obtains table sample data and text sample data, and inputs the table sample data and the text sample data into an initial collaborative model and an initial semantic model respectively, and performs fine-grained modal cross-knowledge alignment based on the table sample data and the text sample data to obtain a target collaborative model. Semantic knowledge can be introduced into the target collaborative model, thereby improving the accuracy and efficiency of the target collaborative model. On this basis, an initial click-through rate prediction model is constructed according to the target collaborative model, and the initial click-through rate prediction model is iteratively updated based on the table sample data to obtain a target click-through rate prediction model. Information is recommended to target users through the target click-through rate prediction model, which can improve the recommendation effect and, at the same time, improve the efficiency of online reasoning.
[0075] It can be understood that the information recommendation method provided in the embodiment of the present application can be applied to any scenario where information recommendation is required to be made to a target user, and by executing the steps of the information recommendation method provided in the present application, information recommendation can be made to the target user. For example, the embodiment of the present application is described by taking personalized recommendation of Internet TV as an example.
[0076] The information recommendation method provided by the embodiments of the present application is described in detail below in combination with multiple embodiments.
[0077] Figure 1 A flowchart of the information recommendation method provided in the embodiment of the present application is shown in FIG. Figure 1 As shown, the execution subject of the method can be any electronic device with processing capability, and the method includes:
[0078] S101, obtaining table sample data and text sample data.
[0079] The table sample data and the text sample data are obtained through the same original data.
[0080] For example, taking Internet TV personalized recommendation as an example, the original data can be the content data of any user when watching Internet TV, where a piece of original data x can include the user's personal information and content data, for example: the personal information includes: gender, age range, geographic location, interests and behavior, etc., and the content data includes: content title, main cast and crew, subject matter and release time, etc. A piece of original data x can get a table sample data x structured , and a text sample data x text .
[0081] Exemplarily, multiple pieces of content data of any user watching Internet TV can be read from a database storing content data of any user watching Internet TV, and each piece of content data of any user watching Internet TV can be formatted to generate table sample data and text sample data.
[0082] Exemplarily, table sample data may also be directly acquired, and formatted to generate corresponding text sample data.
[0083] S102: Input the table sample data into the initial collaborative model to perform table feature processing to obtain first feature data, and input the text sample data into the initial semantic model to perform semantic feature processing to obtain second feature data.
[0084] Optionally, Figure 2 A schematic diagram of the information recommendation method provided in the embodiment of the present application, referring to Figure 2 As shown, the table sample data is input into the initial collaborative model to extract table features and encode them to obtain first feature data, wherein the first feature data includes a plurality of first vectors.
[0085] The initial collaborative model may be implemented based on a collaborative CTR model (Collaborative CTR Model).
[0086] For example, a table sample data x structured Input the initial collaborative model to extract table features and encode them to obtain multiple first vectors v(x structured ).
[0087] Optionally, the text sample data is input into the initial semantic model for semantic feature extraction and encoding processing to obtain second feature data, wherein the second feature data includes a plurality of second vectors.
[0088] The initial semantic model may be implemented based on a large language model (LLM for short).
[0089] For example, a text sample data x text Input the initial semantic model to extract semantic features and encode them to obtain multiple second vectors v(x text ).
[0090] S103, iteratively updating the initial collaborative model and the initial semantic model according to the first feature data, the second feature data and a preset bidirectional loss calculation strategy, and taking the initial collaborative model at the end of the iteration as the target collaborative model.
[0091] It can be understood that after obtaining the first feature data and the second feature data, contrastive learning is used to align the representations in different latent spaces, so that the table sample data and text sample data from the same pair have similar representations in the representation space, thereby aligning and aggregating the collaborative knowledge and semantic knowledge in the mixed representation space, and reinforcing the relationship between the features, thereby improving the application effect of the target collaborative model.
[0092] Optionally, continue to refer to Figure 2 As shown, after obtaining the first feature data and the second feature data, the representations in different latent spaces can be aligned by contrastive learning to obtain the aligned first feature data and the second feature data, and the loss of each training is calculated based on the aligned first feature data and the second feature data and the preset bidirectional loss calculation strategy, and a judgment is made in combination with the preset iteration end condition. If the current iteration meets the preset iteration end condition, the iteration is ended, and the initial collaborative model at the end of the iteration is used as the target collaborative model. If the current iteration does not meet the preset iteration end condition, the initial collaborative model and the initial semantic model continue to be iteratively updated.
[0093] Among them, the preset two-way loss calculation strategy may include a two-way contrastive loss function obtained based on contrastive learning, and may also include parameters such as loss weights.
[0094] S104: construct an initial click rate prediction model based on the target collaborative model, input the table sample data into the initial click rate prediction model for prediction, and obtain the predicted value of the table sample data.
[0095] It can be understood that after the target collaborative model is obtained, the target collaborative model can carry the semantic features in the original data, thereby significantly improving the recommendation efficiency and recommendation effect of the obtained target click-through rate prediction model.
[0096] Optionally, continue to refer to Figure 2 As shown, an initial click rate model can be constructed based on the target collaborative model, and the table sample data can be input into the initial click rate estimation model for prediction to obtain the predicted value of the table sample data.
[0097] The initial click rate model can be obtained by adding a linear layer and an output layer on the basis of the target collaborative model. The predicted value of the table sample data is used to indicate the probability of the user clicking on the content predicted based on the table sample data.
[0098] S105 . Iteratively update the initial click rate estimation model according to the table sample data and the predicted value, and use the initial click rate estimation model at the end of the iteration as the target click rate estimation model.
[0099] Optionally, continue to refer to Figure 2 As shown, after obtaining the predicted value of the table sample data, the loss of each training can be calculated based on the table sample data, the predicted value and the preset loss function, and judged in combination with the preset iteration termination condition. If the current iteration meets the preset iteration termination condition, the iteration is terminated, and the initial click-through rate model at the time of iteration termination is used as the target click-through rate estimation model. If the current iteration does not meet the preset iteration termination condition, the initial click-through rate estimation model continues to be iteratively updated.
[0100] Exemplarily, the binary cross entropy loss function can be used to iteratively update the initial click rate prediction model. Specifically, the loss function L ctr It can be characterized using the following formula (1):
[0101]
[0102] Among them, y represents the true value of the table sample data, represents the predicted value of the initial click rate estimation model, N represents the number of samples of the table sample data, and k represents the kth table sample data.
[0103] For example, the preset iteration termination condition may be to minimize the loss function L ctr ,Specifically, the Adam optimizer can be used to adjust the model parameters of the ,initial CTR prediction model to minimize the loss function.
[0104] S106: Generate target table data according to the historical operation data of the target user, input the target table data into the target click rate prediction model for prediction, obtain the prediction result, and recommend information to the target user according to the prediction result.
[0105] Optionally, after obtaining the target click rate prediction model, online reasoning may be performed based on the target click rate prediction model to recommend information to the user.
[0106] Optionally, target table data may be generated based on historical operation data of the target user, and the target table data may be input into a target click rate prediction model for prediction to obtain a prediction result, and information may be recommended to the target user based on the prediction result.
[0107] For example, taking personalized recommendation of Internet TV as an example, the historical operation data of the target user may be multiple pieces of operation data of the target user in a historical period, that is, what content the user watched and related information.
[0108] For example, continue to refer to Figure 2As shown, after obtaining the historical operation data of the target user, the historical operation data of the target user can be processed to generate target table data, and the target table data is input into the target click rate prediction model for prediction to obtain a prediction result. The prediction result is used to indicate the probability of the user clicking on the content.
[0109] For example, after the prediction result is obtained, all the contents displayed to the target user may be sorted according to the prediction result, and all the sorted contents may be displayed to the target user for information recommendation.
[0110] In this embodiment, by obtaining table sample data and text sample data, and inputting the table sample data and the text sample data into the initial collaborative model and the initial semantic model respectively, the first feature data and the second feature data are obtained, and according to the first feature data, the second feature data and the preset bidirectional loss calculation strategy, the initial collaborative model and the initial semantic model are iteratively updated, and the initial collaborative model at the end of the iteration is used as the target collaborative model, and fine-grained modal cross-knowledge alignment can be performed based on the table sample data and the text sample data, and semantic knowledge is introduced into the target collaborative model, so that the relationship between the features is mutually reinforced, thereby improving the recommendation efficiency and recommendation effect of the obtained target collaborative model. On this basis, according to the target collaborative model, an initial click-through rate prediction model is constructed, and the initial click-through rate prediction model is iteratively updated based on the table sample data to obtain the target click-through rate prediction model, and the supervision signal can be introduced into the initial click-through rate prediction model, and the initial click-through rate prediction model is fine-tuned, so as to ensure the recommendation effect of the obtained target click-through rate prediction model, and information is recommended to the target user through the target click-through rate prediction model, which further improves the recommendation effect of information recommendation to the target user and improves the user experience of the target user. At the same time, when applying, you only need to deploy the target click-through rate prediction model to make recommendations to target users, which can significantly reduce computing costs, reduce reasoning time, ensure efficient online reasoning efficiency, and make it easier to deploy, expand and apply in various industrial scenarios, and easier to maintain and update.
[0111] In one possible implementation, Figure 3 A schematic diagram of the structure of an initial collaborative model in the information recommendation method provided in an embodiment of the present application, Figure 4 A schematic diagram of a flow chart of obtaining the first characteristic data in the information recommendation method provided in the embodiment of the present application, referring to Figure 3 as well as Figure 4 As shown, the initial collaborative model includes: a collaborative module and a first linear projection layer. In the above S102, the table sample data is input into the initial collaborative model for table feature processing to obtain the first feature data, including:
[0112] S401, inputting table sample data into a collaborative module to extract table features and perform encoding processing to obtain multiple intermediate first vectors.
[0113] Among them, the collaborative module M col It can be a collaborative CTR model (Collaborative CTR Model).
[0114] For example, a table sample data x structured For example, take a table sample data x structured Input collaborative module M col Perform table feature extraction and encoding processing to obtain multiple intermediate first vectors M col (x structured ).
[0115] S402: Input each intermediate first vector into a first linear projection layer for dimensional transformation to obtain first feature data.
[0116] It can be understood that in order to align the knowledge of the first feature data and the second feature data, it is necessary to ensure that the first feature data and the second feature data are data of the same dimension. Therefore, each intermediate first vector can be input into the first linear projection layer for dimensionality transformation to ensure that the first feature data and the second feature data are of the same dimension.
[0117] For example, a table sample data x structured For example, multiple intermediate first vectors M col (x structured ) is transformed through the first linear projection layer to obtain multiple first vectors v(x structured ), where the transformation process of the first linear projection layer can be characterized by the following formula (2):
[0118] v structured =M col (x structured )W structured +b structured (2)
[0119] Among them, W structured is the transformation matrix of the first linear projection layer, b structured is the variance of the first linear projection layer.
[0120] In one possible implementation, Figure 5 A schematic diagram of the structure of an initial semantic model in the information recommendation method provided in an embodiment of the present application, Figure 6 A schematic diagram of a flow chart for obtaining the second feature data in the information recommendation method provided in the embodiment of the present application, referring to Figure 5 as well as Figure 6As shown, the initial semantic model includes: a semantic module and a second linear projection layer; in the above S102, the text sample data is input into the initial semantic model for semantic feature processing to obtain second feature data, including:
[0121] S601: Input text sample data into a semantic module for semantic feature extraction and encoding processing to obtain multiple intermediate second vectors.
[0122] The semantic module may be a Large Language Model (LLM for short).
[0123] For example, a text sample data x text For example, take a table sample data x text Input semantic module M sem Perform table feature extraction and encoding processing to obtain multiple intermediate second vectors M sem (x text ).
[0124] S602: Input each intermediate second vector into a second linear projection layer for dimensional transformation to obtain second feature data.
[0125] It can be understood that in order to align the knowledge of the first feature data and the second feature data, it is necessary to ensure that the first feature data and the second feature data are data of the same dimension. Therefore, each intermediate second vector can be input into the second linear projection layer for dimensionality transformation to ensure that the first feature data and the second feature data are of the same dimension.
[0126] For example, a text sample data x text For example, multiple intermediate second vectors M sem (x text ) is transformed through the second linear projection layer to obtain multiple second vectors v text , where the transformation process of the second linear projection layer can be represented by the following formula (3):
[0127] v text =M sem (x text )W text +b text (3)
[0128] Among them, W text is the transformation matrix of the second linear projection layer, b text is the variance of the second linear projection layer.
[0129] In one possible implementation, Figure 7A schematic diagram of a process for iteratively updating an initial collaborative model and an initial semantic model in the information recommendation method provided in an embodiment of the present application, referring to Figure 7 As shown, when the above S103 iteratively updates the initial collaborative model and the initial semantic model according to the first feature data, the second feature data and the preset bidirectional loss calculation strategy, it can be performed according to the following steps, including:
[0130] S701. Project each first vector to a plurality of subspaces to obtain a first component of each first vector in each subspace, and project each second vector to a plurality of subspaces to obtain a second component of each second vector in each subspace.
[0131] It can be understood that in order to improve the effect of knowledge alignment, each first vector and each second vector needs to be fine-grained cross-modal cross-aligned. Therefore, each first vector and each second vector can be projected and output into multiple subspaces, so that features can be extracted from different aspects for alignment.
[0132] Optionally, the first vector v structured and the second vector v text Output to M subspaces to extract information from different aspects. M is a positive integer and can be adjusted according to the actual situation during training.
[0133] For example, the first vector v structured The first component in the mth subspace can be characterized using the following formula (4):
[0134]
[0135] in, is the transformation matrix of the mth subspace, is the deviation vector of the mth subspace, m is greater than 1 and less than M.
[0136] For example, the second vector v text The second component in the mth subspace can be characterized using the following formula (5):
[0137]
[0138] in, is the transformation matrix of the mth subspace, is the deviation vector of the mth subspace, m is greater than 1 and less than M.
[0139] S702 : Determine similarity data between each first vector and each second vector according to the first component of each first vector in each subspace and the second component of each second vector in each subspace.
[0140] It can be understood that after obtaining the first component of each first vector in each subspace and the second component of each second vector in each subspace, the similarity between the first component of each first vector in all subspaces and the second component of each second vector in all subspaces can be calculated, thereby modeling fine-grained similarity in the cross-modal space and achieving fine-grained cross-modal representation alignment of collaborative signals and semantic signals.
[0141] Optionally, a preset similarity calculation formula can be used to calculate the similarity between the first component of the first vector in each subspace and the second component of the second vector in each subspace, thereby obtaining the similarity data between the first vector and the second vector, thereby obtaining the similarity data between each first vector and each second vector.
[0142] S703: Calculate a first contrast loss and a second contrast loss according to the similarity data between each first vector and each second vector, the first contrast loss function, and the second contrast loss function.
[0143] Optionally, similarity data between each first vector and each second vector is input into a first contrast loss function to obtain a first contrast loss.
[0144] Optionally, similarity data between each first vector and each second vector is input into a second contrast loss function to obtain a first contrast loss.
[0145] The first contrast loss is used to indicate the loss of text sample data relative to table sample data, and the second contrast loss is used to indicate the loss of table sample data relative to text sample data.
[0146] Exemplarily, the first contrast loss L text2strutured It can be characterized by the following formula (6):
[0147]
[0148] in, represents the i-th second vector With the i-th first vector , N is the number of the first vector and the second vector, wherein the number of the first vector and the second vector may be the same or different, and t is a hyperparameter, such as a temperature coefficient.
[0149] For example, the second contrast loss L strutured2text It can be characterized by the following formula (7):
[0150]
[0151] in, Represents the i-th first vector and the i-th second vector , N is the number of the first vector and the second vector, wherein the number of the first vector and the second vector may be the same or different, and t is a hyperparameter, such as a temperature coefficient.
[0152] S704: Iteratively update the initial collaborative model and the initial semantic model according to the first contrast loss and the second contrast loss.
[0153] Optionally, the first contrast loss L text2strutured and the second contrast loss L strutured2text , calculate the bidirectional loss L cm , and through the bidirectional loss L cm The initial collaborative model and the initial semantic model are updated iteratively, and the iteration ends when the initial collaborative model and the initial semantic model converge.
[0154] Optionally, the first contrast loss L text2strutured Iteratively update the initial semantic model and use the second contrast loss L strutured2text The initial collaborative model is updated iteratively, and the iteration ends when the initial collaborative model and the initial semantic model converge.
[0155] By projecting each first vector to multiple subspaces to obtain the first component of each first vector in each subspace, and projecting each second vector to multiple subspaces to obtain the second component of each second vector in each subspace, fine-grained cross-modal representation alignment of collaborative signals and semantic signals can be achieved, and based on the first component of each first vector in each subspace and the second component of each second vector in each subspace, the similarity data between each first vector and each second vector is determined, and based on the similarity data between each first vector and each second vector, the first contrast loss function and the second contrast loss function, the first contrast loss and the second contrast loss are calculated, and then the initial collaborative model and the initial semantic model are iteratively updated according to the first contrast loss and the second contrast loss, so that during the training process, the initial collaborative model and the initial semantic model learn their respective representation spaces, so that these representation spaces can be gradually aligned through contrast learning, so that the table sample data and text sample data from the same pair have similar representations in the representation space, thereby strengthening the relationship between features and improving the recommendation effect.
[0156] In one possible implementation, Figure 8 A schematic diagram of a flow chart for determining similarity data between each first vector and each second vector in the information recommendation method provided in an embodiment of the present application, referring to Figure 8As shown, the above S302 determines the similarity data between each first vector and each second vector according to the first component of each first vector in each subspace and the second component of each second vector in each subspace, including:
[0157] S801. Transpose a first component of a first vector in a current subspace to obtain a transposed component.
[0158] Optionally, to calculate any first vector v i With any second vector v i As an example, we can use the similarity data of the first vector v i Transpose the first component of the current subspace m to obtain the transposed component
[0159] S802, respectively calculating the product of the transposed component and the second component of the second vector in each subspace to obtain a plurality of products.
[0160] Optionally, continue to calculate any first vector v i With any second vector v j As an example, the similarity of can be calculated separately. With the second vector v j The second component in each subspace j The product of , to get multiple products Among them, m i ∈1,2,...,M.
[0161] S803: Use the maximum value among the multiple products as the target value of the first vector in the current subspace.
[0162] Optionally, take the maximum of the multiple products As the target value of the first vector in the current subspace.
[0163] S804 , summing the target values of the first vector in all subspaces to obtain similarity data between the first vector and the second vector.
[0164] Optionally, target values of the first vector in all subspaces are summed to obtain similarity data between the first vector and the second vector.
[0165] For example, to calculate any first vector v i With any second vector v j As an example, the first vector v can be calculated by referring to the following formula (8): i With the second vector v j The similarity data sim(v i ,v i ):
[0166]
[0167] in, is the first vector v i In the mth i The first component under the subspace, is the second vector v j In the mth j The second component in the subspace.
[0168] In one possible implementation, Fig. 9 Another flowchart of iteratively updating the initial collaborative model and the initial semantic model in the information recommendation method provided in the embodiment of the present application is shown in FIG. Fig. 9 As shown, the above S704 iteratively updates the initial collaborative model and the initial semantic model according to the first contrast loss and the second contrast loss, including:
[0169] S901. Calculate the bidirectional loss of the first feature data and the second feature data according to the first contrast loss and the second contrast loss.
[0170] For example, the first contrast loss L text2strutured and the second contrast loss L strutured2text The bidirectional loss L of the first feature data and the second feature data is calculated by referring to the following formula (9): cm :
[0171]
[0172] S902: According to the bidirectional loss, the initial collaborative model and the initial semantic model are iteratively updated through a back-propagation algorithm.
[0173] Optionally, after obtaining the bidirectional loss, the model parameters can be optimized by the back propagation algorithm to minimize the bidirectional loss L cm .
[0174] In one possible implementation, Fig.10 A structural diagram of an initial click rate prediction model in the information recommendation method provided in the embodiment of the present application, referring to Fig.10 As shown, the above S104 builds an initial click rate prediction model according to the target collaboration model, including:
[0175] The preset fully connected layer and the preset output layer are sequentially spliced on the top of the target collaborative model to construct an initial click rate prediction model.
[0176] Optionally, a preset fully connected layer and a preset output layer may be added on top of the target collaborative model to construct an initial click rate prediction model, wherein the fully connected layer may be preset as a randomly initialized fully connected layer.
[0177] In one possible implementation, Fig.11 A schematic diagram of a flow chart for obtaining a predicted value of table sample data in the information recommendation method provided in an embodiment of the present application, referring to Fig.10 as well as Fig.11 As shown, the above S104 inputs the table sample data into the initial click rate prediction model for prediction, and obtains the predicted value of the table sample data, including:
[0178] S1101. Input the table sample data into the target collaborative model to process the table features and obtain target feature data.
[0179] Optionally, the table sample data may be input into the target collaborative model for table feature extraction, encoding processing and dimension transformation to obtain target feature data, wherein the target feature data may be 128-dimensional feature data.
[0180] S1102: Input the target feature data into the fully connected layer for linear transformation to obtain initial output data.
[0181] Optionally, the target feature data may be input into a fully connected layer for linear transformation to obtain initial output data, wherein the initial output data may be 32-dimensional feature data.
[0182] S1103, input the initial output data into the output layer for processing to obtain the predicted value of the table sample data.
[0183] Optionally, the initial output data may be input into the output layer for processing to obtain the predicted value of the table sample data, wherein the predicted value of the table sample data is used to indicate the probability of the user clicking on the content predicted based on the table sample data.
[0184] In a possible implementation, the above S101 acquires table sample data and text sample data, including:
[0185] Get the table sample data.
[0186] Optionally, multiple pieces of sample data of any user when watching Internet TV can be read from a database storing content data of any user when watching Internet TV, as table sample data.
[0187] The table sample data is input into a pre-constructed structured text template to generate text sample data.
[0188] Optionally, the table sample data may be input into a pre-constructed structured text template Prompt statement to generate text sample data.
[0189] For example, taking Internet TV personalized recommendation as an example, the pre-constructed structured text template Prompt statement may be:
[0190] {This is a user: the user ID is ID1, the gender is GENDER, the age range is AGE1-AGE2 years old, the geographical location is LOCATION, the interests and hobbies are INTEREST1, INTEREST2, INTEREST3, and the most recently watched video is MOVIE1|MOVIE2|VIDEO1.
[0191] This is a video content: the content identifier is ID2, the title is TITLE, the starring actors are ACTOR1 and ACTOR2, the director is DIRECTOR, the themes are THEME1, THEME2, and THEME3, and the release time is TIME.}
[0192] Based on the same inventive concept, an information recommendation device corresponding to the information recommendation method is also provided in the embodiment of the present application. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the above-mentioned information recommendation method in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0193] Fig.12 A schematic diagram of an information recommendation device provided in an embodiment of the present application, referring to Fig.12 As shown, the device includes: an acquisition module 1201, a feature processing module 1202, a first iterative update module 1203, a construction module 1204, a second iterative update module 1205 and a prediction module 1206;
[0194] An acquisition module 1201 is used to acquire table sample data and text sample data, where the table sample data and the text sample data are obtained through the same original data;
[0195] A feature processing module 1202 is used to input the table sample data into the initial collaborative model to perform table feature processing to obtain first feature data, where the first feature data includes a plurality of first vectors;
[0196] The feature processing module 1202 is used to input the text sample data into the initial semantic model to perform semantic feature processing to obtain second feature data, where the second feature data includes a plurality of second vectors;
[0197] A first iterative updating module 1203 is used to iteratively update the initial collaborative model and the initial semantic model according to the first feature data, the second feature data and a preset bidirectional loss calculation strategy, and use the initial collaborative model at the end of the iteration as the target collaborative model;
[0198] A construction module 1204 is used to construct an initial click rate prediction model according to the target collaborative model, input the table sample data into the initial click rate prediction model for prediction, and obtain the predicted value of the table sample data;
[0199] The second iterative updating module 1205 is used to iteratively update the initial click rate prediction model according to the table sample data and the predicted value, and use the initial click rate prediction model at the end of the iteration as the target click rate prediction model;
[0200] The prediction module 1206 is used to generate target table data according to the historical operation data of the target user, input the target table data into the target click rate prediction model for prediction, obtain the prediction result, and recommend information to the target user according to the prediction result.
[0201] In a possible implementation, the initial collaborative model includes: a collaborative module and a first linear projection layer; a feature processing module 1202, specifically configured to:
[0202] Input the table sample data into the collaborative module to extract table features and encode them to obtain multiple intermediate first vectors;
[0203] Each intermediate first vector is input into the first linear projection layer for dimension transformation to obtain first feature data.
[0204] In a possible implementation, the initial semantic model includes: a semantic module and a second linear projection layer; a feature processing module 1202, specifically configured to:
[0205] Inputting the text sample data into the semantic module for semantic feature extraction and encoding processing to obtain multiple intermediate second vectors;
[0206] Each intermediate second vector is input into the second linear projection layer for dimension transformation to obtain second feature data.
[0207] In a possible implementation, the first iterative updating module 1203 is specifically configured to:
[0208] Projecting each first vector to a plurality of subspaces to obtain a first component of each first vector in each subspace, and projecting each second vector to a plurality of subspaces to obtain a second component of each second vector in each subspace;
[0209] Determine similarity data between each first vector and each second vector according to the first component of each first vector in each subspace and the second component of each second vector in each subspace;
[0210] A first contrast loss and a second contrast loss are calculated according to the similarity data between each first vector and each second vector, a first contrast loss function, and a second contrast loss function, wherein the first contrast loss is used to indicate the loss of the text sample data relative to the table sample data, and the second contrast loss is used to indicate the loss of the table sample data relative to the text sample data;
[0211] According to the first contrast loss and the second contrast loss, the initial collaborative model and the initial semantic model are iteratively updated.
[0212] In a possible implementation, the first iterative updating module 1203 is specifically configured to:
[0213] Transpose the first component of the first vector in the current subspace to obtain a transposed component;
[0214] respectively calculating the product of the transposed component and the second component of the second vector in each subspace to obtain a plurality of products;
[0215] The maximum value among the multiple products is taken as the target value of the first vector in the current subspace;
[0216] The target values of the first vector in all subspaces are summed to obtain the similarity data between the first vector and the second vector.
[0217] In a possible implementation, the first iterative updating module 1203 is specifically configured to:
[0218] According to the first contrast loss and the second contrast loss, a bidirectional loss of the first feature data and the second feature data is calculated;
[0219] According to the bidirectional loss, the initial collaborative model and the initial semantic model are iteratively updated through the back-propagation algorithm.
[0220] In a possible implementation, the construction module 1204 is specifically configured to:
[0221] The preset fully connected layer and the preset output layer are sequentially spliced on the top of the target collaborative model to construct an initial click rate prediction model.
[0222] In a possible implementation, the construction module 1204 is specifically configured to:
[0223] Input the table sample data into the target collaborative model to process the table features and obtain the target feature data;
[0224] Input the target feature data into the fully connected layer for linear transformation to obtain the initial output data;
[0225] The initial output data is input into the output layer for processing to obtain the predicted value of the tabular sample data.
[0226] In a possible implementation, the acquisition module 1201 is specifically configured to:
[0227] Get table sample data;
[0228] The table sample data is input into a pre-constructed structured text template to generate text sample data.
[0229] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.
[0230] The embodiment of the present application also provides an electronic device, Fig.13 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, such as Fig.13 As shown, it includes: a processor 1301, a memory 1302, and optionally, a bus 1303. The memory 1302 stores machine-readable instructions executable by the processor 1301 (for example, Fig.12 In the device, the acquisition module 1201, the feature processing module 1202, the first iterative update module 1203, the construction module 1204, the second iterative update module 1205 and the execution instructions corresponding to the prediction module 1206 are obtained, and when the electronic device is running, the processor 1301 communicates with the memory 1302 through the bus 1303, and when the machine-readable instructions are executed by the processor 1301, the steps of the above-mentioned information recommendation method are performed.
[0231] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned information recommendation method are executed.
[0232] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application. In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0233] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or part of the technical solution that contributes to the prior art or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), disk or optical disk and other media that can store program code.
[0234] The above are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be covered by the protection scope of the present application.
Claims
1. An information recommendation method, characterized in that: include: Acquire table sample data and text sample data, wherein the table sample data and the text sample data are obtained through the same original data; Input the table sample data into the initial collaborative model for table feature processing to obtain first feature data, wherein the first feature data includes a plurality of first vectors; input the text sample data into the initial semantic model for semantic feature processing to obtain second feature data, wherein the second feature data includes a plurality of second vectors; Iteratively updating the initial collaborative model and the initial semantic model according to the first feature data, the second feature data, and a preset bidirectional loss calculation strategy, and taking the initial collaborative model at the end of the iteration as the target collaborative model; According to the target collaborative model, an initial click rate prediction model is constructed, and the table sample data is input into the initial click rate prediction model for prediction to obtain the predicted value of the table sample data; Iteratively updating the initial click rate prediction model according to the table sample data and the predicted value, and using the initial click rate prediction model at the end of the iteration as the target click rate prediction model; Target table data is generated according to the historical operation data of the target user, and the target table data is input into the target click rate prediction model for prediction to obtain a prediction result, and information is recommended to the target user according to the prediction result.
2. The information recommendation method according to claim 1, characterized in that: The initial collaborative model includes: a collaborative module and a first linear projection layer; The step of inputting the table sample data into the initial collaborative model to process the table features to obtain first feature data includes: Inputting the table sample data into the collaborative module to perform table feature extraction and encoding processing to obtain multiple intermediate first vectors; Each of the intermediate first vectors is input into the first linear projection layer for dimensional transformation to obtain the first feature data.
3. The information recommendation method according to claim 1, characterized in that: The initial semantic model includes: a semantic module and a second linear projection layer; The step of inputting the text sample data into the initial semantic model for semantic feature processing to obtain second feature data includes: Inputting the text sample data into the semantic module for semantic feature extraction and encoding processing to obtain a plurality of intermediate second vectors; Each of the intermediate second vectors is input into the second linear projection layer for dimensional transformation to obtain the second feature data.
4. The information recommendation method according to claim 1, characterized in that: The iterative updating of the initial collaborative model and the initial semantic model according to the first feature data, the second feature data and a preset bidirectional loss calculation strategy includes: Projecting each of the first vectors to a plurality of subspaces to obtain a first component of each of the first vectors in each of the subspaces, and projecting each of the second vectors to a plurality of subspaces to obtain a second component of each of the second vectors in each of the subspaces; Determine similarity data between each first vector and each second vector according to the first component of each first vector in each subspace and the second component of each second vector in each subspace; A first contrast loss and a second contrast loss are calculated according to the similarity data between each first vector and each second vector, a first contrast loss function, and a second contrast loss function, wherein the first contrast loss is used to indicate the loss of the text sample data relative to the table sample data, and the second contrast loss is used to indicate the loss of the table sample data relative to the text sample data; The initial collaborative model and the initial semantic model are iteratively updated according to the first contrast loss and the second contrast loss.
5. The information recommendation method according to claim 4, characterized in that: The determining of similarity data between each first vector and each second vector according to the first component of each first vector in each subspace and the second component of each second vector in each subspace includes: Transposing a first component of the first vector in the current subspace to obtain a transposed component; respectively calculating the product of the transposed component and the second component of the second vector in each subspace to obtain a plurality of products; Taking the maximum value among the multiple products as the target value of the first vector in the current subspace; The target values of the first vector in all subspaces are summed to obtain similarity data between the first vector and the second vector.
6. The information recommendation method according to claim 4, characterized in that: The iteratively updating the initial collaborative model and the initial semantic model according to the first contrast loss and the second contrast loss includes: Calculating a bidirectional loss of the first feature data and the second feature data according to the first contrast loss and the second contrast loss; According to the bidirectional loss, the initial collaborative model and the initial semantic model are iteratively updated through a back-propagation algorithm.
7. The information recommendation method according to claim 1, characterized in that: The constructing of an initial click rate prediction model according to the target collaborative model includes: The preset fully connected layer and the preset output layer are sequentially spliced on the top of the target collaborative model to construct the initial click rate prediction model.
8. The information recommendation method according to claim 7, characterized in that: The step of inputting the table sample data into an initial click rate prediction model for prediction to obtain a predicted value of the table sample data includes: Inputting the table sample data into the target collaborative model to perform table feature processing to obtain target feature data; Inputting the target feature data into the fully connected layer for linear transformation to obtain initial output data; The initial output data is input into the output layer for processing to obtain the predicted value of the table sample data.
9. The information recommendation method according to claim 1, characterized in that: The obtaining of table sample data and text sample data includes: Get table sample data; The table sample data is input into a pre-constructed structured text template to generate the text sample data.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the information recommendation method according to any one of claims 1 to 9 are executed.