Method and system for constructing a question and answer knowledge base
By acquiring knowledge source data to generate and optimize question-answer pairs, and using large language models and preset templates to build a question-answer knowledge base, the problems of low efficiency and poor accuracy in existing technologies are solved, and an efficient and reliable question-answer knowledge base is built.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING OCEANBASE TECHNOLOGY CO LTD
- Filing Date
- 2026-03-20
- Publication Date
- 2026-06-09
Smart Images

Figure CN122174965A_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of artificial intelligence technology, and in particular to a method and system for constructing a question-and-answer knowledge base. Background Technology
[0002] With the rapid development of artificial intelligence technology, question-answering systems have been widely used in fields such as intelligent customer service, online education, and information retrieval. The core of a question-answering system relies on a high-quality question-answering knowledge base. Traditional question-answering knowledge base construction typically depends on manual annotation or rule-based extraction, which is inefficient and costly.
[0003] In recent years, with the advancement of big data and natural language processing technologies, methods for automatically or semi-automatically constructing question-answering knowledge bases have emerged. These methods attempt to extract information from various knowledge sources such as text, databases, and web pages and organize them into question-answer pairs. However, in practical applications, due to the differences in format, structure, and semantic expression among different knowledge sources, it is difficult to accurately understand complex semantics when organizing question-answer pairs based on automated or semi-automated information extraction methods. This leads to semantic biases in the generated question-answer pairs, resulting in low accuracy. Therefore, a more efficient and accurate question-answering knowledge base construction scheme is needed.
[0004] The information in the background section is merely information known only to the inventor and does not imply that such information had entered the public domain before the date of this application, nor does it imply that it can be considered prior art in this disclosure. Summary of the Invention
[0005] This specification provides a method and system for constructing a question-and-answer knowledge base, which is applicable to scenarios that require the automated and high-quality construction of a question-and-answer knowledge base from multiple sources and can be continuously optimized.
[0006] Firstly, this specification provides a method for constructing a question-and-answer knowledge base. The method includes: acquiring knowledge source data; generating one or more initial question-and-answer pairs corresponding to the knowledge source data based on the question-and-answer pair generation method corresponding to the knowledge source data, wherein the initial question-and-answer pairs include questions and corresponding answers; determining the association information corresponding to the initial question-and-answer pairs according to the knowledge source data; generating target question-and-answer pairs based on the initial question-and-answer pairs and the association information, wherein the association information is metadata related to the initial question-and-answer pairs, used to describe one or more of the source, basis, and attributes of the initial question-and-answer pairs; and constructing a question-and-answer knowledge base based on the target question-and-answer pairs.
[0007] In some embodiments, the data structure of the associated information includes one or more of the following fields: a source field, used to store the identifier of the knowledge source data from which the initial question-and-answer pair originates; a basis field, used to store the original text basis corresponding to the answer; a question type field, used to store the category corresponding to the question; and a quality score field, used to store the overall quality score result of the target question-and-answer pair.
[0008] In some embodiments, the method further includes: optimizing each target question-answer pair in the question-answer knowledge base to obtain optimized target question-answer pairs; the optimization process includes: rewriting and expansion processing and / or deduplication processing; and constructing an optimized question-answer knowledge base based on multiple optimized target question-answer pairs.
[0009] In some embodiments, the rewriting and expansion process includes: generating one or more related questions that are semantically the same as the question but have different expressions for the question in the target question-answer pair, and associating the related questions with the answers of the target question-answer pair.
[0010] In some embodiments, the deduplication process includes: identifying multiple similar questions with the same semantics in the question-answering knowledge base, and determining the target question-answer pairs corresponding to the multiple similar questions as similar question-answer pairs; generating standard question-answer pairs based on the multiple similar question-answer pairs; wherein the standard question-answer pair includes a standard question, a standard answer, and related information, wherein the standard question and the standard answer are generated based on the initial question-answer pairs corresponding to the multiple similar question-answer pairs respectively, and the related information is obtained by fusing the related information corresponding to the multiple similar question-answer pairs respectively; and adding the standard question-answer pair as a target question-answer pair to the question-answering knowledge base, and deleting multiple similar question-answer pairs in the question-answering knowledge base.
[0011] In some embodiments, the method further includes: performing quality assessment on the target question-answer pairs in the optimized question-answer knowledge base using a large language model, and updating the target question-answer pairs in the optimized question-answer knowledge base based on the quality assessment results, to obtain an updated question-answer knowledge base.
[0012] In some embodiments, updating the target question-answer pairs in the optimized question-answer knowledge base based on the quality assessment results to obtain an updated question-answer knowledge base includes: filtering out low-quality target question-answer pairs whose assessment results do not meet preset requirements based on the quality assessment results; modifying the low-quality target question-answer pairs until their quality assessment results meet the preset requirements; and updating the question-answer knowledge base based on the modified target question-answer pairs.
[0013] In some embodiments, the quality assessment is based on one or more of the following preset dimensions: factual accuracy, question-answer relevance, question-answer completeness, expression coherence, and expression richness.
[0014] In some embodiments, the knowledge source data includes one or more of structured data, semi-structured data, or unstructured data; the step of generating one or more initial question-answer pairs corresponding to the knowledge source data based on the question-answer pair generation method corresponding to the knowledge source data includes: when the knowledge source data is structured data, extracting the knowledge source data and generating corresponding initial question-answer pairs through a preset template; when the knowledge source data is unstructured data, generating the initial question-answer pairs through a large language model; when the knowledge source data is semi-structured data, combining the preset template and the large language model to generate initial question-answer pairs corresponding to the knowledge source data.
[0015] In some embodiments, the step of extracting the knowledge source data and generating corresponding initial question-and-answer pairs using a preset template includes: identifying key entities and attributes in the knowledge source data; and filling the key entities and attributes into the question template and answer template in the preset template to generate the initial question-and-answer pairs corresponding to the knowledge source data.
[0016] In some embodiments, generating one or more initial question-answer pairs corresponding to the knowledge source data based on the question-answer pair generation method corresponding to the knowledge source data includes: generating one or more initial question-answer pairs corresponding to the knowledge source data through a large language model.
[0017] Secondly, this specification also provides a question-and-answer knowledge base construction system, including at least one storage medium and at least one processor, wherein the at least one storage medium stores at least one instruction set for constructing the question-and-answer knowledge base; the at least one processor is communicatively connected to the at least one storage medium, wherein the at least one processor reads the at least one instruction set during operation and executes the method described in any of the first aspects above according to the instructions of the at least one instruction set.
[0018] As can be seen from the above technical solutions, the question-and-answer knowledge base construction method and system provided in this specification first acquire knowledge source data. Based on the question-and-answer pair generation method corresponding to the knowledge source data, the system generates one or more initial question-and-answer pairs corresponding to the knowledge source data. Each initial question-and-answer pair includes a question and its corresponding answer. Therefore, the system can generate initial question-and-answer pairs using appropriate generation methods for knowledge source data with different structures, improving the quality of the initial question-and-answer pairs. Subsequently, the system determines the associated information corresponding to the initial question-and-answer pairs based on the knowledge source data, and generates target question-and-answer pairs based on the initial question-and-answer pairs and their corresponding associated information. Each target question-and-answer pair includes the initial question-and-answer pair and its corresponding associated information. Furthermore, the system constructs a question-and-answer knowledge base based on the target question-and-answer pairs. The associated information is metadata related to the initial question-and-answer pairs, used to describe one or more of the source, basis, and attributes of the initial question-and-answer pairs. The target question-and-answer pairs include both the initial question-and-answer pairs and the associated information. The above method of describing and supplementing the source, basis, and attributes of the initial question-and-answer pairs through associated information enhances the usability, traceability, and manageability of the initial question-and-answer pairs. Furthermore, building a question-answering knowledge base based on target question-answer pairs can integrate scattered and independent knowledge source data into a structured knowledge base. This provides a solid knowledge service foundation for subsequent upper-level applications such as intelligent question answering and information retrieval, and also improves the efficiency and quality of question-answering knowledge base construction.
[0019] The methods for constructing the question-and-answer knowledge base and other functions of the system provided in this specification will be partially listed in the following description. The inventive aspects of the methods for constructing the question-and-answer knowledge base and the system provided in this specification can be fully explained through practice or by using the methods, apparatuses, and combinations described in the detailed examples below. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of this specification, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 A schematic diagram illustrating an application scenario of a question-and-answer knowledge base construction system provided according to an embodiment of this specification is shown. Figure 2 A schematic diagram of the hardware structure of a computing device provided according to some embodiments of this specification is shown; Figure 3 A flowchart illustrating a method for constructing a question-and-answer knowledge base according to an embodiment of this specification is shown. Figure 4A schematic diagram illustrating the construction process of a target question-answer pair according to an embodiment of this specification is shown; Figure 5 A flowchart illustrating a method for constructing a question-and-answer knowledge base according to another embodiment of this specification is shown; and Figure 6 A flowchart illustrating a method for constructing a question-and-answer knowledge base according to yet another embodiment of this specification is shown. Detailed Implementation
[0022] The following description provides specific application scenarios and requirements for this specification, intended to enable those skilled in the art to make and use the contents of this specification. Various partial modifications to the disclosed embodiments will be apparent to those skilled in the art, and the general principles defined herein can be applied to other embodiments and applications without departing from the spirit and scope of this specification. Therefore, this specification is not limited to the embodiments shown, but rather to the widest scope consistent with the claims.
[0023] The terminology used herein is for the purpose of describing particular exemplary embodiments only and is not restrictive. For example, unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “the” used herein may also include the plural forms. When used in this specification, the terms “comprising,” “including,” and / or “containing” mean that the associated integers, steps, operations, elements, and / or components are present, but do not exclude the presence of one or more other features, integers, steps, operations, elements, components, and / or groups, or that other features, integers, steps, operations, elements, components, and / or groups may be added to the system / method.
[0024] Considering the following description, these and other features of this specification, as well as the operation and function of the related components of the structure, and the economy of assembly and manufacture of the parts, can be significantly improved. All of these form part of this specification with reference to the accompanying drawings. However, it should be clearly understood that the drawings are for illustrative and descriptive purposes only and are not intended to limit the scope of this specification. It should also be understood that the drawings are not drawn to scale.
[0025] The flowcharts used in this specification illustrate operations implemented according to some embodiments of this specification. It should be clearly understood that the operations in the flowcharts may not be implemented in a sequential order. Instead, the operations may be implemented in reverse order or simultaneously. Furthermore, one or more additional operations may be added to the flowcharts. One or more operations may be removed from the flowcharts.
[0026] In this specification, "X includes at least one of A, B, or C" means that X includes at least A, or X includes at least B, or X includes at least C. That is, X may include only one of A, B, and C, or any combination of A, B, and C, as well as other possible content / elements. The arbitrary combination of A, B, and C can be A, B, C, AB, AC, BC, or ABC.
[0027] In this specification, unless explicitly stated otherwise, the relationships between structures can be direct or indirect. For example, when describing "A is connected to B," unless it is explicitly stated that A and B are directly connected, it should be understood that A can be directly connected to B or indirectly connected to B. Similarly, when describing "A is on top of B," unless it is explicitly stated that A is directly above B (AB is adjacent and A is above B), it should be understood that A can be directly above B or indirectly above B (AB is separated by other elements, and A is above B). And so on.
[0028] It should be noted that the user data obtained in this manual is authorized by the user and does not involve user privacy.
[0029] For ease of description, the terms that will appear later in this manual will be explained first.
[0030] Large Language Model (LLM): Commonly used in the field of artificial intelligence in Natural Language Processing (NLP), it specifically refers to large machine learning models with a large number of parameters and computational resources. Large language models are named for their huge number of parameters and complex network structures. They have powerful feature representation and feature understanding capabilities, and can better capture patterns and regularities in data when dealing with complex tasks. They are designed and trained to better understand and generate natural language.
[0031] Frequently Asked Questions (FAQ): A FAQ is a set of standard questions and answers pre-compiled around a product, service, or topic. It is designed to enable users to quickly and independently resolve the most common questions encountered during use, thereby improving efficiency and reducing service costs.
[0032] Standardized Data Structure (Standardized FAQ Data Structure, QEA): This is a standardized data structure used in question-and-answer knowledge bases to ensure the quality and maintainability of the FAQ knowledge base. Its name comes from the first letters of its three core fields: Q (Query): Question, i.e., the natural language question a user might ask; E (Evidence): Evidence, referring to the original textual evidence supporting the answer (such as the original product documentation), used to verify the correctness and traceability of the answer; and A (Answer): Answer, i.e., the standard response to the question. In addition, a complete QEA structure data record typically includes fields such as Source, Query Type, and Quality Score. The QEA structure ensures consistency and manageability throughout the entire process of FAQ generation, optimization, and evaluation.
[0033] Question-Answer Pairs (QA Pairs): The smallest unit of knowledge consisting of a standard question (Q) and its answer (A), which is the core data of FAQs. It supports one-to-many (1 Q corresponds to n semantically similar A), many-to-many, and many-to-one (n semantically similar Qs correspond to 1 answer A) mapping methods.
[0034] The question-and-answer knowledge base construction method provided in this manual is applicable to scenarios involving the integration of multi-source heterogeneous knowledge and the construction of intelligent question-and-answer systems. For example, in the financial field, an investment question-and-answer knowledge base can be built based on research reports, announcements, and news; in the healthcare field, a patient consultation question-and-answer knowledge base can be built based on medical literature and treatment guidelines; and in enterprise service scenarios, an intelligent customer service question-and-answer knowledge base can be built based on product manuals and historical customer service conversations. The method provided in this manual can be deployed on cloud servers, enterprise internal data platforms, or edge computing devices to handle the automated knowledge extraction and structuring needs from various knowledge sources such as text, databases, and web pages.
[0035] In related technologies, the construction of question-and-answer knowledge bases typically relies on manual annotation or template extraction based on fixed rules. This approach is ill-suited to the rapid processing needs of large-scale, multi-source, heterogeneous knowledge. Due to differences in knowledge structure and expression across different domains and data formats, generated question-and-answer pairs suffer from incomplete coverage, inconsistent quality, and delayed updates. These problems are more pronounced in dynamically changing, multi-source fusion knowledge processing scenarios, specifically manifesting in the following ways: Dispersed data sources lead to integration difficulties; knowledge may be distributed across various carriers such as structured databases, unstructured documents, and semi-structured web pages, with inconsistent formats and standards, making efficient knowledge extraction difficult; diverse semantic expressions result in inaccurate information extraction; the same knowledge point may be expressed differently in different sources, and the question formats are diverse. Fixed extraction templates cannot fully cover these differences in semantic expression, leading to inaccurate information extraction and redundant or missing question-and-answer pairs; difficulty in quality assessment affects the usability and maintainability of the knowledge base. Automatedly generated question-and-answer pairs lack efficient and reliable evaluation mechanisms in terms of factual accuracy, logical coherence, and answer completeness, while manual verification is costly and difficult to apply on a large scale.
[0036] To address this, this specification provides a method for constructing a question-and-answer knowledge base, which achieves unified acquisition, intelligent transformation, and high-quality integration of multi-source heterogeneous knowledge through an automated process. This method can automatically extract key information from various knowledge sources and construct structured question-and-answer pairs. Simultaneously, it supplements each question-and-answer pair with relevant information such as source, basis, and type, thereby forming rich, semantically complete, and easily searchable target question-and-answer pairs. This method improves coverage, automation, and quality control, enhancing the intelligence and scalability of question-and-answer knowledge base construction.
[0037] It should be noted that the above description of application scenarios is only one of the many use cases provided in this specification. Those skilled in the art should understand that when the question-and-answer knowledge base construction method and system provided in this specification are applied to other use cases, their implementation methods and technical effects are similar.
[0038] Figure 1 A schematic diagram of an application scenario 100 of a question-and-answer knowledge base construction system 130 provided according to an embodiment of this specification is shown.
[0039] like Figure 1 As shown, this application scenario may include a question-and-answer knowledge base construction system 130 (hereinafter referred to as: construction system 130).
[0040] In some embodiments, the construction system 130 can be a system that provides automated knowledge extraction and structuring services. The construction system 130 can automatically extract information from various heterogeneous knowledge sources and organize it into a structured, high-quality, and easily searchable question-and-answer knowledge base.
[0041] Specifically, the construction system 130 first acquires knowledge source data from multiple knowledge sources, which may include various data formats such as text, databases, and web pages. For each knowledge source data, the construction system 130 automatically identifies its content and generates a corresponding question-answer pair. Subsequently, the construction system 130 supplements each question-answer pair with necessary related information, such as the knowledge source, the basis for the answer, and the question type, thereby forming a target question-answer pair containing complete metadata, and constructing a question-answer knowledge base based on multiple target question-answer pairs.
[0042] The construction system 130 is a computing system with certain computing capabilities. The construction system 130 can correspond to a single computing device or a computing cluster composed of multiple computing devices. The construction system 130 can be deployed locally or remotely. In some embodiments, the question-answering knowledge base construction method provided in the embodiments of this specification can be executed on the construction system 130. In this case, the construction system 130 can store data or instructions for executing the above methods, and can execute or be used to execute the data or instructions.
[0043] It should be noted that the knowledge source data obtained in this manual are all from publicly available or authorized data sources and do not involve user privacy.
[0044] Figure 2 A schematic diagram of the hardware structure of a computing device 200 according to some embodiments of this specification is shown. This computing device 200 can be used as... Figure 1 The question-and-answer knowledge base construction system 130 is described above. In some embodiments, when the question-and-answer knowledge base construction system 130 employs a device cluster, the computing device 200 can be any one of the devices in the question-and-answer knowledge base construction system 130.
[0045] like Figure 2 As shown, the computing device 200 includes at least one storage medium 230 and at least one processor 220. In some embodiments, the computing device 200 may further include an internal communication bus 210. In some embodiments, the computing device 200 may further include a communication port 250. In some embodiments, the computing device 200 may further include I / O components 260.
[0046] The internal communication bus 210 can connect different system components, including storage medium 230 and processor 220. I / O component 260 supports input / output between computing device 200 and other components.
[0047] Communication port 250 is used for data communication between computing device 200 and the outside world. For example, computing device 200 can connect to a network through communication port 250.
[0048] Storage medium 230 may include a data storage device. The data storage device may be a non-transitory storage medium or a transient storage medium. For example, the data storage device may include one or more of a disk 232, a read-only storage medium (ROM) 234, or a random access storage medium (RAM) 236. Storage medium 230 also includes at least one instruction set stored in the data storage device. The instruction set is computer program code, which may include programs, routines, objects, components, data structures, procedures, modules, etc., that execute the methods for constructing the question-and-answer knowledge base provided in this specification.
[0049] At least one processor 220 is communicatively connected to at least one storage medium 230 via an internal communication bus 210. The at least one processor 220 is used to execute at least one instruction set. When the system 130 is running, the at least one processor 220 reads at least one instruction set and executes the question-and-answer knowledge base construction method provided in this specification according to the instructions of the at least one instruction set.
[0050] Processor 220 can execute all the steps included in the method for building a question-answering knowledge base. Processor 220 can be in the form of one or more processors. Processor 220 can issue execution instructions. Processor 220 can include one or more hardware processors, such as microcontrollers, microprocessors, reduced instruction set computers (RISC), application-specific integrated circuits (ASICs), application-specific instruction set processors (ASIPs), central processing units (CPUs), graphics processing units (GPUs), physical processing units (PPUs), microcontroller units, digital signal processors (DSPs), field-programmable gate arrays (FPGAs), advanced RISC machines (ARMs), programmable logic devices (PLDs), any circuit or processor capable of performing one or more functions, or any combination thereof.
[0051] For illustrative purposes only, only one processor 220 is shown in the accompanying drawings of the computing device 200. However, it should be noted that the computing device 200 may also include multiple processors. Therefore, the operation and / or method steps disclosed herein may be executed by a single processor or by multiple processors in combination, as described herein. For example, if processor 220 of the computing device 200 in this specification executes steps A and B, it should be understood that steps A and B may also be executed jointly or separately by two different processors 220 (e.g., a first processor executes step A, a second processor executes step B, or the first and second processors jointly execute steps A and B).
[0052] Figure 3 A flowchart illustrating a method for constructing a question-and-answer knowledge base according to an embodiment of this specification is shown; the method P300 for constructing the question-and-answer knowledge base can be executed by the construction system 130. Figure 3 As shown, the method P300 provided in this specification may include S310-S350, wherein: S310: Obtain knowledge source data.
[0053] Among them, knowledge source data can be one or more knowledge source data with a single structure, or multiple knowledge source data with heterogeneity. Knowledge source data includes one or more of the following: structured data, semi-structured data, or unstructured data.
[0054] In structured data, information is organized using predefined fields and relationships, making it easy to extract using templates or rules. Structured data includes, but is not limited to, database tables, Excel spreadsheets, and triple data in knowledge graphs.
[0055] Semi-structured data has a certain organizational form, but the structure may not be uniform or completely fixed. Semi-structured data includes, but is not limited to, JavaScript Object Notation (JSON), Extensible Markup Language (XML) documents, Hypertext Markup Language (HTML), log files, etc.
[0056] Unstructured data typically exists in natural language form and does not have a predefined data model. Unstructured data includes, but is not limited to: plain text (such as TXT files), portable document format (PDF) files, presentations (PPT), text converted from images using optical character recognition (OCR), text converted from speech using automatic speech recognition (ASR), web articles, news reports, technical forum posts, product manuals, academic papers, customer service history chat logs, etc.
[0057] For example, the source of knowledge source data can be existing high-quality case data (good case) or manually annotated data. Furthermore, knowledge source data can be acquired through batch import, API calls, reading from a specified file storage directory, or cloud storage services.
[0058] To improve the coverage and diversity of knowledge source data, the system supports unified access and preprocessing of multi-source heterogeneous data. In some embodiments, the system can be configured with data access tasks to periodically or trigger-based (e.g., in response to user import operations) retrieve the latest knowledge source data from preset data sources to support continuous updates of the question-answering knowledge base.
[0059] S330: Based on the question-answer pair generation method corresponding to the knowledge source data, generate one or more initial question-answer pairs corresponding to the knowledge source data. The initial question-answer pairs include questions and corresponding answers. Determine the associated information corresponding to the initial question-answer pairs according to the knowledge source data. Generate target question-answer pairs based on the initial question-answer pairs and their associated information. The associated information is metadata related to the initial question-answer pairs, used to describe one or more of the source, basis, and attributes of the initial question-answer pairs. The target question-answer pairs include the initial question-answer pairs and their corresponding associated information.
[0060] Each initial question-and-answer pair contains a question and a corresponding answer, forming a knowledge unit composed of a question and an answer.
[0061] The question-answer pairs generated from the knowledge source data can be generated in ways including, but not limited to, the following: One approach is a generation method based on a large language model. It relies on the language understanding and generation capabilities obtained by deep neural networks pre-trained on massive corpora. It can flexibly generate natural, fluent, and semantically reasonable question-and-answer pairs in different domains and can be used to process unstructured data sources, semi-structured data sources, and structured data sources.
[0062] Another approach is to generate data based on preset templates. This method fills the raw data into standardized question-and-answer pairs based on existing grammatical patterns and knowledge domain templates. This can improve the consistency and controllability of the generated results and can be used for structured data sources and domain-specific scenarios.
[0063] Another approach is a hybrid generation method that combines large language models and preset templates, which can be used for semi-structured data sources.
[0064] In one possible embodiment, the system can generate question-and-answer pairs corresponding to knowledge source data through a large language model. Specifically, the large language model analyzes the knowledge source data to generate corresponding question-and-answer pairs based on the analysis results. That is, regardless of the structure of the knowledge source data, the large language model is used to generate question-and-answer pairs corresponding to the knowledge source.
[0065] In another possible implementation, the system can select the appropriate question-and-answer pair generation method based on the structure of the knowledge source data, and then generate corresponding question-and-answer pairs according to that method. For example, when building a question-and-answer knowledge base, the system can use multiple methods to generate question-and-answer pairs for knowledge source data with different structures. When the knowledge source data is structured, the system can directly extract and generate the corresponding initial question-and-answer pairs using a preset template. When the knowledge source data is unstructured, such as plain text documents or web page content, the system can generate initial question-and-answer pairs using a large language model. When the knowledge source data is semi-structured, the system can use a hybrid generation method, combining a preset template with a large language model to generate the initial question-and-answer pairs corresponding to the knowledge source data, adapting to the differences in the degree of structure of different parts of the data, thereby generating high-quality question-and-answer pairs more efficiently.
[0066] In some embodiments, the association information is metadata related to the initial question-and-answer pair, used to describe and supplement information such as the background, source, and attributes of the initial question-and-answer pair to enhance its usability, traceability, and manageability. The data structure of the association information includes, but is not limited to, source fields, basis fields, and attribute fields (e.g., question type fields, quality score fields). The determination of the association information can be based on rule matching, metadata extraction, or contextual analysis of the knowledge source data and the initial question-and-answer pair using a large language model.
[0067] The source field is used to store the identifier of the knowledge source data from which the initial question and answer pair originates, such as the path of the source file, the Uniform Resource Locator (URL), the database table name, and the record identifier (ID).
[0068] The "Based On" field is used to store the original text supporting the answer. For example, the "Based On" field can record the original sentence, paragraph number, or start and end positions of the text corresponding to the answer to support the traceability and credibility verification of the answer.
[0069] The question type field stores the category corresponding to the question. This category can be automatically determined based on the question text through rule matching, keyword analysis, or a classification model. Question types can include factual, cause / explanation, operation / step, definition, comparison, etc.
[0070] The quality score field stores the overall quality score of the target question-answer pair. The score can be based on preset rules (such as answer length, keyword coverage) or a lightweight evaluation model. The determination of the score can provide a reference for the subsequent selection and optimization of question-answer pairs.
[0071] After obtaining the initial question-and-answer pairs and their corresponding related information, the system combines and encapsulates these pairs according to a predefined structured format to form complete target question-and-answer pairs. Each target question-and-answer pair is a structured data unit containing both the question-and-answer pair and related information. For example, the system can express target question-and-answer pairs as JSON objects. { Question: How do I reset a user's password? Answer: "Please go to the settings page, select account security, click reset password and follow the instructions." "source": "internal_docs / user_manual_v2.1.pdf", "evidence": "Chapter 5, Section 2, Paragraph 1 of the original text", "question_type": "operation step class", "quality_score": 8.5 } S350: Based on the target question-answer pairs, a question-answer knowledge base is constructed.
[0072] In some embodiments, the system can aggregate all target question-answer pairs from different knowledge source data to form a question-answer pair set, which can be imported into or stored in a specific data storage system, such as a relational database, a non-relational database, or a dedicated vector database.
[0073] The system indexes the aggregated target question-and-answer pairs to support efficient subsequent retrieval and querying, and generates a question-and-answer knowledge base based on the indexing results. The system can perform one or more of the following indexing operations: text indexing, semantic indexing, and attribute indexing.
[0074] The system can build a text index for the question text and / or answer text in a target question-answer pair. The text index can be built in the following ways: the system constructs an inverted index or a full-text index based on the question and answer text content. This is done by establishing a mapping relationship between words and the identifiers of question-answer pairs containing those words. The text index supports keyword matching and fuzzy search.
[0075] The system can build a semantic index based on the semantic content of the target question-answer pair. The semantic index can be constructed as follows: the system converts the question and answer texts into vector representations using a semantic encoding model (such as Sentence-BERT), and then builds a vector index based on these vector representations (e.g., using the FAISS or Annoy libraries). The vector index supports retrieval based on the distance between vectors (such as cosine similarity), and can return the question-answer pair that is semantically closest to the query question.
[0076] The system can build attribute indexes based on fields containing related information (such as source, question type, quality score, etc.) in the target question-answer pair. The attribute indexes support exact match queries based on field values, range queries (such as finding all question-answer pairs with a quality score higher than a certain threshold), and sorting operations. They also support filtering, screening, and grouping by metadata attributes.
[0077] In some embodiments, to improve the indexing speed of the question-answer set, the system can build multiple types of indexes in parallel for each question-answer pair in the set, such as building a corresponding text index, semantic index, and attribute index for each question-answer pair. Through this composite indexing mechanism, the question-answer knowledge base can simultaneously support precise keyword matching, fuzzy retrieval based on semantic similarity, and filtering and sorting based on metadata attributes, thereby meeting diverse subsequent query needs and improving the efficiency and accuracy of knowledge retrieval.
[0078] In some embodiments, the system can enhance and optimize the management functions of the question-and-answer knowledge base, wherein the management functions include, but are not limited to, at least one of the following: version management, access control, updates and interface maintenance.
[0079] In the version management approach, the system establishes a version control mechanism for the question-and-answer knowledge base, recording logs of each addition, deletion, and modification operation in the question-and-answer knowledge base, thereby supporting rollback, comparison, and incremental updates of the question-and-answer knowledge base.
[0080] In access control management, the system sets access policies based on user roles or permissions to control different users' permissions on different parts or specific attribute fields of the question-and-answer knowledge base. Permissions to the question-and-answer knowledge base can include read data, write data, and delete data permissions.
[0081] In the update and interface maintenance management approach, the system provides an application programming interface (API) or a graphical user interface (GUI) to support the batch import of new target question-and-answer pairs into the question-and-answer knowledge base, modification of existing question-and-answer pairs, or deletion of some question-and-answer pairs.
[0082] Through the above steps, multiple independent target question-answer pairs are integrated into a structured question-answer knowledge base that is efficient in retrieval, manageable, and scalable, providing a data foundation for subsequent application scenarios such as knowledge-based intelligent question answering, information retrieval, and decision support.
[0083] For example, the system deploys an indexed and enhanced question-and-answer knowledge base to the service environment, enabling the knowledge base to provide knowledge services to upper-layer applications. For instance, the knowledge base can be integrated into an intelligent customer service system. When a user enters a natural language question, the system can quickly retrieve at least one semantically closest target question-and-answer pair by querying the semantic index of the knowledge base, and return the answers corresponding to each of these pairs as candidate answers to the user.
[0084] In summary, the embodiments provided in this specification involve the following steps: First, the system acquires knowledge source data. Based on the question-and-answer pair generation method corresponding to the knowledge source data, it generates one or more initial question-and-answer pairs, each including a question and its corresponding answer. Therefore, the system can generate initial question-and-answer pairs using appropriate generation methods for knowledge source data with different structures, improving the quality of the initial question-and-answer pairs. Subsequently, the system determines the associated information corresponding to the initial question-and-answer pairs based on the knowledge source data, and generates target question-and-answer pairs based on the initial question-and-answer pairs and their associated information. The target question-and-answer pairs include the initial question-and-answer pairs and their corresponding associated information. Furthermore, the system constructs a question-and-answer knowledge base based on the target question-and-answer pairs. The associated information is metadata related to the initial question-and-answer pairs, used to describe one or more of the sources, bases, and attributes of the initial question-and-answer pairs. The target question-and-answer pairs include both the initial question-and-answer pairs and the associated information. This method of describing and supplementing the sources, bases, and attributes of the initial question-and-answer pairs through associated information enhances their usability, traceability, and manageability. Furthermore, building a question-answering knowledge base based on target question-answer pairs can integrate scattered and independent knowledge source data into a structured knowledge base. This provides a solid knowledge service foundation for subsequent upper-level applications such as intelligent question answering and information retrieval, and also improves the efficiency and quality of question-answering knowledge base construction.
[0085] Furthermore, the system constructs a target question-answer pair by concatenating the question-answer pair and related information to generate the target question-answer pair. This encapsulates the question-answer pair and related information into a unified and complete structured data unit, ensuring the consistency of the target question-answer pair format and facilitating subsequent systematic processing, storage, and retrieval.
[0086] Furthermore, since the system can generate one or more initial question-answer pairs corresponding to the knowledge source data by using the question-answer pair generation method, it can collect knowledge source data from multiple heterogeneous knowledge channels, providing a broad and diverse data foundation for the subsequent construction of the question-answer knowledge base, and enhancing the coverage and information richness of the content contained in the question-answer knowledge base.
[0087] Furthermore, the system can utilize one or more initial question-answer pairs corresponding to the generated knowledge source data from large language models and / or preset templates, thereby automating the process, improving generation efficiency, and reducing manual costs.
[0088] Figure 4 A schematic diagram illustrating the construction process of a target question-answer pair according to an embodiment of this specification is shown, such as... Figure 4 As shown, when the system generates initial question-answer pairs based on a large language model, it can obtain prompt words according to the preset QEA structure and question-answer pairs, extract information from the knowledge source data, and generate initial question-answer pairs based on the extracted information. The prompt words can include relevant instructions for controlling the generation strategy, such as guiding and constraining the question topic, type, length, and style, thereby achieving automated generation of structured initial question-answer pairs.
[0089] Continue as Figure 4 As shown, when the system generates initial question-and-answer pairs based on a preset template, it can perform structured parsing of the knowledge source data according to the preset template to identify key entities and attributes in the knowledge source data, and fill the key entities and attributes into the preset template according to the identification results to generate the initial question-and-answer pairs corresponding to the knowledge source data.
[0090] Key entities are the objects or subjects described, such as product names, fault codes, operation step titles, rule clauses, person names, and location names. Attributes are the features, parameters, or descriptive information associated with the key entities. Attributes can include, but are not limited to: numerical attributes (such as price, quantity, size, weight, temperature, duration, version number, etc.), status attributes (such as operating status: on / off, available: yes / no, completion status: completed / incomplete, level: high / medium / low, etc.), descriptive attributes (such as function description, cause analysis, effect description, definition explanation, etc.), relational attributes (such as category, components, preconditions, subsequent steps, applicable objects, etc.), and spatiotemporal attributes (such as effective time, expiration date, geographical location, applicable area, etc.). Subsequently, the system will fill the identified key entities and attributes into the corresponding placeholders of predefined question and answer templates according to preset mapping rules to generate corresponding initial question-answer pairs.
[0091] For example, the system can generate question-answer pairs using a method based on type recognition and matching with predefined templates. Specifically, the system first performs content analysis on the input knowledge source data to identify its corresponding question-answer type or intent. This identification process can be achieved through rule matching (e.g., based on keywords or field names), classification model prediction, or matching with predefined semantic slots. For instance, for data containing fields such as "warranty period" and "coverage," the system can identify it as a "warranty policy" type.
[0092] After determining the question-and-answer type, the system retrieves and calls the corresponding preset template from the preset template library. The preset templates include question templates and answer templates. Each template defines at least one semantic slot (i.e., placeholder). These semantic slots are used to indicate the information that needs to be included to generate the initial question-and-answer pair. Taking the preset template corresponding to the "warranty policy" type as an example, the preset template may include semantic slots such as {product name}, {warranty duration}, and {coverage conditions}.
[0093] Subsequently, the system extracts the corresponding key entities and attribute values from the knowledge source data based on the semantic definition of the semantic slots in the preset template corresponding to the question-and-answer type. For example, for the semantic slot {warranty duration}, the system will locate and represent the duration value (such as "2 years") from the knowledge source data; for the semantic slot {coverage conditions}, the system will extract the text describing the warranty coverage (such as "non-human-caused damage").
[0094] Finally, the system fills the extracted key entities and attributes into the corresponding semantic slots of the question and answer templates in the preset templates, thereby automatically constructing initial question-answer pairs that are fluent, semantically complete, and formatted correctly. The above-described generation process—identifying the type -> selecting the template -> targeted extraction -> filling to generate initial question-answer pairs—allows the system to intelligently adapt to knowledge source data from different domains and in different formats, thus efficiently and accurately producing structured initial question-answer pairs in batches.
[0095] As an example, for knowledge source data of type "product return policy", the system identifies the key entity in the knowledge source data as "product A", with attributes including: "return period: 7 days", "condition: unopened", and "process: contact customer service to apply". The system can retrieve the corresponding preset template from a pre-defined template library based on the type "product return policy". The preset template includes the question template: "What is the return policy for {product name}?", and the answer template: "{product name} supports returns within the {return period} under {conditions}. The specific process is: {process}". The system fills the identified key entities and attributes into the corresponding positions in the preset template to automatically generate initial question-and-answer pairs. The question in the initial question-and-answer pair is: "What is the return policy for product A?", and the answer in the initial question-and-answer pair is: "Product A supports returns within 7 days, provided it is unopened. The specific process is: contact customer service to apply." Continue as Figure 4 As shown, after obtaining the initial question-answer pairs, the system also determines the association information of each initial question-answer pair based on the large language model, and generates the target question-answer pair based on the determination results and the association information.
[0096] The system inputs initial question-and-answer pairs and their corresponding knowledge source data into a large language model. It then uses pre-defined association information to obtain prompts, guiding the large language model to determine the association information corresponding to the initial question-and-answer pair. This association information includes, but is not limited to: source information, identifying the knowledge source data or data fragments from which the question-and-answer pair originates; basis information, i.e., the location of the original text evidence or key fragments supporting the accuracy of the answer within the knowledge source data; question type information, the category corresponding to the question; and quality scoring information, such as a comprehensive evaluation based on the internal logic, information completeness, and clarity of expression of the question-and-answer pair.
[0097] In some embodiments, the large language model outputs structured association information based on initial question-answer pairs and knowledge source data. Subsequently, the system constructs the initial question-answer pairs and association information according to predefined data specifications (e.g., using JSON or XML format with fixed fields) to generate target question-answer pairs. These target question-answer pairs not only contain the question and its corresponding answer but also metadata for traceability, verification, classification, and quality management, providing a solid data foundation for building a high-quality, maintainable, and interpretable question-answer knowledge base.
[0098] In some embodiments, in order to improve the data quality in the question-answering knowledge base, the system can optimize each target question-answer pair in the question-answering knowledge base to obtain optimized target question-answer pairs.
[0099] Figure 5 This specification illustrates a flowchart of a question-and-answer knowledge base construction method according to another embodiment, as shown below. Figure 5 As shown, after generating multiple target question-answer pairs, the system enters the optimization phase. This optimization includes rewriting and expansion processes and / or deduplication. Subsequently, the system constructs an optimized question-answer knowledge base based on these optimized target question-answer pairs.
[0100] In this process, by rewriting and expanding the target question-answer pairs in the question-answer knowledge base, the expanded question-answer knowledge base can generate multiple related questions with the same semantics but different expressions around the same answer. This expands the coverage of the question-answer knowledge base for diverse and colloquial questioning methods of users, and improves the intent recognition ability and query recall rate of the subsequent intelligent question-answering system in real-world scenarios.
[0101] By deduplicating question-answer pairs in the question-answer knowledge base, the system can automatically identify and merge similar question-answer pairs that are semantically repetitive or highly similar, normalize similar question-answer pairs to standard question-answer pairs, eliminate the waste of storage resources caused by information redundancy, and enhance the simplicity, consistency and maintainability of the knowledge base.
[0102] For example, during the rewrite and expansion process, the system generates one or more related questions that are semantically identical to the questions but have different expressions for the questions in the target question-answer pair, and associates the related questions with the answers in the target question-answer pair.
[0103] By rewriting and expanding the processing, the system can diversify and expand questions while maintaining the semantic intent of the questions in the target question-answer pair. For example, when the question is "How to reset my login password?", the system can generate related questions such as "What should I do if I forget my password?", "What are the steps to reset my login password?", and "What should I do if I can't retrieve my password?". These generated related questions will be associated with the answers in the target question-answer pair, thus forming multiple target question-answer pairs with the same answer corresponding to different questions in the question-answer knowledge base, thereby improving the query coverage of the question-answer knowledge base.
[0104] In some embodiments, the process of rewriting the target problem can be achieved through methods such as preset rule templates, synonym replacement, sentence transformation, or semantic paraphrasing using a large language model.
[0105] During deduplication, the system identifies multiple semantically identical similar questions in the question-answering knowledge base and determines the target question-answer pairs corresponding to these similar questions as similar target question-answer pairs. Semantically identical questions mean that while the expressions of the multiple similar questions differ, their intents are the same. The system generates standard question-answer pairs based on these similar target question-answer pairs. Subsequently, the system adds these standard question-answer pairs as target question-answer pairs to the question-answering knowledge base and deletes multiple similar target question-answer pairs from the knowledge base.
[0106] The deduplication process described above not only eliminates duplicate questions but also merges multiple similar question-answer pairs, thereby reducing redundant data in the question-answer knowledge base and reducing its storage overhead.
[0107] Specifically, the system constructs a system that uses semantic similarity calculation (e.g., based on word vectors, sentence vectors, or deep learning models) to identify multiple questions that express different meanings but have the same intent, and determines the target question-answer pairs corresponding to multiple questions as similar question-answer pairs.
[0108] In some embodiments, the standard questions and standard answers are generated based on initial question-answer pairs corresponding to multiple similar question-answer pairs.
[0109] As an example, a standardized answer can be selected from the initial question-answer pairs corresponding to multiple similar question-answer pairs based on factors such as completeness and accuracy. Alternatively, a large language model can be used to merge and refine the initial question-answer pairs corresponding to multiple similar question-answer pairs to generate a standardized answer.
[0110] For example, the question-and-answer database may contain three similar questions with different expressions but the same intent: "Is Beijing the capital of China?", "Is Beijing the capital of my country?", and "Where is the capital of our country located?". After deduplication, these three questions can be mapped to the standardized question "What city is the capital of China?" and uniformly associated with the standardized answer "Beijing", so as to form a standard question-and-answer pair based on the standardized question and standardized answer.
[0111] In some embodiments, the association information is obtained by fusing the association information corresponding to multiple similar question-answer pairs. Specifically, the system can fuse the association information corresponding to multiple similar question-answer pairs and determine the association information corresponding to the standard question-answer pair based on the fusion result.
[0112] As an example, the system can fuse the associated information corresponding to multiple similar question-answer pairs in the following ways: merging, selecting parts, fusion based on confidence principle, fusion based on majority principle, fusion based on average principle, etc.
[0113] In some embodiments, the rewriting and expansion process can be performed in the later stages of the question-answering knowledge base construction phase or in the initial optimization phase. The rewriting and expansion process operates on a single high-quality target question-answer pair. The construction system uses rule templates or a large language model to generate at least one similar question that is semantically similar to but expresses differently from the question contained in the target question-answer pair.
[0114] For example, to prevent subsequent deduplication operations from removing the rewritten and expanded content, the system can assign a unified source identification (ID) to all similar questions originating from the same answer. For instance, all similar questions originating from the same answer can be assigned the same family ID or associated with the same answer ID; questions with the same source identification are considered to be from the same source.
[0115] Deduplication can be performed after rewriting is complete, or as a periodic maintenance task of the question-answering knowledge base. The purpose of deduplication is to identify semantic redundancy among other questions that are not identified as related questions in multiple target question-answer pairs.
[0116] As an example, the system can calculate the semantic similarity between questions in a question-answering knowledge base. When highly similar questions are found, the system checks whether they have a common-origin identifier. For multiple similar questions that have no common-origin identifier but are highly similar, the system further determines the similar question-answer pairs corresponding to these multiple similar questions. Alternatively, the system can calculate the semantic similarity between other questions in the question-answering knowledge base that are not identified as common-origin questions. Subsequently, the system identifies multiple other questions that are semantically highly similar and determines the similar question-answer pairs corresponding to these other questions. Then, the system maps these multiple similar question-answer pairs to a single standard question-answer pair. Finally, the system removes these multiple similar question-answer pairs from the question-answering knowledge base to eliminate duplicate target question-answer pairs in the knowledge base.
[0117] Since the questions and similar questions in the target question-answer pair generated by the rewriting process have the same common origin identifier, the deduplication process can treat multiple questions with the same common origin identifier as a whole and skip the semantic similarity comparison between multiple questions (multiple questions with the same common origin identifier) contained in the whole, thereby avoiding the problem of erroneous merging.
[0118] The system employs a phased approach—first rewriting and expanding the question-answering knowledge base to generate source tags, then intelligently identifying and deduplicating data—ensuring that the diversity of questions arising from the rewriting and expansion process is preserved, while simultaneously eliminating other redundant data in the question-answering knowledge base. This collaborative process achieves a balance between richness and simplicity in the question-answering knowledge base, while avoiding the ineffective consumption of computational resources.
[0119] In some embodiments, the system also needs to perform a quality assessment on the optimized target question-answer pairs. For example, the system performs a quality assessment on the target question-answer pairs in the optimized question-answer knowledge base using a large language model, and updates the target question-answer pairs in the optimized question-answer knowledge base based on the quality assessment results, thus obtaining an updated question-answer knowledge base.
[0120] The quality assessment result can be a quality score or a confidence level. By introducing a large language model to assess the quality of the optimized target question-and-answer pairs, the system can automatically and intelligently identify the quality assessment results. Based on the quality assessment results, the system can then perform targeted corrections and improvements on low-quality target question-and-answer pairs. Subsequently, based on the modified target question-and-answer pairs, the system updates the target question-and-answer knowledge base, ensuring that all target question-and-answer pairs in the updated knowledge base meet the preset quality standards.
[0121] The aforementioned quality control steps, while reducing the cost of manual review and subjective errors, improve the overall reliability, consistency, and professionalism of the question-and-answer knowledge base, providing a stable and reliable data foundation for its subsequent applications in intelligent question answering, information retrieval, and other fields.
[0122] In some embodiments, the system can filter out low-quality target question-answer pairs whose evaluation results do not meet preset requirements based on the quality assessment results. Then, the system modifies the low-quality target question-answer pairs until their quality assessment results meet the preset requirements. Finally, the system updates the target question-answer pairs in the question-answer knowledge base based on the modified target question-answer pairs.
[0123] For example, the construction module categorizes target question-answer pairs in the question-answering knowledge base into high-quality and low-quality pairs based on the quality assessment results. High-quality target question-answer pairs can be directly stored in the knowledge base. Low-quality pairs are selected for modification, and their quality is reassessed until the assessment result indicates they are high-quality. Only then are the high-quality pairs stored in the knowledge base. This method ensures the reliability of the target question-answer pairs contained in the knowledge base.
[0124] As an example, the system can input low-quality target question-and-answer pairs, quality assessment results, and preset modification prompts into a large language model, and then modify the low-quality target question-and-answer pairs based on the large language model; alternatively, the system can assign low-quality target question-and-answer pairs to humans for review, correction, or re-annotation. Specific modification methods can be flexibly adjusted according to user needs and are not limited to those given in the above embodiments.
[0125] In some embodiments, quality assessment may be based on one or more preset dimensions. These preset dimensions may include one or more of the following: factual accuracy, question-answer relevance, question-answer completeness, expression coherence, and expression richness.
[0126] Figure 6A flowchart illustrating a method for constructing a question-and-answer knowledge base according to yet another embodiment of this specification is shown, such as... Figure 6 As shown, after acquiring the knowledge source data, the question-and-answer knowledge base construction system enters the stage of automatically generating initial question-and-answer pairs. In this stage, the system employs two parallel paths for generating initial question-and-answer pairs.
[0127] On the one hand, the system is built based on the generation method of a large language model. By inputting knowledge source data into the large language model, the system generates initial question-and-answer pairs corresponding to the knowledge source data through a preset question-and-answer pair generation strategy.
[0128] On the other hand, the system generates structured initial question-and-answer pairs by filling key entities and attributes from the knowledge source data into a preset template. Furthermore, the system inputs both the knowledge source data and the initial question-and-answer pairs into a large language model to extract the associated information. Finally, the system generates target question-and-answer pairs based on the initial question-and-answer pairs and their corresponding associated information.
[0129] Following this, the optimization phase of the target question-answer pairs begins. This optimization includes rewriting and expansion, and deduplication. Rewriting and expansion generates multiple semantically identical but differently expressed similar questions for the answers in the target question pair, improving the query coverage of the question-answering knowledge base. Deduplication aims to identify and merge semantically repetitive similar target question-answer pairs in the question-answering knowledge base, mapping them to the same standardized question and answer. Then, similar target question-answer pairs are removed from the knowledge base, retaining only the target question-answer pairs corresponding to multiple similar pairs, thus reducing data redundancy in the knowledge base.
[0130] After optimization, the system enters the question-and-answer pair quality control phase. Only target question-and-answer pairs that pass quality review are ultimately stored in the question-and-answer knowledge base. The system performs quality assessments on each target question-and-answer pair across multiple dimensions, obtaining the assessment results and updating the knowledge base based on these results. These dimensions include one or more of the following: factual accuracy, question-and-answer relevance, question-and-answer completeness, expression coherence, and expression richness. Furthermore, the system modifies low-quality target question-and-answer pairs based on the quality assessment results until the modified results meet preset requirements. Finally, the system updates the target question-and-answer pairs in the knowledge base based on the modified results, resulting in an updated knowledge base.
[0131] This specification, in another aspect, provides a computer-readable non-transitory storage medium storing at least one set of instructions executable for constructing a question-and-answer knowledge base. When the at least one set of instructions is executed by a processor, it instructs the processor to implement the steps of the question-and-answer knowledge base construction method P300 of this specification. In some possible embodiments, various aspects of this specification may also be implemented as a program product comprising program code. When the program product is run on a construction system 130, the program code causes the construction system 130 to perform the steps of the method P300 described in this specification. The program product for implementing the above method may employ a portable compact disk read-only memory (CD-ROM) containing program code and may run on the construction system 130. However, the program product of this specification is not limited thereto. In this specification, the readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system. The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing. Computer-readable storage media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A readable storage medium may also be any readable medium other than a readable storage medium that can send, propagate, or transmit programs for use by or in connection with an instruction execution system, apparatus, or device. Program code contained on a readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination of the foregoing. Program code for performing the operations described herein may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar programming languages.
[0132] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0133] In summary, after reading this detailed disclosure, those skilled in the art will understand that the foregoing detailed disclosure may be presented by way of example only and may not be restrictive. Although not explicitly stated herein, those skilled in the art will understand that this specification requires various reasonable changes, improvements, and modifications to the embodiments. These changes, improvements, and modifications are intended to be made by this specification and are within the spirit and scope of the exemplary embodiments described herein.
[0134] Furthermore, certain terms in this specification have been used to describe embodiments of this specification. For example, "an embodiment," "an embodiment," and / or "some embodiments" mean that a particular feature, structure, or characteristic described in connection with that embodiment may be included in at least one embodiment of this specification. Therefore, it is to be emphasized and understood that two or more references to "an embodiment" or "an embodiment" or "alternative embodiment" in various parts of this specification do not necessarily refer to the same embodiment. Moreover, specific features, structures, or characteristics may be suitably combined in one or more embodiments of this specification.
[0135] It should be understood that in the foregoing description of the embodiments in this specification, various features are combined in a single embodiment, drawing, or description for the purpose of simplifying the description and to aid in understanding a feature. However, this does not mean that the combination of these features is necessary, and those skilled in the art, upon reading this specification, may readily identify some of the devices as separate embodiments. That is, the embodiments in this specification can also be understood as an integration of multiple secondary embodiments. And the content of each secondary embodiment is valid even if it contains fewer than all the features of a single foregoing disclosed embodiment.
[0136] Every patent, patent application, publication of a patent application, and other material, such as articles, books, specifications, publications, documents, and literature (excluding any related historical examination documents), cited in this disclosure is incorporated herein for all purposes, including, for example, in the specification and claims of this disclosure. However, in the event of any inconsistency or conflict between the descriptions, definitions, and / or terms used in the foregoing and those used in this disclosure, the descriptions, definitions, and / or terms used in this disclosure shall prevail.
[0137] Finally, it should be understood that the embodiments disclosed herein are illustrative of the principles of the embodiments described in this specification. Other modified embodiments are also within the scope of this specification. Therefore, the embodiments disclosed in this specification are merely examples and not limitations. Those skilled in the art can implement the applications described in this specification using alternative configurations based on the embodiments in this specification. Therefore, the embodiments in this specification are not limited to the embodiments precisely described in the applications.
Claims
1. A method for constructing a question-answering knowledge base, wherein, The method includes: Acquire knowledge source data; Based on the question-answer pair generation method corresponding to the knowledge source data, one or more initial question-answer pairs corresponding to the knowledge source data are generated, each initial question-answer pair including a question and a corresponding answer; the associated information corresponding to the initial question-answer pairs is determined according to the knowledge source data, and target question-answer pairs are generated based on the initial question-answer pairs and the associated information, wherein the associated information is metadata related to the initial question-answer pairs, used to describe one or more of the source, basis, and attributes of the initial question-answer pairs; and A question-and-answer knowledge base is constructed based on the target question-and-answer pairs.
2. The method according to claim 1, wherein, The data structure of the associated information includes one or more of the following fields: The source field is used to store the identifier of the knowledge source data from which the initial question and answer pair originates; The "Based on" field is used to store the original text supporting the answer. The question type field is used to store the category corresponding to the question. The quality score field is used to store the overall quality score of the target question and answer pair.
3. The method according to claim 1, wherein, The method further includes: The target question-answer pairs in the question-answering knowledge base are optimized to obtain optimized target question-answer pairs; the optimization process includes: rewriting and expansion processing and / or deduplication processing; and Based on multiple optimized target question-answer pairs, an optimized question-answer knowledge base is constructed.
4. The method according to claim 3, wherein, The rewrite and expansion process includes: For each question in the target question-answer pair, generate one or more related questions that are semantically the same as the question but have different expressions, and associate the related questions with the answers in the target question-answer pair.
5. The method according to claim 3, wherein, The deduplication process includes: In the question-answering knowledge base, multiple similar questions with the same semantics are identified, and the target question-answer pairs corresponding to the multiple similar questions are determined as similar question-answer pairs; Based on multiple similar question-answer pairs, standard question-answer pairs are generated; wherein, each standard question-answer pair includes a standard question, a standard answer, and related information, wherein the standard question and the standard answer are generated based on the initial question-answer pairs corresponding to the multiple similar question-answer pairs respectively, and the related information is obtained by fusing the related information corresponding to the multiple similar question-answer pairs respectively; and The standard question-answer pair is added to the question-answer knowledge base as the target question-answer pair, and multiple similar question-answer pairs are deleted from the question-answer knowledge base.
6. The method according to claim 3, wherein, The method further includes: The quality of the target question-answer pairs in the optimized question-answer knowledge base is evaluated using a large language model, and the target question-answer pairs in the optimized question-answer knowledge base are updated based on the quality evaluation results to obtain the updated question-answer knowledge base.
7. The method according to claim 6, wherein, The process of updating the target question-answer pairs in the optimized question-answer knowledge base based on the quality assessment results yields an updated question-answer knowledge base, including: Based on the quality assessment results, low-quality target question-answer pairs that do not meet the preset requirements are selected; and The low-quality target question-and-answer pairs are modified until their quality assessment results meet the preset requirements, and the question-and-answer knowledge base is updated based on the modified target question-and-answer pairs.
8. The method according to claim 6, wherein, The quality assessment is based on one or more of the following preset dimensions: Accuracy of facts, relevance of questions and answers, completeness of questions and answers, coherence of expression, and richness of expression.
9. The method according to claim 1, wherein, The knowledge source data includes one or more of the following: structured data, semi-structured data, or unstructured data; The method for generating one or more initial question-answer pairs corresponding to the knowledge source data, based on the question-answer pair generation method corresponding to the knowledge source data, includes: When the knowledge source data is structured data, the knowledge source data is extracted using a preset template to generate corresponding initial question-and-answer pairs; When the knowledge source data is unstructured data, the initial question-answer pair is generated through a large language model; When the knowledge source data is semi-structured data, the initial question-answer pairs corresponding to the knowledge source data are generated by combining the preset template with the large language model.
10. The method according to claim 9, wherein, The step of extracting the knowledge source data and generating corresponding initial question-and-answer pairs using a preset template includes: Identify the key entities and attributes in the knowledge source data; and The key entities and attributes are filled into the question template and answer template in the preset template to generate the initial question-answer pair corresponding to the knowledge source data.
11. The method according to claim 1, wherein, The method for generating one or more initial question-answer pairs corresponding to the knowledge source data, based on the question-answer pair generation method corresponding to the knowledge source data, includes: One or more initial question-answer pairs are generated based on the large language model, corresponding to the knowledge source data.
12. A system for constructing a question-answering knowledge base, comprising: At least one storage medium storing at least one instruction set for constructing a question-and-answer knowledge base; as well as At least one processor is communicatively connected to the at least one storage medium, wherein the at least one processor reads the at least one instruction set during operation and executes the method according to any one of claims 1-11 as instructed by the at least one instruction set.