Professional field-oriented question and answer knowledge database construction method and device, equipment and medium

By obtaining and processing the original literature data of the target field, combined with large language models and field knowledge maps, a candidate answer and updating the Q & A data set can solve the problem of outdated or error information to generate a Q & A data set in the large language model. Construction of knowledge database in professional fields.

CN119378672APending Publication Date: 2025-01-28XIAMEN YIHUA SMART TECHNOLOGY CO LTD +1
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411439731.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

The question and answer datasets directly generated by large language models often have more outdated or incorrect information.

Method used

By obtaining the original literature data in the target field, the large -language model is used to generate the original Q & A data set, and combined with the field of knowledge maps and external search tools to generate candidate answers, and finally update the Q & A data set to generate the knowledge database in the professional field.

Benefits of technology

The question and answer dataset generated by large language models has an outdated or error message, and a high -quality, accurate, and latest professional field knowledge database is generated.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119378672A_ABST
    Figure CN119378672A_ABST
Patent Text Reader

Abstract

The invention provides a professional field-oriented question and answer knowledge database construction method and device, equipment and a medium, and the method comprises the steps: firstly obtaining original literature data of a target field, and generating an original question and answer data set through a large language model according to an abstract of the original literature data and a preset construction instruction; then, generating a first candidate answer based on the constructed domain knowledge graph and the query statement, extracting a domain research result from the abstract of the original literature data, generating a second candidate answer according to the domain research result, calling an external search tool to retrieve the first n results matched with the question, and generating a third candidate answer; and finally, based on the first candidate answer, the second candidate answer and the third candidate answer, updating the answer of the original question and answer data set, and generating a knowledge database of a professional field, thereby solving the problem that the question and answer data set directly generated by a large language model often has more outdated or wrong information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of database construction, and in particular to a method, device, equipment and medium for constructing a question-and-answer knowledge database for a professional field. Background Art

[0002] At present, scientific question-answering systems have been widely used in natural language understanding tasks and scientific research fields. They play an important role in providing knowledge services, assisting scientific research decisions, and promoting academic exchanges. Constructing scientific question-answering datasets is the basis for developing and verifying scientific question-answering systems. However, existing technical methods face many challenges in constructing high-quality question-answering datasets. Although the question-answering datasets manually written by experts are accurate, they are inefficient; although the template method can generate question-answering data in batches, its scalability is limited; although the knowledge graph-based query method can use the knowledge graph to generate more diverse question-answering instructions, the construction of the knowledge graph is time-consuming and labor-intensive, and the versatility is insufficient, making it difficult to apply to multiple scientific fields; although the current large language model can efficiently generate question-answering datasets, due to the time lag and hallucination problems of the training corpus, the question-answering datasets directly generated by the large language model often contain a lot of outdated or erroneous information.

[0003] In view of this, this application is filed. Summary of the invention

[0004] The present invention discloses a method, device, equipment and medium for constructing a question-and-answer knowledge database for a professional field, aiming to solve the problem that a question-and-answer data set directly generated by a large language model often contains a lot of outdated or erroneous information.

[0005] The first embodiment of the present invention provides a method for constructing a question-and-answer knowledge database for a professional field, comprising:

[0006] Obtaining original document data in the target field, and generating an original question-answering dataset through a large language model according to a summary of the original document data and preset construction instructions;

[0007] Extracting entities and relationships from the abstract of the original document data, constructing a domain knowledge graph based on the entities and relationships, and querying the domain knowledge graph based on a query statement to generate a first candidate answer;

[0008] Extracting field research results from the abstract of the original document data, and generating a second candidate answer based on the field research results, wherein the second candidate answer is the first n results that match the question in the research results;

[0009] Call an external search tool to retrieve the top n results matching the question and generate a third candidate answer;

[0010] The answers to the original question-and-answer data set are updated based on the first candidate answer, the second candidate answer, and the third candidate answer, and a knowledge database in a professional field is generated.

[0011] Preferably, after obtaining the original document data of the target field and generating the original question-answering data set according to the summary of the original document data and the preset construction instructions, the method further includes:

[0012] SciBERT is used to calculate the similarity between questions and answers in the original question-answering dataset, and when it is determined that the similarity is greater than a preset value, the question-answer pair is deleted.

