Professional domain database retrieval method based on big language model knowledge enhancement, electronic equipment and medium
Through the knowledge enhancement method of large language model, the problems of low manual efficiency and incomplete external knowledge base in large-scale field comprehensive database search are solved, and more efficient and stable data retrieval performance is achieved, which is suitable for databases in different professional fields.
Patent Information
- Application Number
- CN202411247254.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2044-09-06
AI Technical Summary
The prior art has problems such as low manual search efficiency, limitations in keyword and data description, and imperfect external knowledge bases in data retrieval of large-scale field comprehensive databases, resulting in unstable search performance and insufficient universality.
Using a knowledge enhancement method based on a large language model, the data prompt text and query prompt text are generated by obtaining keywords and descriptions in the database, and feature extraction and weighting fusion are used for natural language processing models to calculate the response text features and query text features. The similarity of the data with the highest similarity is derived as the search result.
It improves the efficiency and performance of data retrieval, overcomes the limitations of database self-set keywords and data descriptions, improves the credibility and versatility of search results, and reduces the dependence on search personnel's experience and external knowledge base.
Smart Images

Figure CN119226500A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of data retrieval, and in particular relates to a professional field database retrieval method, electronic equipment, and medium based on large language model knowledge enhancement. Background Art
[0002] With the development of intelligent technology in the field of science and technology, more and more large-scale public comprehensive databases have emerged, such as the UK Biobank (UKB) in the field of life sciences, the China Kadoorie Biobank (CKB) in the field of chronic disease prospective study, and the high spatial resolution global weather and climate database (WorldClim) in the field of meteorological science. The data scale of comprehensive databases in the field is huge and the data types are complicated, but the database itself only presets the search code (such as keywords) and the search standard field information (such as data description) for each type of data. In order to fully and reasonably utilize these professional and large-scale comprehensive databases, effective data retrieval methods have become particularly important.
[0003] At present, the data retrieval methods for large-scale comprehensive databases have the following problems:
[0004] 1. Traditional manual retrieval methods are mainly performed by researchers or field practitioners as searchers, who use their own field knowledge and professional experience to search field databases. This is time-consuming and laborious when processing large-scale comprehensive databases, and the quality of the search results is easily affected by the professional ability of the searchers.
[0005] 2. Although searching by keyword semantic similarity can quickly process large-scale comprehensive databases, its performance is easily limited by the database's own keywords and data descriptions. If there are few keywords or the description is too brief, the algorithm's search performance will be greatly affected. In addition, this method is also easily affected by the query language entered by the user. If the query language is too simple or vague, it will also lead to problems such as retrieval mismatch and omission.
[0006] 3. The method of using a large model to construct a high-dimensional feature vector for semantic similarity matching is also susceptible to the limitations of the database's self-set keywords and data descriptions. The limitations of the database's self-set search fields can be compensated by injecting external knowledge, but if the knowledge base is incomplete or incomplete, the credibility of the search results will be reduced. In addition, different external knowledge bases need to be independently set up for different databases to fine-tune and train the model, which lacks universality. Summary of the invention
[0007] In view of the deficiencies in the prior art, the present invention provides a professional field database retrieval method, electronic device, and medium based on large language model knowledge enhancement.
[0008] In a first aspect, an embodiment of the present invention provides a professional domain database retrieval method based on large language model knowledge enhancement, the method comprising:
[0009] Obtain keywords and descriptions corresponding to each type of data in the target domain database, and match keywords and descriptions corresponding to each type of data with data links and content to obtain an SQL table for the target domain; define a first corpus template, and concatenate keywords and descriptions based on the first corpus template to obtain data prompt text;
[0010] A second corpus template is defined, and the query text input by the user is concatenated based on the second corpus template to obtain a query prompt text;
[0011] Inputting the data prompt text and the query prompt text into the large language model to generate the response text and the retrieval text respectively;
[0012] Inputting the query text, the retrieval text and the response text into the natural language processing model respectively to generate query text features, retrieval text features and response text features;
[0013] Perform weighted fusion on query text features and retrieval text features to obtain fused text features;
[0014] The similarity between the fused text features and the response text features is calculated, and the data corresponding to the top K response text features with the highest similarity are exported from the SQL table as the retrieval results.
[0015] In a second aspect, an embodiment of the present invention provides an electronic device, comprising a memory and a processor, characterized in that the memory is coupled to the processor; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the above-mentioned professional field database retrieval method based on large language model knowledge enhancement.
[0016] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, characterized in that when the program is executed by a processor, the professional field database retrieval method based on large language model knowledge enhancement is implemented.
[0017] In a fourth aspect, an embodiment of the present invention provides a computer program product, including a computer program / instructions, characterized in that when the computer program / instructions are executed by a processor, the above-mentioned professional field database retrieval method based on large language model knowledge enhancement is implemented.
[0018] Compared with the prior art, the present invention has the following beneficial effects:
[0019] (1) The present invention obtains keywords and descriptions of different types of data in the database, inputs the query text, retrieval text and response text into the natural language processing model respectively, generates query text features, retrieval text features and response text features, and performs knowledge reasoning through a large language model. By utilizing the knowledge base and context understanding capabilities of the large language model, more relevant background information and details can be obtained to better understand the user's query intent. At the same time, the limitations of the self-set keywords and data descriptions of professional domain databases can be overcome, effectively improving retrieval performance.
[0020] (2) The query text features and the retrieval text features are weightedly fused to obtain fused text features. The fused text features are then matched with the response text features for similarity, which can quickly process large-scale comprehensive databases and effectively improve data utilization efficiency.
[0021] (3) The present invention improves database retrieval performance based on the domain knowledge of the large language model. There is no need to set up an external knowledge base for different professional databases, nor is there any need to train or fine-tune the large language model. It has stronger versatility and wider application scenarios. At the same time, the present invention makes full use of the domain knowledge of the large language model for retrieval, and uses the model domain knowledge to improve the semantic matching performance between query statements and retrieval content. It is not easily affected by the search personnel's own lack of experience or the imperfection of the external knowledge base, and the retrieval performance is more stable and reliable. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0023] Figure 1 It is a first schematic diagram of a professional field database retrieval method based on large model knowledge enhancement provided by an embodiment;
[0024] Figure 2 is a second schematic diagram of a professional field database retrieval method based on large model knowledge enhancement provided by an embodiment;
[0025] Figure 3 It is a schematic diagram of the flow of generating data prompt text and response text provided by the embodiment;
[0026] Figure 4 It is a schematic diagram of the flow of generating query prompt text and search text provided by the embodiment;
[0027] Figure 5 is a schematic diagram of an electronic device provided by an embodiment. DETAILED DESCRIPTION
[0028] 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.
[0029] It should be noted that, in the absence of conflict, the features in the following embodiments and implementations may be combined with each other.
[0030] like Figure 1 and Figure 2 As shown, an embodiment of the present invention provides a professional domain database retrieval method based on large language model knowledge enhancement, the method comprising:
[0031] Step S1, obtain the keywords and descriptions corresponding to each type of data in the target domain database, and match the keywords and descriptions corresponding to each type of data with the data link and content to obtain the SQL table of the target domain; define a first corpus template, and concatenate the keywords and descriptions based on the first corpus template to obtain data prompt text.
[0032] Furthermore, the target field databases include: the UK Biobank (UKBiobank, UKB) in the field of life sciences, the China Kadoorie Biobank (CKB) in the field of chronic disease prospective study, the high spatial resolution global weather and climate database (WorldClim) in the field of meteorological sciences, and so on.
[0033] Furthermore, the first corpus template is an imperative sentence or a question sentence.
[0034] Step S2, defining a second corpus template, and concatenating the query text based on the second corpus template to obtain a query prompt text.
[0035] Furthermore, the step S2 comprises:
[0036] According to the size and scope of the target domain database, set the number parameter N of generated search texts;
[0037] A second corpus template is defined, where the second corpus template is a command sentence or a question sentence, and the query text is concatenated with the quantity parameter N to obtain a query prompt text.
[0038] Step S3, inputting the data prompt text and the query prompt text into the large language model respectively, and generating a response text and a search text respectively.
[0039] Specifically, the data prompt text is input into the large language model to generate knowledge-enhanced response text;
[0040] The query prompt text is input into the large language model, and N knowledge-enhanced retrieval texts are obtained according to the quantity parameter N.
[0041] Step S4, inputting the query text, the search text and the response text into the natural language processing model respectively, generating query text features, search text features and response text features.
[0042] Furthermore, the step S4 comprises:
[0043] Input the query text and the search text into the natural language processing model respectively, and obtain the feature vector of each text unit in the query text and the search text;
[0044] Input the response text into the natural language processing model to obtain the feature vector of each text unit in the response text;
[0045] For a natural language processing model containing a special unit [CLS], the feature vector corresponding to the text unit [CLS] is used as a high-dimensional feature vector of the text;
[0046] For a natural language processing model that does not contain a special unit [CLS], the average value of the feature vectors corresponding to all text units is used as the high-dimensional feature vector of the text.
[0047] Step S5, weighted fusion of the query text features and the retrieval text features to obtain fused text features.
[0048] Furthermore, the query text features and the retrieval text features are weighted and fused, and the expression is as follows:
[0049]
[0050] In the formula, M is the fusion text feature vector, N is the number of generated retrieved texts, λ is the query text weight, and d k is the kth retrieval text generated by the large language model, f(.) is the vectorization operation, and q is the query text.
[0051] Step S6, calculating the similarity between the fused text features and the response text features, and exporting the data corresponding to the first K response text features with the highest similarity from the SQL table as the retrieval result.
[0052] Furthermore, in this example, the Euclidean distance or the cosine distance is used to calculate the similarity between the fused text feature and the response text feature.
[0053] Among them, the expression for calculating the Euclidean distance is as follows:
[0054]
[0055] The expression for calculating the cosine distance is as follows:
[0056]
[0057] In the formula, r i is the i-th dimension feature of the response text feature R, m i is the i-th dimension feature of the fused text feature M, and P is the dimension of the high-dimensional feature vector.
[0058] According to the calculation result of similarity, the data corresponding to the K response texts with the highest similarity are used as the query result of the user, and the corresponding data content is exported from the SQL table and returned to the user. Preferably, K can be adjusted by the user according to the user's usage requirements, and the value range of K is: greater than 0 and less than or equal to the number of database data types.
[0059] Example 1
[0060] The following examples further illustrate the professional field database retrieval method and system based on large model knowledge enhancement proposed by the present invention.
[0061] In the embodiment of the present invention, a computing server is equipped for data storage, computing, and retrieval method implementation. The server is equipped with 1 Intel Xeon Silver 4214 GPU, 2 Nvidia V100 GPUs, 256GB DDR4-2666MHz memory, Crucial 4TB SSD solid state drive, Lenovo T24A-10 LCD display.
[0062] In the embodiment of the present invention, the UK Biobank database is used as an example of a professional database to demonstrate the effectiveness of the present invention. The UK Biobank database is a large-scale life science database that contains biomedical data samples of approximately 500,000 participants aged 45 to 69, including: population data, genetic data, human imaging data, cognitive and psychological data, and other data types, totaling 15,205 sample fields. The professional database retrieval method based on large model knowledge enhancement for the UK Biobank database has the following specific steps:
[0063] Step S1, obtain the keywords and descriptions corresponding to each type of data in the target domain database, and match the keywords and descriptions corresponding to each type of data with the data link and content to obtain the SQL table of the target domain; define a first corpus template, and concatenate the keywords and descriptions based on the first corpus template to obtain data prompt text.
[0064] Extract keywords and description fields of 15205 data samples in the database. This embodiment takes the keywords and descriptions of the "demographic characteristics" sample data as an example; for example, Figure 3 As shown, the first corpus template is defined as:
[0065] “As a team of experienced healthcare professionals, biologists, medical experts and sociological researchers, your task is to translate the following items from the UK Biobank database into informative summaries. Subsequently, analyse their significance in the context of precision medicine and personal health management:
[0066] [Keywords] is a type of data in the UK Biobank database. [Description]. ”
[0067] The key words are: demographic characteristics;
[0068] Description: This category contains data on the characteristics of the participants. It contains: 2 subcategories, including: (1) baseline characteristics, (2) ongoing characteristics;
[0069] Based on the first corpus template, the concatenated keywords and their descriptions are obtained as follows:
[0070] “As a research team of experienced healthcare professionals, biologists, medical experts and sociological researchers, your task is to translate the following items from the UK Biobank database into highly readable summaries. Subsequently, analyze their significance in the context of precision medicine and personal health management:
[0071] Demographic characteristics is a category of data in the UK Biobank database. This category contains data on the characteristics of the participants. It contains: 2 subcategories, including: (1) baseline characteristics, (2) ongoing characteristics. "
[0072] Step S2, defining a second corpus template, and concatenating the query text based on the second corpus template to obtain a query prompt text.
[0073] Receive the query text input by the user. In this embodiment, take "blood-related data" as an example. For example, Figure 4 As shown, the second corpus template is:
[0074] “As an experienced healthcare professional, biologist, medical specialist and social researcher, your task is to translate the following query into [N] sub-summaries based on the UK Biobank database, in order to better retrieve relevant queries from the UK Biobank:
[0075] [user query text]. ”
[0076] Query text: blood related data;
[0077] The number of search texts generated N is set to: 10;
[0078] Based on the second corpus template, the query text is concatenated to obtain the query prompt text:
[0079] “As an experienced healthcare professional, biologist, medical expert and social researcher, your task is to transform the following query into 10 informative and concise abstracts based on the UK Biobank database to better retrieve relevant query content from the UK Biobank:
[0080] Blood-related data. ”
[0081] Step S3, inputting the data prompt text and the query prompt text into the large language model respectively, and generating a response text and a search text respectively.
[0082] Furthermore, in this example, the "Tongyi Qianwen 7B Model" is selected as the knowledge-enhanced large language model.
[0083] Specifically, the data prompt text is input into the large language model to generate knowledge-enhanced response text;
[0084] Exemplarily, the generated knowledge-enhanced response text is:
[0085] “The demographic profile of UK Biobank contains important information about participants, helping to give a comprehensive picture of their age, sex, education, occupation, health conditions (such as smoking or pre-existing illnesses), and family medical history.
[0086] The information is divided into two subcategories:
[0087] 1. Baseline characteristics: These are the initial attributes collected at the beginning of the study and reflect the background information of the participants. For example, age, gender, education level, occupation, and health status. Understanding these factors helps researchers establish a basis for assessing individual health risks.
[0088] 2. Continuous features: This subcategory contains data that changes over time and is essential for time-series precision medicine. It can track lifestyle changes, medical events, or other factors that may affect health. Monitoring these continuous features can provide more personalized interventions and targeted treatments based on real-time information.
[0089] Impact on precision medicine and health management:
[0090] 1. Genetic diversity: Baseline characteristics provide insights into the genetic composition of the population, helping to discover associations between diseases and genetic factors and develop customized genetic tests.
[0091] 2. Risk stratification: By analyzing this data, medical professionals can identify individuals at high risk for developing specific conditions, allowing for early intervention and personalized preventive measures.
[0092] 3. Lifestyle tracking: Continuous features allow researchers to assess lifestyle habits that may affect health, such as diet or exercise habits. This can provide a basis for personalized recommendations to improve overall health and reduce disease risk.
[0093] 4. Dynamic health management: Precision medicine often involves adjusting to changing conditions. Data from the UK Biobank allows for continuous monitoring of participant characteristics so that treatment plans can be adjusted if necessary.
[0094] 5. Public Health Policy: Understanding population characteristics can guide the development of public health policies and allocate resources to specific groups with higher needs.
[0095] In conclusion, the population characteristics of UK Biobank provide a rich source of data for precision medicine and health management, helping researchers to identify risk factors, track changes and develop strategies personalised for individuals.”
[0096] Furthermore, the query prompt text is input into the large language model, and N knowledge-enhanced retrieval texts are obtained according to the quantity parameter N.
[0097] Exemplarily, the generated knowledge-enhanced search text is:
[0098] "To more efficiently retrieve blood data from the UK Biobank database, here are 10 informative and condensed summaries, each focusing on a different aspect of blood data, designed to guide precise queries:
[0099] 1. Complete blood count: retrieve red blood cell count, hemoglobin, hematocrit, mean corpuscular volume, white blood cell count and differential, platelet count, and evaluate for anemia, infection, or blood disorders.
[0100] 2. Biochemical indicators: query liver enzyme activity, renal function, blood sugar, blood lipids and inflammatory markers for chronic disease risk assessment.
[0101] 3. Genetic associations: Analysis of the association between genetic variants and blood parameters, including genotypic and phenotypic associations related to inherited blood disorders.
[0102] 4. Metabolomics: Study of metabolites in blood samples, such as amino acids, fatty acids, glucose derivatives, to identify biomarkers associated with metabolic syndrome, cardiovascular disease, and diabetes.
[0103] 5. Drug responsiveness: Evaluate pharmacokinetic and pharmacodynamic parameters and monitor the effects of drugs on blood parameters, including drug concentrations and drug-induced hematological changes.
[0104] 6. Immune cell analysis: Check white blood cell subsets, including T cells, B cells, natural killer cells and monocytes, to evaluate the status of the immune system and immune-related diseases.
[0105] 7. Cardiovascular disease biomarkers: Identify blood biomarkers associated with cardiovascular disease, such as myocardial injury markers, heart failure markers, and atherosclerosis markers.
[0106] 8. Genetic risk score: Calculates the contribution of genetic factors to abnormal blood parameters and predicts the risk of cardiovascular disease, diabetes and certain cancers.
[0107] 9. Environmental exposure and blood parameters: Analyze the impact of environmental factors, such as air pollution and heavy metal exposure, on blood parameters and assess environmental health risks.
[0108] 10. Lifestyle factors: Assess the impact of diet, exercise, smoking and drinking habits on blood parameters such as blood pressure, blood sugar, lipid levels to promote recommendations for a healthy lifestyle.”
[0109] Step S4, inputting the query text, the search text and the response text into the natural language processing model respectively, generating query text features, search text features and response text features.
[0110] Furthermore, the step S4 comprises:
[0111] Input the query text and search text into the natural language processing model respectively to obtain the feature vector of each text unit in the query text and search text. In this example, select the "Sentence-BERT-base model" as the natural language processing model, which can convert text sentences into 768-dimensional feature vectors.
[0112] Input the response text into the natural language processing model to obtain the feature vector of each text unit in the response text;
[0113] Since the Sentence-BERT-base model contains a special unit [CLS], the feature vector corresponding to the special unit [CLS] can be used as a high-dimensional feature vector of the input text.
[0114] Step S5, weighted fusion of the query text features and the retrieval text features to obtain fused text features.
[0115] Furthermore, the query text features and the retrieval text features are weighted and fused, and the expression is as follows:
[0116]
[0117] Where M is the fused text feature vector, N is the number of generated retrieval texts (in this example, N = 10), λ is the query text weight (in this example, λ = 5), and d k is the kth retrieval text generated by the large language model, f(.) is the vectorization operation, and q is the query text.
[0118] Step S6, calculating the similarity between the fused text features and the response text features, and exporting the data corresponding to the first K response text features with the highest similarity from the SQL table as the retrieval result.
[0119] Furthermore, in this example, the Euclidean distance or the cosine distance is used to calculate the similarity between the fused text feature and the response text feature.
[0120] According to the calculation result of the similarity, the data corresponding to the K response texts with the highest similarity are used as the query result of the user, and the corresponding data content is exported from the SQL table and returned to the user. Preferably, K can be adjusted by the user according to the user's usage requirements, and the value range of K is: greater than 0 and less than or equal to the number of database data types; in this example, K is an integer greater than 0 and less than or equal to 15205.
[0121] In this embodiment, the K value is set to 3, and the search results of "blood-related data" are shown in Table 1 below.
[0122] Table 1: Query result table
[0123]
[0124]
[0125] As can be seen from Table 1, when the user inputs "blood-related data" to query the UK Biobank database, three blood-related contents, "blood-immunodeficiency report", "blood sample collection report" and "blood-anemia report" are returned, which proves the effectiveness of the professional field database retrieval method based on large model knowledge enhancement proposed in the present invention.
[0126] Accordingly, the present application also provides an electronic device, comprising: one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned professional field database retrieval method based on large model knowledge enhancement. Figure 5 As shown, it is a hardware structure diagram of any device with data processing capability where the professional field database retrieval method based on large model knowledge enhancement provided by the embodiment of the present invention is located, except Figure 5 In addition to the processor, memory device, input device and network interface shown, any device with data processing capability in which the apparatus in the embodiment is located may also include other hardware, which will not be described in detail, generally based on the actual function of the device with data processing capability.
[0127] Accordingly, the present application also provides a computer-readable storage medium on which computer instructions are stored, and when the instructions are executed by the processor, the professional field database retrieval method based on large model knowledge enhancement as described above is implemented. The computer-readable storage medium can be an internal storage unit of any device with data processing capabilities described in this embodiment, such as a hard disk or memory. The computer-readable storage medium can also be an external storage device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), an SD card, a flash card (Flash Card), etc. equipped on the device. Further, the computer-readable storage medium can also include an internal storage unit and an external storage device of any device with data processing capabilities at the same time. The computer-readable storage medium is used to store the computer program, as well as other programs and data required by any device with data processing capabilities, and can also be used to temporarily store data that has been output or is to be output.
[0128] The above embodiments are only used to illustrate the design ideas and features of the present invention, and their purpose is to enable those skilled in the art to understand the content of the present invention and implement it accordingly. The protection scope of the present invention is not limited to the above embodiments. Therefore, any equivalent changes or modifications made based on the principles and design ideas disclosed by the present invention are within the protection scope of the present invention.
Claims
1. A professional domain database retrieval method based on large language model knowledge enhancement, characterized in that: The method comprises: Obtain keywords and descriptions corresponding to each type of data in the target domain database, and match keywords and descriptions corresponding to each type of data with data links and content to obtain an SQL table of the target domain database; define a first corpus template, and concatenate keywords and descriptions based on the first corpus template to obtain data prompt text; A second corpus template is defined, and the query text input by the user is concatenated based on the second corpus template to obtain a query prompt text; Inputting the data prompt text and the query prompt text into the large language model to generate the response text and the retrieval text respectively; Inputting the query text, the retrieval text and the response text into the natural language processing model respectively to generate query text features, retrieval text features and response text features; Perform weighted fusion on query text features and retrieval text features to obtain fused text features; The similarity between the fused text features and the response text features is calculated, and the data corresponding to the top K response text features with the highest similarity are exported from the SQL table as the retrieval results.
2. According to claim 1, a professional domain database retrieval method based on large language model knowledge enhancement is characterized in that: The target area databases include: UK Biobank, China Prospective Study of Chronic Disease Cohort Sample Bank or high spatial resolution global weather and climate database in the field of meteorological science.
3. According to claim 1, a professional domain database retrieval method based on large language model knowledge enhancement is characterized in that: The first corpus template is an imperative sentence or a question sentence.
4. The method for professional domain database retrieval based on large language model knowledge enhancement according to claim 1, characterized in that: The process of obtaining the query hint text includes: According to the size and scope of the target domain database, set the number parameter N of generated search texts; A second corpus template is defined, where the second corpus template is a command sentence or a question sentence, and the query text is concatenated with the quantity parameter N to obtain a query prompt text.
5. The method for professional domain database retrieval based on large language model knowledge enhancement according to claim 1, characterized in that: The process of inputting the query text, the retrieval text and the response text into the natural language processing model to generate query text features, retrieval text features and response text features includes: Input the query text and the search text into the natural language processing model respectively, and obtain the feature vector of each text unit in the query text and the search text; Input the response text into the natural language processing model to obtain the feature vector of each text unit in the response text; For a natural language processing model containing a special unit [CLS], the feature vector corresponding to the text unit [CLS] is used as a high-dimensional feature vector of the text; For a natural language processing model that does not contain a special unit [CLS], the average value of the feature vectors corresponding to all text units is used as the high-dimensional feature vector of the text.
6. The method for professional domain database retrieval based on large language model knowledge enhancement according to claim 1, characterized in that: The process of weighted fusion of query text features and retrieval text features to obtain fused text features includes: In the formula, M is the fusion text feature vector, N is the number of generated retrieved texts, λ is the query text weight, and d k is the kth retrieval text generated by the large language model, f(.) is the vectorization operation, and q is the query text.
7. The method for professional domain database retrieval based on large language model knowledge enhancement according to claim 1, characterized in that: Calculating the similarity between the fused text features and the response text features includes: The Euclidean distance or cosine distance is used to calculate the similarity between the fusion text features and the response text features.
8. An electronic device, comprising a memory and a processor, characterized in that: The memory is coupled to the processor; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the professional field database retrieval method based on large language model knowledge enhancement as described in any one of claims 1-7 above.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the professional field database retrieval method based on large language model knowledge enhancement as described in any one of claims 1 to 7 is implemented.
10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the professional field database retrieval method based on large language model knowledge enhancement as described in any one of claims 1-7 is implemented.
Citation Information
Patent Citations
Database query method and device, computer equipment and storage medium
CN114253990A
Information query method
CN116595026A
Text semantic representation method and system based on entity enhancement
CN116662480A
Data retrieval method and system based on large language model
CN116701431A
Education domain knowledge base search optimization method and device based on question generation
CN117540063A
Cited By
Enzyme mining method and system and storage medium
CN121415892A