Method and apparatus for conducting a question and answer, electronic device, storage medium
By performing semantic understanding on the user-input question text through a pre-set entity and concept library, the answer can be obtained directly from the information table. This solves the problem that existing table-based knowledge question answering technologies require a large amount of training data, and realizes a fast and efficient question answering method.
Patent Information
- Application Number
- CN202111564917.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-20
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2041-12-20
AI Technical Summary
Existing table-based knowledge answering technologies require a large amount of training data and manpower, making it difficult to achieve efficient question answering.
By using a pre-defined entity and concept library to perform semantic understanding of the user's input question text, the answer can be obtained directly from the information table, avoiding extensive training of the question-answering model.
It enables rapid implementation of a table-based knowledge question-answering method without requiring a significant investment of time and labor, providing an 'out-of-the-box' question-answering solution.
Smart Images

Figure CN114328825B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of knowledge question answering technology, such as a method and apparatus for question answering, electronic devices, and storage media. Background Technology
[0002] Existing technologies typically utilize artificial intelligence and other techniques to automatically answer user-inputted questions using natural language that humans can understand. This is commonly used in customer service robots, intelligent assistants, and shopping guides. Based on the source of the question-and-answer knowledge, related technologies can be categorized into knowledge graph-based question answering, question-and-answer pair-based question answering, document-based question answering, and table-based question answering.
[0003] In the process of implementing the embodiments of this disclosure, at least the following problems were found in the related art:
[0004] In existing technologies, table-based question answering is usually achieved by using a pre-trained knowledge question answering model. However, training a knowledge question answering model often requires a large amount of training data. Obtaining training data and training the knowledge question answering model consumes a lot of time and labor, making it difficult to achieve table-based knowledge question answering. Summary of the Invention
[0005] To provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. This summary is not intended as a general commentary, nor is it intended to identify key / important components or describe the scope of protection of these embodiments, but rather as a prelude to the detailed description that follows.
[0006] This disclosure provides a method, apparatus, electronic device, and storage medium for question answering, enabling easier implementation of table-based knowledge question answering.
[0007] In some embodiments, the method for question answering includes: obtaining question text input by a user; performing semantic understanding on the question text according to a preset entity library and a preset concept library to obtain a target concept corresponding to the question text; both the entity library and the concept library are obtained according to a preset information table; and obtaining an answer corresponding to the target concept from the information table.
[0008] In some embodiments, the apparatus for question answering includes: a first acquisition module configured to acquire question text input by a user; a semantic understanding module configured to perform semantic understanding on the question text according to a preset entity library and a preset concept library to obtain a target concept corresponding to the question text; wherein the entity library and the concept library are both obtained according to a preset information table; and a second acquisition module configured to acquire an answer corresponding to the target concept from the information table.
[0009] In some embodiments, the electronic device includes a processor and a memory storing program instructions, the processor being configured to perform the question-and-answer method as described above when the program instructions are executed.
[0010] In some embodiments, the storage medium stores program instructions that, when executed, perform the above-described question-and-answer method.
[0011] The method, apparatus, electronic device, and storage medium for question answering provided in this disclosure can achieve the following technical effects: It acquires the question text input by the user; performs semantic understanding on the question text based on a preset entity library and a preset concept library to obtain the target concept corresponding to the question text; both the entity library and the concept library are obtained based on preset information tables; and retrieves the answer corresponding to the target concept from the information table. By acquiring the target concept corresponding to the question text based on the preset entity library and the preset concept library, and directly retrieving the answer corresponding to the target concept from the information table, a large amount of training material is not required to train the question answering model, making the table-based knowledge question answering method easier to implement.
[0012] The above general description and the description below are exemplary and illustrative only and are not intended to limit this application. Attached Figure Description
[0013] One or more embodiments are illustrated by way of example with reference to the accompanying drawings. These illustrations and drawings do not constitute a limitation on the embodiments. Elements having the same reference numerals in the drawings are shown as similar elements. The drawings are not to be scaled. And wherein:
[0014] Figure 1 This is a schematic diagram of a question-and-answer method provided in an embodiment of this disclosure;
[0015] Figure 2 This is a schematic diagram of another question-and-answer method provided in this embodiment of the disclosure;
[0016] Figure 3 This is a schematic diagram of another question-and-answer method provided in this embodiment of the disclosure;
[0017] Figure 4 This is a schematic diagram of another question-and-answer method provided in this embodiment of the disclosure;
[0018] Figure 5 This is a schematic diagram of a question-and-answer apparatus provided in an embodiment of this disclosure;
[0019] Figure 6 This is a schematic diagram of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0020] To provide a more detailed understanding of the features and technical content of the embodiments of this disclosure, the implementation of the embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. The accompanying drawings are for illustrative purposes only and are not intended to limit the embodiments of this disclosure. In the following technical description, for ease of explanation, several details are used to provide a full understanding of the disclosed embodiments. However, one or more embodiments may still be implemented without these details. In other cases, well-known structures and devices may be simplified in their depiction to simplify the drawings.
[0021] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this disclosure described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion.
[0022] Unless otherwise stated, the term "multiple" means two or more.
[0023] In this embodiment of the disclosure, the character " / " indicates that the objects before and after it are in an "or" relationship. For example, A / B means: A or B.
[0024] The term "and / or" describes an association between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or A and B.
[0025] The term "correspondence" can refer to an association or binding relationship. The correspondence between A and B means that there is an association or binding relationship between A and B.
[0026] Combination Figure 1 As shown, this disclosure provides a method for question answering, including:
[0027] Step S101: Obtain the question text input by the user.
[0028] Step S102: Semantically understand the question text based on the preset entity library and the preset concept library to obtain the target concept corresponding to the question text; both the entity library and the concept library are obtained based on the preset information table.
[0029] Step S103: Obtain the answer corresponding to the target concept from the information table.
[0030] The question-answering method provided in this disclosure involves: acquiring user-inputted question text; performing semantic understanding on the question text based on a preset entity library and a preset concept library to obtain the target concept corresponding to the question text; both the entity library and the concept library are obtained from preset information tables; and retrieving the answer corresponding to the target concept from the information table. By obtaining the target concept corresponding to the question text from the preset entity library and the preset concept library, and directly retrieving the answer corresponding to the target concept from the information table, a large amount of training material is not required for training the question-answering model, thus saving significant time and labor, making table-based knowledge question-answering methods easier to implement.
[0031] Optionally, the concept base is obtained based on a preset information table, including: extracting first concept information from the information table; the first concept information includes the header information in the information table. The first concept information is then stored in the concept base.
[0032] In some embodiments, the information table is as shown in Table 1, which represents an information table of a transistor provided in the embodiments of this disclosure.
[0033] name Packaging polarity Function Pressure resistance Current power frequency Pairing tubes D633 28 NPN Audio amplifier switch 100V 7A 40W Darlington 9013 21 NPN Low frequency amplification 50V 0.5A 0.625W 9012 9014 21 NPN Low noise amplification 50V 0.1A 0.4W 150HMZ 9015 9015 21 NPN Low noise amplification 50V 0.1A 0.4W 150HMZ 9014
[0034] Table 1
[0035] In some embodiments, Table 1 is an information table of a transistor provided in this disclosure; as shown in Table 1, the header information in Table 1 includes: "Name", "Package", "Polarity", "Function", "Bandwidth", "Current", "Power", "Frequency" and "Matching Transistor". The first concept information extracted from Table 1 includes: "Name", "Package", "Polarity", "Function", "Bandwidth", "Current", "Power", "Frequency" and "Matching Transistor".
[0036] Optionally, obtaining the entity database based on a preset information table includes: extracting metadata and corresponding secondary concept information from the information table; and storing the metadata and corresponding secondary concept information into the entity database.
[0037] Optionally, the second concept information is the same as the first concept information. Optionally, the metadata and the corresponding second concept information are entities.
[0038] In some embodiments, as shown in Table 1, the transistor named 9013 has a package of 21, an NPN polarity, a low-frequency amplification function, a withstand voltage of 50V, a current of 0.625W, and a matching transistor of 9012. The second set of conceptual information includes: "Name", "Package", "Polarity", "Function", "Voltage", "Current", "Power", "Frequency", and "Matching Transistor"; the metadata corresponding to "Name" includes: D633, 9013, 9014, and 9015; the metadata corresponding to "Package" includes: 28 and 21; the metadata corresponding to "Polarity" includes: NPN; the metadata corresponding to "Function" includes: "Audio Amplifier Switch", "Low-Frequency Amplification", and "Low-Noise Amplification"; the metadata corresponding to "Voltage" includes: 100V and 50V; the metadata corresponding to "Current" includes: 7A, 0.5A, and 0.1A; the metadata corresponding to "Power" includes: 40W, 0.625W, and 0.4W; the metadata corresponding to "Frequency" includes: 150HMZ; and the metadata corresponding to "Matching Transistor" includes: Darlington, 9012, 9015, and 9014.
[0039] In this way, by performing natural language processing on the information table, the information table is used to extract the first concept information and extract the information table to obtain the metadata and its corresponding second concept information. The first concept information is stored in the concept library and the metadata and its corresponding second concept information are stored in the entity library to form the concept library and entity library, which facilitates the semantic understanding of the question text input by the user.
[0040] Optionally, semantic understanding of the question text is performed based on a preset entity library and a preset concept library to obtain the target concept corresponding to the question text, including: matching the question text with the entity library and the concept library to obtain the entities and concepts corresponding to the question text; and determining the target concept based on the entities and concepts.
[0041] Optionally, the entity library and concept library are used to match the question text to obtain the entities and concepts corresponding to the question text, including: matching entities associated with keywords in the question text from the entity library, and matching concepts that are the same as keywords in the question text from the concept library.
[0042] Optionally, when the keywords include metadata, the entities associated with the keywords in the question text include: metadata and the secondary concept information corresponding to the metadata.
[0043] Optionally, determining the target concept based on entities and concepts includes: inferring the target concept using entities and concepts according to preset inference rules.
[0044] Optionally, the preset inference rules include: determining the first concept information that both the entity and the concept correspond to as the target concept.
[0045] In some embodiments, the question text is “What is the encapsulation of 9013?”, the entities extracted from the question text include “9013” and “name”, and the concept extracted from the question text includes “encapsulation”; then the target concept is: “encapsulation” with “name” “9013”.
[0046] Optionally, determining the target concept based on entities and concepts further includes: obtaining the syntactic relations corresponding to the question text using entities and concepts based on a pre-defined semantic analysis model; constructing the semantic relations corresponding to the question text based on the syntactic relations; and inferring the target concept corresponding to the question text by combining the semantic relations. In this way, obtaining the semantic relations corresponding to each component in the question text through a semantic analysis model can improve the accuracy of target concept inference.
[0047] Optionally, the preset semantic analysis model includes dependency parsing models or phrase structure parsing models. In this way, by analyzing the syntactic relations corresponding to the question text using deep learning technology, the semantic relations of the question text can be obtained, and the accuracy of inferring the target concept can be improved based on these semantic relations.
[0048] In some embodiments, when analyzing the syntactic relations of a problem text using a dependency parsing model, the interdependencies between words in the sentences of the problem text can be identified. When analyzing the syntactic relations of a problem text using a sentence structure parsing model, the phrase structures in the sentences of the problem text and the hierarchical syntactic relations between phrases can be identified, thereby facilitating the acquisition of the semantic relations of the problem text.
[0049] Optionally, syntactic relations include at least one of the following: subject-predicate relation, verb-object relation, verb-complement relation, modifier-head relation, complement relation, coordinate relation, successive relation, progressive relation, alternative relation, adversative relation, hypothetical relation, causal relation, conditional relation, explanatory relation, and purpose relation.
[0050] Combination Figure 2 As shown, this disclosure provides a method for question answering, including:
[0051] Step S201: Obtain the question text input by the user.
[0052] Step S202: Match the question text using a preset entity library and a preset concept library to obtain the entities and concepts corresponding to the question text.
[0053] Step S203: Determine the target concept based on the entity and concept.
[0054] Step S204: Obtain the answer corresponding to the target concept from the information table.
[0055] The question-answering method provided in this disclosure involves: acquiring user-inputted question text; performing semantic understanding on the question text based on a preset entity library and a preset concept library to obtain the target concept corresponding to the question text; both the entity library and the concept library are obtained from preset information tables; and retrieving the answer corresponding to the target concept from the information table. By matching entities and concepts from the preset entity library and the preset concept library, determining the target concept corresponding to the question text based on the entities and concepts, and directly retrieving the answer corresponding to the target concept from the information table, this eliminates the need for extensive training of the question-answering model, reducing the time and labor required and making table-based knowledge question-answering methods easier to implement.
[0056] Optionally, obtaining the answer corresponding to the target concept from the information table includes: obtaining table query conditions based on the target concept; retrieving knowledge data corresponding to the table query conditions from the information table; and generating the answer corresponding to the target concept from the knowledge data according to a preset answer template.
[0057] Optionally, table query criteria can include entities and concepts.
[0058] In some embodiments, the user inputs the question text "books with the title 'Hua Wuque'", and the target concept corresponding to this question text is "books with the title 'Hua Wuque'"; then the query condition corresponding to this target concept is "Select: 'Book title' = 'Hua Wuque'".
[0059] Optionally, obtaining table query conditions based on the target concept includes: matching table query conditions corresponding to the target concept from a preset database; the database stores the correspondence between the target concept and the table query conditions.
[0060] Optionally, the preset answer template is a manually predefined template.
[0061] Optionally, after matching the question text using entity and concept libraries, the method further includes: matching the question text using a pre-defined thesaurus to obtain the entities and concepts corresponding to the question text.
[0062] Combination Figure 3 As shown, this disclosure provides a method for question answering, including:
[0063] Step S301: Obtain the question text input by the user.
[0064] Step S302: Use the preset entity library, preset concept library and preset thesaurus to match the question text to obtain the entities and concepts corresponding to the question text.
[0065] Step S303: Determine the target concept based on the entity and the concept.
[0066] Step S304: Obtain the answer corresponding to the target concept from the information table.
[0067] The question-answering method provided in this disclosure involves: acquiring user-inputted question text; performing semantic understanding on the question text based on a preset entity library and a preset concept library to obtain the target concept corresponding to the question text; both the entity library and the concept library are obtained from preset information tables; and retrieving the answer corresponding to the target concept from the information table. By adding a thesaurus to match entities and concepts in the question text, the acquired entities and concepts become more comprehensive. Expanding the entity and concept data in the information table improves the accuracy of obtaining the target concept, thereby addressing the problem of insufficient recall. Simultaneously, determining the target concept corresponding to the question text based on entities and concepts and directly retrieving the answer corresponding to the target concept from the information table eliminates the need for extensive training of the question-answering model, reducing time and labor costs and making table-based knowledge question-answering methods easier to implement.
[0068] Optionally, after obtaining the answer corresponding to the target concept from the information table, the method also includes: providing the answer back to the user.
[0069] Combination Figure 4 As shown, this disclosure provides a method for question answering, including:
[0070] Step S401: Obtain the question text input by the user.
[0071] Step S402: Semantically understand the question text based on the preset entity library and the preset concept library to obtain the target concept corresponding to the question text; both the entity library and the concept library are obtained based on the preset information table.
[0072] Step S403: Obtain the answer corresponding to the target concept from the information table.
[0073] Step S404: Provide the answer to the user.
[0074] The question-answering method provided in this disclosure obtains the target concept corresponding to the question text from a preset entity library and a preset concept library, directly obtains the answer corresponding to the target concept from an information table, and provides the answer back to the user. This eliminates the need for extensive training of the question-answering model, making the table-based knowledge question-answering method easier to implement, thus achieving an "out-of-the-box" question-answering method and providing answers to the user more quickly.
[0075] Optionally, combined Figure 5As shown in the figure, this disclosure provides an apparatus for question answering, including: a first acquisition module 501, a semantic understanding module 502, and a second acquisition module 503; the first acquisition module 501 is configured to acquire question text input by a user and send the question text to the semantic understanding module; the semantic understanding module 502 is configured to receive the question text sent by the first acquisition module, perform semantic understanding on the question text according to a preset entity library and a preset concept library to obtain the target concept corresponding to the question text; both the entity library and the concept library are obtained according to a preset information table; and send the target concept to the second acquisition module; the second acquisition module 503 is configured to receive the target concept sent by the semantic understanding module and obtain the answer corresponding to the target concept from the information table.
[0076] The question-answering apparatus provided in this embodiment acquires user-inputted question text via a first acquisition module; a semantic understanding module performs semantic understanding on the question text based on a preset entity library and a preset concept library to obtain the target concept corresponding to the question text; and a second acquisition module retrieves the answer corresponding to the target concept from an information table. In this way, by acquiring the target concept corresponding to the question text based on the preset entity library and the preset concept library, and directly retrieving the answer corresponding to the target concept from the information table, a large amount of training material is not required for training the question-answering model, thus reducing the time and labor costs and making table-based knowledge question-answering methods easier to implement.
[0077] Optionally, the device for question answering further includes a concept extraction module, configured to obtain a concept library based on a preset information table, including: extracting first concept information from the information table; the first concept information includes header information in the information table. The first concept information is then stored in the concept library. Optionally, the concept extraction module is configured to perform concept extraction when the device for question answering is offline.
[0078] Optionally, the device for question answering further includes an entity extraction module, which is configured to obtain an entity library based on a preset information table, including: extracting metadata and corresponding second concept information from the information table; and storing the metadata and corresponding second concept information into the entity library. Optionally, the entity extraction module is configured to perform entity extraction when the device for question answering is offline.
[0079] Optionally, the semantic understanding module is configured to perform semantic understanding on the question text based on a preset entity library and a preset concept library to obtain the target concept corresponding to the question text: matching the question text with the entity library and the concept library to obtain the entities and concepts corresponding to the question text; and determining the target concept based on the entities and concepts.
[0080] Optionally, the second acquisition module is configured to acquire the answer corresponding to the target concept from the information table in the following ways: acquire the table query conditions based on the target concept; retrieve the knowledge data corresponding to the table query conditions from the information table; and generate the answer corresponding to the target concept from the knowledge data according to the preset answer template.
[0081] Optionally, after matching the question text using entity and concept libraries, the method further includes: matching the question text using a pre-defined thesaurus to obtain the entities and concepts corresponding to the question text.
[0082] Optionally, the second acquisition module is further configured to, after acquiring the answer corresponding to the target concept from the information table, also include: providing feedback to the user.
[0083] Combination Figure 6 As shown, this disclosure provides an electronic device including a processor 600 and a memory 601. Optionally, the electronic device may further include a communication interface 602 and a bus 603. The processor 600, communication interface 602, and memory 601 can communicate with each other via the bus 603. The communication interface 602 can be used for information transmission. The processor 600 can call logical instructions in the memory 601 to execute the question-and-answer method described in the above embodiment.
[0084] The electronic device provided in this disclosure acquires user-input question text; performs semantic understanding on the question text based on a preset entity library and a preset concept library to obtain the target concept corresponding to the question text; both the entity library and the concept library are obtained based on preset information tables; and the answer corresponding to the target concept is obtained from the information table. By acquiring the target concept corresponding to the question text based on the preset entity library and the preset concept library, and directly obtaining the answer corresponding to the target concept from the information table, a large amount of training material is not required to train the question-answering model, making the table-based knowledge question-answering method easier to implement.
[0085] Alternatively, the electronic device may include a smartphone, computer, or tablet computer.
[0086] Furthermore, the logic instructions in the aforementioned memory 601 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium.
[0087] The memory 601, as a computer-readable storage medium, can be used to store software programs and computer-executable programs, such as program instructions / modules corresponding to the methods in the embodiments of this disclosure. The processor 600 executes functional applications and data processing by running the program instructions / modules stored in the memory 601, thereby implementing the question-and-answer method described in the above embodiments.
[0088] The memory 601 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the terminal device. Furthermore, the memory 601 may include high-speed random access memory and may also include non-volatile memory.
[0089] This disclosure provides a storage medium storing program instructions that, when executed, perform the above-described question-and-answer method.
[0090] This disclosure provides a computer program product, which includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions that, when executed by a computer, cause the computer to perform the above-described question-and-answer method.
[0091] The aforementioned computer-readable storage medium may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.
[0092] The technical solutions of this disclosure can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes one or more instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in this disclosure. The aforementioned storage medium can be a non-transitory storage medium, including: a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and other media capable of storing program code; it can also be a transient storage medium.
[0093] The foregoing description and accompanying drawings fully illustrate embodiments of this disclosure to enable those skilled in the art to practice them. Other embodiments may include structural, logical, electrical, procedural, and other changes. The embodiments represent only possible variations. Individual components and functions are optional unless explicitly required, and the order of operation may vary. Parts and features of some embodiments may be included in or replace parts and features of other embodiments. Moreover, the terminology used in this application is for describing embodiments only and is not intended to limit the claims. As used in the description of embodiments and claims, the singular forms “a,” “an,” and “the” are intended to equally include the plural forms unless the context clearly indicates otherwise. Similarly, the term “and / or” as used in this application means including one or more of the associated listed items and all possible combinations thereof. Additionally, when used in this application, the term "comprise" and its variations "comprises" and / or "comprising" refer to the presence of stated features, integrals, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof. Without further limitations, an element defined by the phrase "comprises a..." does not exclude the presence of other identical elements in the process, method, or apparatus that includes said element. In this document, each embodiment may focus on the differences from other embodiments, and similar or identical parts between embodiments can be referred to mutually. For methods, products, etc., disclosed in the embodiments, if they correspond to the method section disclosed in the embodiments, the relevant parts can be referred to the description of the method section.
[0094] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this disclosure. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0095] The methods and products (including but not limited to devices and equipment) disclosed in the embodiments herein can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units may be merely a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the shown or discussed units may be through some interfaces, and the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected to implement this embodiment according to actual needs. Furthermore, the functional units in the embodiments of this disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0096] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than that shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. In the descriptions corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different blocks may also occur in a different order than disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. Each block in a block diagram and / or flowchart, and combinations of blocks in a block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
Claims
1. A method for question-and-answering, characterized in that, include: Get the question text entered by the user; The question text is semantically understood based on a preset entity library and a preset concept library to obtain the target concept corresponding to the question text; both the entity library and the concept library are obtained based on preset information tables. Obtain the answer corresponding to the target concept from the information table; Obtaining the concept library based on a preset information table includes: extracting first concept information from the information table; the first concept information includes the header information in the information table; and storing the first concept information into the concept library. The process of semantically understanding the question text based on a preset entity library and a preset concept library to obtain the target concept corresponding to the question text includes: matching the question text using the entity library and the concept library to obtain the entities and concepts corresponding to the question text; and determining the target concept based on the entities and concepts. The entity library and concept library are used to match the question text to obtain the entities and concepts corresponding to the question text, including: matching entities associated with keywords in the question text from the entity library, and matching concepts that are the same as keywords in the question text from the concept library; Determining the target concept based on entities and concepts includes: inferring the target concept using entities and concepts according to preset inference rules; the preset inference rules include: determining the first concept information that is commonly associated with the entities and concepts as the target concept; Determining the target concept based on entities and concepts also includes: obtaining the syntactic relations corresponding to the question text using entities and concepts based on a pre-defined semantic analysis model; constructing the semantic relations corresponding to the question text based on the syntactic relations; and inferring the target concept corresponding to the question text based on the semantic relations. The pre-defined semantic analysis model includes: a dependency parsing model or a phrase structure parsing model.
2. The method according to claim 1, characterized in that, The entity library is obtained according to a preset information table, including: Extract metadata and the corresponding second concept information from the information table; The metadata and the corresponding second concept information are stored in the entity database.
3. The method according to claim 1, characterized in that, Retrieving the answer corresponding to the target concept from the information table includes: Obtain table query conditions based on the target concept; Retrieve the knowledge data corresponding to the query conditions in the information table; The knowledge data is used to generate answers corresponding to the target concept according to a preset answer template.
4. The method according to claim 1, characterized in that, After matching the question text using the entity library and the concept library, the process further includes: The question text is matched using a pre-defined thesaurus to obtain the entities and concepts corresponding to the question text.
5. The method according to any one of claims 1 to 4, characterized in that, After obtaining the answer corresponding to the target concept from the information table, the process also includes: The answer will be provided to the user.
6. A device for question-and-answering, characterized in that, include: The first acquisition module is configured to acquire the question text input by the user. The semantic understanding module is configured to perform semantic understanding on the question text based on a preset entity library and a preset concept library to obtain the target concept corresponding to the question text; Both the entity library and the concept library are obtained based on a preset information table; Obtaining the concept library based on a preset information table includes: extracting first concept information from the information table; the first concept information includes the header information in the information table; and storing the first concept information into the concept library. The process of semantically understanding the question text based on a preset entity library and a preset concept library to obtain the target concept corresponding to the question text includes: matching the question text using the entity library and the concept library to obtain the entities and concepts corresponding to the question text; and determining the target concept based on the entities and concepts. The entity library and concept library are used to match the question text to obtain the entities and concepts corresponding to the question text, including: matching entities associated with keywords in the question text from the entity library, and matching concepts that are the same as keywords in the question text from the concept library; Determining the target concept based on entities and concepts includes: inferring the target concept using entities and concepts according to preset inference rules; the preset inference rules include: determining the first concept information that is commonly associated with the entities and concepts as the target concept; Determining the target concept based on entities and concepts also includes: obtaining the syntactic relations corresponding to the question text using entities and concepts based on a pre-defined semantic analysis model; constructing the semantic relations corresponding to the question text based on the syntactic relations; and inferring the target concept corresponding to the question text based on the semantic relations. The pre-defined semantic analysis model includes: a dependency parsing model or a phrase structure parsing model. The second acquisition module is configured to acquire the answer corresponding to the target concept from the information table.
7. An electronic device comprising a processor and a memory storing program instructions, characterized in that, The processor is configured to, when executing the program instructions, perform the question-and-answer method as described in any one of claims 1 to 5.
8. A storage medium storing program instructions, characterized in that, When the program instructions are executed, they perform the question-and-answer method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Question and answer processing method and device, language model training method and device, equipment and storage medium
CN111625635A
Intelligent question answering system for hypertension
CN113314236A