A knowledge recommendation method fusing text labels and user behaviors and related equipment
By obtaining the knowledge text and behavior records of user interactions, performing preprocessing and subject mining, generating keywords and text tags, and constructing a user knowledge scoring matrix, the low accuracy and cold start problems of knowledge recommendation in professional fields are solved, and personalized recommendations are achieved.
Patent Information
- Application Number
- CN202510984796.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-17
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2045-07-17
AI Technical Summary
Existing knowledge recommendation methods have problems in professional fields such as difficulty in obtaining labels, poor user interest modeling capabilities, and data sparsity, resulting in low accuracy of knowledge recommendation.
By obtaining the knowledge text and behavior records of the target user's interaction with the electronic device, preprocessing and subject mining are performed to generate initial text tags and keywords, and virtual users are introduced to construct a user knowledge scoring matrix for personalized knowledge recommendation.
It improves the accuracy of knowledge recommendation, overcomes the problem of sparse user data, avoids cold start, and enhances the adaptability and coverage of the recommendation system.
Smart Images

Figure CN120508647B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent knowledge recommendation technology, and in particular to a knowledge recommendation method and related equipment that integrates text tags and user behaviors. Background Art
[0002] With the widespread adoption of internet information services, users face challenges with inefficient information screening and inaccurate knowledge acquisition in a massive data environment. User knowledge needs are not only dynamic and ever-changing, but also highly personalized. This is especially true in specialized vertical fields like healthcare and fintech, where knowledge texts often contain a large number of domain-specific terms and complex semantic relationships. User needs are highly specialized and real-time. Building a precise, domain-specific knowledge recommendation system has become crucial for improving the effectiveness of information services in these verticals.
[0003] Knowledge recommendation methods have been widely applied in various fields. Traditional recommendation methods primarily rely on collaborative filtering and content-based models, but these methods often perform poorly when faced with diverse and dynamic knowledge service demands. In recent years, the introduction of deep learning technology has driven rapid development in the recommendation field. Through precise user behavior modeling and deep semantic analysis, the accuracy and diversity of knowledge recommendations have been significantly improved. However, existing research primarily focuses on feature extraction and matching mechanisms for general scenarios, while fine-grained semantic mining and dynamic interest modeling for domain-specific knowledge recommendation remain significantly insufficient.
[0004] In text knowledge recommendation, text tags, as semantic connectors between domain knowledge and user profiles, have the advantages of structured representation and interpretability. High-quality text tags can not only present users' potential interest preferences in a fine-grained form, but also effectively reflect the similarity between knowledge content, providing a basis for accurately matching user needs. However, text recommendation for professional fields still faces many challenges: (1) Difficulty in obtaining tags: Domain knowledge texts usually contain a large number of professional terms, are long and semantically complex, and existing methods have the problem of insufficient topic level recognition in long text processing, resulting in low efficiency in building a tag system. At the same time, the inherent long-tail distribution characteristics of text tags make it difficult to effectively utilize low-frequency professional tags. (2) Poor user interest modeling capabilities: Users' interest preferences are highly domain-related and dynamic. Traditional static modeling methods often lack in-depth understanding of users' specific needs and personalized services, making it difficult to adapt to changes in demand in professional scenarios, resulting in poor recommendation effects. (3) Data sparsity and cold start dilemma: The behavioral data density of user groups is significantly lower than that of general scenarios. The recommendation quality of traditional collaborative filtering methods drops sharply under limited data conditions. This leads to the problem of low accuracy in knowledge recommendation for users. Summary of the Invention
[0005] This application provides a knowledge recommendation method and related equipment that integrates text tags and user behaviors, which can solve the problem of low accuracy of knowledge recommendation to users.
[0006] In a first aspect, an embodiment of the present application provides a knowledge recommendation method that integrates text tags and user behavior. The knowledge recommendation method includes:
[0007] Acquire multiple knowledge texts that the target user interacts with the electronic device, as well as a behavior record of the target user interacting with each knowledge text with the electronic device;
[0008] Preprocess each knowledge text to obtain multiple initial text labels for each knowledge text; the initial text labels are used to describe the semantics in the knowledge text;
[0009] For each knowledge text, perform subject mining on the knowledge text to obtain the subject words of the knowledge text, and generate the text representation of each initial text label of the knowledge text based on the subject words;
[0010] Based on the text representation of all initial text labels of each knowledge text, a target text label of each knowledge text is selected from all initial text labels of each knowledge text; the matching degree between the knowledge text and the target text label is greater than the matching degree between the knowledge text and each other initial text label;
[0011] Introducing virtual users, constructing a user knowledge scoring matrix based on the target text labels of all knowledge texts, all target users' behavior records, and virtual users; the elements in the user knowledge scoring matrix are the scores of the target users for each initial text label;
[0012] Personalized knowledge recommendation is performed for target users based on the user knowledge scoring matrix.
[0013] Optionally, perform subject mining on the knowledge text to obtain the key words of the knowledge text, including:
[0014] By formula:
[0015] ;
[0016] ;
[0017] ;
[0018] ;
[0019] Keywords of Computational Knowledge Texts ;
[0020] in, represents the latent variable, and represents the variational parameter, represents the parameter distribution, 、 、 represents a multi-layer perceptron computing network, The feature vector representing the knowledge text, represents the latent variable mean vector, represents the latent variable variance vector, Represents the activation function.
[0021] Optionally, a text representation of each initial text tag of the knowledge text is generated based on the subject words, including:
[0022] Perform context sensing on the knowledge text to obtain the vector representation of each word in the knowledge text;
[0023] The text representation of each initial text tag is calculated based on all vector representations and knowledge text keywords.
[0024] Optionally, a text representation for each initial text tag is calculated based on all vector representations and knowledge text keywords, including:
[0025] By formula:
[0026] ;
[0027] Calculate the Text representation of the initial text labels ;
[0028] in, , Indicates the number of initial text labels corresponding to the knowledge text, 、 represents the weight matrix, 、 represents the bias term, represents the transpose operation, Indicates the Topic-guided representation of initial text labels:
[0029] ;
[0030] ;
[0031] ;
[0032] in, represents the normalization coefficient guided by the subject word, Indicates the The vector representation of the subject words of the knowledge text, Indicates the The number of knowledge texts corresponding to the initial text labels, Indicates the The initial text label corresponds to the The normalized attention weight of the subject words of the knowledge text, Indicates the The initial text label corresponds to the The normalized attention weight of the subject words of the knowledge text, represents the attention parameter, represents a constant, 、 Indicates parameters, Represents the subject term of the knowledge text.
[0033] Optionally, based on the text representation of all initial text labels of each knowledge text, a target text label of each knowledge text is selected from all initial text labels of each knowledge text, including:
[0034] For each knowledge text, perform the following steps:
[0035] Calculating the matching degree between the knowledge text and each initial text label according to the text representation of each initial text label of the knowledge text;
[0036] All matching degrees are sorted from large to small, and the initial text labels corresponding to the first multiple matching degrees are used as the target text labels of the knowledge text.
[0037] Optionally, based on the text representation of each initial text label of the knowledge text, a matching degree between the knowledge text and each initial text label is calculated, including:
[0038] By formula:
[0039] ;
[0040] Computational Knowledge Text and The matching degree between the initial text labels ;
[0041] in, Indicates the The text representation of the initial text labels, Represents knowledge text, , Indicates the number of initial text labels corresponding to the knowledge text, represents a constant, represents the weight vector, Represents a transpose operation.
[0042] Optionally, a user knowledge scoring matrix is constructed based on the target text labels of all knowledge texts, all behavior records of target users, and virtual users, including:
[0043] A user interaction scoring matrix is constructed based on all the behavior records of the target user and the virtual user. The elements in the user interaction scoring matrix are the interaction scores between the target user and each knowledge text, or the interaction scores between the virtual user and each knowledge text.
[0044] A text label matrix is constructed based on the target text labels of all knowledge texts; the elements in the text label matrix are scored for the matching between each knowledge text and each initial text label;
[0045] A user knowledge scoring matrix is constructed based on the user interaction scoring matrix and the text label matrix; the elements in the user knowledge scoring matrix are the scores of the target user for each initial text label.
[0046] Optionally, the behavior record includes the user's browsing time, collection behavior, and like behavior of the knowledge text;
[0047] Build a user interaction scoring matrix based on all target user behavior records, including:
[0048] By formula:
[0049] ;
[0050] Calculating users With knowledge text Interaction score between ;
[0051] in, Represents a user No. The number of days between the browsing behavior and the current time, , Represents a user The total number of browsing behaviors, represents the time decay rate constant, Represents a user With knowledge text The interaction weight of:
[0052] ;
[0053] in, 、 、 Both represent weights, Represents a user Browse knowledge text duration, Represents a user Knowledge Text Performed a like action. Represents a user No knowledge text Perform a like action. Represents a user Knowledge Text Collecting behavior, Represents a user No knowledge text Collecting behavior, , The total number of numbers representing knowledge texts;
[0054] Construct a text label matrix based on the target text labels of all knowledge texts, including:
[0055] By formula:
[0056] ;
[0057] Computational Knowledge Text With initial text label Match score between ;
[0058] in, , Represents the set of all initial text labels corresponding to all knowledge text labels.
[0059] Optionally, a user knowledge scoring matrix is constructed based on the user interaction scoring matrix and the text label matrix, including:
[0060] By formula:
[0061] ;
[0062] Calculate the target user's initial text label Rating ;
[0063] in, The total number of numbers representing knowledge texts, Indicates target users Knowledge Text The interaction score, Represents a user Knowledge Text The interaction score, Indicates the number of users, , represents the user label matrix, , , Represents the transposed matrix of the text label matrix Corresponding knowledge text With initial text label The matching score between the elements, represents the user interaction rating matrix, Represents a text label matrix.
[0064] In a second aspect, an embodiment of the present application provides a knowledge recommendation device that integrates text tags and user behavior, including:
[0065] An acquisition module, configured to acquire multiple knowledge texts that a target user interacts with an electronic device, and a behavior record of the target user interacting with each knowledge text with the electronic device;
[0066] The preprocessing module is used to preprocess each knowledge text to obtain multiple initial text labels for each knowledge text; the initial text labels are used to describe the semantics in the knowledge text;
[0067] The subject mining module is used to perform subject mining on each knowledge text, obtain the subject words of the knowledge text, and generate the text representation of each initial text label of the knowledge text based on the subject words;
[0068] a selection module for selecting a target text label for each knowledge text from all initial text labels of each knowledge text based on text representations of all initial text labels of each knowledge text; a matching degree between the knowledge text and the target text label is greater than a matching degree between the knowledge text and each other initial text label;
[0069] The construction module is used to introduce virtual users and construct a user knowledge scoring matrix based on the target text labels of all knowledge texts, all behavior records of the target users, and the virtual users. The elements in the user knowledge scoring matrix are the scores of the target users for each initial text label.
[0070] The personalized recommendation module is used to make personalized knowledge recommendations for target users based on the user knowledge scoring matrix.
[0071] In a third aspect, an embodiment of the present application provides a terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned knowledge recommendation method integrating text tags and user behaviors when executing the above-mentioned computer program.
[0072] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-mentioned knowledge recommendation method that integrates text tags and user behaviors.
[0073] The above-mentioned solutions of the present application have the following beneficial effects:
[0074] In some embodiments of the present application, by acquiring a plurality of knowledge texts interacted by a target user with an electronic device and a behavior record of the target user when interacting with the electronic device for each knowledge text, then preprocessing each knowledge text to obtain a plurality of initial text labels of each knowledge text, then respectively for each knowledge text, subject mining is performed on the knowledge text to obtain a subject word of the knowledge text, and then a text representation of each initial text label of the knowledge text is generated based on the subject word, then based on the text representation of all initial text labels of each knowledge text, a target text label of each knowledge text is selected from all initial text labels of each knowledge text, then a virtual user is introduced, a user knowledge score matrix is constructed according to the target text labels of all knowledge texts, all behavior records of the target user and the virtual user, and finally personalized knowledge recommendation is performed for the target user according to the user knowledge score matrix. Wherein, the user knowledge score matrix is constructed based on the behavior record when the user interacts and the target text label of the knowledge text, the user interaction and the text semantics of the knowledge text are considered, the text label interested by the user is effectively analyzed, the user is recommended personalized knowledge based on the user knowledge score matrix, and the accuracy of the knowledge recommendation for the user is improved.
[0075] In addition, the virtual user is introduced to construct the user knowledge score matrix, which can overcome the problem of sparse user data, avoid the cold start of knowledge recommendation, and improve the recommendation quality.
[0076] Other beneficial effects of the present application will be described in detail in the subsequent specific embodiments. BRIEF DESCRIPTION OF DRAWINGS
[0077] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0078] Figure 1 The flow chart of the knowledge recommendation method combining text labels and user behaviors provided by an embodiment of the present application;
[0079] Figure 2 The structural schematic diagram of the knowledge recommendation device combining text labels and user behaviors provided by an embodiment of the present application;
[0080] Figure 3 The structural schematic diagram of the terminal device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0081] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obscuring the description of the present application with unnecessary detail.
[0082] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.
[0083] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0084] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0085] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0086] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.
[0087] In response to the problem of low accuracy of existing knowledge recommendation for users, the embodiment of the present application provides a knowledge recommendation method that integrates text tags and user behavior. The knowledge recommendation method obtains multiple knowledge texts that the target user interacts with the electronic device, as well as the target user's behavior record when interacting with the electronic device for each knowledge text, and then preprocesses each knowledge text to obtain multiple initial text tags for each knowledge text. Then, for each knowledge text, the knowledge text is subject mined to obtain the subject words of the knowledge text, and the text representation of each initial text tag of the knowledge text is generated based on the subject words. Then, based on the text representation of all initial text tags of each knowledge text, the target text tag of each knowledge text is selected from all initial text tags of each knowledge text. Then, a virtual user is introduced, and a user knowledge scoring matrix is constructed based on the target text tags of all knowledge texts, all behavior records of the target user, and the virtual user. Finally, personalized knowledge recommendation is performed for the target user based on the user knowledge scoring matrix. Among them, the user knowledge scoring matrix is constructed based on the behavior record of the user interaction and the target text tag of the knowledge text, taking into account the text semantics of the user interaction and the knowledge text, effectively analyzing the text tags of the user's interest, and performing personalized knowledge recommendation for the user based on the user knowledge scoring matrix, thereby improving the accuracy of knowledge recommendation for the user.
[0088] Next, an exemplary description is given of the knowledge recommendation method provided in this application that integrates text tags and user behaviors.
[0089] like Figure 1 As shown, the knowledge recommendation method provided by this application that integrates text tags and user behavior includes the following steps:
[0090] Step 11: Acquire multiple knowledge texts that the target user interacts with the electronic device, as well as a behavior record of the target user interacting with each knowledge text with the electronic device.
[0091] The aforementioned knowledge texts are electronic texts that target users browse when interacting with electronic devices, such as news on disease prevention and control, articles on health and wellness, etc. The aforementioned behavioral records include the user's browsing time, collection behavior, and like behavior of the knowledge texts.
[0092] In some embodiments of the present application, a log recording script or software may be used to obtain the knowledge text of the target user interaction and the corresponding behavior record.
[0093] For example, the data format of the behavior record is in vector format:
[0094] ;
[0095] in, Indicates target users Knowledge Text The vector form of Indicates target users Knowledge Text The time of interaction, Indicates target users Knowledge Text The duration of browsing, Indicates target users Knowledge Text Performed a like action. Indicates target users No knowledge text Perform a like action. Indicates target users Knowledge Text Collecting behavior, Indicates target users No knowledge text Collecting behavior.
[0096] Step 12: pre-process each knowledge text to obtain multiple initial text labels for each knowledge text.
[0097] The above initial text tags are used to describe the semantics in the knowledge text.
[0098] For example, a support vector machine or other method can be used to preprocess the knowledge text to obtain multiple initial text labels for the knowledge text. A comprehensive frequency statistics is performed on the initial text labels of all knowledge texts, and the initial text label with the highest frequency among all the initial text labels of the knowledge text is used as the standard label of the knowledge text. For example, if the initial text labels of knowledge text A are "epidemic prevention" and "disinfection", and they appear 8 and 6 times respectively among the initial text labels of all knowledge texts, then "epidemic prevention" is used as the standard label of knowledge text A.
[0099] Step 13: For each knowledge text, subject mining is performed on the knowledge text to obtain the subject words of the knowledge text, and a text representation of each initial text label of the knowledge text is generated based on the subject words.
[0100] In some embodiments of the present application, the steps of performing subject mining on the knowledge text to obtain the subject words of the knowledge text and generating a text representation of each initial text tag of the knowledge text based on the subject words include:
[0101] The first step is to conduct subject mining on the knowledge text to obtain the key words of the knowledge text.
[0102] By formula:
[0103] ;
[0104] ;
[0105] ;
[0106] ;
[0107] Keywords of Computational Knowledge Texts .
[0108] in, represents the latent variable, and represents the variational parameter, represents the parameter distribution, , 、 、 represents a multi-layer perceptron computing network, To calculate the computing network of keywords, is the computational network for calculating the mean vector of latent variables, is the computational network for calculating the latent variable variance vector, The feature vector representing the knowledge text (which can be obtained by calculating the knowledge text using algorithms such as the bag-of-words model, the word frequency-inverse document frequency algorithm, and the variational autoencoder. For example, the knowledge text is input into the bag-of-words model for calculation, the word frequency-inverse document frequency algorithm is used to calculate the output data of the bag-of-words model, and then the variational autoencoder is used to calculate the output data of the word frequency-inverse document frequency algorithm to obtain the feature vector of the knowledge text). represents the latent variable mean vector, represents the latent variable variance vector, Represents the activation function.
[0109] The second step is to perform context sensing on the knowledge text and obtain the vector representation of each word in the knowledge text.
[0110] For example, a bidirectional encoder representation model with a sliding window mechanism (BERT) and a bidirectional gated recurrent unit (BiGRU) can be used to contextualize knowledge text and generate vector representations of vocabulary. BERT generates a textual semantic representation vector for the knowledge text, while the BiGRU extracts all vocabulary in the knowledge text and calculates a vector representation for each vocabulary word based on the textual semantic representation vector.
[0111] In the third step, the text representation of each initial text tag is calculated based on all vector representations and knowledge text keywords.
[0112] Specifically, through the formula:
[0113] ;
[0114] Calculate the Text representation of the initial text labels .
[0115] in, , Indicates the number of initial text labels corresponding to the knowledge text, 、 represents the weight matrix, 、 represents the bias term, represents the transpose operation, Indicates the Topic-guided representation of initial text labels:
[0116] ;
[0117] ;
[0118] ;
[0119] in, represents the normalization coefficient guided by the subject word, Indicates the The vector representation of the subject words of the knowledge text, Indicates the The number of knowledge texts corresponding to the initial text labels, Indicates the The initial text label corresponds to the The normalized attention weight of the subject words of the knowledge text, Indicates the The initial text label corresponds to the The normalized attention weight of the subject words of the knowledge text, represents the attention parameter, represents a constant, 、 Indicates parameters, Represents the subject term of the knowledge text.
[0120] Step 14 : Based on the text representation of all the initial text labels of each knowledge text, a target text label of each knowledge text is selected from all the initial text labels of each knowledge text.
[0121] The matching degree between the above knowledge text and the target text label is greater than the matching degree between the knowledge text and each other initial text label.
[0122] In some embodiments of the present application, the step of selecting a target text label for each knowledge text from all initial text labels of each knowledge text based on the text representation of all initial text labels of each knowledge text includes:
[0123] For each knowledge text, perform the following steps:
[0124] In the first step, the matching degree between the knowledge text and each initial text label is calculated based on the text representation of each initial text label of the knowledge text.
[0125] Specifically, through the formula:
[0126] ;
[0127] Computational Knowledge Text and The matching degree between the initial text labels .
[0128] in, Indicates the The text representation of the initial text labels, Represents knowledge text, , Indicates the number of initial text labels corresponding to the knowledge text, represents a constant, represents the learnable weight vector, Represents a transpose operation.
[0129] In the second step, all matching degrees are sorted from large to small, and the initial text labels corresponding to the first multiple matching degrees are used as the target text labels of the knowledge text.
[0130] For example, in order to improve the accuracy of the target text label, it is necessary to train the parameters of BERT and BiGRU for generating the vector representation of the vocabulary in step 13, as well as the formula for calculating the topic words, the formula for calculating the text representation, and the formula for calculating the matching degree between the knowledge text and the initial text label. Specifically, sample knowledge texts that have a true match with the initial text labels are used as training data. BERT is first trained, and BERT is used to generate a text semantic representation vector for each sample knowledge text. The fully connected network is then used to classify the text semantic representation vector to obtain a predicted category label. The standard labels of all sample knowledge texts are obtained according to the process of step 12. A classification loss function is constructed based on all standard labels and all predicted category labels. With the purpose of minimizing the value of the classification loss function, the Adam optimizer and the back-propagation algorithm are used to adjust the parameters of BERT. Then, the parameters of BiGRU and the three formulas are trained, and the text semantic representation vector generated by the trained BERT is input into BiGRU to generate a vector representation of the vocabulary. According to steps 13 and 14, the target text label of each sample knowledge text is obtained, and a ranking loss function and a reconstruction loss function are constructed based on all target text labels. The final loss function is constructed based on the ranking loss function and the reconstruction loss function. With the purpose of minimizing the final loss function, the Adam optimizer and the back-propagation algorithm are used to train the parameters of BiGRU and the three formulas.
[0131] The above classification loss function is:
[0132] ;
[0133] in, represents the number of sample knowledge texts, represents the value of the classification loss function, represents the number of standard labels, represents the true label, Indicates that the sample knowledge text belongs to The probability of a standard label.
[0134] The above ranking loss function is:
[0135] ;
[0136] in, represents the value of the ranking loss function, represents the number of sample knowledge texts, The number of target text labels representing the sample knowledge text, Indicates the Sample knowledge texts, Indicates the Sample knowledge text and The true matching degree between the target text labels (which can be calculated by using the trained bag-of-words model, support vector machine and other models to calculate the sample knowledge text and the target text label), Indicates the Sample knowledge text and The matching degree between the target text labels.
[0137] The above reconstruction loss function is:
[0138] ;
[0139] in, represents the value of the reconstruction loss function, represents the latent variable, represents the process of inferring the model, represents the process of generating the model, represents the text reconstructed according to the latent variables, represents the prior distribution of the latent variable z, represents the KL divergence that measures the difference between two distributions, Representation based on distribution expectations, Feature vector representing the sample knowledge text.
[0140] The final loss function mentioned above is:
[0141] ;
[0142] in, represents the balancing hyperparameter.
[0143] Step 15: Introduce virtual users and construct a user knowledge scoring matrix based on the target text labels of all knowledge texts, all behavior records of target users, and virtual users.
[0144] The elements in the above user knowledge rating matrix are the target user's ratings for each initial text tag, and multiple elements correspond one-to-one to multiple ratings. The above virtual users are virtual users who have browsed the knowledge texts, and it is assumed that the virtual users have browsed each knowledge text.
[0145] In some embodiments of the present application, the step of constructing a user knowledge scoring matrix based on the target text labels of all knowledge texts, all behavior records of target users, and virtual users includes:
[0146] The first step is to build a user interaction rating matrix based on all the behavior records of the target user and the virtual user.
[0147] The elements in the above user interaction score matrix are the interaction scores between the target user and each knowledge text, or the interaction scores between the virtual user and each knowledge text. The interaction score is used to describe the interest level between the target user or virtual user and the knowledge text. Multiple elements correspond to multiple interaction scores. For example, if there are 3 virtual users and 3 knowledge texts, then there are 3 elements in the user interaction score matrix. elements.
[0148] By formula:
[0149] ;
[0150] Calculating users With knowledge text Interaction score between .
[0151] in, Represents a user No. The number of days between the browsing behavior and the current time, , Represents a user The total number of browsing behaviors, The browsing behavior is the The behavior of opening the device to browse text, and interacting with at least one text in this browsing behavior, represents the time decay rate constant, Represents a user With knowledge text The interaction weight of:
[0152] ;
[0153] in, 、 、 Both represent weights, Represents a user Browse knowledge text duration, Represents a user Knowledge Text Performed a like action. Represents a user No knowledge text Perform a like action. Represents a user Knowledge Text Collecting behavior, Represents a user No knowledge text Collecting behavior, , Indicates the total number of knowledge text numbers. In this formula, the superscript Indicates the Browsing behavior, that is, users Browse knowledge text Browsing behavior, such as user Browse knowledge text When the user opens the device to browse text for the second time, Through this superscript, the user's interactive behavior on the knowledge text can be expressed while expressing the relative time the user browses the knowledge text.
[0154] In the second step, a text label matrix is constructed based on the target text labels of all knowledge texts.
[0155] The elements in the above text label matrix are the matching scores between each knowledge text and each initial text label.
[0156] Specifically, through the formula:
[0157] ;
[0158] Computational Knowledge Text With initial text label Match score between .
[0159] in, , Represents the set of all initial text labels corresponding to all knowledge text labels.
[0160] The third step is to construct a user knowledge scoring matrix based on the user interaction scoring matrix and the text label matrix.
[0161] The elements in the user knowledge rating matrix are the target user's ratings for each initial text tag. The ratings express the target user's interest in the initial text tag.
[0162] Specifically, through the formula:
[0163] By formula:
[0164] ;
[0165] Calculate the target user's initial text label Rating ;
[0166] in, The total number of numbers representing knowledge texts, Indicates target users Knowledge Text The score of the interaction, in which the user is considered For target users, Represents a user Knowledge Text The interaction score, Indicates the number of users (that is, the number of virtual users, is the sum of the number of virtual users and target users), , represents the user label matrix, , , Represents the transposed matrix of the text label matrix Corresponding knowledge text With initial text label The matching score between the elements, represents the user interaction rating matrix, Represents a text label matrix.
[0167] Step 16: Perform personalized knowledge recommendations for target users based on the user knowledge scoring matrix.
[0168] Specifically, according to the score between the target user and each initial text label in the user knowledge score matrix, the initial text labels corresponding to the highest scores are used as recommended labels, and knowledge texts with recommended labels are recommended to the target user.
[0169] It should be noted that for new users with no browsing history, a basic profile of the new user is constructed, and based on the clustering algorithm, the new user and existing users are clustered according to the basic profile, and knowledge recommendations are made to the new user based on other users who belong to the same cluster as the new user. For example, the tag with the highest score among other users is used as the recommended tag for the new user, and the knowledge text including the recommended tag is recommended to the new user.
[0170] For new users who need to browse disease treatment and health-related knowledge, the basic portrait includes the new user's age, gender, medical history, inherent ability characteristics, and monitoring indicators including heart rate and blood sugar.
[0171] The data in the basic portrait is then processed and converted into a data vector form for subsequent analysis. One-hot encoding or the like can be used to process the data. For high-dimensional data after encoding (such as disease history), principal component analysis (PCA) or the like can be used to reduce the dimension of the data after encoding. The core principle of the PCA method is to convert the original high-dimensional data into a new representation of linearly independent dimensions through linear transformation, thereby effectively reducing the data dimension while preserving the main features of the data. Assuming that the original disease history data matrix of the user is Udisease, the dimension is (M is the number of samples, is the feature dimension, which is the total number of disease types here), first calculate the covariance matrix of the data. Perform eigenvalue decomposition on the covariance matrix C to obtain the eigenvalues and the corresponding eigenvectors . Sort the eigenvalues according to their sizes, and select the eigenvectors corresponding to the first d largest eigenvalues to form the projection matrix . Through the projection transformation , the original data U is projected into a low-dimensional space to obtain the reduced data , and the dimension is .
[0172] The K-means clustering algorithm can be used for clustering, and the processed basic portrait and the user portrait of the existing user are used as data points of the K-means clustering algorithm. The elbow method is used for optimization to obtain the best cluster number K. The core idea is to measure the closeness of samples in the same cluster and the difference between samples in different clusters during clustering, so as to find a suitable K value to balance the accuracy and model complexity of the clustering result. The following normalization formula is used to map the feature values in the basic portrait to the range [0, 1]: , where is the th feature value (i.e., the data in the basic portrait after numbering and dimension reduction) of the th sample (i.e., a new user or an existing user) in the data set U, represents the th feature value of the th sample in the data U, and are the The minimum and maximum values of the features. Secondly, the normalized data samples are divided into several clusters. In cluster analysis, the within-cluster sum of squares (WCSS) is used as an indicator to measure the tightness of the clustering results. Its calculation formula is: , where K is the number of clusters, Indicates the clusters, u is the number of clusters in the normalized data set. The sample points in It is a cluster As the value of K increases, the number of samples in each cluster decreases, and the sum of the squared distances between sample points and the cluster center (WCSS) gradually decreases because more clusters provide a better fit to the data. However, too many clusters increase model complexity and can easily lead to overfitting. Finally, we calculate the WCSS for different K values and plot a curve of WCSS versus K. We find the inflection point in the curve. The K value corresponding to this inflection point is the optimal balance between reducing WCSS and controlling model complexity, which serves as the input parameter for the subsequent K-means clustering algorithm.
[0173] After completing data dimensionality reduction and determining the optimal K value, the normalized basic profile and the user profile of existing users are used as data points to perform cluster analysis using the K-means clustering algorithm. Specifically, randomly select data points as initial cluster centers For each data point in the dataset , using Euclidean distance Calculate the distance between it and each cluster center, where is the data dimension, Represents data points No. The value of the dimension, Represents the cluster center No. dimension) and Assigned to the cluster with the closest cluster center Recalculate the center of each cluster, that is, take the mean of all data points in the cluster as the new cluster center, and the calculation formula is ,in Represents a cluster The number of data points in the cluster is quantified. The steps of data point assignment and cluster center update are repeated until a stopping condition is met. This stopping condition can be when the cluster center no longer changes, when the change in cluster center is less than a preset threshold, or when a preset number of iterations is reached. Through continuous iterative optimization, a stable clustering result is eventually achieved.
[0174] It is worth mentioning that a user knowledge scoring matrix is constructed based on the behavioral records of user interactions and the target text tags of knowledge texts. It takes into account the text semantics of user interactions and knowledge texts, effectively analyzes the text tags that users are interested in, and makes personalized knowledge recommendations to users based on the user knowledge scoring matrix, thereby improving the accuracy of knowledge recommendations to users.
[0175] In addition, introducing virtual users to construct the user knowledge rating matrix can overcome the problem of sparse user data, avoid the cold start of knowledge recommendation, and improve the quality of recommendation.
[0176] The method of the present application also has the following advantages:
[0177] By deeply mining the fine-grained features of text tags, we can more accurately identify users’ interests and preferences. Based on this, the recommendation system can provide users with knowledge content that meets their needs, improving the adaptability and coverage of the recommendation system for complex knowledge content.
[0178] The introduction of the BERT pre-training model and the adoption of a two-stage training method fully utilize the correlation between head labels and tail labels, effectively resolving the common problems of long length and complex content in Chinese knowledge texts, alleviating the long-tail and imbalanced data distribution problems in text label classification, and overcoming the shortcomings of low efficiency and information omissions in traditional methods when processing long texts.
[0179] It effectively integrates topic guidance and multi-layer attention mechanism, which can efficiently mine the potential topic information in knowledge text, enable the model to adaptively capture the topic features related to different tags in the text, establish label-aware context associations in the encoding stage, and improve the accuracy and reliability of label acquisition.
[0180] The introduction of virtual users and their appropriate weighting alleviates the knowledge cold-start problem faced by traditional recommendation systems, allowing new knowledge to be smoothly incorporated. Leveraging cluster analysis of user profile characteristics, health knowledge recommendations are recommended to new users based on behavioral data from similar groups, effectively addressing the cold-start issue for new users. Furthermore, the integration of historical user interaction records with a health knowledge tag matrix effectively addresses the issue of sparse user group data and improves the real-time and accuracy of recommendations.
[0181] The following is an exemplary description of the knowledge recommendation device that integrates text tags and user behaviors provided by this application.
[0182] like Figure 2 As shown, an embodiment of the present application provides a knowledge recommendation device that integrates text tags and user behaviors. The knowledge recommendation device 200 that integrates text tags and user behaviors includes:
[0183] The acquisition module 201 is configured to acquire a plurality of knowledge texts interacted by a target user with an electronic device and a behavior record of the target user when each knowledge text is interacted with the electronic device;
[0184] The preprocessing module 202 is configured to pre-process each knowledge text to obtain a plurality of initial text labels of each knowledge text. The initial text label is used to describe semantics in the knowledge text.
[0185] The subject mining module 203 is configured to perform subject mining on each knowledge text to obtain a subject word of the knowledge text, and generate a text representation of each initial text label of the knowledge text based on the subject word.
[0186] The selection module 204 is configured to select a target text label of each knowledge text from all initial text labels of each knowledge text based on the text representation of all initial text labels of each knowledge text. A matching degree between the knowledge text and the target text label is greater than a matching degree between the knowledge text and each other initial text label.
[0187] The construction module 205 is configured to introduce a virtual user, and construct a user knowledge score matrix according to the target text labels of all knowledge texts, all behavior records of the target user and the virtual user. An element in the user knowledge score matrix is a score of the target user on each initial text label.
[0188] The personalized recommendation module 206 is configured to perform personalized knowledge recommendation for the target user according to the user knowledge score matrix.
[0189] It should be noted that the information interaction, execution process and the like between the above apparatuses / units are based on the same concept as the method embodiments of the present application, and the specific functions and the technical effects brought by the same can be referred to the method embodiments part, which will not be described here.
[0190] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0191] like Figure 3 As shown, an embodiment of the present application provides a terminal device. The terminal device D10 of this embodiment includes: at least one processor D100 ( Figure 3 Only one processor is shown in the figure), a memory D101, and a computer program D102 stored in the memory D101 and executable on the at least one processor D100, wherein the processor D100 implements the steps of any of the above-mentioned method embodiments when executing the computer program D102.
[0192] Specifically, when the processor D100 executes the computer program D102, it obtains multiple knowledge texts that the target user interacts with the electronic device, as well as the behavior records of the target user when interacting with the electronic device for each knowledge text, and then preprocesses each knowledge text to obtain multiple initial text tags for each knowledge text. Then, for each knowledge text, the knowledge text is subject-mined to obtain the subject words of the knowledge text, and a text representation of each initial text tag of the knowledge text is generated based on the subject words. Then, based on the text representation of all initial text tags of each knowledge text, a target text tag of each knowledge text is selected from all initial text tags of each knowledge text. Then, a virtual user is introduced, and a user knowledge scoring matrix is constructed based on the target text tags of all knowledge texts, all behavior records of the target user, and the virtual user. Finally, personalized knowledge recommendation is performed for the target user based on the user knowledge scoring matrix. Among them, the user knowledge scoring matrix is constructed based on the behavior records of the user interaction and the target text tags of the knowledge text, taking into account the text semantics of the user interaction and the knowledge text, effectively analyzing the text tags of interest to the user, and performing personalized knowledge recommendation for the user based on the user knowledge scoring matrix, thereby improving the accuracy of knowledge recommendation for the user.
[0193] The processor D100 can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.
[0194] The memory D101 can be an internal storage unit of the terminal device D10 in some embodiments, for example, a hard disk or a memory of the terminal device D10. The memory D101 can also be an external storage device of the terminal device D10 in other embodiments, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Further, the memory D101 can include both an internal storage unit and an external storage device of the terminal device D10. The memory D101 is used to store an operating system, application programs, a boot loader, data, and other programs, for example, program codes of the computer program, etc. The memory D101 can also be used to temporarily store data that has been output or will be output.
[0195] The embodiments of the present application further provide a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the steps in the above-mentioned various method embodiments.
[0196] The embodiments of the present application provide a computer program product. When the computer program product is run on a terminal device, the terminal device is caused to implement the steps in the above-mentioned various method embodiments.
[0197] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing related hardware, and the computer program can be stored in a computer readable storage medium. The computer program can implement the steps of each method embodiment when executed by a processor. The computer program includes computer program code, which can be in the form of source code, object code, executable files or some intermediate forms. The computer readable medium at least includes any entity or device capable of carrying the computer program code to the knowledge recommendation method and device / terminal equipment of fused text label and user behavior, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium. For example, U disk, mobile hard disk, magnetic disk or optical disk, etc.
[0198] In the above embodiments, the description of each embodiment has its own focus, and the parts not described or recorded in detail in a certain embodiment can be referred to the related description of other embodiments.
[0199] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in connection with the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0200] The above is the preferred embodiment of the present application. It should be noted that for those of ordinary skill in the art, without departing from the principles described in the present application, a number of improvements and refinements can be made, which should also be considered within the scope of protection of the present application.
Claims
1. A knowledge recommendation method that integrates text labels and user behaviors, characterized in that: include: Acquire multiple knowledge texts interacted between a target user and an electronic device, and a behavior record of the target user interacting with each of the knowledge texts between the target user and the electronic device; Preprocessing each of the knowledge texts to obtain a plurality of initial text labels for each of the knowledge texts; the initial text labels are used to describe the semantics in the knowledge texts; For each of the knowledge texts, subject mining is performed on the knowledge text to obtain the subject words of the knowledge text, and a text representation of each initial text label of the knowledge text is generated based on the subject words; Based on the textual representation of all initial text labels of each knowledge text, a target text label of each knowledge text is selected from all initial text labels of each knowledge text; the matching degree between the knowledge text and the target text label is greater than the matching degree between the knowledge text and each other initial text label; Introducing a virtual user, constructing a user knowledge scoring matrix based on the target text labels of all knowledge texts, all behavior records of the target user, and the virtual user; the elements in the user knowledge scoring matrix are the scores of the target user for each of the initial text labels; Performing personalized knowledge recommendations for the target user based on the user knowledge scoring matrix; Among them, virtual users are virtual users who have browsed the knowledge text; The user knowledge scoring matrix is constructed based on the target text labels of all knowledge texts, all behavior records of the target users, and virtual users, including: A user interaction scoring matrix is constructed based on all behavioral records of the target user and the virtual user; the elements in the user interaction scoring matrix are interaction scores between the target user and each knowledge text, or interaction scores between the virtual user and each knowledge text; Constructing a text label matrix based on the target text labels of all knowledge texts; the elements in the text label matrix are scores for the matching between each knowledge text and each initial text label; A user knowledge scoring matrix is constructed based on the user interaction scoring matrix and the text label matrix; the elements in the user knowledge scoring matrix are the scores of the target user for each initial text label.
2. The knowledge recommendation method according to claim 1, characterized in that: The subject mining of the knowledge text to obtain the subject words of the knowledge text includes: By formula: ; ; ; ; Keywords of computing knowledge texts ; in, represents the latent variable, and represents the variational parameter, represents the parameter distribution, 、 、 represents a multi-layer perceptron computing network, The feature vector representing the knowledge text, represents the latent variable mean vector, represents the latent variable variance vector, Represents the activation function.
3. The knowledge recommendation method according to claim 1, characterized in that: Generating a text representation of each initial text tag of the knowledge text based on the subject word includes: Performing context sensing on the knowledge text to obtain a vector representation of each word in the knowledge text; A text representation of each initial text tag is calculated based on all vector representations and the knowledge text keywords.
4. The knowledge recommendation method according to claim 3, characterized in that: The calculating of the text representation of each initial text tag based on all vector representations and the knowledge text keywords includes: By formula: ; Calculate the Text representation of the initial text labels ; in, , Indicates the number of initial text labels corresponding to the knowledge text, 、 represents the weight matrix, 、 represents the bias term, represents the transpose operation, Indicates the Topic-guided representation of initial text labels: ; ; ; in, represents the normalization coefficient guided by the subject word, Indicates the The vector representation of the subject words of the knowledge text, Indicates the The number of knowledge texts corresponding to the initial text labels, Indicates the The initial text label corresponds to the The normalized attention weight of the subject words of the knowledge text, Indicates the The initial text label corresponds to the The normalized attention weight of the subject words of the knowledge text, represents the attention parameter, represents a constant, 、 Indicates parameters, Represents the subject term of the knowledge text.
5. The knowledge recommendation method according to claim 1, characterized in that: The text representation based on all initial text labels of each knowledge text, selecting a target text label for each knowledge text from all initial text labels of each knowledge text, includes: For each of the knowledge texts, perform the following steps: Calculating a matching degree between the knowledge text and each of the initial text labels according to a text representation of each of the initial text labels of the knowledge text; All matching degrees are sorted from large to small, and the initial text labels corresponding to the first multiple matching degrees are used as the target text labels of the knowledge text.
6. The knowledge recommendation method according to claim 5, characterized in that: The calculating the matching degree between the knowledge text and each of the initial text labels according to the text representation of each of the initial text labels of the knowledge text comprises: By formula: ; Computational Knowledge Text and The matching degree between the initial text labels ; in, Indicates the The text representation of the initial text labels, represents the knowledge text, , Indicates the number of initial text labels corresponding to the knowledge text, represents a constant, represents the weight vector, Represents a transpose operation.
7. The knowledge recommendation method according to claim 1, characterized in that: The behavior record includes the user's browsing time, collection behavior and like behavior of the knowledge text; The step of constructing a user interaction scoring matrix based on all behavior records of the target user includes: By formula: ; Calculating users With knowledge text Interaction score between ; in, Represents a user No. The number of days between the browsing behavior and the current time, , Represents a user The total number of browsing behaviors, represents the time decay rate constant, Represents a user With knowledge text The interaction weight of: ; in, 、 、 Both represent weights, Represents a user Browse knowledge text duration, Represents a user Knowledge Text Performed a like action. Represents a user No knowledge text Perform a like action. Represents a user Knowledge Text Collecting behavior, Represents a user No knowledge text Collecting behavior, , The total number of numbers representing knowledge texts; The text label matrix is constructed according to the target text labels of all knowledge texts, including: By formula: ; Computational Knowledge Text With initial text label Match score between ; in, , Represents the set of all initial text labels corresponding to all knowledge text labels.
8. The knowledge recommendation method according to claim 7, characterized in that: The constructing of a user knowledge scoring matrix based on the user interaction scoring matrix and the text label matrix includes: By formula: ; Calculate the target user's initial text label Rating ; in, The total number of numbers representing knowledge texts, Indicates target users Knowledge Text The interaction score, Represents a user Knowledge Text The interaction score, Indicates the number of users, , represents the user label matrix, , , Represents the transposed matrix of the text label matrix Corresponding knowledge text With initial text label The matching score between the elements, represents the user interaction rating matrix, Represents a text label matrix.
9. A terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the knowledge recommendation method integrating text tags and user behaviors as described in any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Tag recommendation method of online question and answer platform based on knowledge graph and tag association
CN113672693A
Tag recommendation method fusing text similarity and collaborative filtering
CN113722443A