[0013] Preferably, after updating the answer of the original question-answer data set based on the first candidate answer, the second candidate answer, and the third candidate answer, the method further includes:

[0014] Randomly select a question-answer pair from a knowledge database in a professional field, obtain a first annotation result of a first annotator on the question-answer pair, and a second annotation result of a second annotator on the question-answer pair;

[0015] When it is determined that the first labeling result and the second labeling result cannot reach an agreement, the question-answer pair is deleted from the knowledge database of the professional field.

[0016] Preferably, the format of the original question-answering dataset is json format.

[0017] The second embodiment of the present invention provides a device for constructing a question-answer knowledge database for a professional field, comprising:

[0018] A question-answering dataset construction unit, used to obtain original document data in a target field, and generate an original question-answering dataset through a large language model according to a summary of the original document data and preset construction instructions;

[0019] A first candidate answer generating unit, configured to extract entities and relationships from the abstract of the original document data, construct a domain knowledge graph based on the entities and relationships, and query the domain knowledge graph based on a query statement to generate a first candidate answer;

[0020] A second candidate answer generating unit is used to extract the field research results from the abstract of the original document data, and generate a second candidate answer according to the field research results, wherein the second candidate answer is the first n results matching the question in the research results;

[0021] A third candidate answer generating unit, used for calling an external search tool to retrieve the first n results matching the question and generating a third candidate answer;

[0022] An updating unit is used to update the answers of the original question-answer data set based on the first candidate answer, the second candidate answer, and the third candidate answer, and generate a knowledge database in a professional field.

[0023] Preferably, the question-answer dataset construction unit is further used for:

[0024] SciBERT is used to calculate the similarity between questions and answers in the original question-answering dataset, and when it is determined that the similarity is greater than a preset value, the question-answer pair is deleted.

[0025] Preferably, the updating unit is further used for:

[0026] Randomly select a question-answer pair from a knowledge database in a professional field, obtain a first annotation result of a first annotator on the question-answer pair, and a second annotation result of a second annotator on the question-answer pair;

[0027] When it is determined that the first labeling result and the second labeling result cannot reach an agreement, the question-answer pair is deleted from the knowledge database of the professional field.

[0028] Preferably, the format of the original question-answering dataset is json format.

[0029] The third embodiment of the present invention provides a question-and-answer knowledge database construction device for a professional field, comprising a memory and a processor, wherein the memory stores a computer program, and the computer program can be executed by the processor to implement a question-and-answer knowledge database construction method for a professional field as described in any one of the above items.

[0030] The fourth embodiment of the present invention provides a computer-readable storage medium, characterized in that a computer program is stored therein, and the computer program can be executed by a processor of a device where the computer-readable storage medium is located to implement a method for constructing a question-and-answer knowledge database for a professional field as described in any one of the above items.

[0031] A method, device, equipment and medium for constructing a question-and-answer knowledge database for a professional field provided by the present invention first obtains original document data of the target field, and generates an original question-and-answer data set through a large language model according to the abstract of the original document data and preset construction instructions; then, a first candidate answer is generated based on the constructed domain knowledge graph and query statement, the domain research results are extracted from the abstract of the original document data, a second candidate answer is generated according to the domain research results, an external search tool is called to retrieve the top n results matching the question, and a third candidate answer is generated; finally, the answer to the original question-and-answer data set is updated based on the first candidate answer, the second candidate answer and the third candidate answer, and a knowledge database for the professional field is generated, thereby solving the problem that the question-and-answer data set directly generated by the large language model often contains a lot of outdated or erroneous information. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 It is a flowchart of a method for constructing a question-and-answer knowledge database for a professional field provided by the first embodiment of the present invention;

[0033] Figure 2 It is a schematic diagram of the process of constructing a domain knowledge graph provided by the present invention;

[0034] Figure 3 It is the knowledge graph entity distribution diagram provided by the present invention;

[0035] Figure 4 Word cloud diagrams of various categories of knowledge graph entities;

[0036] Figure 5 It is a module diagram of a device for constructing a question-and-answer knowledge database for a professional field provided by the second embodiment of the present invention. DETAILED DESCRIPTION

