Knowledge base content recommendation method and system based on large model and subdivision field matching
By automatically extracting content feature words and determining subdivided fields through a large model-based method, the problem of relying on manual annotation data and difficulty in covering subdivided fields in the existing technology is solved, low-cost and accurate content recommendation is achieved, and user experience and system intelligence are improved.
Patent Information
- Application Number
- CN202411641818.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-03-11
AI Technical Summary
Existing content recommendation methods rely on a large amount of manual labeling data, which is expensive and difficult to cover all subdivided fields, and the recommended content lacks interpretability.
Using a large model-based method, we automatically extract content feature words and use the large model to quickly determine professional subdivided fields, so as to accurately recommend relevant content in related fields and generate recommendation reasons.
It realizes automated and low-cost accurate content recommendations, without the need for a large amount of manual data, and can be widely used in knowledge base systems in multiple vertical fields, significantly improving the user experience and system intelligence level.
Smart Images

Figure CN119599119A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of digital publishing technology, and in particular relates to a knowledge base content recommendation method and system based on matching a large model with segmented fields. Background Art
[0002] Existing content recommendation methods are usually implemented based on methods such as knowledge graphs, and often rely on a large amount of manually annotated data. Their data processing and computing costs are usually expensive, making it difficult to cover all sub-sectors, and the recommended content is not explainable. Summary of the invention
[0003] The purpose of the present invention is to provide a knowledge base content recommendation method and system based on matching a large model with segmented fields, which automatically extracts content feature words and uses a large model to quickly determine professional segmented fields, thereby accurately recommending relevant content in related fields and generating recommendation reasons to improve user experience and recommendation efficiency.
[0004] The present invention provides a knowledge base content recommendation method based on matching a large model with a segmented field, comprising the following steps:
[0005] Step 1: automatically extract key content feature words from the original content currently read by the user based on a feature word weighted extraction algorithm; the content feature words include one or more core themes representing the content;
[0006] Step 2, forming prompt words based on the characteristic words and the names of the subdivided fields, and determining the professional subdivided fields according to the prompt words;
[0007] Step 3: for each determined sub-field, a semantic similarity retrieval algorithm is used to search for content related to the feature word in the corresponding database or knowledge base, and the top M most relevant results are extracted to obtain the top M search results in the sub-field;
[0008] Step 4: Based on the feature words and the first M search results in the subdivided fields, prompt words are formed, and the relevance of the first M search results to the user's current reading content is evaluated according to the prompt words. The first L most relevant results are calculated from the M search results as recommended content, and corresponding recommendation reasons are generated;
[0009] Step 5: Summarize the recommended content determined in each segment and save it in the database for quick subsequent retrieval;
[0010] Step 6: retrieve recommended content in each sub-field from the database and display it to users when they read the knowledge base content.
[0011] Furthermore, the step 2 comprises:
[0012] Preset the big model prompt word template, input all feature word parameters, input all segment field name parameters to form a complete prompt word, and the big model generates the segment field return value based on the prompt word.
[0013] Furthermore, the step 2 also includes: returning at most N sub-fields through prompt word template setting.
[0014] Furthermore, the step 4 comprises:
[0015] Using the big model, a big model prompt word template is preset, all feature word parameters are input, and the parameters of the first M search results in the segmented field are input to form a complete prompt word. The big model evaluates the relevance of the first M search results to the user's current reading content based on the prompt word, calculates the first L most relevant results from the M search results as recommended content, and generates corresponding recommendation reasons.
[0016] Furthermore, the step 6 comprises:
[0017] Based on user permissions and terminal window size, the number of appropriate segments and recommended content are displayed in the relevant recommendation area.
[0018] Furthermore, the feature word weighted extraction algorithm process in step 1 includes:
[0019] 1) Calculate the contribution value of each keyword each time it appears:
[0020] For the kth occurrence of the ith keyword, its contribution value Cik is defined as:
[0021]
[0022] Among them, P ik is the position of the i-th keyword when it appears for the kth time; α is a parameter to adjust the importance of the position, so that the closer the position is, the higher the P ik The smaller it is, the greater the contribution value; is the normalized frequency, which is used to ensure that the frequency contributions of all keywords are on the same scale, and F i is the total frequency of the i-th keyword; N is the total number of keywords;
[0023] 2) Calculate the total correlation S:
[0024] Add up the contribution values of all occurrences of all keywords to get the total relevance S:
[0025]
[0026] Among them, Mi is the number of times the i-th keyword appears, that is, the frequency F i The specific number of times; denominator is the total number of times the keyword appears, which is used for normalization so that the value of S is between 0 and 1.
[0027] Furthermore, the semantic similarity retrieval algorithm process in step 3 includes:
[0028] (1) Data preprocessing:
[0029] Clean and segment the collected text data to remove noise and redundant information and improve the quality of text vectors;
[0030] (2) Text segmentation:
[0031] Segment the preprocessed text into smaller units, including sentences, paragraphs, or text blocks defined according to specific rules;
[0032] (3) Text clue injection:
[0033] Based on text segmentation, additional clue information is injected into the text block, including keywords, metadata, and context features;
[0034] (4) Text vectorization:
[0035] The bge_large_zh model is used to convert the preprocessed text data into vector representation, and each text or text fragment is converted into a vector of fixed length as the basis for retrieval;
[0036] (5) Vector index construction:
[0037] Import text vectors and their corresponding text IDs into the Elasticsearch index;
[0038] (6) Similarity search:
[0039] When the user enters a query text, the bge_large_zh model is also used to convert it into a vector, and the vector search function of Elasticsearch is used to calculate the similarity between the query vector and all text vectors in the index. The results are then sorted according to the similarity score and returned to the user.
[0040] The present invention also provides a knowledge base content recommendation system based on matching a large model with a segmented field, characterized in that it includes a recommendation module, and the recommendation module executes the knowledge base content recommendation method based on matching a large model with a segmented field.
[0041] The present invention also provides a non-transitory computer-readable storage medium, which stores computer instructions. When the computer instructions are executed by a processor, the method for recommending knowledge base content based on matching a large model with a segmented field is implemented.
[0042] The present invention also provides an electronic device, comprising:
[0043] A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the knowledge base content recommendation method based on matching a large model with a segmented field by executing the computer instructions.
[0044] Through the above solution, through the knowledge base content recommendation method and system based on the matching of large models and subdivided fields, in the knowledge base system, when a user reads a professional content, the content related to the professional level can be accurately recommended based on the content, and the reasons for the recommendation can be given. It can realize automatic, low-cost accurate recommendation without the need for a large amount of manual annotation data, and can be widely used in knowledge base systems in multiple vertical fields such as medicine, justice, finance, agriculture, etc., significantly improving the user experience and the intelligence level of the system.
[0045] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention and implement it according to the contents of the specification, the following is a detailed description of the preferred embodiments of the present invention in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 A flowchart of the knowledge base content recommendation method based on matching of a large model with subdivided fields according to the present invention;
[0047] Figure 2 It is a schematic diagram of the structure of the electronic device of the present invention. DETAILED DESCRIPTION
[0048] The specific implementation of the present invention is further described in detail below in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.
[0049] Ginseng Figure 1 As shown, this embodiment provides a knowledge base content recommendation method based on matching a large model with a segmented field, including the following steps:
[0050] Step S1, extracting feature words: automatically extracting key content feature words from the original content currently read by the user based on a feature word weighted extraction algorithm; the content feature words include one or more core themes representing the content.
[0051] For example, for a medical content about "atrial fibrillation", feature words may include "atrial fibrillation", "hypertension", "coronary heart disease", "amiodarone", "radiofrequency ablation", etc.
[0052] Step S2, determining the professional subdivision field: forming prompt words based on the characteristic words and the subdivision field name, and determining the professional subdivision field according to the prompt words.
[0053] Specifically:
[0054] Preset the large model prompt word template, enter all feature word parameters, enter all subdivision field name parameters, form a complete prompt word, and the large model generates the subdivision field return value based on the prompt word. You can set the prompt word template to return up to N subdivision fields.
[0055] For example: input the feature words "atrial fibrillation, hypertension, coronary heart disease, amiodarone, radiofrequency ablation", input all the sub-field names "disease knowledge, typical cases, symptoms and signs, tests, etc.", the model may return "disease knowledge", "guideline consensus", "cardiovascular medicine", "drug information", "surgical operation" and other sub-fields.
[0056] Step S3, search in the sub-database of the subdivided field: for each determined sub-field, use the semantic similarity retrieval algorithm to search for content related to the feature word in the corresponding database or knowledge base, and extract the top M most relevant results to obtain the top M search results of the sub-field.
[0057] For example, in the "Disease Knowledge" domain sub-database, the keyword "atrial fibrillation" and semantic similarity calculation are used to retrieve the top 20 most relevant contents.
[0058] Step S4, determine the recommended content in the segmented field: based on the feature words and the first M search results in the segmented field, form prompt words, evaluate the relevance of the first M search results to the user's current reading content based on the prompt words, calculate the first L most relevant results from the M search results as recommended content, and generate corresponding recommendation reasons.
[0059] Specifically:
[0060] Use the big model again, preset the big model prompt word template, input all feature word parameters, input the parameters of the top M search results in the segmented field, form a complete prompt word, and use the big model to evaluate the relevance of these results to the user's current reading content based on the prompt words, calculate the top L most relevant results from the M search results as recommended content, and generate corresponding recommendation reasons.
[0061] For example, after model evaluation, 3 most relevant contents were selected from the 20 contents in the "Disease Knowledge" domain sub-library. They may be "1. [Disease term] Premature atrial contraction: Both arrhythmia and atrial fibrillation, with strong correlation", "2. [Disease term] Ventricular flutter and ventricular fibrillation: Both are abnormal cardiac electrical activity, understanding is helpful for comparative treatment", "3. [Disease term] Sinoatrial block: Both are problems of the cardiac conduction system, which helps to fully understand cardiac electrophysiology".
[0062] Step S5, summarizing the results and storing them in the database: Summarize the recommended contents determined in each segment field and save them in the database for quick subsequent retrieval.
[0063] Step S6, front-end window display: retrieve recommended content in each sub-field from the database and display it to users when they read the knowledge base content.
[0064] When users read the knowledge base content, recommended content in each segmented field is retrieved from the database, and an appropriate number of segments and recommended content are displayed in the "Related Recommendations" area based on user permissions and terminal window size.
[0065] In this embodiment, the feature word weighted extraction algorithm is based on the vocabulary of professional fields, matches relevant keywords from the original content, records the position P and frequency F information of the keywords, sets the position and frequency weight W, and calculates the relevance value S. S is a floating point number between 0 and 1. Finally, sorting is performed. The specific process is as follows:
[0066] 1) Calculate the contribution value of each keyword each time it appears:
[0067] For the kth occurrence of the ith keyword, define its contribution value C ik for:
[0068]
[0069] Among them, P ik is the position of the ith keyword when it appears for the kth time (the earlier the position, the more important it is usually); α is a parameter to adjust the importance of the position (for example, α = 0.1), so that the earlier the position, the more important it is. ik The smaller it is, the greater the contribution value; is the normalized frequency, which is used to ensure that the frequency contributions of all keywords are on the same scale, and F i is the total frequency of the i-th keyword; N is the total number of keywords;
[0070] 2) Calculate the total correlation S:
[0071] Add up the contribution values of all occurrences of all keywords to get the total relevance S:
[0072]
[0073] Among them, Mi is the number of times the i-th keyword appears, that is, the frequency F i The specific number of times; denominator is the total number of times the keyword appears, which is used for normalization so that the value of S is between 0 and 1.
[0074] In this embodiment, the semantic similarity retrieval algorithm consists of text preprocessing, text segmentation, text clue injection, text vectorization (using the bge_large_zh model), building an Elasticsearch vector index, and similarity retrieval. The characteristic is that it combines the semantic understanding ability of the deep learning model and the efficient retrieval ability of Elasticsearch to ensure the completeness of the vector information of each text unit, realize accurate semantic retrieval, and improve the relevance, accuracy, and recall rate of the retrieval results. The specific process is as follows:
[0075] (1) Data preprocessing:
[0076] The collected text data is preprocessed by cleaning, word segmentation and other operations to remove noise and redundant information and improve the quality of text vectors.
[0077] (2) Text segmentation:
[0078] Split the preprocessed text into smaller units such as sentences, paragraphs, or text blocks defined according to specific rules.
[0079] (3) Text clue injection:
[0080] Based on text segmentation, additional clue information is injected into the text block, including keywords, metadata, contextual features, etc.
[0081] (4) Text vectorization:
[0082] The bge_large_zh model is used to convert the preprocessed text data into vector representation, and each text or text fragment is converted into a vector of fixed length, which will be used as the basis for retrieval.
[0083] (5) Vector index construction:
[0084] Import the text vector and its corresponding text ID (or other unique identifier) into the Elasticsearch index. When building the index, you need to consider factors such as the vector's storage format and query performance.
[0085] (6) Similarity search:
[0086] When the user enters a query text, the bge_large_zh model is also used to convert it into a vector, and the vector search function of Elasticsearch is used to calculate the similarity between the query vector and all text vectors in the index. The results are then sorted according to the similarity score and returned to the user.
[0087] Through the knowledge base content recommendation method and system based on matching large models with subdivided fields, in the knowledge base system, when a user reads a piece of professional content, the user can accurately recommend content related to the professional level based on the content and give reasons for the recommendation. It can achieve automatic, low-cost and accurate recommendations without the need for a large amount of manual annotation data, and can be widely used in knowledge base systems in multiple vertical fields such as medicine, justice, finance, agriculture, etc., significantly improving the user experience and the intelligence level of the system.
[0088] The present invention also provides a knowledge base content recommendation system based on matching a large model with a segmented field, characterized in that it includes a recommendation module, and the recommendation module executes the knowledge base content recommendation method based on matching a large model with a segmented field.
[0089] The present invention also provides a non-transitory computer-readable storage medium, which stores computer instructions. When the computer instructions are executed by a processor, the method for recommending knowledge base content based on matching a large model with a segmented field is implemented.
[0090] The present invention also provides an electronic device, comprising:
[0091] A memory 201 and a processor 202, wherein the memory 201 and the processor 202 are communicatively connected to each other, the memory 201 stores computer instructions, and the processor 202 executes the computer instructions to execute the knowledge base content recommendation method based on matching a large model with a segmented field.
[0092] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the technical principles of the present invention, and these improvements and modifications should also be regarded as within the scope of protection of the present invention.
Claims
1. A knowledge base content recommendation method based on matching a large model with a segmented field, characterized in that: The steps include: Step 1: automatically extract key content feature words from the original content currently read by the user based on a feature word weighted extraction algorithm; the content feature words include one or more core themes representing the content; Step 2, forming prompt words based on the characteristic words and the names of the subdivided fields, and determining the professional subdivided fields according to the prompt words; Step 3: for each determined sub-field, a semantic similarity retrieval algorithm is used to search for content related to the feature word in the corresponding database or knowledge base, and the top M most relevant results are extracted to obtain the top M search results in the sub-field; Step 4: Based on the feature words and the first M search results in the subdivided fields, prompt words are formed, and the relevance of the first M search results to the user's current reading content is evaluated according to the prompt words. The first L most relevant results are calculated from the M search results as recommended content, and corresponding recommendation reasons are generated; Step 5: Summarize the recommended content determined in each segment and save it in the database for quick subsequent retrieval; Step 6: retrieve recommended content in each sub-field from the database and display it to users when they read the knowledge base content.
2. The method for recommending knowledge base content based on matching a large model with subdivided fields according to claim 1, characterized in that: The step 2 comprises: Preset the big model prompt word template, input all feature word parameters, input all segment field name parameters to form a complete prompt word, and the big model generates the segment field return value based on the prompt word.
3. The method for recommending knowledge base content based on matching a large model with subdivided fields according to claim 2, characterized in that: The step 2 also includes: returning at most N subdivision fields through prompt word template setting.
4. The method for recommending knowledge base content based on matching a large model with subdivided fields according to claim 3 is characterized in that: The step 4 comprises: Using the big model, a big model prompt word template is preset, all feature word parameters are input, and the parameters of the first M search results in the segmented field are input to form a complete prompt word. The big model evaluates the relevance of the first M search results to the user's current reading content based on the prompt word, calculates the first L most relevant results from the M search results as recommended content, and generates corresponding recommendation reasons.
5. The method for recommending knowledge base content based on matching a large model with subdivided fields according to claim 1, characterized in that: The step 6 comprises: Based on user permissions and terminal window size, the number of appropriate segments and recommended content are displayed in the relevant recommendation area.
6. The method for recommending knowledge base content based on matching a large model with subdivided fields according to claim 1, characterized in that: The feature word weighted extraction algorithm process described in step 1 includes: 1) Calculate the contribution value of each keyword each time it appears: For the kth occurrence of the ith keyword, its contribution value Cik is defined as: Among them, P ik is the position of the i-th keyword when it appears for the kth time; α is a parameter to adjust the importance of the position, so that the closer the position is, the higher the P ik The smaller it is, the greater the contribution value; is the normalized frequency, which is used to ensure that the frequency contributions of all keywords are on the same scale, and F i is the total frequency of the i-th keyword; N is the total number of keywords; 2) Calculate the total correlation S: Add up the contribution values of all occurrences of all keywords to get the total relevance S: Among them, M i is the number of times the i-th keyword appears, that is, the frequency F i The specific number of times; denominator is the total number of times the keyword appears, which is used for normalization so that the value of S is between 0 and 1.
7. The method for recommending knowledge base content based on matching a large model with subdivided fields according to claim 6, characterized in that: The semantic similarity retrieval algorithm process described in step 3 includes: (1) Data preprocessing: Clean and segment the collected text data to remove noise and redundant information and improve the quality of text vectors; (2) Text segmentation: Segment the preprocessed text into smaller units, including sentences, paragraphs, or text blocks defined according to specific rules; (3) Text clue injection: Based on text segmentation, additional clue information is injected into the text block, including keywords, metadata, and context features; (4) Text vectorization: The bge_large_zh model is used to convert the preprocessed text data into vector representation, and each text or text fragment is converted into a vector of fixed length as the basis for retrieval; (5) Vector index construction: Import text vectors and their corresponding text IDs into the Elasticsearch index; (6) Similarity search: When the user enters a query text, the bge_large_zh model is also used to convert it into a vector, and the vector search function of Elasticsearch is used to calculate the similarity between the query vector and all text vectors in the index. The results are then sorted according to the similarity score and returned to the user.
8. A knowledge base content recommendation system based on matching large models with subdivided fields, characterized in that: It includes a recommendation module, which executes the knowledge base content recommendation method based on matching a large model with a segmented field as described in any one of claims 1 to 7.
9. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium stores computer instructions, which, when executed by a processor, implement a knowledge base content recommendation method based on matching a large model with a segmented field as described in any one of claims 1 to 7.
10. An electronic device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the knowledge base content recommendation method based on matching a large model with a segmented field as described in any one of claims 1 to 7 by executing the computer instructions.
Citation Information
Cited By
Method and system for completing searching according to fuzzy significance label by using AI large model
CN120386810A
Intelligent prompting method and system, computer equipment and storage medium
CN120744105A
Schematic circuit diagram retrieval method and device and medium
CN121524305A