A multi-source cross-domain knowledge system adaptive sorting recommendation method and system
Patent Information
- Application Number
- CN202311430863.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-31
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2043-10-31
AI Technical Summary
[0005]本发明的目的就是解决上述背景中,知识不完整、类别不同、侧重点不同等因素导致的知识排序结果不符合用户的真实需求的问题,提出了一种多源跨域知识体系自适应排序推荐方法
[0089]The beneficial effects of this invention are as follows: Based on the idea of reinforcement learning, this invention integrates multiple databases of different categories. It records the knowledge selected by the user and feeds back the knowledge's category and semantic features to the system. The category features of the knowledge are reflected in the fact that when a user selects knowledge from a particular knowledge base, the system considers the category differences between the databases and uses different methods to calculate the relevance of that knowledge to other knowledge bases. After acquiring these features, the system calculates the relevance of these features to other knowledge. The system assigns greater weight to the relevance obtained from the user's current operation and less weight to the relevance obtained from the user's previous operations. The final relevance score is the sum of the step-by-step relevance scores of all previous operations multiplied by their respective weights. Through this mechanism, the system continuously obtains the user's intent and continuously adjusts the order of knowledge, thereby providing the user with a recommendation list that better meets their needs.
Smart Images

Figure CN117435719B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of recommender systems, specifically to an adaptive ranking and recommendation method and system for multi-source cross-domain knowledge systems. Background Technology
[0002] With the research and development and deployment of new-generation information technologies, organizations around the world have stored massive amounts of data. When users retrieve information from this data according to their own needs, there are problems such as a large amount of knowledge data but a single database category. At the same time, there are problems such as inaccurate search results due to information exchange errors between humans and machines. How to filter useful data from the massive knowledge base based on the limited information provided by users and provide priority ranking is one of the key tasks that the field of intelligent recommendation needs to solve.
[0003] Currently, the mainstream methods used in recommendation systems include collaborative filtering algorithms, content filtering methods, deep learning-based methods, latent semantic model-based methods, rule-based recommendation methods, and reinforcement learning-based methods. Reinforcement learning-based methods learn the optimal strategy through continuous iteration via user-system interaction, making them suitable for the personalized needs of different users.
[0004] Most existing recommendation systems focus on recommending and ranking knowledge within the same category. However, knowledge recommended from a single knowledge base is incomplete. Mixing different categories of knowledge together for recommendation can lead to ranking results that do not meet the user's actual needs due to differences in categories and emphases across knowledge domains. Summary of the Invention
[0005] The purpose of this invention is to address the problem, as mentioned above, that incomplete knowledge, different categories, and different focuses lead to knowledge ranking results that do not meet users' actual needs. This invention proposes an adaptive ranking and recommendation method for multi-source, cross-domain knowledge systems. The method includes the following steps:
[0006] S1. Extract user input text, obtain search keywords, and vectorize them to obtain search keyword vectors;
[0007] S2. Sort and preprocess the knowledge from multiple source databases, extract keywords and vectorize keyword text, and obtain the keyword weights of individual data in different knowledge bases.
[0008] S3. Based on the calculated search keyword vector and the initial correlation score between knowledge in the database, initialize the recommendation ranking of different knowledge base data;
[0009] S4. Record the user's selection operation, calculate the relevance of the selected knowledge to other knowledge to obtain the operation relevance, calculate the relevance of this operation, the relevance of previous operations and the initial relevance according to the weight, and finally obtain the comprehensive relevance. Based on the comprehensive relevance, recommend and update the knowledge in the knowledge base.
[0010] S5. Continue to record the user's selection actions and repeat step S4 to update the knowledge base recommendation ranking.
[0011] In the preferred embodiment, the knowledge base data includes: knowledge graph data, encyclopedia data, literature database data, and national standard data;
[0012] Step S2 also includes: extracting keywords from encyclopedia data, literature database data, and national standard data, vectorizing keyword text, obtaining the keyword weights of individual data in the three knowledge bases, and vectorizing the triples in the knowledge graph data.
[0013] Encyclopedia keyword vectors are obtained from encyclopedia data, document keyword vectors are obtained from document database data, and standard keyword vectors are obtained from national standards.
[0014] Step S3 also includes: initializing the recommended sorting of encyclopedia data, literature database data, and national standard data; calculating the initial relevance of knowledge graph data based on search keywords and knowledge completeness, and then performing preliminary sorting.
[0015] In the preferred embodiment, step S2 further includes the following steps:
[0016] S21. Concatenate the head entity, relation, and tail entity of the i-th triple in the knowledge graph data into a sentence, and then use BERT to perform vector transformation to obtain the knowledge graph vector, which is denoted as gvec. 1 i The above processing is performed on all triples in the knowledge graph to obtain a knowledge graph vector sequence, which is denoted as Gvec. 1 Its expression is:
[0017] Gvec 1 ={gvec 1 1, gvec 1 2, ..., gvec 1 n}
[0018] S22. Perform word segmentation and stop word removal on the title of each standard in the national standard data to obtain n words as keywords, and set the weight of each word to 1.
[0019] S23. Combine the title and abstract of each document in the document database;
[0020] S24. Use the TF-IDF algorithm to calculate the keyword weight of each piece of knowledge in the two databases, the literature database and the encyclopedia database, and retain the n words with the highest weights in descending order of weight as the keyword sequence of this knowledge.
[0021] S25. Let t denote the weight of the i-th keyword in the keyword sequence. i Each keyword in the keyword sequence is vectorized using the BERT model, and the vector of the i-th keyword in the keyword sequence is denoted as KW. i Let T be the keyword weight sequence and KW be the keyword vector sequence. The expressions for T and KW are:
[0022] T = {t1, t2, ..., t} n}
[0023] KW = {KW1, KW2, ..., KW} n}
[0024] In the preferred embodiment, step S3 further includes the following steps:
[0025] S31. Denote the sum of the weights of the weight sequence as TS. Normalize the keyword weight sequence of each data point in the encyclopedia data, document database data, and national standard data to obtain a new weight sequence T. 0 The weight of the i-th keyword in the keyword weight sequence is updated to T. i 0 Weight sequence T 0 The expression is:
[0026] T 0 ={T1 0 T2 0 , ..., T n 0}
[0027] The formulas for calculating the weights and TS of a weighted sequence are:
[0028]
[0029] weight t i Updated to t i 0 The calculation formula is:
[0030]
[0031] S32. Let the search keyword vector be KwVec. Calculate the cosine similarity between the keyword vector in the keyword vector sequence KW of each data point in the encyclopedia data, document database data, and national standard data, and KwVec. The i-th keyword vector in KW... i The cosine similarity calculated with KwVec is Cscore. i The calculation formula is as follows:
[0032] Cscore i =cos <KwVev,KW i >
[0033] The resulting keyword cosine similarity sequence is denoted as C, and the expression for C is:
[0034] C={Cscore1, Cscore2,…, Cscore n}
[0035] S33. The relevance score between each data point and the search keywords obtained from S1 is obtained by multiplying the cosine similarity by the weights of the corresponding keywords and summing the results. The relevance score is denoted as KS0, and the formula for calculating KS0 is as follows:
[0036]
[0037] S34. Based on the search keywords in S1, retrieve all relevant triplet data in the knowledge graph data as candidate triplets;
[0038] S35. Determine the knowledge integrity of each triple in the candidate triples based on whether it belongs to the ontology, rule, attribute, or relation, and obtain the relevance score of the knowledge graph data. Mark the relevance score with KS0.
[0039] S36. Sort the results from highest to lowest according to the correlation score to obtain the initial sort.
[0040] In the preferred embodiment, step S4 further includes the following steps:
[0041] S41. Record the user's current selection operation and determine whether the knowledge selected by the user belongs to the knowledge graph data;
[0042] S42. The knowledge selected by the user is vectorized differently according to the different categories of their knowledge base;
[0043] S43. Calculate the correlation between the vectorized knowledge and the knowledge that was not selected by the user;
[0044] S44. The weighted calculation of the correlation degree obtained in step S43 and the initial correlation degree score obtained in step S3 results in the comprehensive correlation degree score that has changed due to this selection operation.
[0045] S45. Update the recommended ranking of each database according to the comprehensive correlation score to obtain the updated ranking of the multi-source database.
[0046] In a preferred embodiment, step S42 further includes the following steps:
[0047] S421. When the knowledge selected by the user belongs to the knowledge graph data, the head entity, relation and tail entity of the triple are concatenated into a sentence and then BERT is used to perform vector transformation to obtain the sentence vector of the knowledge, denoted as Gvec, and the weight is 1.
[0048] S422. When the knowledge selected by the user belongs to one of the three databases—encyclopedia data, literature database data, and national standard data—let P be the i-th knowledge in one of the three databases selected by the user. i , note P i The keyword sequence is W 0 Record the database with a correlation score higher than P. i The sequence of all keywords for the knowledge is W. 1 Let its corresponding word frequency sequence be TF. 1 W 0 W 1 and TF 1 The expression is:
[0049] W 0 ={w 0 1, ww 0 2, ..., w 0 n}
[0050] W 1 ={w 1 1, w 1 2, ..., w 1 m}
[0051] TF 1 ={f 1 1, f 1 2, ..., f 1 m}
[0052] According to W 1 and TF 1 Get W 0 Chinese keywords in W 1 The word frequency in the text is denoted as TF. 0 Its expression is:
[0053] TF 0 ={f 0 1, f 02, ..., f 0 n}
[0054] Find the three keywords with the lowest word frequency, which are w 0 r w 0 s w 0 t Their corresponding word frequencies are f 0 r f 0 s f 0 t When the word frequency is 0, its word frequency weight is set to... When f 0 r f 0 s d 0 t When not all values are 0, calculate the word frequency weight of the three keywords, w. 0 r w 0 s w 0 t The word frequency weight is denoted as t. 0 r , t 0 s , t 0 t The calculation formula is as follows:
[0055]
[0056]
[0057]
[0058] S423: Use the BERT model to analyze the three keywords obtained. 0 r w 0 s w 0 t The text is vectorized to obtain three vectors, denoted as v. 0 r v 0 s v 0 t .
[0059] In the preferred embodiment, step S43 further includes the following steps:
[0060] S431. When the knowledge selected by the user belongs to the knowledge graph data, calculate the cosine distance between the user-selected knowledge vector Gvec and the β-th triplet vector in the knowledge graph knowledge vector sequence that was not selected by the user. Obtain the cosine score between the β-th triplet and the user-selected knowledge, denoted as Gd. α The calculation formula is as follows:
[0061] Gf α =cos <Gvec,gvec 1 α >
[0062] S432. Calculate the cosine distance between the user-selected knowledge vector Gvec and all keyword vectors in the keyword vector sequence KW of all knowledge in the three databases (encyclopedia data, document database data, and national standard data) and Gvec. Multiply this distance by the corresponding weights in KW and sum to obtain the cosine score with respect to the user-selected knowledge, denoted as Gd. β The calculation formula is as follows:
[0063]
[0064] S433. Calculate the cosine distance between all keyword vectors in the keyword vector sequence KW of the user-selected knowledge and the i-th triple vector of the knowledge graph. Multiply this distance by the sum of the corresponding keyword weights in KW to obtain the cosine score of the triple, denoted as Pd. δ Its formula is:
[0065]
[0066] S434. When the knowledge selected by the user does not belong to the knowledge graph data, calculate the i-th keyword vector in the keyword vector sequence KW of the knowledge in the three databases of encyclopedia data, document database data, and national standard data that were not selected by the user, and the vector of the i-th keyword vector in v. 0 r v 0 s v 0 t The cosine distance between them, multiplied by the corresponding weight t 0 r , t 0 s , t 0 t Then the keyword KW was obtained. α The cosine distance, denoted as d α Calculate the relationship between all keywords in the keyword vector sequence KW and v. 0 r v 0 s v 0 tThe cosine distance between the keywords is multiplied by the keyword weights and summed to obtain a pre-scored score, denoted as Pd. γ d α and Pd γ The formula is:
[0067] d α =t 0 r cos <v 0 r KW α >+t 0 s cos <v 0 s KW α >+t 0 t cos <v 0 t KW α >
[0068]
[0069] In the preferred embodiment, step S44 further includes the following steps:
[0070] S441. Obtain the number of selection operations the user has performed, denoted as μ, and record the updated score as y. u ;
[0071] S442. Obtain the sorted scores and score update records of the knowledge that needs to be updated. Assign weights according to the inverted sequence of partial harmonic series, that is, give the highest weight to the operation selected last by the user. Denote this weight sequence as T, and the expression for T is:
[0072]
[0073] If the knowledge selected by the user belongs to the knowledge graph data, the ranking score of a single triplet knowledge in the knowledge graph data will be updated as follows:
[0074]
[0075] Gd α 1 The cosine fraction Gd of the triplet knowledge calculated for the user's first selection operation. α ;
[0076] If the knowledge selected by the user belongs to knowledge graph data, the ranking scores of all knowledge in the three databases—encyclopedia data, literature database data, and national standards data—are updated as follows:
[0077]
[0078] Gd β 1 The cosine fraction Gd of this knowledge is calculated based on the user's first selection operation. β ;
[0079] If the knowledge selected by the user does not belong to the knowledge graph data, the ranking score of a single triplet knowledge in the knowledge graph data will be updated as follows:
[0080]
[0081] Where Pd δ 1 The cosine fraction Pd of the triplet knowledge calculated for the user's first selection operation. δ ;
[0082] If the knowledge selected by the user does not belong to the knowledge graph data, the ranking scores of all knowledge in the three databases—encyclopedia data, literature database data, and national standards data—are updated as follows:
[0083]
[0084] Where Pd γ 1 The cosine fraction Pd of this knowledge is calculated based on the user's first selection operation. γ .
[0085] This invention also proposes an adaptive ranking and recommendation system for multi-source cross-domain knowledge systems, including a database processing module, a correlation score initialization module, and a correlation score iterative update module;
[0086] The database processing module is used to extract content from knowledge bases of different types, and to transform the knowledge from different types of databases into text vectors that can be recognized by computers based on the characteristics of the databases.
[0087] The relevance score initialization module is used to calculate the relevance of knowledge in each database based on the user's search content, and provides an initial recommendation ranking system;
[0088] The relevance score iterative update module is used to record the user's selection operation, calculate the impact of the operation on the relevance score of knowledge in the system, update the relevance score of each knowledge, and re-sort the data in the knowledge base.
[0089] The beneficial effects of this invention are as follows: Based on the idea of reinforcement learning, this invention integrates multiple databases of different categories. It records the knowledge selected by the user and feeds back the knowledge's category and semantic features to the system. The category features of the knowledge are reflected in the fact that when a user selects knowledge from a particular knowledge base, the system considers the category differences between the databases and uses different methods to calculate the relevance of that knowledge to other knowledge bases. After acquiring these features, the system calculates the relevance of these features to other knowledge. The system assigns greater weight to the relevance obtained from the user's current operation and less weight to the relevance obtained from the user's previous operations. The final relevance score is the sum of the step-by-step relevance scores of all previous operations multiplied by their respective weights. Through this mechanism, the system continuously obtains the user's intent and continuously adjusts the order of knowledge, thereby providing the user with a recommendation list that better meets their needs. Attached Figure Description
[0090] Figure 1 This is a flowchart of a method according to an embodiment of the present invention. Detailed Implementation
[0091] Reference Figure 1 This invention provides a method for adaptive ranking and recommendation of multi-source cross-domain knowledge systems based on reinforcement learning, comprising the following steps:
[0092] S1: Extract user input text, obtain search keywords, and vectorize them to obtain search keyword vectors;
[0093] S2: Perform sorting and preprocessing on knowledge from multiple source databases, extract keywords and vectorize keyword text from encyclopedia data, literature database data, and national standard data, and obtain the keyword weights of individual data in the three knowledge bases. Perform text vectorization on triples in knowledge graph data.
[0094] S3: Initialize the knowledge base sorting, calculate the initial relevance score between the search keyword vector and the knowledge in the database, and initialize the recommended sorting of encyclopedia data, literature database data and national standard data accordingly. The knowledge graph data is then sorted based on the initial relevance score calculated according to the search keywords and knowledge completeness.
[0095] S4: Record the user's selection operation, calculate the relevance of the selected knowledge to other knowledge to obtain the operation relevance, sum the operation relevance, previous operation relevance, and initial relevance according to a certain weight, and finally obtain the comprehensive relevance, and recommend and update the knowledge in the knowledge base accordingly;
[0096] S5: Continue recording the user's selection actions and repeat step S4 to update the knowledge base recommendation ranking.
[0097] Furthermore, in step S1, the search keywords and search keyword vectors are obtained by first segmenting the user-input text and removing stop words to obtain several keywords that are set as search keywords by the system. Then, BERT or other word vector models are used to convert the search keywords into vectors, thus obtaining the search keyword vectors.
[0098] Step S2 is as follows:
[0099] S21: Concatenate the head entity, relation, and tail entity of the i-th triple in the knowledge graph data into a sentence, and then use BERT to perform vector transformation to obtain the knowledge graph vector, which is denoted as gvec. 1 i The above processing is performed on all triples in the knowledge graph to obtain a knowledge graph vector sequence, which is denoted as Gvec. 1 Its expression is:
[0100] Gvec 1 ={gvec 1 1, gvec 1 2, ..., gvec 1 n}
[0101] S22: Perform word segmentation and stop word removal on the title of each standard in the national standard data to obtain n words as keywords, and set the weight of each word to 1;
[0102] S23: Combine the title and abstract of each document in the document database;
[0103] S24: Use the TF-IDF algorithm to calculate the keyword weight of each piece of knowledge in the two databases, the literature database and the encyclopedia database, and retain the n words with the highest weights in descending order of weight as the keyword sequence of this knowledge.
[0104] S25: Let t denote the weight of the i-th keyword in the keyword sequence. i Each keyword in the keyword sequence is vectorized using the BERT model, and the vector of the i-th keyword in the keyword sequence is denoted as KW. i Let T be the keyword weight sequence and KW be the keyword vector sequence. The expressions for T and KW are:
[0105] T = {t1, t2, ..., t} n}
[0106] KW = {KW1, KW2, ..., KW} n}
[0107] Step S3 is as follows:
[0108] S31: Denote the sum of the weights of the weight sequence as TS. Normalize the keyword weight sequence of each data point in the encyclopedia data, document database data, and national standard data to obtain a new weight sequence T. 0 The weight of the i-th keyword in the keyword weight sequence is updated to T. i 0 Weight sequence T 0 The expression is:
[0109] T 0 ={T1 0 T2 0 , ..., T n 0}
[0110] The formulas for calculating the weights and TS of a weighted sequence are:
[0111]
[0112] weight t i Updated to t i 0 The calculation formula is:
[0113]
[0114] S32: Let the search keyword vector be denoted as KwVec. Calculate the cosine similarity between the keyword vector in the keyword vector sequence KW of each data point in the encyclopedia data, document database data, and national standard data, and KwVec. The i-th keyword vector in KW... i The cosine similarity calculated with KwVec is Cscore. i The calculation formula is as follows:
[0115] Cscore i =cos < KwVec, KW i >
[0116] The resulting keyword cosine similarity sequence is denoted as C, and the expression for C is:
[0117] C={Cscore1, Cscore2,…, Cscore n}
[0118] S33: The relevance score between each data point and the search keywords obtained from S1 is obtained by multiplying the cosine similarity by the weights of the corresponding keywords and summing the results. This relevance score is denoted as KS0, and the formula for calculating KS0 is as follows:
[0119]
[0120] S34: Based on the search keywords in S1, retrieve all relevant triplet data in the knowledge graph data as candidate triplets;
[0121] S35: Determine the knowledge integrity of each triple in the candidate triples based on whether it belongs to the ontology, rule, attribute, or relation, and obtain the relevance score of the knowledge graph data. Mark the relevance score with KS0.
[0122] S36: Sort the results from highest to lowest according to the relevance score to obtain the initial sort.
[0123] Step S4 is as follows:
[0124] S41: Record the user's current selection operation and determine whether the knowledge selected by the user belongs to the knowledge graph data;
[0125] S42: The knowledge selected by the user is vectorized differently according to the category of the knowledge base;
[0126] S43: Calculate the correlation between the vectorized knowledge and the knowledge that was not selected by the user;
[0127] S44: The weighted relevance score obtained in S43 is combined with the initial relevance score obtained in step S3 to obtain the overall relevance score that has changed due to this selection operation;
[0128] S45: Update the recommended ranking of each database according to the comprehensive correlation score to obtain the updated ranking of the multi-source databases.
[0129] Furthermore, step S42 specifically includes:
[0130] S421: When the knowledge selected by the user belongs to the knowledge graph data, the head entity, relation and tail entity of the triple are concatenated into a sentence and then BERT is used to transform it into a vector to obtain the sentence vector of the knowledge, denoted as Gvec, with a weight of 1.
[0131] S422: When the knowledge selected by the user belongs to one of the three databases—encyclopedia data, literature database data, and national standard data—let P be the i-th knowledge in one of the three databases selected by the user. i , note P i The keyword sequence is W 0 Record the database with a correlation score higher than P. i The sequence of all keywords for the knowledge is W. 1 Let its corresponding word frequency sequence be TF. 1 W 0 W 1 and TF 1 The expression is:
[0132] W0 ={w 0 1, w 0 2, ..., w 0 n}
[0133] W 1 ={w 1 1, w 1 2, ..., w 1 m}
[0134] TF 1 ={f 1 1, f 1 2, ..., f 1 m}
[0135] According to W 1 and TF 1 Get W 0 Chinese keywords in W 1 The word frequency in the text is denoted as TF. 0 Its expression is:
[0136] TF 0 ={f 0 1, f 0 2, ..., f 0 n}
[0137] Find the three keywords with the lowest word frequency, which are w 0 r w 0 s w 0 t Their corresponding word frequencies are f 0 r f 0 s f 0 t When the word frequency is 0, its word frequency weight is set to... When f 0 r f 0 s f 0 t When not all values are 0, calculate the word frequency weight of the three keywords, w. 0 r w 0 s w 0 t The word frequency weight is denoted as t. 0 r , t 0s , t 0 t The calculation formula is as follows:
[0138]
[0139]
[0140]
[0141] S423: Use the BERT model to analyze the three keywords obtained. 0 r w 0 s w 0 t The text is vectorized to obtain three vectors, denoted as v. 0 r v 0 s v 0 t .
[0142] Furthermore, step S43 specifically involves:
[0143] S431: When the knowledge selected by the user belongs to the knowledge graph data, calculate the cosine distance between the user-selected knowledge vector Gvec and the β-th triplet vector in the knowledge graph knowledge vector sequence that was not selected by the user. This yields the cosine score between the β-th triplet and the user-selected knowledge, denoted as Gd. α The calculation formula is as follows:
[0144] Gd α =cos <Gvec,gvec 1 α >
[0145] S432: Calculate the cosine distance between the user-selected knowledge vector Gvec and all keyword vectors in the keyword vector sequence KW of all knowledge in the three databases (encyclopedia data, document database data, and national standard data) and Gvec. Multiply this distance by the corresponding weights in KW to calculate the cosine score with the user-selected knowledge, denoted as Gd. β The calculation formula is as follows:
[0146]
[0147] S433: Calculate the cosine distance between all keyword vectors in the keyword vector sequence KW of the user-selected knowledge and the i-th triple vector in the knowledge graph. Multiply this distance by the sum of the corresponding keyword weights in KW to obtain the cosine score of the triple, denoted as Pd. δ Its formula is:
[0148]
[0149] S434: When the knowledge selected by the user does not belong to the knowledge graph data, calculate the i-th keyword vector in the keyword vector sequence KW of the knowledge in the three databases of encyclopedia data, document database data, and national standard data that were not selected by the user, and then calculate the vector of the i-th keyword vector in v. 0 r v 0 s v 0 t The cosine distance between them, multiplied by the corresponding weight t 0 r , t 0 s , t 0 t Then the keyword KW was obtained. α The cosine distance, denoted as d α Calculate the relationship between all keywords in the keyword vector sequence KW and v. 0 r v 0 s v 0 t The cosine score is obtained by multiplying the cosine distance between keywords by the weight of each keyword and summing the results. This cosine score is denoted as Pd. γ d α and Pd γ The formula is:
[0150] d α =t 0 r cos<v 0 r KW α >+t 0 s cos <v 0 s KW α >+t 0 t cos <v 0 t KW α >
[0151]
[0152] Furthermore, step S44 specifically includes:
[0153] S441: Obtain the number of selection operations the user has made so far, denoted as μ, and record the updated score as y. u ;
[0154] S442: Obtain the sorted scores of the knowledge that needs to be updated and the update records of the scores. Assign weights according to the inverted sequence of the partial harmonic series, that is, give the highest weight to the operation selected last by the user. Denote this weight sequence as T, and the expression for T is:
[0155]
[0156] If the knowledge selected by the user belongs to the knowledge graph data, the ranking score of a single triplet knowledge in the knowledge graph data will be updated as follows:
[0157]
[0158] Gd α 1 The cosine fraction Gd of the triplet knowledge calculated for the user's first selection operation. α ;
[0159] If the knowledge selected by the user belongs to knowledge graph data, the ranking scores of all knowledge in the three databases—encyclopedia data, literature database data, and national standards data—are updated as follows:
[0160]
[0161] Gd β 1 The cosine fraction Gd of this knowledge is calculated based on the user's first selection operation. β ;
[0162] If the knowledge selected by the user does not belong to the knowledge graph data, the ranking score of a single triplet knowledge in the knowledge graph data will be updated as follows:
[0163]
[0164] Where Pd δ 1 The cosine fraction Pd of the triplet knowledge calculated for the user's first selection operation. δ ;
[0165] If the knowledge selected by the user does not belong to the knowledge graph data, the ranking scores of all knowledge in the three databases—encyclopedia data, literature database data, and national standards data—are updated as follows:
[0166]
[0167] Where Pd γ 1 The cosine fraction Pd of this knowledge is calculated based on the user's first selection operation. γ ;
[0168] This invention provides a system for adaptive ranking and recommendation of multi-source cross-domain knowledge systems based on reinforcement learning, comprising the following modules:
[0169] The database processing module is used to extract content from knowledge bases of different types and to transform knowledge from different databases into text vectors that can be recognized by computers based on the characteristics of the databases.
[0170] The relevance score initialization module is used to calculate the relevance of knowledge in each database based on the user's search content, and provides an initial recommendation ranking system;
[0171] The relevance score iterative update module is used to record the user's selection operation, calculate the impact of the operation on the relevance score of knowledge in the system, update the relevance score of each knowledge, and re-sort the data in the knowledge base.
[0172] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0173] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An adaptive ranking and recommendation method for multi-source cross-domain knowledge systems, characterized by: Includes the following steps: S1. Extract user input text, obtain search keywords, and vectorize them to obtain search keyword vectors; S2. Perform sorting and preprocessing on knowledge from multiple source databases, extract keywords and vectorize keyword text, and obtain the keyword weights of individual data in different knowledge bases. S3. Based on the calculated search keyword vector and the initial correlation score between knowledge in the database, initialize the recommendation ranking of different knowledge base data; S4. Record the user's current selection operation and determine whether the knowledge selected by the user belongs to the knowledge graph data; perform different vectorization processing on the knowledge selected by the user according to the different categories of its knowledge base; Calculate the correlation between the vectorized knowledge and the knowledge not selected by the user; calculate the correlation obtained in the weighted calculation step and the initial correlation score obtained in step S3 to obtain the comprehensive correlation score changed due to this selection operation; update the recommendation ranking of each database according to the comprehensive correlation score to obtain the updated ranking of the multi-source database; The knowledge base data includes knowledge graph data and other knowledge base data; step S43 includes: S431. When the knowledge selected by the user belongs to the knowledge graph data, calculate the knowledge vector selected by the user. The first knowledge vector in the knowledge graph sequence that was not selected by the user The cosine distance of the nth triplet vectors is obtained to get the nth... The cosine fraction of each triplet and the user's chosen knowledge is denoted as . The calculation formula is as follows: ; S432, Calculate the knowledge vector selected by the user. Keyword vector sequence of all knowledge in other knowledge base data AND of all keyword vectors Cosine distance, multiplied by The cosine fraction of the knowledge selected by the user is calculated by summing the corresponding weights, and denoted as . The calculation formula is as follows: ; S433, Calculate the keyword vector sequence of the knowledge selected by the user. All keyword vectors and knowledge graphs in the first part The cosine distance of the triple vectors, multiplied by The cosine fraction of the triple is obtained by summing the weights of the corresponding keywords, denoted as . Its formula is: ; S434. When the knowledge selected by the user does not belong to the knowledge graph data, calculate the keyword vector sequence of knowledge in other knowledge base data that were not selected by the user. The Middle Keyword vectors and The cosine distance between them, multiplied by the corresponding weight Then we obtained the keywords The cosine distance is denoted as Calculate the keyword vector sequence All keywords in the text The pre-scoring score is obtained by multiplying the cosine distance between the keywords by their respective weights and summing the results. , and The formula is: ; ; S441. Obtain the number of times the user has made a selection operation, denoted as... Record the updated score after sorting as ; S442. Obtain the sorted scores of the knowledge that needs to be updated and the update records of the scores. Assign weights according to the inverted sequence of the partial harmonic series, that is, give the highest weight to the operation selected by the user last. Record the weight sequence as follows: , The expression is: ; If the knowledge selected by the user belongs to the knowledge graph data, the ranking score of a single triplet knowledge in the knowledge graph data will be updated as follows: ; in The cosine fraction of the triplet knowledge calculated for the user's first selection operation. ; If the knowledge selected by the user belongs to the knowledge graph data, the ranking scores of all knowledge in other knowledge base data are updated as follows: ; in The cosine fraction of this knowledge calculated for the user's first selection operation. ; If the knowledge selected by the user does not belong to the knowledge graph data, the ranking score of a single triplet knowledge in the knowledge graph data will be updated as follows: ; in The cosine fraction of the triplet knowledge calculated for the user's first selection operation. ; If the knowledge selected by the user does not belong to the knowledge graph data, the ranking scores of all knowledge in the three databases—encyclopedia data, literature database data, and national standards data—are updated as follows: ; in The cosine fraction of this knowledge calculated for the user's first selection operation. ; S5. Continue recording the user's selection actions and repeat step S4 to update the knowledge base recommendation ranking.
2. The adaptive ranking and recommendation method for multi-source cross-domain knowledge systems according to claim 1, characterized in that: Other knowledge base data includes: encyclopedia data, literature database data, and national standards data; Step S2 also includes: extracting keywords from encyclopedia data, literature database data, and national standard data, vectorizing keyword text, obtaining the keyword weights of individual data in the three knowledge bases, and vectorizing the triples in the knowledge graph data. Encyclopedia keyword vectors are obtained from encyclopedia data, document keyword vectors are obtained from document database data, and standard keyword vectors are obtained from national standards. Step S3 also includes: initializing the recommended sorting of encyclopedia data, literature database data, and national standard data, while the knowledge graph data is initially sorted based on the search keywords and knowledge completeness by calculating the initial relevance.
3. The adaptive ranking and recommendation method for multi-source cross-domain knowledge systems according to claim 1, characterized in that: Step S2 also includes the following steps: S21, The knowledge graph data of the first... i After concatenating the head entity, relation, and tail entity of each triple into a sentence, BERT is used to transform it into a knowledge graph vector, which is denoted as [vector]. The above processing is applied to all triples in the knowledge graph to obtain a knowledge graph vector sequence, which is denoted as... Its expression is: ; S22. Perform word segmentation and stop word removal on the title of each standard in the national standard data to obtain n words as keywords, and set the weight of each word to 1. S23. Combine the title and abstract of each document in the document database; S24. Use the TF-IDF algorithm to calculate the keyword weight of each piece of knowledge in the two databases, the literature database and the encyclopedia database, and retain the n words with the highest weights in descending order of weight as the keyword sequence of this knowledge. S25. Denote the weight of the i-th keyword in the keyword sequence as... Each keyword in the keyword sequence is vectorized using the BERT model, and the vector of the i-th keyword in the keyword sequence is denoted as... The keyword weight sequence is denoted as The keyword vector sequence is denoted as , and The expression is: ; 。 4. The adaptive ranking and recommendation method for multi-source cross-domain knowledge systems according to claim 1, characterized in that: Step S3 also includes the following steps: S31. Let the sum of the weights of the weight sequence be denoted as... The keyword weight sequences of each data point from encyclopedia data, literature database data, and national standard data are normalized to obtain new weight sequences. The weight of the i-th keyword in the keyword weight sequence is updated to... Weight sequence The expression is: Weights of the weight sequence The calculation formula is: Weight Updated to The calculation formula is: S32. Denote the search keyword vector as... Calculate the keyword vector sequence for each piece of data in encyclopedia data, literature database data, and national standard data. Keyword vectors and The cosine similarity is derived from The i-th keyword vector and The calculated cosine similarity is: The calculation formula is as follows: The keyword cosine similarity sequence is denoted as , The expression is: S33. The relevance score between each data point and the search keywords obtained from S1 is obtained by multiplying the cosine similarity by the weights of the corresponding keywords and summing the results. The relevance score is denoted as... , The calculation formula is: S34. Based on the search keywords in S1, retrieve all relevant triplet data in the knowledge graph data as candidate triplets; S35. Determine the knowledge completeness of each triple in the candidate triples based on whether it belongs to an ontology, rule, attribute, or relation, and obtain the relevance score of the knowledge graph data. Then, use the relevance score as... mark; S36. Sort the results from highest to lowest according to the correlation score to obtain the initial sort.
5. The adaptive ranking and recommendation method for multi-source cross-domain knowledge systems according to claim 1, characterized in that: Step S42 also includes the following steps: S421. When the knowledge selected by the user belongs to knowledge graph data, the head entity, relation, and tail entity of the triple are concatenated into a sentence, and then BERT is used for vector transformation to obtain the sentence vector of that knowledge, denoted as... The weight is denoted as 1; S422. When the knowledge selected by the user belongs to data in other knowledge bases, let the i-th knowledge in a certain database of the other knowledge base selected by the user be denoted as... ,remember The keyword sequence is Record the database with a correlation score higher than The sequence of all keywords for the knowledge is Let its corresponding word frequency sequence be denoted as , , and The expression is: ; ; ; according to and get Chinese keywords in The word frequency in the text is denoted as Its expression is: ; Find the three keywords with the lowest word frequency, namely: , The corresponding word frequencies are respectively When the word frequency is 0, then its word frequency weight is set to... ;when When not all values are 0, calculate the word frequency weights of the three keywords. , The word frequency weight is denoted as The calculation formula is as follows: ; ; ; S423: Using the BERT model to analyze the three keywords obtained , Text vectorization is performed, resulting in three vectors denoted as... .
6. An adaptive ranking and recommendation system for multi-source cross-domain knowledge systems, characterized by: It includes a database processing module, a correlation score initialization module, and a correlation score iterative update module; The database processing module is used to extract content from knowledge bases of different types, and to transform the knowledge from different types of databases into text vectors that can be recognized by computers based on the characteristics of the databases. The relevance score initialization module is used to calculate the relevance of knowledge in each database based on the user's search content, and provides an initial recommendation ranking system; The relevance score iterative update module is used to record the user's selection operation, calculate the impact of the operation on the relevance score of knowledge in the system, update the relevance score of each knowledge, and re-sort the data in the knowledge base. The correlation score iterative update module specifically includes the following steps: When the knowledge selected by the user belongs to the knowledge graph data, calculate the knowledge vector selected by the user. The first knowledge vector in the knowledge graph sequence that was not selected by the user The cosine distance of the nth triplet vectors is obtained to get the nth... The cosine fraction of each triplet and the user's chosen knowledge is denoted as . The calculation formula is as follows: ; Calculate the knowledge vector selected by the user Keyword vector sequence of all knowledge in other knowledge base data AND of all keyword vectors Cosine distance, multiplied by The cosine fraction of the knowledge selected by the user is calculated by summing the corresponding weights, and denoted as . The calculation formula is as follows: ; Calculate the keyword vector sequence of the knowledge selected by the user. All keyword vectors and knowledge graphs in the first part The cosine distance of the triple vectors, multiplied by The cosine fraction of the triple is obtained by summing the weights of the corresponding keywords, denoted as . Its formula is: ; When the knowledge selected by the user does not belong to the knowledge graph data, calculate the keyword vector sequence of knowledge from other knowledge base data that were not selected by the user. The Middle Keyword vectors and The cosine distance between them, multiplied by the corresponding weight Then we obtained the keywords The cosine distance is denoted as Calculate the keyword vector sequence All keywords in the text The pre-scoring score is obtained by multiplying the cosine distance between the keywords by their respective weights and summing the results. , and The formula is: ; ; Get the number of times the user has made a selection, denoted as . Record the updated score after sorting as ; Retrieve the sorted scores of the knowledge that needs updating and the update records of those scores. Assign weights according to the inverted sequence of partial harmonic series, that is, give the highest weight to the operation selected last by the user. Record the weight sequence as follows: , The expression is: ; If the knowledge selected by the user belongs to the knowledge graph data, the ranking score of a single triplet knowledge in the knowledge graph data will be updated as follows: ; in The cosine fraction of the triplet knowledge calculated for the user's first selection operation. ; If the knowledge selected by the user belongs to the knowledge graph data, the ranking scores of all knowledge in other knowledge base data are updated as follows: ; in The cosine fraction of this knowledge calculated for the user's first selection operation. ; If the knowledge selected by the user does not belong to the knowledge graph data, the ranking score of a single triplet knowledge in the knowledge graph data will be updated as follows: ; in The cosine fraction of the triplet knowledge calculated for the user's first selection operation. ; If the knowledge selected by the user does not belong to the knowledge graph data, the ranking scores of all knowledge in the three databases—encyclopedia data, literature database data, and national standards data—are updated as follows: ; in The cosine fraction of this knowledge calculated for the user's first selection operation. .
Citation Information
Patent Citations
Intelligent consultation method and device, and computer storage medium
CN109346170A
Knowledge graph construction method for intelligent power grid customer service questions and answers
CN110457442A