[0037] 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.

[0038] In order to better understand the technical solution of the present invention, the embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0039] It should be clear that the described embodiments are only some embodiments of the present invention, not all 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.

[0040] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.

[0041] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0042] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.

[0043] The "first\second" mentioned in the embodiments is only to distinguish similar objects, and does not represent a specific order for the objects. It is understandable that the "first\second" can be interchanged with the specific order or sequence where permitted. It should be understood that the objects distinguished by "first\second" can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than those illustrated or described herein.

[0044] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0045] The present invention discloses a method, device, equipment and medium for constructing a question-and-answer knowledge database for a professional field, aiming to solve the problem that a question-and-answer data set directly generated by a large language model often contains a lot of outdated or erroneous information.

[0046] The first embodiment of the present invention provides a method for constructing a question-and-answer knowledge database for a professional field, which can be executed by a question-and-answer knowledge database construction device for a professional field (hereinafter referred to as a construction device), and in particular, executed by one or more processors in the construction device to implement at least the following steps:

[0047] S101, obtaining original document data in a target field, and generating an original question-answering dataset through a large language model according to a summary of the original document data and preset construction instructions;

[0048] In this embodiment, the construction device can be a terminal with data processing capabilities such as a desktop computer, a laptop computer, a server, a workstation, etc. The construction device can be installed with a corresponding operating system and application software, and the functions required by this embodiment are realized through the combination of the operating system and the application software.

[0049] It should be noted that, in this embodiment, original literature data in the target field can be collected through a variety of channels, including but not limited to: public literature data sets, literature database APIs, web crawlers, and local uploads, among which the collected data include the title, abstract, journal name and publication time of the literature.

[0050] Furthermore, in this embodiment, the construction instructions for generating question-answering data may include the following elements: role setting, setting the large language model as an expert role in the target field to ensure that the generated content meets the professional level. Task definition, (1) Convert the document title into an academic question, and remove key professional terms when necessary to form an object that can be asked. (2) Extract experimental and computational results from the abstract as answers, focusing on the "research results" or "conclusions" section. (3) Extract the rest of the abstract as context. (4) Input format, specifying the input as the title and abstract of the document. (5) Output format, requiring the output to be in JSON format, containing question, answer, and context fields.

[0051] The process of using the large language model to process each document can be: (1) input the title and abstract of the document into the large language model; (2) apply the preset construction instructions to guide the large language model to generate question and answer data. (3) obtain the JSON format question and answer data output by the large language model (wherein the JSON format is used for batch processing to facilitate testing and fine-tuning). Then, summarize the processing results to form an original question and answer dataset. Specifically, all JSON format question and answer data generated by the large language model can be collected. These data are integrated into a unified data structure to form a complete original question and answer dataset.

[0052] S102, extracting entities and relationships from the abstract of the original document data, and constructing a domain knowledge graph based on the entities and relationships (such as Figure 2 , 3 , 4), querying the domain knowledge graph based on the query statement to generate a first candidate answer;

[0053] It should be noted that, in this embodiment, natural language processing (NLP) technology and a pre-trained language model (such as BERT or SciBERT) can be used to segment and tag the abstracts of the original document data to identify entities and relational words in the text.

[0054] Next, based on the identified entities and relational words, named entity recognition (NER) and relation extraction techniques are used to extract entities (such as research objects, variables, research methods, etc.) and their relationships (such as functional relationships, causal relationships, etc.) in the abstract. Next, the extracted entities and relationships are organized and stored according to the predefined domain knowledge graph architecture to form a preliminary domain knowledge graph. The domain knowledge graph includes nodes (representing entities) and edges (representing relationships between entities). Among them, the domain knowledge graph can be optimized and cleaned to remove redundant or erroneous entities and relationships to ensure the accuracy and consistency of the knowledge graph.

[0055] Furthermore, based on the query statement, the query statement can be parsed into corresponding entities and relationships, so as to perform a query in the domain knowledge graph. The specific steps include:

[0056] Perform word segmentation and part-of-speech tagging on query statements to identify key entities and relationships.

