Content recommendation method and device, equipment, storage medium and product
By splicing user features in natural language and using BERT model for feature fusion, the problem of insufficient user feature understanding in the prior art is solved, and more accurate personalized content recommendation is achieved.
Patent Information
- Application Number
- CN202411604968.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-01-10
AI Technical Summary
In the prior art, in the user's personalized recommendation scenario, it is difficult to accurately understand user characteristics, resulting in the recommendation content not meeting the actual needs and preferences of users.
By obtaining multiple user feature information for natural language splicing, forming user portrait description text, and using a bidirectional encoder to characterize the BERT model for feature fusion, combining the content recommendation model for prediction, providing personalized and contextualized content recommendation.
It improves the accuracy of content recommendations, makes recommendations more in line with users' actual needs and preferences, and achieves more accurate customized recommendations.
Smart Images

Figure CN119293340A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of large model technology, and in particular to a content recommendation method, device, equipment, storage medium and product. Background Art
[0002] In the related technologies, the feature understanding in the scenario of personalized user recommendation currently mainly relies on traditional machine learning methods, such as random forests, support vector machines, etc., and basic deep learning methods, such as simple feedforward neural networks. These methods usually process different characteristics of users independently, which will lead to low accuracy of user portraits, making it difficult to provide customized recommendation services based on specific user conditions and difficult to meet the actual needs of users.
[0003] Therefore, how to make the recommended content more in line with the actual needs and preferences of users is a problem that needs to be solved urgently. Summary of the invention
[0004] The main purpose of this application is to provide a content recommendation method, device, equipment, storage medium and product, aiming to solve the technical problem of how to make the recommended content more in line with the actual needs and preferences of users.
[0005] To achieve the above purpose, the present application proposes a content recommendation method, which includes: Obtain multiple characteristic information of target users; Perform natural language splicing on the plurality of feature information to obtain a user portrait description text; Input the user portrait description text into the feature fusion model to obtain the fusion features of the target user; the feature fusion model is a bidirectional encoder representation BERT model; the fusion features are used to describe the content needs and / or content preferences of the target user; The fused features are input into the content recommendation model to obtain the content recommendation prediction results.
[0006] In some embodiments, multiple feature information are concatenated in natural language to obtain a user portrait description text, including: Generate a natural language description sentence corresponding to each feature information; All natural language description sentences are concatenated according to the natural language sentence structure to obtain the user portrait description text.
[0007] In some embodiments, the bidirectional encoder representation BERT model includes a multi-head self-attention module and a feed-forward neural network module; The user portrait description text is input into the feature fusion model to obtain the fusion features of the target user, including: Processing the user portrait description text through the multi-head self-attention module to obtain a self-attention output matrix; Processing the self-attention output matrix through a feedforward neural network module to obtain a context encoding vector; The context encoding vector is used as a fusion feature of the target user.
[0008] In some embodiments, the processing of the user portrait description text by the multi-head self-attention module to obtain a self-attention output matrix includes: For each head in the multi-head self-attention mechanism, a query matrix, a key matrix, and a value matrix are calculated according to a preset weight matrix and the user portrait description text; Using a normalized exponential function, the query matrix, the key matrix, the value matrix, and the dimension of the key matrix are operated to obtain a self-attention value; The self-attention values corresponding to each head are superimposed to obtain the self-attention output matrix.
[0009] In some embodiments, the self-attention output matrix is processed by a feedforward neural network module to obtain a context encoding vector, including: For each layer of the feedforward neural network in the feedforward neural network module, a preset weight matrix and a bias vector corresponding to the current layer are used to perform a linear transformation on the input content of the current layer; wherein the input content of the first layer of the feedforward neural network is the self-attention output matrix, and the input content of each layer of the feedforward neural network after the first layer is the output content of the previous layer of the feedforward neural network; The output content of the last layer of feedforward neural network is used as the context encoding vector.
[0010] In one embodiment, multiple characteristic information of the target user is obtained, including: Obtain multiple original features of the target user; Calculate the information gain value of each of the original features; The first N intermediate features with the highest information gain values are used as the feature information of the target user, where N is a preset positive integer.
[0011] In addition, to achieve the above purpose, the present application also proposes a content recommendation device, which includes: A feature acquisition module is used to acquire multiple feature information of target users; A text splicing module is used to perform natural language splicing on the plurality of feature information to obtain a user portrait description text; A feature fusion module is used to input the user portrait description text into a feature fusion model to obtain the fusion features of the target user; the feature fusion model is a bidirectional encoder representation BERT model; the fusion features are used to describe the content needs and / or content preferences of the target user; The result prediction module is used to input the fusion features into the content recommendation model to obtain the content recommendation prediction results.
[0012] In addition, to achieve the above-mentioned purpose, the present application also proposes a content recommendation device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the content recommendation method described above.
[0013] In addition, to achieve the above objectives, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the content recommendation method described above are implemented.
[0014] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of the content recommendation method described above are implemented.
[0015] One or more technical solutions proposed in this application have at least the following technical effects: Through multi-dimensional feature screening and natural language splicing, combined with the BERT model for semantic encoding, the contextual semantic information of natural language text can be fully captured, so that the trained feature fusion model can better understand user needs and preferences, so that the output fusion features can provide users with personalized and contextualized processing, making the content recommendations using fusion features more in line with user preferences, and achieving more accurate recommendations that meet user-specific needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0018] Figure 1 A schematic diagram of the process of the model training phase provided in an embodiment of the present application is shown; Figure 2 A schematic diagram showing a flow chart of a content recommendation method provided by an embodiment of the present application is shown; Figure 3 A schematic diagram showing the structure of a content recommendation device provided in an embodiment of the present application is shown; Figure 4 A schematic diagram of the structure of a content recommendation device provided in an embodiment of the present application is shown.
[0019] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0020] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0021] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0022] The main solution of the embodiment of the present application is: obtain multiple feature information of the target user; perform natural language splicing on multiple feature information to obtain user portrait description text; input the user portrait description text into a feature fusion model to obtain the fusion features of the target user; the feature fusion model is a bidirectional encoder representation BERT model; the fusion features are used to describe the content needs and / or content preferences of the target user; the fusion features are input into a content recommendation model to obtain content recommendation prediction results.
[0023] In the related art, the feature understanding in the user personalized recommendation scenario mainly relies on traditional machine learning methods, including random forests, support vector machines, and basic deep learning methods, such as simple feedforward neural networks. These methods usually treat the multi-dimensional features of users as independent elements, lack the ability to capture the deep correlation between features, and cannot form a feature representation that deeply characterizes the multi-dimensional features of users. For example, the personalized recommendation method in the related art ignores the logical relationship between user feature information such as age, user number level and consumption ability, and fails to provide customized feature analysis based on the specific user status, thereby affecting the accuracy of content recommendation.
[0024] In summary, how to make the recommended content more in line with the actual needs and preferences of users is a problem that needs to be solved urgently.
[0025] Based on this, the present application provides a solution by performing natural language splicing on the characteristic information of the target user to form a semantic user description text, and then using the BERT model and content recommendation model to predict content recommendations for the target user, thereby improving the accuracy of content recommendations and better meeting the actual needs and preferences of the target user.
[0026] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or a content recommendation device capable of realizing the above functions, etc. The following takes the content recommendation device as an example to illustrate this embodiment and the following embodiments.
[0027] This application divides the content recommendation method into a model training phase and a product usage phase and explains them separately.
[0028] Reference Figure 1 The model training phase may include the following steps S110 to S150: Step S110, acquiring sample data and preprocessing the sample data.
[0029] The sample data may include multiple user samples, each of which represents a historical behavior record of a user. The historical behavior record may include the user, the user's characteristics, and the user's behavior.
[0030] For example, the user sample can be shown in Table 1 below: Table 1
[0031] In order to eliminate the influence between different feature dimensions and enable the different features in the sample data to be uniformly compared, the sample data needs to be preprocessed.
[0032] In some implementations, for numerical features in a sample, a standardized formula may be used to perform separate calculations. The standardized formula is as follows:
[0033] in, is the original value of the feature, is the mean of the feature, is the standard deviation of the feature, The processed features.
[0034] In some implementations, for text features in the sample (such as device model, occupation, etc.), a One-hot encoding method can be used to convert the text features into numerical features.
[0035] For example, assuming that the sample data contains three industry characteristics: IT industry, education industry, and medical industry, these three industry characteristics can be encoded as [1, 0, 0], [0, 1, 0], and [0, 0, 1] respectively.
[0036] After the above processing is performed on the features of the sample data, a feature matrix can be formed, and the dimension of the feature matrix is the product of the number of samples and the total number of features.
[0037] Step S120: based on the sample data, screen out target features whose correlation with the target behavior meets preset conditions.
[0038] Among them, the target behavior can be a specific feature selected in the sample, for example, the purchase of a package in Table 1 above is the target behavior. It can be understood that in this application, content recommendation (such as package recommendation) is recommended to users through the content recommendation method in the following embodiment in order to encourage users to perform the target behavior (such as purchase of a package) as much as possible. For this reason, this application is designed to train a model that better meets user needs through the steps of this embodiment to recommend content (such as a package) that better meets user needs to users.
[0039] In order to measure the influence of a feature on the target behavior, in some embodiments, a chi-square test may be used to analyze the correlation between each feature and the target behavior. In other embodiments, permutation importance may be used to evaluate the influence of a feature on the target behavior by randomly perturbing each feature and observing the decrease in the performance of a preset model.
[0040] In some other implementations, the information gain of different features may be calculated for comparison to determine the influence of different features on the target behavior.
[0041] Specifically, the sample data can be split according to the features to obtain multiple trees, and the root node of each tree is the sample data before the split. is the sample data before splitting, and are the left and right child node sample sets after splitting, are the number of samples in the corresponding sample set, They are respectively the loss function values (i.e. entropy) of the sample set.
[0042] Then the loss difference formula before and after the feature combination split can be as follows:
[0043] Among them, the loss function value for the sample set is , can be calculated by the following formula:
[0044] in, is the category of the target behavior, is the set of target behavior categories, Is the category in the collection The proportion of The calculation of , as well as The value of .
[0045] After that, each feature is calculated by the following formula Information gain : ; in, is the set of all trees, It's a tree Using features The set of all nodes of Is the current node The information gain of
[0046] After obtaining the information gain of all features in the sample data, the influence of the features on the target behavior can be measured based on the information gain.
[0047] Specifically, the information gains of all features in the sample data may be sorted from large to small, and the first N features may be determined as the most important features. N may be a positive integer set by the developer, and this embodiment does not limit this.
[0048] Step S130, performing natural language concatenation on the target features to obtain a sample description text.
[0049] In some embodiments, since the user's feature information can be understood through semantics, in order to make the subsequent training model more systematic and scalable, the N screened features can be spliced in natural language. For example, a natural language processing (NLP) model can be used to string multiple features into a coherent sentence to obtain a sample description text.
[0050] Specifically, in a feasible implementation, the target feature may include a feature name and a feature value field. For each target feature, a corresponding natural language description short sentence may be generated according to the subject-predicate-object sentence pattern: feature name + predicate + feature value field. For example, user age + is +25 years old.
[0051] In another feasible implementation, for the first target feature, a natural language description short sentence can be generated according to the subject-predicate-object sentence pattern; for subsequent target features, a natural description sentence can be generated according to the verb-object phrase sentence pattern. For example, the user's age is 25 years old and he / she is engaged in IT industry.
[0052] After obtaining the natural description sentences corresponding to each target feature, the natural language description sentences can be spliced according to the natural language sentence pattern to obtain the user portrait description text. For example, assuming that the natural description sentences include "the user is 25 years old", "using the X1 model", "working in the IT industry", "having a Global Link Gold Card" and "having a Diamond Star Card", through natural language splicing, they can be concatenated into "the user is 25 years old, using the X1 model, working in the IT industry, having a Global Link Gold Card, and having a Diamond Star Card".
[0053] Through the above steps, the screening and preprocessing of user features are completed.
[0054] Step S140, inputting the sample description text into the feature fusion model to obtain a context encoding vector.
[0055] Among them, the feature fusion model can select a large language model, such as the BERT model. The BERT model can capture the context information in the sentence and generate a high-dimensional feature vector representation to provide input for subsequent supervised training. The following is a further description using the BERT model as an example.
[0056] Specifically, in the BERT model, the sample description text can be segmented first, and after the segmentation is completed, a special mark can be added at the specified position. For example, for "the user is 25 years old, uses the X1 model, works in the IT industry, has a Global Link Gold Card, and has a Diamond Star Card", it can be segmented into "[CLS]", "user", "age", "is", "25 years old", "uses", "X1 model", "works in", "IT", "industry", "has", "Global Link", "Gold Card", "has", "Diamond", "Star", "Card", "[SEP]".
[0057] The word segmentation sequence is embedded, which can include word embedding, position embedding and segment embedding. Mapped to a word embedding vector ; Each position Mapped to a position embedding vector ; Each segment (such as a sentence) corresponds to an embedding vector .
[0058] It should be noted that if it is a single sentence input, the segment embedding is usually a zero vector.
[0059] For the first Participle , the embedding is expressed as: , then for the entire word segmentation sequence ( The value range is 1~ ), the embedding matrix obtained after embedding representation is: .
[0060] After obtaining the embedding matrix, the embedding matrix can be Input the multi-head self-attention layer for processing. Specifically, the multi-head self-attention layer includes multiple heads, and the following takes a single head as an example for explanation.
[0061] Step ①, calculate the query matrix, key matrix and value matrix respectively using the following formulas:
[0062] in, Preset weight matrices for queries, keys, and values respectively.
[0063] Step ②, calculate the self-attention value of a single head using the following formula:
[0064] in, is the dimension of the key matrix.
[0065] After calculating the self-attention value corresponding to each head through the above steps ① and ②, the self-attention output matrix of multi-head attention can be obtained by the following formula :
[0066] in, For the The self-attention value corresponding to each head, is the preset output weight matrix.
[0067] After obtaining the self-attention output matrix, the self-attention output matrix can be used as the input of the feed-forward neural network layer for further processing.
[0068] Specifically, the feedforward neural network layer may include two layers. The context encoding vector is calculated by the following formula: ;
[0069] in, is the aforementioned self-attention output matrix ( ), and are the preset weight matrices of the first and second layers of the feedforward neural network, and is the preset bias vector, is the activation function.
[0070] The context encoding vector contains the semantic information of the entire sentence and will be used as input in the subsequent step S150.
[0071] Step S150: Use the context encoding vector to train the content recommendation model.
[0072] In some embodiments, a fully connected neural network can be constructed for classification or regression tasks. The fully connected neural network may include a hidden layer and an output layer. As shown in the following formula: ;
[0073] in, is the context encoding vector, is the output of the hidden layer, and is the preset bias matrix, and is the bias vector, For activation functions (e.g. function). is the output of the output layer, that is, the probability corresponding to each target behavior category.
[0074] At this point, the model involved in the content recommendation method provided by this application has been trained.
[0075] In addition, after the model training is completed, the model parameters can be optimized through the loss function and gradient descent algorithm.
[0076] Specifically, the cross entropy loss function can be used to measure the difference between the predicted value and the true value of the constructed model. As follows:
[0077] in, is the number of samples, For the The true value of the samples, is the predicted value of the model.
[0078] Use the gradient descent algorithm (such as Adam) to optimize the model parameters and improve the accuracy of model prediction by minimizing the loss function. As shown in the following formula:
[0079] in, represents the relevant parameters in the model, is the learning rate, For the loss function to the relevant parameters The gradient of For the optimized .
[0080] The model training process provided in this embodiment can fully capture the contextual semantic information of natural language text through multi-dimensional feature screening and natural language splicing, and combine with the BERT model for semantic encoding, so that the trained feature fusion model can better understand user needs and preferences, so that the output fusion features can provide users with personalized and contextualized processing, so that the content recommendation using the fusion features is more in line with the user's preferences, and more accurate recommendations that meet the specific needs of users are achieved.
[0081] Reference Figure 2 Based on the feature fusion model and content recommendation model provided in steps S110 to S150, the use phase of the content recommendation method provided in this embodiment may include the following steps S210 to S240: Step S210, obtaining multiple characteristic information of the target user.
[0082] In some implementations, multiple original features corresponding to the target user are obtained; among the multiple original features, original features whose correlation with the target behavior meets preset conditions are screened out as feature information of the target user.
[0083] In some implementations, corresponding to the implementation using the chi-square test in the above embodiment, the preset condition may be that the chi-square test value (ie, p-value) corresponding to each feature is greater than or equal to a set threshold.
[0084] In other implementations, corresponding to the implementation of ranking importance in the above-mentioned embodiment, the preset condition may be that the importance score corresponding to each feature is greater than or equal to a set score.
[0085] In some other implementations, corresponding to the implementation using information gain in the above embodiments, the preset condition may be that the information gain value of the original feature ranks within the top N, where N is a preset positive integer that can be set by the staff according to actual needs.
[0086] Taking the implementation method of information gain as an example, specifically, the information gain value of each original feature can be calculated, and the information gain value is used to characterize the correlation between the original feature and the target behavior; the top N original features with the highest information gain values are used as the feature information of the target user.
[0087] In different application scenarios, the original features of the target user can be obtained in different ways. For example, for the package recommendation scenario, the original features of the target user can be stored in the server database in advance in the form of a data table, etc.; in other possible scenarios, the target user (or business personnel) can also directly input the original features of the target user in real time in the form of text, voice, etc., which is not limited in this embodiment of the present application.
[0088] It is understandable that model training and model use have the same data processing flow, so for the parts not described in detail here, please refer to the relevant content in the above steps S110 and S120, and this embodiment will not be repeated here.
[0089] Step S220, performing natural language splicing on multiple feature information to obtain user portrait description text.
[0090] In some implementations, a natural language description sentence corresponding to each feature information may be generated, and all natural language description sentences may be concatenated according to the sentence structure of the natural language to obtain a user portrait description text.
[0091] It is understandable that in order to recommend content to the target user, the target user's feature information needs to be concatenated with the target feature in natural language as in step S130, so as to obtain a user portrait description text that can be input into the feature fusion model. For how to perform natural language concatenation to obtain the user description text, please refer to the relevant content in the above step S130.
[0092] Step S230: input the user portrait description text into the feature fusion model to obtain the fusion features of the target user.
[0093] Among them, the feature fusion model is a bidirectional encoder representation BERT model; the fusion feature is used to describe the content needs and / or content preferences of the target user. It can be understood that the BERT model can include a multi-head self-attention module and a feedforward neural network module.
[0094] In some implementations, the user portrait description text can be processed by a multi-head self-attention module to obtain a self-attention output matrix; the self-attention output matrix can be processed by a feedforward neural network module to obtain a context encoding vector; and the context encoding vector can be used as a fusion feature of the target user.
[0095] Specifically, for each head in the multi-head self-attention mechanism, the query matrix, key matrix and value matrix can be calculated according to the preset weight matrix and the user portrait description text; the normalized exponential function is used to operate the dimensions of the query matrix, key matrix, value matrix and key matrix to obtain the self-attention value; the self-attention values corresponding to each head are superimposed to obtain the self-attention output matrix.
[0096] In some embodiments, for each layer of feedforward neural network in the feedforward neural network module, the preset weight matrix and bias vector corresponding to the current layer can be used to perform a linear transformation on the input content of the current layer; wherein the input content of the first layer of feedforward neural network is the self-attention output matrix, and the input content of each layer of feedforward neural network after the first layer is the output content of the previous layer of feedforward neural network; and the output content of the last layer of feedforward neural network is used as the context encoding vector.
[0097] For example, a feedforward neural network module includes two layers: based on the first preset weight matrix and the first bias vector of the first layer of the feedforward neural network, the self-attention output matrix is linearly transformed to obtain a first transformation value; based on the second preset weight matrix and the second bias vector of the second layer of the feedforward neural network, the first transformation value is linearly transformed to obtain a context coding vector, that is, the fusion feature of the target user.
[0098] Step S240: input the fused features into the content recommendation model to obtain a content recommendation prediction result.
[0099] Among them, step S230 and step S240 are similar to the above-mentioned step S140 and step S150. For the parts not described in detail, please refer to the relevant content in the above-mentioned embodiment, and this embodiment will not be repeated here.
[0100] In some embodiments, the content recommendation prediction result may be a set of user selection probabilities for a variety of different contents. For example, in a package recommendation scenario, based on the above steps S210 to S240, the target user's purchase probabilities for a variety of packages may be obtained respectively. The various packages may be sorted in descending order of purchase probability, and packages with higher purchase probabilities may be displayed preferentially on the user interface.
[0101] In other embodiments, the content recommendation prediction result may be the user's selection probability for a single content. For example, in a package recommendation scenario, based on the above steps S210 to S240, the target user's purchase probability for the target package may be obtained. Similarly, a recommendation threshold may be pre-set, and when the purchase probability of the target package is greater than or equal to the recommendation threshold, the recommendation threshold may be pre-determined, and when the purchase probability of the target package is greater than or equal to the recommendation threshold, the target package is recommended to the user, otherwise, the target package is not recommended to the user.
[0102] This embodiment provides a content recommendation method, which forms a semantic user description text by natural language splicing of the target user's feature information, and then predicts content recommendations for the target user through a BERT model and a content recommendation model, thereby improving the accuracy of content recommendations and better meeting the actual needs and preferences of the target user.
[0103] This application also provides a content recommendation device, please refer to Figure 3 , the content recommendation device 100 comprises: The feature acquisition module 110 is used to acquire multiple feature information of the target user; A text splicing module 120 is used to perform natural language splicing on multiple feature information to obtain a user portrait description text; The feature fusion module 130 is used to input the user portrait description text into the feature fusion model to obtain the fusion features of the target user; the feature fusion model is a bidirectional encoder representation BERT model; the fusion features are used to describe the content needs and / or content preferences of the target user; The result prediction module 140 is used to input the fusion features into the content recommendation model to obtain the content recommendation prediction results.
[0104] The content recommendation device 100 provided by the present application adopts the content recommendation method in the above embodiment, and can solve the technical problem of how to make the recommended content more in line with the actual needs and preferences of the user. Compared with the prior art, the beneficial effects of the content recommendation device 100 provided by the present application are the same as the beneficial effects of the content recommendation method provided by the above embodiment, and other technical features in the content recommendation device 100 are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0105] The present application provides a content recommendation device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the content recommendation method in the above-mentioned embodiment 1.
[0106] Reference below Figure 4 , which shows a schematic diagram of the structure of a content recommendation device suitable for implementing an embodiment of the present application. The content recommendation device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The content recommendation device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0107] like Figure 4 As shown, the content recommendation device 200 may include a processing device 210 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 220 or a program loaded from a storage device 230 to a random access memory (RAM: Random Access Memory) 240. In RAM240, various programs and data required for the operation of the content recommendation device are also stored. The processing device 210, ROM220, and RAM240 are connected to each other through a bus 250. An input / output (I / O) interface 260 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 260: an input device 270 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 280 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 230 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 290. The communication device 290 can allow the content recommendation device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a content recommendation device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.
[0108] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through a communication device, or installed from the storage device 230, or installed from the ROM 220. When the computer program is executed by the processing device 210, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0109] The content recommendation device provided by the present application adopts the content recommendation method in the above embodiment, which can solve the technical problem of how to make the recommended content more in line with the actual needs and preferences of users. Compared with the prior art, the beneficial effects of the content recommendation device provided by the present application are the same as the beneficial effects of the content recommendation method provided by the above embodiment, and the other technical features in the content recommendation device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0110] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0111] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0112] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, wherein the computer-readable program instructions are used to execute the content recommendation method in the above-mentioned embodiment.
[0113] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0114] The computer-readable storage medium may be included in the content recommendation device; or may exist independently without being incorporated into the content recommendation device.
[0115] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the content recommendation device, the content recommendation device can write computer program codes for performing the operations of the present application in one or more programming languages or a combination thereof. The programming languages include object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, through the Internet using an Internet service provider).
[0116] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0117] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0118] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned content recommendation method, and can solve the technical problem of how to make the recommended content more in line with the actual needs and preferences of users. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the content recommendation method provided in the above-mentioned embodiment, and will not be repeated here.
[0119] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned content recommendation method when executed by a processor.
[0120] The computer program product provided by this application can solve the technical problem of how to make the recommended content more in line with the actual needs and preferences of users. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the content recommendation method provided by the above embodiment, which will not be repeated here.
[0121] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A content recommendation method, characterized in that: The content recommendation method comprises: Obtain multiple characteristic information of target users; Perform natural language splicing on the plurality of feature information to obtain a user portrait description text; Input the user portrait description text into the feature fusion model to obtain the fusion features of the target user; the feature fusion model is a bidirectional encoder representation BERT model; the fusion features are used to describe the content needs and / or content preferences of the target user; The fused features are input into the content recommendation model to obtain the content recommendation prediction results.
2. The content recommendation method according to claim 1, characterized in that: The plurality of feature information is concatenated in natural language to obtain a user portrait description text, including: Generate a natural language description sentence corresponding to each of the feature information; All the natural language description short sentences are spliced according to the natural language sentence structure to obtain the user portrait description text.
3. The content recommendation method according to claim 1, characterized in that: The bidirectional encoder representation BERT model includes a multi-head self-attention module and a feedforward neural network module; The user portrait description text is input into the feature fusion model to obtain the fusion features of the target user, including: Processing the user portrait description text through the multi-head self-attention module to obtain a self-attention output matrix; Processing the self-attention output matrix through a feedforward neural network module to obtain a context encoding vector; The context encoding vector is used as a fusion feature of the target user.
4. The content recommendation method according to claim 3, characterized in that: The user portrait description text is processed by the multi-head self-attention module to obtain a self-attention output matrix, including: For each head in the multi-head self-attention mechanism, a query matrix, a key matrix, and a value matrix are calculated according to a preset weight matrix and the user portrait description text; Using a normalized exponential function, the query matrix, the key matrix, the value matrix, and the dimension of the key matrix are operated to obtain a self-attention value; The self-attention values corresponding to each head are superimposed to obtain the self-attention output matrix.
5. The content recommendation method according to claim 4, characterized in that: The self-attention output matrix is processed by a feedforward neural network module to obtain a context encoding vector, including: For each layer of the feedforward neural network in the feedforward neural network module, a preset weight matrix and a bias vector corresponding to the current layer are used to perform a linear transformation on the input content of the current layer; wherein the input content of the first layer of the feedforward neural network is the self-attention output matrix, and the input content of each layer of the feedforward neural network after the first layer is the output content of the previous layer of the feedforward neural network; The output content of the last layer of feedforward neural network is used as the context encoding vector.
6. The content recommendation method according to claim 1, characterized in that: The step of obtaining multiple characteristic information of the target user includes: Obtain multiple original features of the target user; Calculate the information gain value of each of the original features; The first N original features with the highest information gain values are used as the feature information of the target user, where N is a preset positive integer.
7. A content recommendation device, characterized in that: The content recommendation device comprises: A feature acquisition module is used to acquire multiple feature information of target users; A text splicing module is used to perform natural language splicing on the plurality of feature information to obtain a user portrait description text; A feature fusion module is used to input the user portrait description text into a feature fusion model to obtain the fusion features of the target user; the feature fusion model is a bidirectional encoder representation BERT model; the fusion features are used to describe the content needs and / or content preferences of the target user; The result prediction module is used to input the fusion features into the content recommendation model to obtain the content recommendation prediction results.
8. A content recommendation device, characterized in that: The content recommendation device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the content recommendation method according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the content recommendation method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the content recommendation method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Standardized demand retrieval matching method and system based on user portrait feature fusion
CN119807540A
Multimedia content intelligent recommendation display control method and system
CN120238679A