Associated information recommendation system based on natural language processing
By constructing a user intention distribution vector and intention transfer model, combining historical data to predict, and generating a highly diverse recommendation list, the problems of dynamic changes in user needs and insufficient recommendation diversity in the existing technology are solved, and a more optimized recommendation effect is achieved.
Patent Information
- Application Number
- CN202411623049.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-11-14
AI Technical Summary
The existing information recommendation system is difficult to effectively handle the dynamic changes of user needs, and the diversity of recommendation results is insufficient, so it is impossible to further optimize the recommendation effect.
By obtaining the search text and click page text, creating a vocabulary and constructing search word vectors and click word vectors, performing intent analysis, and obtaining the user intent distribution vector. Then, an intention transfer model is constructed, the transfer matrix of user intentions is analyzed, and the historical user intention distribution vector set is used to predict, a candidate recommendation set is generated, and the diversity score is calculated to finally generate the best recommendation list.
It realizes dynamic changes in user intentions and precise modeling, improves the accuracy and diversity of recommendations, and optimizes the recommendation effect.
Smart Images

Figure CN119577243A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of natural language processing, and in particular to a related information recommendation system based on natural language processing. Background Art
[0002] With the rapid development of Internet technology and the sharp increase in the amount of information, a huge amount of search data and browsing data has been generated on the Internet. How to accurately understand the interests and needs of users from this data is the key to improving the accuracy of information recommendation systems. In the field of information recommendation, natural language processing technology can deeply understand the interests and needs of users through semantic analysis of massive text data, provide intelligent and personalized recommendation results, and greatly improve the accuracy of recommendations.
[0003] At present, the mainstream natural language processing technologies used for information recommendation include collaborative filtering recommendation methods and content-based recommendation methods; the collaborative filtering recommendation method predicts the content that users are interested in by analyzing user groups with similar behavior patterns, and the content-based recommendation method recommends content with similar characteristics by analyzing the content characteristics of users' historical browsing history; these existing technologies are difficult to effectively handle the dynamically changing characteristics of user needs, and the diversity of recommendation results is insufficient, making it impossible to further optimize the recommendation effect.
[0004] Therefore, a related information recommendation system based on natural language processing is proposed. Summary of the invention
[0005] The purpose of the present invention is to provide an associative information recommendation system based on natural language processing, which establishes a vocabulary by acquiring search text and click page text, constructs search word vectors and click word vectors according to the vocabulary, and performs intent analysis to obtain the user intent distribution vector at each time point; by constructing an intent transfer model, the transfer matrix of the user intent distribution vector between two consecutive time points is analyzed; the predicted user intent distribution vector is calculated by combining the historical user intent distribution vector set and the transfer matrix; the candidate recommendation set is determined according to the predicted user intent distribution vector, and the recommendation score including the diversity score is calculated to generate the best recommendation list from the candidate recommendation set.
[0006] To achieve the above object, the present invention provides the following technical solutions:
[0007] A related information recommendation system based on natural language processing, comprising:
[0008] A data acquisition module, which acquires N search texts with timestamps and M click page texts in the search results, establishes a vocabulary according to the search texts and the click page texts, and constructs a search word vector and a click word vector at each time point according to the vocabulary, the search texts and the click page texts to obtain a search word vector sequence and a click word vector sequence;
[0009] An intention recognition module is used to construct an intention recognition model, wherein the intention recognition model is used to analyze the search word vector sequence and the click word vector sequence to obtain a search intention distribution vector and a click intention distribution vector at each time point, and calculate a user intention distribution vector at each time point based on the search intention distribution vector and the click intention distribution vector to obtain a user intention distribution vector sequence;
[0010] A dynamic analysis module constructs an intention transfer model, wherein the intention transfer model is used to analyze the user intention distribution vector sequence to obtain a transfer matrix of the user intention distribution vector between two consecutive time points;
[0011] An intention prediction module constructs a set of historical user intention distribution vectors, and calculates a predicted user intention distribution vector based on the set of historical user intention distribution vectors and the transfer matrix;
[0012] A recommendation generation module determines a candidate recommendation set according to the predicted user intention distribution vector, calculates a diversity score according to the candidate recommendation set, calculates a recommendation score in combination with the diversity score, and generates an optimal recommendation list from the candidate recommendation set according to the recommendation score.
[0013] Preferably, establishing the vocabulary table according to the search text and the click page text includes: performing word segmentation, stop word removal and word standardization on the search text and the click page text, and after processing, aggregating all non-repeated words to form a word set H; constructing the vocabulary table V = {v|v∈H,f(v)≥δ1,f d (v)≥δ2}, where f(v) represents the original word frequency of word v, which is the frequency of occurrence of word v in all the search texts and the click page texts; f d (v) represents the original document frequency of word v, and the original document frequency is the number of texts containing word v in all the search texts and the click page texts; δ1 represents the original word frequency threshold; δ2 represents the original document frequency threshold.
[0014] Preferably, the specific steps of constructing the search word vector and the click word vector at each time point according to the vocabulary include:
[0015] Divide T time windows according to the timestamp of the search text; in the tth time window, include n t The search text and m t The corresponding click page text;
[0016] Constructing the search term vector at the t-th time point includes:
[0017] In the tth time window, calculate the i-th word v in the vocabulary i In n t The search term frequency f is obtained by calculating the frequency of occurrence of the search term in the search text. q (v i );Calculate the i-th word v in the vocabulary i The search document frequency f dq (v i ); the search document frequency is N, the search text contains the word v i The number of texts; Calculate the i-th element q in the search word vector according to the search word frequency and the search document frequency i =f q (v i )·log(N / f dq (v i )); Traverse each word in the vocabulary to obtain the search word vector q at the tth time point t ={q1,q2,…,q D}, where D represents the number of words in the vocabulary;
[0018] Constructing the click word vector at the t-th time point includes:
[0019] In the tth time window, calculate the i-th word v in the vocabulary i In m t The frequency of occurrence of the click word in the text of the click page is obtained by c (v i );Calculate the i-th word v in the vocabulary i The frequency of document clicks f dc (v i ); the click document frequency is M the click page text contains the word v i The number of texts; Calculate the i-th element c in the click word vector according to the click word frequency and the click document frequency i =f c (v i )·log(N / f dc (v i )); Traverse each word in the vocabulary to obtain the click word vector c at the tth time pointt ={c1,c2,…,c D}.
[0020] Preferably, all the search word vectors are arranged in chronological order to obtain the search word vector sequence of length T; all the click word vectors are arranged in chronological order to obtain the click word vector sequence of length T; the tth element in the search word vector sequence is the search word vector at the tth time point; the tth element in the click word vector sequence is the click word vector at the tth time point.
[0021] Preferably, the intention recognition model is constructed based on an implicit Dirichlet distribution model; the t-th element in the search word vector sequence is analyzed according to the intention recognition model to obtain the search intention distribution vector at the t-th time point. Analyze the tth element in the click word vector sequence according to the intention recognition model to obtain the click intention distribution vector at the tth time point Calculate the user intention distribution vector at the tth time point according to the search intention distribution vector and the click intention distribution vector Wherein, λ represents a weight parameter; all elements of the search word vector sequence and the click word vector sequence are traversed to obtain the user intention distribution vector sequence.
[0022] Preferably, the training process of the intention transfer model includes:
[0023] S11. Initialize the transfer matrix M = [m ij ],m ij represents the element in the i-th row and j-th column in the transfer matrix, i, j = 1, 2, ..., K, K represents the number of intentions;
[0024] S12. For the j-th intention, calculate the forward probability of each time point in sequence from the first time point to obtain the forward probability of the T-th time point;
[0025] S13. For the i-th intention, reversely calculate the backward probability of each time point from the T-th time point to obtain the backward probability of the first time point;
[0026] S14. Calculating the forward transfer expectation according to the forward probability at the Tth time point;
[0027] S15. Calculate the backward transfer expectation according to the backward probability at the first time point;
[0028] S16. Calculate the element m in the transfer matrix according to the forward transfer expectation and the backward transfer expectation ij , update the transfer matrix;
[0029] S17. Repeat steps S12 to S16 until the difference between the two transfer matrices obtained in two adjacent iterations is less than a preset threshold, thereby obtaining the transfer matrix.
[0030] Preferably, constructing a set of historical user intention distribution vectors, and calculating the predicted user intention distribution vector according to the set of historical user intention distribution vectors and the transfer matrix specifically includes:
[0031] Collecting the user intention distribution vectors at all historical time points to construct the historical user intention distribution vector set;
[0032] Calculate the distribution similarity of the user intention distribution vector at the Tth time point and each historical time point;
[0033] Sort all historical time points from large to small according to the distribution similarity, select the first n historical time points as similar time points, and obtain the next time point of each similar time point to obtain n similar transfer time points;
[0034] Acquire the user intention distribution vector at the similar transfer time point according to the historical user intention distribution vector set to obtain a historical transfer intention distribution set;
[0035] The predicted user intention distribution vector is calculated according to the historical transfer intention distribution set and the transfer matrix, and the calculation formula is as follows:
[0036]
[0037] in, represents the predicted user intention distribution vector; A distribution vector representing the user intention at the Tth time point; represents the i-th user intention distribution vector in the historical transfer intention distribution set; w1 and w2 represent weights, w1+w2=1; n represents the number of elements in the historical transfer intention distribution set.
[0038] Preferably, determining the candidate recommendation set based on the predicted user intention distribution vector includes: obtaining all pages to be recommended, performing word segmentation, stop word removal and word standardization processing on the text of the pages to be recommended; constructing a word vector to be recommended for each page to be recommended based on the vocabulary and the processed text; analyzing the word vector to be recommended through the intention recognition model to obtain the intention distribution vector to be recommended; calculating the cosine similarity between each intention distribution vector to be recommended and the predicted user intention distribution vector to obtain a first distribution similarity; sorting the corresponding pages to be recommended in descending order according to the first distribution similarity, and selecting the first m pages to be recommended as the candidate recommendation set.
[0039] Preferably, the diversity score is calculated according to the candidate recommendation set, and the specific steps of calculating the recommendation score in combination with the diversity score include:
[0040] Calculating the intention distribution distance between the to-be-recommended intention distribution vectors corresponding to any two to-be-recommended pages in the candidate recommendation set;
[0041] Calculating a diversity score of each of the to-be-recommended pages in the candidate recommendation set according to the intention distribution distance;
[0042] Calculating the cosine similarity between the to-be-recommended intention distribution vector corresponding to the to-be-recommended page and the predicted user intention distribution vector in the candidate recommendation set to obtain a second distribution similarity of each to-be-recommended page;
[0043] The recommendation score of each of the to-be-recommended pages is calculated by combining the second distribution similarity and the diversity score.
[0044] Preferably, the specific steps of selecting the best recommended page from the candidate recommendation set according to the recommendation score to generate the best recommendation list include:
[0045] S21. Initialize the set of selected pages to be recommended Setting the target length of the best recommendation list to L;
[0046] S22. Select the page to be recommended with the highest recommendation score from the candidate recommendation set as the best page to be recommended, add the best page to be recommended to the selected set of pages to be recommended, delete it from the candidate recommendation set, and update the candidate recommendation set;
[0047] S23. Calculate the cosine similarity between the distribution vector of the to-be-recommended intention corresponding to each of the to-be-recommended items and the best to-be-recommended page in the candidate recommendation set to obtain a third distribution similarity, sort the corresponding to-be-recommended items in descending order of the third distribution similarity, select the first r to-be-recommended pages to be deleted from the candidate recommendation set, and update the candidate recommendation set;
[0048] S24. Updating the recommendation score of each of the pages to be recommended in the candidate recommendation set;
[0049] S25. Repeat steps S22 to S24 until the number of pages to be recommended in the selected set of pages to be recommended is equal to L;
[0050] S26. Obtain the first distribution similarity of the pages to be recommended in the selected set of pages to be recommended, sort the pages to be recommended in the selected set of pages to be recommended in descending order of the first distribution similarity, and obtain the best recommendation list.
[0051] Compared with the prior art, the present invention has the following beneficial effects:
[0052] 1. The present invention first calculates the user intention distribution vector by combining the search topic distribution vector and the click topic distribution vector, so as to comprehensively capture the user intention and improve the accuracy of understanding the user intention. Then, by constructing an intention transfer model and iteratively calculating the forward probability and the backward probability, the transfer matrix of the user intention distribution vector between consecutive time points is obtained, thereby realizing the accurate modeling of the user intention change. The present invention can accurately grasp the dynamic change characteristics of the user intention and optimize the recommendation effect.
[0053] 2. The present invention accurately predicts future user intentions by combining a set of historical user intention distribution vectors. First, the similarity between the user intention distribution vectors of the current time point and the historical time point is calculated, and the most similar n historical time points are selected as similar time points. Then, the next time point of these n similar time points is obtained to form a set of similar transfer time points, and the user intention distribution vectors corresponding to these time points are obtained to form a historical transfer topic distribution set. When predicting, the result of the current user intention distribution vector transformed by the transfer matrix and the vectors in the historical transfer topic distribution set are comprehensively considered, which not only takes into account the continuity characteristics of user interests, but also utilizes similar contextual information in historical data, making the prediction results more accurate and reliable, thereby optimizing the recommendation effect.
[0054] 3. The present invention ensures the relevance of recommendation results to user intentions while focusing on the diversity of recommendation results. First, based on the predicted user intention distribution vector, the distribution similarity between the page to be recommended and the user intention is calculated, and the most relevant m pages are selected to build a candidate recommendation set; then, by calculating the intention distribution distance between any two pages in the candidate set, the diversity score of each page to be recommended is evaluated, and the recommendation score is calculated by combining the distribution similarity and the diversity score to achieve a flexible trade-off between relevance and diversity; finally, an iterative screening method is used to gradually build a recommendation list, each time selecting the page to be recommended with the highest recommendation score and deleting the candidate items that are too similar to it, to ensure that the final recommendation list is both relevant to the user intention and diverse, and can achieve the optimization of the recommendation effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 A schematic diagram of the structure of a related information recommendation system based on natural language processing provided by an embodiment of the present invention;
[0056] Figure 2A schematic diagram of the training process of the intent transfer model provided in an embodiment of the present invention;
[0057] Figure 3 A schematic diagram of a process for generating an optimal recommendation list provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0058] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0059] Embodiment 1
[0060] A social platform is mainly used to share travel experiences and query travel guides. When users plan their travels, they will search and view guides on the platform according to their needs. In order to improve the accuracy and diversity of user homepage recommendations and meet user needs, the social platform applies a related information recommendation system based on natural language processing. Figure 1 ,include:
[0061] A data acquisition module, which acquires N search texts with timestamps and M click page texts in the search results, establishes a vocabulary according to the search texts and the click page texts, and constructs a search word vector and a click word vector at each time point according to the vocabulary, the search texts and the click page texts to obtain a search word vector sequence and a click word vector sequence;
[0062] An intention recognition module is used to construct an intention recognition model, wherein the intention recognition model is used to analyze the search word vector sequence and the click word vector sequence to obtain a search intention distribution vector and a click intention distribution vector at each time point, and calculate a user intention distribution vector at each time point based on the search intention distribution vector and the click intention distribution vector to obtain a user intention distribution vector sequence;
[0063] A dynamic analysis module constructs an intention transfer model, wherein the intention transfer model is used to analyze the user intention distribution vector sequence to obtain a transfer matrix of the user intention distribution vector between two consecutive time points;
[0064] An intention prediction module constructs a set of historical user intention distribution vectors, and calculates a predicted user intention distribution vector based on the set of historical user intention distribution vectors and the transfer matrix;
[0065] A recommendation generation module determines a candidate recommendation set according to the predicted user intention distribution vector, calculates a diversity score according to the candidate recommendation set, calculates a recommendation score in combination with the diversity score, and generates an optimal recommendation list from the candidate recommendation set according to the recommendation score.
[0066] The data acquisition module processes the search text and click page text to construct a standardized word vector sequence, providing a standardized data basis for subsequent analysis; the intention recognition module analyzes the search word vector sequence and the click word vector sequence, and integrates them to obtain the user intention distribution vector, thereby achieving a comprehensive understanding of user needs; the dynamic analysis module captures the evolution of user intentions by establishing an intention transfer model, providing a theoretical basis for intention prediction; the intention prediction module uses historical data and transfer matrices to accurately predict the user's future intention distribution; the recommendation generation module considers diversity while ensuring relevance and generates the optimal recommendation list; through the collaborative work of the five modules, it is possible to provide users with personalized and diversified recommendation services.
[0067] In the embodiment of the present application, the clicked page text is the title text of the page clicked by the user in the search results; Table 1 shows part of the user's search text and clicked page text data.
[0068] Table 1 Search text and click page text
[0069]
[0070] Furthermore, establishing the vocabulary table according to the search text and the click page text includes: performing word segmentation, stop word removal and word standardization on the search text and the click page text, and after processing, aggregating all non-repeated words to form a word set H; constructing the vocabulary table V = {v|v∈H,f(v)≥δ1,f d (v)≥δ2}, where f(v) represents the original word frequency of word v, which is the frequency of occurrence of word v in all the search texts and the click page texts; f d (v) represents the original document frequency of word v, where the original document frequency is the frequency of all the search texts and the click page texts containing word v. i δ1 represents the original word frequency threshold; δ2 represents the original document frequency threshold.
[0071] Through word segmentation, stop word removal and word standardization, and the introduction of original word frequency thresholds and original document frequency thresholds for screening, a high-quality vocabulary can be built, which removes low-frequency invalid words and overly common words, thereby improving the accuracy and efficiency of subsequent text vectorization.
[0072] Furthermore, the specific steps of constructing the search word vector and the click word vector at each time point according to the vocabulary include:
[0073] Divide T time windows according to the timestamp of the search text; in the tth time window, include n t The search text and m t The corresponding click page text,
[0074] Constructing the search term vector at the t-th time point includes:
[0075] In the tth time window, calculate the i-th word v in the vocabulary i In n t The search term frequency f is obtained by calculating the frequency of occurrence of the search term in the search text. q (v i );Calculate the i-th word v in the vocabulary i The search document frequency f dq (v i ); the search document frequency is N, the search text contains the word v i The number of texts; Calculate the i-th element q in the search word vector according to the search word frequency and the search document frequency i =f q (v i )·log(N / f dq (v i )); Traverse each word in the vocabulary to obtain the search word vector q at the tth time point t ={q1,q2,…,q D}, where D represents the number of words in the vocabulary;
[0076] Constructing the click word vector at the t-th time point includes:
[0077] In the tth time window, calculate the i-th word v in the vocabulary i In m t The frequency of occurrence of the click word in the text of the click page is obtained by c (v i );Calculate the i-th word v in the vocabulary i The frequency of document clicks f dc (v i ); the click document frequency is M the click page text contains the word v i The number of texts; Calculate the i-th element c in the click word vector according to the click word frequency and the click document frequency i =f c (vi )·log(N / f dc (v i )); Traverse each word in the vocabulary to obtain the click word vector c at the tth time point t ={c1,c2,…,c D}.
[0078] First, the time window is divided, and then the search word vector and click word vector at each time point are constructed by combining the word frequency and document frequency. This not only retains the important information of the words in the text, but also captures the temporal characteristics of the data, providing a high-quality data foundation for subsequent intent distribution analysis.
[0079] Furthermore, all the search word vectors are arranged in chronological order to obtain the search word vector sequence of length T; all the click word vectors are arranged in chronological order to obtain the click word vector sequence of length T; the tth element in the search word vector sequence is the search word vector at the tth time point; the tth element in the click word vector sequence is the click word vector at the tth time point.
[0080] By arranging the search word vectors and click word vectors in chronological order, a standardized vector sequence is formed, which provides a structured data foundation for subsequent timing analysis and intent transfer modeling.
[0081] Further, the intention recognition model is constructed based on the implicit Dirichlet distribution model; the t-th element in the search word vector sequence is analyzed according to the intention recognition model to obtain the search intention distribution vector at the t-th time point Analyze the tth element in the click word vector sequence according to the intention recognition model to obtain the click intention distribution vector at the tth time point Calculate the user intention distribution vector at the tth time point according to the search intention distribution vector and the click intention distribution vector Wherein, λ represents a weight parameter; all elements of the search word vector sequence and the click word vector sequence are traversed to obtain the user intention distribution vector sequence.
[0082] By adopting the latent Dirichlet distribution model and balancing the influence of search and click behaviors through weight parameters, the accurate characterization of user intention distribution is achieved, which can more accurately understand the actual focus of users.
[0083] Table 2 Probability values under user intention distribution vector
[0084] Time Attractions Culinary Experience Transportation and accommodation Cultural Experience Price Budget T-3 0.35 0.15 0.30 0.10 0.10 T-2 0.20 0.40 0.20 0.10 0.10 T-1 0.45 0.10 0.25 0.10 0.10 T 0.25 0.15 0.20 0.30 0.10
[0085] In the embodiment of the present application, each time window includes 1 search text, the 4 timestamps in Table 1 correspond to the 4 time points in Table 2, and the Tth time window includes 1 search text and 2 click page texts; according to the user's search text and click page text, 5 intentions are set, namely, scenic spot sightseeing, food experience, transportation and accommodation, cultural experience, and price budget; Table 2 shows the probability value of each intention under the user intention distribution vector at the 4 time points.
[0086] Further, see Figure 2 , the training process of the intention transfer model includes:
[0087] S11. Initialize the transfer matrix M = [m ij ],m ij represents the element in the i-th row and j-th column of the transfer matrix, 0≤m ij ≤1, K represents the number of intentions;
[0088] S12. For the jth intention, calculate the forward probability of each time point in sequence from the first time point Get the forward probability α at the Tth time point T (j); where α t (i) represents the forward probability of the i-th intention at the t-th time point; K represents the number of intentions; Represents the user intention distribution vector at the t+1th time point The probability value of the next intention j; the forward probability at the first time point in, Represents the user intention distribution vector at the first time point The probability value of the next intention j;
[0089] S13. For the i-th intention, reversely calculate the backward probability of each time point from the T-th time point Get the backward probability β1(i) at the first time point; where β t+1 (j) represents the backward probability of the j-th intention at the t+1-th time point;
[0090] S14. Calculate the forward transfer expectation according to the forward probability at the Tth time point
[0091] S15. Calculate the backward transfer expectation based on the backward probability at the first time point
[0092] S16. Calculate the element m in the transfer matrix according to the forward transfer expectation and the backward transfer expectationij =E1·E2, update the transfer matrix;
[0093] S17. Repeat steps S12 to S16 until the difference between the two transfer matrices obtained in two adjacent iterations is less than a preset threshold, thereby obtaining the transfer matrix.
[0094] Through the iterative calculation of forward probability and backward probability, an accurate topic transfer matrix is obtained, which can effectively capture the law of user intention distribution evolution over time and improve the accuracy of user intention prediction.
[0095] Further, constructing a set of historical user intention distribution vectors, and calculating the predicted user intention distribution vector according to the set of historical user intention distribution vectors and the transfer matrix specifically includes:
[0096] Collecting the user intention distribution vectors at all historical time points to construct the historical user intention distribution vector set;
[0097] Calculate the distribution similarity of the user intention distribution vector at the Tth time point and each historical time point;
[0098] Sort all historical time points from large to small according to the distribution similarity, select the first n historical time points as similar time points, and obtain the next time point of each similar time point to obtain n similar transfer time points;
[0099] Acquire the user intention distribution vector at the similar transfer time point according to the historical user intention distribution vector set to obtain a historical transfer intention distribution set;
[0100] The predicted user intention distribution vector is calculated according to the historical transfer intention distribution set and the transfer matrix, and the calculation formula is as follows:
[0101]
[0102] in, represents the predicted user intention distribution vector; represents the user intention distribution vector at the Tth time point; M represents the transfer matrix; represents the i-th user intention distribution vector in the historical transfer intention distribution set; w1 and w2 represent weights, w1+w2=1; n represents the number of elements in the historical transfer intention distribution set.
[0103] Through the analysis of similar historical time points and the application of the transfer matrix, similar historical situations and current intention distribution are comprehensively considered, making the prediction results more reliable.
[0104] Furthermore, determining the candidate recommendation set based on the predicted user intention distribution vector includes: obtaining all pages to be recommended, performing word segmentation, stop word removal and word standardization processing on the text of the pages to be recommended; constructing a word vector to be recommended for each page to be recommended based on the vocabulary and the processed text; analyzing the word vector to be recommended through the intention recognition model to obtain the intention distribution vector to be recommended; calculating the cosine similarity between each intention distribution vector to be recommended and the predicted user intention distribution vector to obtain a first distribution similarity; sorting the corresponding pages to be recommended in descending order according to the first distribution similarity, and selecting the first m pages to be recommended as the candidate recommendation set.
[0105] By calculating and sorting the similarity of intent distribution, we ensure that the selected candidate recommendation items are highly relevant to the predicted user intent, thereby improving the accuracy of the recommendation.
[0106] Furthermore, the diversity score is calculated according to the candidate recommendation set, and the specific steps of calculating the recommendation score in combination with the diversity score include:
[0107] The intention distribution distance between the intention distribution vectors to be recommended corresponding to any two pages to be recommended in the candidate recommendation set is calculated using the following calculation formula:
[0108]
[0109] Among them, dist(u1,u2) represents the distribution vector of the recommended intention corresponding to the recommended pages u1 and u2 and The intention distribution distance between them; and Respectively and The probability value of the kth intention in ;
[0110] The diversity score of each to-be-recommended page in the candidate recommendation set is calculated according to the intention distribution distance, and the calculation formula is as follows:
[0111] div(p)=min p′∈S {dist(p,p′)};
[0112] Wherein, div(p) represents the diversity score of the page p to be recommended in the candidate recommendation set; dist(p, p′) represents the intention distribution distance between the page p to be recommended and the page p′ to be recommended; S represents the selected page set to be recommended; if S is empty, div(p) = 1;
[0113] Calculating the cosine similarity between the to-be-recommended intention distribution vector corresponding to the to-be-recommended page and the predicted user intention distribution vector in the candidate recommendation set to obtain a second distribution similarity of each to-be-recommended page;
[0114] The recommendation score score(p)=λ·sim(p)+(1-λ)·div(p) of each page to be recommended is calculated by combining the second distribution similarity and the diversity score, where λ represents an adjustable balance parameter and sim(p) represents the second distribution similarity of the page to be recommended p.
[0115] By calculating the intention distribution differences between the pages to be recommended, the degree of content difference can be accurately evaluated; the diversity score and distribution similarity are weighted and fused, and the influence of the selected page set is considered in the calculation process, ensuring that the recommendation results are relevant to the predicted user intentions while ensuring that the newly selected pages can maximize the diversity of the recommendation results.
[0116] Further, see Figure 3 The specific steps of selecting the best recommended page from the candidate recommendation set according to the recommendation score to generate the best recommendation list include:
[0117] S21. Initialize the set of selected pages to be recommended Setting the target length of the best recommendation list to L;
[0118] S22. Select the page to be recommended with the highest recommendation score from the candidate recommendation set as the best page to be recommended, add the best page to be recommended to the selected set of pages to be recommended, delete it from the candidate recommendation set, and update the candidate recommendation set;
[0119] S23. Calculate the cosine similarity between the distribution vector of the to-be-recommended intention corresponding to each of the to-be-recommended items and the best to-be-recommended page in the candidate recommendation set to obtain a third distribution similarity, sort the corresponding to-be-recommended items in descending order of the third distribution similarity, select the first r to-be-recommended pages to be deleted from the candidate recommendation set, and update the candidate recommendation set;
[0120] S24. Updating the recommendation score of each of the pages to be recommended in the candidate recommendation set;
[0121] S25. Repeat steps S22 to S24 until the number of pages to be recommended in the selected set of pages to be recommended is equal to L;
[0122] S26. Obtain the first distribution similarity of the pages to be recommended in the selected set of pages to be recommended, sort the pages to be recommended in the selected set of pages to be recommended in descending order of the first distribution similarity, and obtain the best recommendation list.
[0123] An iterative screening strategy is adopted to select the recommended page with the highest recommendation score each time, ensuring the local optimal selection; the recommendation list is generated by dynamically updating the candidate recommendation set, which not only ensures the relevance of the recommended items to the user's interests, but also maintains the diversity within the recommendation results, and can provide better quality recommendation results.
[0124] Embodiment 2
[0125] An e-commerce platform has applied a related information recommendation system based on natural language processing provided by the present invention, including:
[0126] A data acquisition module, which acquires N search texts with timestamps and M click page texts in the search results, establishes a vocabulary according to the search texts and the click page texts, and constructs a search word vector and a click word vector at each time point according to the vocabulary, the search texts and the click page texts to obtain a search word vector sequence and a click word vector sequence;
[0127] An intention recognition module is used to construct an intention recognition model, wherein the intention recognition model is used to analyze the search word vector sequence and the click word vector sequence to obtain a search intention distribution vector and a click intention distribution vector at each time point, and calculate a user intention distribution vector at each time point based on the search intention distribution vector and the click intention distribution vector to obtain a user intention distribution vector sequence;
[0128] A dynamic analysis module constructs an intention transfer model, wherein the intention transfer model is used to analyze the user intention distribution vector sequence to obtain a transfer matrix of the user intention distribution vector between two consecutive time points;
[0129] An intention prediction module constructs a set of historical user intention distribution vectors, and calculates a predicted user intention distribution vector based on the set of historical user intention distribution vectors and the transfer matrix;
[0130] A recommendation generation module determines a candidate recommendation set according to the predicted user intention distribution vector, calculates a diversity score according to the candidate recommendation set, calculates a recommendation score in combination with the diversity score, and generates an optimal recommendation list from the candidate recommendation set according to the recommendation score.
[0131] Table 3 shows some of the users’ search text and clicked page text data.
[0132] Table 3 Search text and click page text
[0133]
[0134] Furthermore, establishing the vocabulary table according to the search text and the click page text includes: performing word segmentation, stop word removal and word standardization on the search text and the click page text, and after processing, aggregating all non-repeated words to form a word set H; constructing the vocabulary table V = {v|v∈H,f(v)≥δ1,f d (v)≥δ2}, where f(v) represents the original word frequency of word v, which is the frequency of occurrence of word v in all the search texts and the click page texts; f d (v) represents the original document frequency of word v, and the original document frequency is the number of texts containing word v in all the search texts and the click page texts; δ1 represents the original word frequency threshold; δ2 represents the original document frequency threshold.
[0135] Furthermore, the specific steps of constructing the search word vector and the click word vector at each time point according to the vocabulary include:
[0136] Divide T time windows according to the timestamp of the search text; in the tth time window, include n t The search text and m t The corresponding click page text;
[0137] Constructing the search term vector at the t-th time point includes:
[0138] In the tth time window, calculate the i-th word v in the vocabulary i In n t The search term frequency f is obtained by calculating the frequency of occurrence of the search term in the search text. q (v i );Calculate the i-th word v in the vocabulary i The search document frequency f dq (v i ); the search document frequency is N, the search text contains the word v i The number of texts; Calculate the i-th element q in the search word vector according to the search word frequency and the search document frequency i =f q (v i )·log(N / f dq (v i )); Traverse each word in the vocabulary to obtain the search word vector q at the tth time point t ={q1,q2,…,q D}, where D represents the number of words in the vocabulary;
[0139] Constructing the click word vector at the t-th time point includes:
[0140] In the tth time window, calculate the i-th word v in the vocabulary i In m t The frequency of occurrence of the click word in the text of the click page is obtained by c (v i );Calculate the i-th word v in the vocabulary i The frequency of document clicks f dc (v i ); the click document frequency is M the click page text contains the word v i The number of texts; Calculate the i-th element c in the click word vector according to the click word frequency and the click document frequency i =f c (v i )·log(N / f dc (v i )); Traverse each word in the vocabulary to obtain the click word vector c at the tth time point t ={c1,c2,…,c D}.
[0141] Furthermore, all the search word vectors are arranged in chronological order to obtain the search word vector sequence of length T; all the click word vectors are arranged in chronological order to obtain the click word vector sequence of length T; the tth element in the search word vector sequence is the search word vector at the tth time point; the tth element in the click word vector sequence is the click word vector at the tth time point.
[0142] Further, the intention recognition model is constructed based on the implicit Dirichlet distribution model; the t-th element in the search word vector sequence is analyzed according to the intention recognition model to obtain the search intention distribution vector at the t-th time point Analyze the tth element in the click word vector sequence according to the intention recognition model to obtain the click intention distribution vector at the tth time point Calculate the user intention distribution vector at the tth time point according to the search intention distribution vector and the click intention distribution vector Wherein, λ represents a weight parameter; all elements of the search word vector sequence and the click word vector sequence are traversed to obtain the user intention distribution vector sequence.
[0143] Furthermore, the training process of the intention transfer model includes:
[0144] S11. Initialize the transfer matrix M = [m ij ],m ij represents the element in the i-th row and j-th column in the transfer matrix, i, j = 1, 2, ..., K, K represents the number of intentions;
[0145] S12. For the j-th intention, calculate the forward probability of each time point in sequence from the first time point to obtain the forward probability of the T-th time point;
[0146] S13. For the i-th intention, reversely calculate the backward probability of each time point from the T-th time point to obtain the backward probability of the first time point;
[0147] S14. Calculating the forward transfer expectation according to the forward probability at the Tth time point;
[0148] S15. Calculate the backward transfer expectation according to the backward probability at the first time point;
[0149] S16. Calculate the element m in the transfer matrix according to the forward transfer expectation and the backward transfer expectation ij , update the transfer matrix;
[0150] S17. Repeat steps S12 to S16 until the difference between the two transfer matrices obtained in two adjacent iterations is less than a preset threshold, thereby obtaining the transfer matrix.
[0151] Further, constructing a set of historical user intention distribution vectors, and calculating the predicted user intention distribution vector according to the set of historical user intention distribution vectors and the transfer matrix specifically includes:
[0152] Collecting the user intention distribution vectors at all historical time points to construct the historical user intention distribution vector set;
[0153] Calculate the distribution similarity of the user intention distribution vector at the Tth time point and each historical time point;
[0154] Sort all historical time points from large to small according to the distribution similarity, select the first n historical time points as similar time points, and obtain the next time point of each similar time point to obtain n similar transfer time points;
[0155] Acquire the user intention distribution vector at the similar transfer time point according to the historical user intention distribution vector set to obtain a historical transfer intention distribution set;
[0156] The predicted user intention distribution vector is calculated according to the historical transfer intention distribution set and the transfer matrix, and the calculation formula is as follows:
[0157]
[0158] in, represents the predicted user intention distribution vector; A distribution vector representing the user intention at the Tth time point; represents the i-th user intention distribution vector in the historical transfer intention distribution set; w1 and w2 represent weights, w1+w2=1; n represents the number of elements in the historical transfer intention distribution set.
[0159] Furthermore, determining the candidate recommendation set based on the predicted user intention distribution vector includes: obtaining all pages to be recommended, performing word segmentation, stop word removal and word standardization processing on the text of the pages to be recommended; constructing a word vector to be recommended for each page to be recommended based on the vocabulary and the processed text; analyzing the word vector to be recommended through the intention recognition model to obtain the intention distribution vector to be recommended; calculating the cosine similarity between each intention distribution vector to be recommended and the predicted user intention distribution vector to obtain a first distribution similarity; sorting the corresponding pages to be recommended in descending order according to the first distribution similarity, and selecting the first m pages to be recommended as the candidate recommendation set.
[0160] Furthermore, the diversity score is calculated according to the candidate recommendation set, and the specific steps of calculating the recommendation score in combination with the diversity score include:
[0161] Calculating the intention distribution distance between the to-be-recommended intention distribution vectors corresponding to any two to-be-recommended pages in the candidate recommendation set;
[0162] Calculating a diversity score of each of the to-be-recommended pages in the candidate recommendation set according to the intention distribution distance;
[0163] Calculating the cosine similarity between the to-be-recommended intention distribution vector corresponding to the to-be-recommended page and the predicted user intention distribution vector in the candidate recommendation set to obtain a second distribution similarity of each to-be-recommended page;
[0164] The recommendation score of each of the to-be-recommended pages is calculated by combining the second distribution similarity and the diversity score.
[0165] Furthermore, the specific steps of selecting the best recommended page from the candidate recommendation set according to the recommendation score to generate the best recommendation list include:
[0166] S21. Initialize the set of selected pages to be recommended Setting the target length of the best recommendation list to L;
[0167] S22. Select the page to be recommended with the highest recommendation score from the candidate recommendation set as the best page to be recommended, add the best page to be recommended to the selected set of pages to be recommended, delete it from the candidate recommendation set, and update the candidate recommendation set;
[0168] S23. Calculate the cosine similarity between the distribution vector of the to-be-recommended intention corresponding to each of the to-be-recommended items and the best to-be-recommended page in the candidate recommendation set to obtain a third distribution similarity, sort the corresponding to-be-recommended items in descending order of the third distribution similarity, select the first r to-be-recommended pages to be deleted from the candidate recommendation set, and update the candidate recommendation set;
[0169] S24. Updating the recommendation score of each of the pages to be recommended in the candidate recommendation set;
[0170] S25. Repeat steps S22 to S24 until the number of pages to be recommended in the selected set of pages to be recommended is equal to L;
[0171] S26. Obtain the first distribution similarity of the pages to be recommended in the selected set of pages to be recommended, sort the pages to be recommended in the selected set of pages to be recommended in descending order of the first distribution similarity, and obtain the best recommendation list.
[0172] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A related information recommendation system based on natural language processing, characterized in that: include: A data acquisition module, which acquires N search texts with timestamps and M click page texts in the search results, establishes a vocabulary according to the search texts and the click page texts, and constructs a search word vector and a click word vector at each time point according to the vocabulary, the search texts and the click page texts to obtain a search word vector sequence and a click word vector sequence; An intention recognition module is used to construct an intention recognition model, wherein the intention recognition model is used to analyze the search word vector sequence and the click word vector sequence to obtain a search intention distribution vector and a click intention distribution vector at each time point, and calculate a user intention distribution vector at each time point based on the search intention distribution vector and the click intention distribution vector to obtain a user intention distribution vector sequence; A dynamic analysis module constructs an intention transfer model, wherein the intention transfer model is used to analyze the user intention distribution vector sequence to obtain a transfer matrix of the user intention distribution vector between two consecutive time points; An intention prediction module constructs a set of historical user intention distribution vectors, and calculates a predicted user intention distribution vector based on the set of historical user intention distribution vectors and the transfer matrix; A recommendation generation module determines a candidate recommendation set according to the predicted user intention distribution vector, calculates a diversity score according to the candidate recommendation set, calculates a recommendation score in combination with the diversity score, and generates an optimal recommendation list from the candidate recommendation set according to the recommendation score.
2. The natural language processing-based association information recommendation system according to claim 1, characterized in that: Establishing the vocabulary table according to the search text and the click page text includes: performing word segmentation, stop word removal and word standardization on the search text and the click page text, and after processing, aggregating all non-repeated words to form a word set H; constructing the vocabulary table V = {v|v∈H,f(v)≥δ1,f d (v)≥δ2}, where f(v) represents the original word frequency of word v, which is the frequency of occurrence of word v in all the search texts and the click page texts; f d (v) represents the original document frequency of word v, and the original document frequency is the number of texts containing word v in all the search texts and the click page texts; δ1 represents the original word frequency threshold; δ2 represents the original document frequency threshold.
3. The natural language processing-based association information recommendation system according to claim 1, characterized in that: The specific steps of constructing the search word vector and the click word vector at each time point according to the vocabulary include: Divide T time windows according to the timestamp of the search text; in the tth time window, include n t The search text and m t The corresponding click page text; Constructing the search term vector at the t-th time point includes: In the tth time window, calculate the i-th word v in the vocabulary i In n t The frequency of occurrence of the search word in the search text is obtained q (v i );Calculate the i-th word v in the vocabulary i The search document frequency f dq (v i ); the search document frequency is N, the search text contains the word v i The number of texts; Calculate the i-th element q in the search word vector according to the search word frequency and the search document frequency i =f q (v i )·log(N / f dq (v i )); Traverse each word in the vocabulary to obtain the search word vector q at the tth time point t ={q1,q2,…,q D }, where D represents the number of words in the vocabulary; Constructing the click word vector at the t-th time point includes: In the tth time window, calculate the i-th word v in the vocabulary i In m t The frequency of occurrence of the click word in the text of the click page is obtained by c (v i );Calculate the i-th word v in the vocabulary i The frequency of document clicks f dc (v i ); the click document frequency is M the click page text contains the word v i The number of texts; Calculate the i-th element c in the click word vector according to the click word frequency and the click document frequency i =f c (v i )·log(N / f dc (v i )); Traverse each word in the vocabulary to obtain the click word vector c at the tth time point t ={c1,c2,…,c D }.
4. The natural language processing-based association information recommendation system according to claim 1, characterized in that: Arrange all the search word vectors in chronological order to obtain the search word vector sequence of length T; arrange all the click word vectors in chronological order to obtain the click word vector sequence of length T; the tth element in the search word vector sequence is the search word vector at the tth time point; the tth element in the click word vector sequence is the click word vector at the tth time point.
5. The natural language processing-based association information recommendation system according to claim 1, characterized in that: The intention recognition model is constructed based on the implicit Dirichlet distribution model; the t-th element in the search word vector sequence is analyzed according to the intention recognition model to obtain the search intention distribution vector at the t-th time point Analyze the tth element in the click word vector sequence according to the intention recognition model to obtain the click intention distribution vector at the tth time point Calculate the user intention distribution vector at the tth time point according to the search intention distribution vector and the click intention distribution vector Wherein, λ represents a weight parameter; all elements of the search word vector sequence and the click word vector sequence are traversed to obtain the user intention distribution vector sequence.
6. The natural language processing-based association information recommendation system according to claim 1, characterized in that: The training process of the intention transfer model includes: S11. Initialize the transfer matrix M = [m ij ],m ij represents the element in the i-th row and j-th column in the transfer matrix, i, j = 1, 2, ..., K, K represents the number of intentions; S12. For the j-th intention, calculate the forward probability of each time point in sequence from the first time point to obtain the forward probability of the T-th time point; S13. For the i-th intention, reversely calculate the backward probability of each time point from the T-th time point to obtain the backward probability of the first time point; S14. Calculating the forward transfer expectation according to the forward probability at the Tth time point; S15. Calculate the backward transfer expectation according to the backward probability at the first time point; S16. Calculate the element m in the transfer matrix according to the forward transfer expectation and the backward transfer expectation ij , update the transfer matrix; S17. Repeat steps S12 to S16 until the difference between the two transfer matrices obtained in two adjacent iterations is less than a preset threshold, thereby obtaining the transfer matrix.
7. The natural language processing-based association information recommendation system according to claim 1, characterized in that: Constructing a historical user intention distribution vector set, and calculating a predicted user intention distribution vector according to the historical user intention distribution vector set and the transfer matrix specifically includes: Collecting the user intention distribution vectors at all historical time points to construct the historical user intention distribution vector set; Calculate the distribution similarity of the user intention distribution vector at the Tth time point and each historical time point; Sort all historical time points from large to small according to the distribution similarity, select the first n historical time points as similar time points, and obtain the next time point of each similar time point to obtain n similar transfer time points; Acquire the user intention distribution vector at the similar transfer time point according to the historical user intention distribution vector set to obtain a historical transfer intention distribution set; The predicted user intention distribution vector is calculated according to the historical transfer intention distribution set and the transfer matrix, and the calculation formula is as follows: in, represents the predicted user intention distribution vector; Represents the user intention distribution vector at the Tth time point; represents the i-th user intention distribution vector in the historical transfer intention distribution set; w1 and w2 represent weights, w1+w2=1; n represents the number of elements in the historical transfer intention distribution set.
8. The natural language processing-based association information recommendation system according to claim 1, characterized in that: Determining a candidate recommendation set based on the predicted user intention distribution vector includes: obtaining all pages to be recommended, performing word segmentation, stop word removal and word standardization on the text of the pages to be recommended; constructing a word vector to be recommended for each page to be recommended based on the vocabulary and the processed text; analyzing the word vector to be recommended through the intention recognition model to obtain a distribution vector of intention to be recommended; calculating the cosine similarity between each intention distribution vector to be recommended and the predicted user intention distribution vector to obtain a first distribution similarity; sorting the corresponding pages to be recommended in descending order according to the first distribution similarity, and selecting the first m pages to be recommended as the candidate recommendation set.
9. The natural language processing-based association information recommendation system according to claim 1, characterized in that: The specific steps of calculating the diversity score according to the candidate recommendation set and calculating the recommendation score in combination with the diversity score include: Calculating the intention distribution distance between the to-be-recommended intention distribution vectors corresponding to any two to-be-recommended pages in the candidate recommendation set; Calculating a diversity score of each of the to-be-recommended pages in the candidate recommendation set according to the intention distribution distance; Calculating the cosine similarity between the to-be-recommended intention distribution vector corresponding to the to-be-recommended page and the predicted user intention distribution vector in the candidate recommendation set to obtain a second distribution similarity of each to-be-recommended page; The recommendation score of each of the to-be-recommended pages is calculated by combining the second distribution similarity and the diversity score.
10. The natural language processing-based association information recommendation system according to claim 1, characterized in that: The specific steps of selecting the best recommended page from the candidate recommendation set according to the recommendation score to generate the best recommendation list include: S21. Initialize the set of selected pages to be recommended Setting the target length of the best recommendation list to L; S22. Select the page to be recommended with the highest recommendation score from the candidate recommendation set as the best page to be recommended, add the best page to be recommended to the selected set of pages to be recommended, delete it from the candidate recommendation set, and update the candidate recommendation set; S23. Calculate the cosine similarity between the distribution vector of the to-be-recommended intention corresponding to each of the to-be-recommended items and the best to-be-recommended page in the candidate recommendation set to obtain a third distribution similarity, sort the corresponding to-be-recommended items in descending order of the third distribution similarity, select the first r to-be-recommended pages to be deleted from the candidate recommendation set, and update the candidate recommendation set; S24. Updating the recommendation score of each of the pages to be recommended in the candidate recommendation set; S25. Repeat steps S22 to S24 until the number of pages to be recommended in the selected set of pages to be recommended is equal to L; S26. Obtain the first distribution similarity of the pages to be recommended in the selected set of pages to be recommended, sort the pages to be recommended in the selected set of pages to be recommended in descending order of the first distribution similarity, and obtain the best recommendation list.
Citation Information
Patent Citations
Service recommendation method and system based on transfer learning
CN113342963A
Time-based directional attention recommendation system and method
CN115129965A
Natural language understanding method and device fusing dialogue context information
CN116542256A
Heuristic knowledge navigation recommendation method fusing user retrieval intention
CN118939787A
Method and system for multi-modal input based platform for intent based product recommendations
US20200104900A1