[0057] Map the identified key entities and relationships to the corresponding nodes and edges in the domain knowledge graph to determine the target and scope of the query.

[0058] Query the domain knowledge graph and obtain entities and relationships that match the query statement.

[0059] Finally, the first candidate answer is generated according to the query results. The specific steps include:

[0060] Organize query results into structured data, including matching entities, relationships, and relevant contextual information.

[0061] The query results are sorted according to their relevance and importance, and the top n most relevant results are selected as the first candidate answers.

[0062] Convert the first candidate answer into natural language text to ensure the readability and accuracy of the answer.

[0063] S103, extracting field research results from the abstract of the original document data, and generating a second candidate answer based on the field research results, wherein the second candidate answer is the first n results matching the question in the research results;

[0064] Specifically, in this embodiment, natural language processing (NLP) technology and pre-trained language models (such as BERT or SciBERT) can be used to analyze the abstracts of the original literature data to identify and extract the research results in the abstracts. Among them, the research results usually appear in the "research results", "conclusions" or "findings" section of the abstract. Then, the identified research results can be structured, including marking the type of research results (such as experimental results, calculation results, survey results, etc.) and the specific content of the research results (such as numerical values, trends, findings, etc.). The extracted research results are classified and organized, similar or related research results are merged, and duplicate or irrelevant information is removed to ensure the accuracy and consistency of the results.

[0065] Based on the query statement, the query statement is parsed into corresponding keywords and topics, so as to match them in the extracted research results. The specific steps include:

[0066] Perform word segmentation and keyword extraction on query statements to identify the core topics and key terms in the query.

[0067] The identified core themes and key terms were matched with the extracted research findings to identify relevant research results.

[0068] Further, the matching research results are ranked according to the relevance and importance of the matches, and the top n most relevant results are selected as the second candidate answers. The ranking criteria may include the significance of the research results, the strength of the supporting evidence of the results, and the relevance of the results to the query topic.

[0069] The second candidate answer is organized into a structured data format, including the specific content of the research results, the source (such as the title of the document, the author, the journal, the publication time, etc.) and the relevant context information to ensure the completeness and traceability of the answer. Finally, the second candidate answer is converted into natural language text to ensure the readability and accuracy of the answer, and provide users with a clear and detailed answer.

[0070] S104, calling an external search tool to retrieve the top n results matching the question and generating a third candidate answer;

[0071] It should be noted that external search tools such as academic search engines (e.g. Google Scholar, PubMed), commercial search engines (e.g. Google, Bing) or other specialized databases (e.g. IEEE Xplore, ACM Digital Library) can be selected to ensure the professionalism and authority of the search results. Similarly, the query statements can be converted into search keywords and query strings suitable for use with external search tools.

[0072] Call an external search tool to execute a query and obtain search results that match the query string. The specific steps include:

[0073] Submit the query string to the external search tool through the API interface.

[0074] Receive search results returned by the search tool, including the title, abstract, URL, author, publication time and other information of the results.

[0075] Filter and sort the search results, and select the top n most relevant results as the third candidate answers. The filtering and sorting criteria may include:

[0076] Select the results most relevant to the query topic based on the search tool's relevance score or manual evaluation.

[0077] Prioritize results from authoritative journals, well-known conferences, or credible websites.

[0078] Select the latest research results or the most classic literature as needed.

[0079] The third candidate answer is organized into a structured data format, including the title, summary, source (such as URL, author, publication time, etc.) of the search result, and related context information to ensure the integrity and traceability of the answer. The third candidate answer is converted into natural language text to ensure the readability and accuracy of the answer, and provide users with a clear and detailed answer.

[0080] S105: Update the answers to the original question-and-answer data set based on the first candidate answer, the second candidate answer, and the third candidate answer, and generate a knowledge database in a professional field.

[0081] It should be noted that in this embodiment, the first candidate answer generated from the domain knowledge graph query, the second candidate answer generated from the literature research results, and the third candidate answer generated by the external search tool can be collected and sorted. Ensure that the source, content and relevance of each candidate answer are clearly marked. Compare and merge the first candidate answer, the second candidate answer and the third candidate answer. Through natural language processing technology (such as text similarity calculation, keyword matching, etc.), evaluate the accuracy and relevance of each candidate answer, select the best answer or integrate multiple answers to form a more comprehensive answer. Update the original question and answer data set, and replace or supplement the old answer in the original question and answer data set with the best or integrated answer. Ensure that the updated question and answer pair contains accurate, comprehensive and up-to-date information. The updated question and answer data set is structured and converted into part of the professional domain knowledge database. The database should contain complete information of the question and answer pair, such as questions, answers, sources, context, etc., for subsequent retrieval and application. Perform quality inspection and verification on the generated professional domain knowledge database to ensure that the information in the database is accurate, logically consistent, and meets the predetermined standards and requirements. According to the test results, make necessary adjustments and optimizations to the database.

[0082] In a possible embodiment of the present invention, after obtaining the original document data of the target field and generating the original question-answering dataset according to the summary of the original document data and the preset construction instructions, the method further includes:

[0083] SciBERT is used to calculate the similarity between questions and answers in the original question-answering dataset, and when it is determined that the similarity is greater than a preset value, the question-answer pair is deleted.

[0084] It should be noted that SciBERT is a pre-trained language model that is optimized specifically for scientific literature. First, you need to load the SciBERT model and related vocabulary to process the question-answering dataset and calculate similarity. The questions and answers in the original question-answering dataset are preprocessed, including removing punctuation, converting to lowercase, removing stop words, and other steps to ensure that the text format of the input model is unified and reduce noise. Use the SciBERT model to encode each question and answer into a high-dimensional vector. SciBERT can capture the contextual information of the text, so that the encoded vector can effectively represent the semantic information of the text. Use similarity metrics such as cosine similarity or Euclidean distance to calculate the similarity score between each pair of questions and answers. The specific steps include:

[0085] Compute the similarity between questions and answers in the same question-answer pair to assess whether they are too similar, potentially leading to duplication or redundancy.

[0086] Compare questions and answers in different question-answer pairs, evaluate the similarities between them, and ensure the diversity and coverage of the question-answering dataset.

[0087] Set a similarity threshold based on the specific application scenario and the characteristics of the data set. When the calculated similarity score is greater than the preset threshold, the question-answer pair is considered to be duplicate or redundant and needs to be deleted. Traverse the entire question-answer data set, and for each question-answer pair, calculate the similarity score and compare it with the preset threshold. If the similarity score exceeds the threshold, the question-answer pair is marked as redundant and deleted from the data set. Ensure the rationality of the deletion operation to avoid accidentally deleting valid question-answer pairs. Update the question-answer data set: After deleting duplicate question-answer pairs, update and optimize the remaining question-answer data set to ensure the high quality and diversity of the data set. The deletion operation can be logged for subsequent review and tracking. Ensure the streamlining and effectiveness of the question-answer data set.

[0088] In a possible embodiment of the present invention, after updating the answer of the original question-answer dataset based on the first candidate answer, the second candidate answer, and the third candidate answer, the method further includes:

[0089] Randomly select a question-answer pair from a knowledge database in a professional field, obtain a first annotation result of a first annotator on the question-answer pair, and a second annotation result of a second annotator on the question-answer pair;

[0090] When it is determined that the first labeling result and the second labeling result cannot reach an agreement, the question-answer pair is deleted from the knowledge database of the professional field.

[0091] It should be noted that the automatically generated and updated question-answer dataset is used as PQA-U. The expert collaborative verification process is performed by two experts (i.e., the first annotator and the second annotator) to independently mark the question-answer pair to determine whether to keep the question-answer pair. Among them, keep is the label that needs to be marked, including "keep" or "delete". In the whole algorithm process, the loop operation will continue until the preset number of questions and answers is reached.

[0092] In each cycle, an instance QAi is randomly selected from PQA-U. First, QAi is annotated by two independent annotators (usually domain experts). Annotator 1 obtains the annotation result keep1 based on the question, context and answer, while annotator 2 obtains the annotation result keep2 based only on the question and context. If keep1 and keep2 are the same, it is considered a consistent result and keep is set to keep1. If they are inconsistent, annotator 1 and annotator 2 need to discuss and try to reach a consistent annotation result keep. If the two cannot reach an agreement, the QAi is deleted and the next iteration is continued. If an agreement is reached, keep is recorded as the true label. Through the collaboration of the two annotators, the accuracy and consistency of the annotations are ensured to obtain an authoritative and high-quality question and answer dataset.

[0093] See also Figure 5 The second embodiment of the present invention provides a device for constructing a question-answer knowledge database for a professional field, comprising:

[0094] A question-answering dataset construction unit 201 is used to obtain original document data in a target field, and generate an original question-answering dataset through a large language model according to a summary of the original document data and preset construction instructions;

[0095] A first candidate answer generating unit 202 is used to extract entities and relationships from the abstract of the original document data, construct a domain knowledge graph based on the entities and relationships, and query the domain knowledge graph based on a query statement to generate a first candidate answer;

[0096] A second candidate answer generating unit 203 is used to extract the field research results from the abstract of the original document data, and generate a second candidate answer according to the field research results, wherein the second candidate answer is the first n results matching the question in the research results;

[0097] A third candidate answer generating unit 204, configured to call an external search tool to retrieve the first n results matching the question and generate a third candidate answer;

[0098] The updating unit 205 is used to update the answers of the original question and answer dataset based on the first candidate answer, the second candidate answer, and the third candidate answer, and generate a knowledge database in a professional field.

[0099] Preferably, the question-answer dataset construction unit is further used for:

[0100] SciBERT is used to calculate the similarity between questions and answers in the original question-answering dataset, and when it is determined that the similarity is greater than a preset value, the question-answer pair is deleted.

[0101] Preferably, the updating unit is further used for:

[0102] Randomly select a question-answer pair from a knowledge database in a professional field, obtain a first annotation result of a first annotator on the question-answer pair, and a second annotation result of a second annotator on the question-answer pair;

[0103] When it is determined that the first labeling result and the second labeling result cannot reach an agreement, the question-answer pair is deleted from the knowledge database of the professional field.

[0104] Preferably, the format of the original question-answering dataset is json format.

[0105] The third embodiment of the present invention provides a question-and-answer knowledge database construction device for a professional field, comprising a memory and a processor, wherein the memory stores a computer program, and the computer program can be executed by the processor to implement a question-and-answer knowledge database construction method for a professional field as described in any one of the above items.

[0106] The fourth embodiment of the present invention provides a computer-readable storage medium, characterized in that a computer program is stored therein, and the computer program can be executed by a processor of a device where the computer-readable storage medium is located to implement a method for constructing a question-and-answer knowledge database for a professional field as described in any one of the above items.

[0107] A method, device, equipment and medium for constructing a question-and-answer knowledge database for a professional field provided by the present invention first obtains original document data of the target field, and generates an original question-and-answer data set through a large language model according to the abstract of the original document data and preset construction instructions; then, a first candidate answer is generated based on the constructed domain knowledge graph and query statement, the domain research results are extracted from the abstract of the original document data, a second candidate answer is generated according to the domain research results, an external search tool is called to retrieve the top n results matching the question, and a third candidate answer is generated; finally, the answer to the original question-and-answer data set is updated based on the first candidate answer, the second candidate answer and the third candidate answer, and a knowledge database for the professional field is generated, thereby solving the problem that the question-and-answer data set directly generated by the large language model often contains a lot of outdated or erroneous information.

[0108] Exemplarily, the computer program described in the third and fourth embodiments of the present invention may be divided into one or more modules, and the one or more modules are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the device for constructing a question-and-answer knowledge database for a professional field. For example, the device described in the second embodiment of the present invention.

[0109] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the method for constructing a question-and-answer knowledge database for a professional field, and uses various interfaces and lines to connect the various parts of the method for constructing a question-and-answer knowledge database for a professional field.

[0110] The memory can be used to store the computer program and / or module, and the processor realizes various functions of a method for constructing a question-answer knowledge database for a professional field by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, a text conversion function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, text message data, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0111] Wherein, if the implemented module is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0112] It should be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art may understand and implement it without paying any creative effort.

[0113] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A method for constructing a question-answer knowledge database for a professional field, characterized in that: include: Obtaining original document data in the target field, and generating an original question-answering dataset through a large language model according to a summary of the original document data and preset construction instructions; Extracting entities and relationships from the abstract of the original document data, constructing a domain knowledge graph based on the entities and relationships, and querying the domain knowledge graph based on a query statement to generate a first candidate answer; Extracting field research results from the abstract of the original document data, and generating a second candidate answer based on the field research results, wherein the second candidate answer is the first n results that match the question in the research results; Call an external search tool to retrieve the top n results matching the question and generate a third candidate answer; The answers to the original question-and-answer data set are updated based on the first candidate answer, the second candidate answer, and the third candidate answer, and a knowledge database in a professional field is generated.

2. The method for constructing a question-answer knowledge database for a professional field according to claim 1, characterized in that: After obtaining the original literature data in the target field and generating the original question-answering dataset according to the summary of the original literature data and the preset construction instructions, the following steps are also included: SciBERT is used to calculate the similarity between questions and answers in the original question-answering dataset, and when it is determined that the similarity is greater than a preset value, the question-answer pair is deleted.

3. The method for constructing a question-answer knowledge database for a professional field according to claim 1, characterized in that: After updating the answer of the original question-answering dataset based on the first candidate answer, the second candidate answer, and the third candidate answer, the method further includes: Randomly select a question-answer pair from a knowledge database in a professional field, obtain a first annotation result of a first annotator on the question-answer pair, and a second annotation result of a second annotator on the question-answer pair; When it is determined that the first labeling result and the second labeling result cannot reach an agreement, the question-answer pair is deleted from the knowledge database of the professional field.

4. The method for constructing a question-answer knowledge database for a professional field according to claim 1, characterized in that: The format of the original question-answering dataset is json.

5. A device for constructing a question-answer knowledge database for a professional field, characterized in that: include: A question-answering dataset construction unit, used to obtain original document data in a target field, and generate an original question-answering dataset through a large language model according to a summary of the original document data and preset construction instructions; A first candidate answer generating unit, configured to extract entities and relationships from the abstract of the original document data, construct a domain knowledge graph based on the entities and relationships, and query the domain knowledge graph based on a query statement to generate a first candidate answer; A second candidate answer generating unit is used to extract the field research results from the abstract of the original document data, and generate a second candidate answer according to the field research results, wherein the second candidate answer is the first n results matching the question in the research results; A third candidate answer generating unit, used for calling an external search tool to retrieve the first n results matching the question and generating a third candidate answer; An updating unit is used to update the answers of the original question-answer data set based on the first candidate answer, the second candidate answer, and the third candidate answer, and generate a knowledge database in a professional field.

6. The device for constructing a question-answer knowledge database for a professional field according to claim 5, characterized in that: The question-answering dataset construction unit is also used for: SciBERT is used to calculate the similarity between questions and answers in the original question-answering dataset, and when it is determined that the similarity is greater than a preset value, the question-answer pair is deleted.

7. The device for constructing a question-answer knowledge database for a professional field according to claim 5, characterized in that: The updating unit is further configured to: Randomly select a question-answer pair from a knowledge database in a professional field, obtain a first annotation result of a first annotator on the question-answer pair, and a second annotation result of a second annotator on the question-answer pair; When it is determined that the first labeling result and the second labeling result cannot reach an agreement, the question-answer pair is deleted from the knowledge database of the professional field.

8. The device for constructing a question-answer knowledge database for a professional field according to claim 5, characterized in that: The format of the original question-answering dataset is json.

9. A question-answering knowledge database construction device for professional fields, characterized in that: It includes a memory and a processor, wherein the memory stores a computer program, and the computer program can be executed by the processor to implement a method for constructing a question-and-answer knowledge database for a professional field as described in any one of claims 1 to 4.

10. A computer-readable storage medium, characterized in that: A computer program is stored, and the computer program can be executed by a processor of the device where the computer-readable storage medium is located to implement a method for constructing a question-and-answer knowledge database for a professional field as described in any one of claims 1 to 4.

Citation Information

Cited By

  • Multi-type question and answer data chain generation method for scientific and technical literature question and answer system

    CN120929568A

  • Method for generating multi-type question and answer data chain for science and technology literature question and answer system

    CN120929568B