Automatic question answering method and device, electronic equipment and computer readable storage medium
By introducing multiple search methods and large-scale language models into the traditional FAQ knowledge base question and answer system, multiple question and answer combinations are generated, and the problem of low response accuracy in traditional systems is solved, and more accurate and appropriate user responses are achieved.
Patent Information
- Application Number
- CN202311675089.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-07
- Publication Date
- 2025-06-10
AI Technical Summary
Due to the limitation of a single search result, the traditional question and answer system based on the FAQ knowledge base has insufficient diversity of user questions and answers, and the accuracy of response results is low.
A variety of preset search methods (such as keyword search and semantic vector search) are used to search in the preset knowledge base, generate multiple question-and-answer combinations, and input statements and question-and-answer combinations are input to a large-scale language model to generate more accurate replies.
The question-and-answer combination obtained through multiple search methods covers user intentions more comprehensively, improves the accuracy and accompliance of the response, and improves user experience and satisfaction.
Smart Images

Figure CN120123462A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and particularly to an automatic question answering method and device, an electronic device, and a computer-readable storage medium. Background Art
[0002] For a traditional question answering system based on FAQ knowledge base retrieval, for a question raised by a user, it can only rely on a single FAQ retrieval result, usually the FAQ retrieval result with the highest relevance score, which limits the diversity of user questions and the answers corresponding to the user questions, making the response result obtained based on a single FAQ retrieval result not appropriate enough or unable to address the specific intention of the question, resulting in a low accuracy of the response result. Summary of the Invention
[0003] The present disclosure provides an automatic question answering method and device, an electronic device, and a computer-readable storage medium.
[0004] In a first aspect, the present disclosure provides an automatic question answering method, including:
[0005] In response to an input statement, at least two preset retrieval methods are started;
[0006] The preset knowledge base is retrieved by the at least two preset retrieval methods to generate at least two question-answer combinations related to the input statement, where each question-answer combination includes a question statement and a reply statement;
[0007] The input statement and the at least two question-answer combinations are input into a large language model to generate a target reply statement corresponding to the input statement.
[0008] Further, the at least two preset retrieval methods at least include:
[0009] A keyword retrieval method and a semantic vector retrieval method.
[0010] Further, the retrieving the preset knowledge base by the at least two preset retrieval methods to generate at least two question-answer combinations related to the input statement includes:
[0011] At least one keyword is extracted from the input statement, and the preset knowledge base is retrieved based on the at least one keyword to obtain at least one first question-answer combination corresponding to the at least one keyword;
[0012] At least one semantic vector corresponding to the input statement is obtained, and the preset knowledge base is retrieved based on the at least one semantic vector to obtain at least one second question-answer combination corresponding to the semantic vector;
[0013] Collect the at least one first Q&A combination and the at least one second Q&A combination to obtain the at least two Q&A combinations.
[0014] Further, the collecting the at least one first Q&A combination and the at least one second Q&A combination to obtain the at least two Q&A combinations includes:
[0015] Collect the at least one first Q&A combination and the at least one second Q&A combination to obtain a Q&A set;
[0016] Deduplicate each Q&A combination in the Q&A set to obtain the at least two Q&A combinations.
[0017] Further, the extracting at least one keyword from the input statement, retrieving the preset knowledge base based on the at least one keyword, and obtaining at least one first Q&A combination corresponding to the at least one keyword includes:
[0018] Perform word segmentation on the input statement to obtain each keyword and the description classification corresponding to each keyword, and retrieve the preset knowledge base according to each keyword and the description classification corresponding to each keyword to obtain at least one first Q&A combination corresponding to the keyword of each description classification.
[0019] Further, the obtaining at least one semantic vector corresponding to the input statement, retrieving the preset knowledge base based on the at least one semantic vector, and obtaining at least one second Q&A combination corresponding to the semantic vector includes:
[0020] Obtain at least one semantic vector corresponding to the input statement under each description classification, and retrieve the preset knowledge base based on the at least one semantic vector to obtain at least one second Q&A combination corresponding to the semantic vector.
[0021] Further, the preset knowledge base includes a FAQ knowledge base.
[0022] Further, the description classification includes at least one of the following:
[0023] Context;
[0024] Domain;
[0025] Subject.
[0026] In a second aspect, the present disclosure provides an automatic Q&A device, including:
[0027] A response module, configured to start at least two preset retrieval methods in response to an input statement;
[0028] A retrieval module, configured to retrieve a preset knowledge base through the at least two preset retrieval methods, and generate at least two question-and-answer combinations related to the input statement, where each question-and-answer combination includes a question statement and an answer statement;
[0029] A generation module, configured to input the input statement and the at least two question-and-answer combinations into a large language model, and generate a target answer statement corresponding to the input statement.
[0030] In a third aspect, the present disclosure provides an electronic device, including:
[0031] At least one processor; and
[0032] A memory communicatively connected to the at least one processor; wherein,
[0033] The memory stores one or more computer programs executable by the at least one processor, and when the one or more computer programs are executed by the at least one processor, the at least one processor is enabled to execute the automatic question-and-answer method according to any one of the first aspect.
[0034] In a fourth aspect, the present disclosure provides a computer-readable storage medium, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the automatic question-and-answer method according to any one of the first aspect.
[0035] The automatic question-and-answer method provided by the embodiments of the present disclosure can obtain an input statement, initiate multiple preset retrieval methods to retrieve in a preset knowledge base, and obtain multiple question-and-answer combinations related to the input statement. This helps to more comprehensively retrieve at least two question-and-answer combinations related to the input statement. Each question-and-answer combination includes a question statement and an answer statement. Inputting the input statement and at least two question-and-answer combinations into a large language model to generate a target answer statement. The large language model can more comprehensively understand the user's input statement based on at least two question-and-answer combinations, and then more accurately generate a target answer statement corresponding to the input statement, making the target answer statement closer to the true intention of the input statement, and improving the user experience and satisfaction.
[0036] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings are used to provide a further understanding of the present disclosure and form a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation to the present disclosure. By describing the detailed exemplary embodiments with reference to the accompanying drawings, the above and other features and advantages will become more apparent to those skilled in the art. In the accompanying drawings:
[0038] Figure 1 It is a schematic flowchart of an automatic question-answering method provided by an embodiment of the present disclosure;
[0039] Figure 2 It is a schematic block diagram of an automatic question-answering device provided by an embodiment of the present disclosure;
[0040] Figure 3 It is an application scenario diagram of an automatic question-answering method and device provided by an embodiment of the present disclosure;
[0041] Figure 4 It is a structural block diagram of an electronic device provided by an embodiment of the present disclosure. Detailed Embodiments
[0042] To enable those skilled in the art to better understand the technical solutions of the present disclosure, the following provides descriptions of exemplary embodiments of the present disclosure with reference to the accompanying drawings. Various details of the embodiments of the present disclosure are included to facilitate understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for clarity and conciseness, descriptions of well-known functions and structures are omitted below.
[0043] Without conflict, the embodiments of the present disclosure and the features in the embodiments can be combined with each other.
[0044] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0045] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a" and "the" are also intended to include the plural forms unless the context clearly indicates otherwise. It will also be understood that when the terms "include" and / or "consist of" are used in this specification, the specified features, wholes, steps, operations, elements, and / or components are present, but one or more other features, wholes, steps, operations, elements, components, and / or their groups are not excluded. "Connection" or "connected" and other similar terms are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.
[0046] Unless otherwise defined, all terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries shall be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this disclosure, and shall not be interpreted as having an idealized or overly formal meaning unless expressly so defined herein.
[0047] To solve the problem that accurate answers to questions cannot be obtained in the current field of answering questions, embodiments of the present disclosure provide an automatic question-answering method. By making full use of various retrieval means and the powerful text generation and understanding capabilities of large language models, the limitations of traditional knowledge base question-answering systems are solved, making natural language question-answering more accurate, and thus providing a better question-answering experience for users. Embodiments of the present disclosure are applicable to various application scenarios, including search engines, virtual assistants, knowledge base queries, etc. Through the embodiments of the present disclosure, users can obtain the required information more accurately, improving the user experience.
[0048] Figure 1 It is a flowchart of an automatic question-answering method provided by an embodiment of the present disclosure. Referring to Figure 1 ,the method includes:
[0049] Step S11, in response to an input statement, start at least two preset retrieval methods.
[0050] In some embodiments, at least two preset retrieval methods at least include: keyword retrieval method and semantic vector retrieval method.
[0051] Among them, the obtaining method of the input statement is not limited. For example, the input statement is a user question input by the user in the terminal input system, or the input statement is text obtained from other devices.
[0052] Among them, there are various keyword retrieval methods, and it only needs to be able to perform statement retrieval based on keywords to meet the requirements of the embodiments of the present disclosure. For example, the keyword retrieval method includes ES (Elasticsearch, an open-source distributed search and analysis engine), which can be used to quickly retrieve documents in the knowledge base that contain the keywords of the input statement.
[0053] Among them, for the semantic vector retrieval method, the input statement can be converted into a semantic vector corresponding to the input statement by using a pre-trained word vector model or a large language model, etc., and then further retrieve based on the generated semantic vector.
[0054] By starting at least two preset retrieval methods, the recall rate of the retrieval results is improved.
[0055] It can be understood that, for the input statement in the embodiments of the present disclosure, at least two preset retrieval methods are first started, avoiding the limitations of single retrieval in the prior art and laying a foundation for the subsequent retrieval results not being limited to single results.
[0056] Step S12: Retrieve a preset knowledge base through the at least two preset retrieval methods to generate at least two question-and-answer combinations related to the input statement, where each question-and-answer combination includes a question statement and an answer statement.
[0057] In some embodiments, the preset knowledge base includes a FAQ (Frequently Asked Questions) knowledge base.
[0058] In some embodiments, retrieving the preset knowledge base through a keyword retrieval method to generate at least one first question-and-answer combination related to the input statement includes: extracting at least one keyword from the input statement, and retrieving the preset knowledge base based on the at least one keyword to obtain at least one first question-and-answer combination corresponding to the at least one keyword;
[0059] Among them, through each keyword in the at least one keyword, or through each keyword combination obtained from the at least one keyword, various corresponding first question-and-answer combinations are searched in the FAQ knowledge base, so that the various obtained first question-and-answer combinations can interpret the input statement from multiple angles.
[0060] In some embodiments, extracting at least one keyword from the input statement and retrieving the preset knowledge base based on the at least one keyword to obtain at least one first question-and-answer combination corresponding to the at least one keyword includes: performing word segmentation on the input statement to obtain each keyword and the description classification corresponding to each keyword, and retrieving the preset knowledge base according to each keyword and the description classification corresponding to each keyword to obtain at least one first question-and-answer combination corresponding to the keyword of each description classification.
[0061] Among them, the description classification includes at least one of the following: context; field; theme.
[0062] Among them, keywords and description classifications can classify the input statement from different angles, and then obtain first question-and-answer combinations from different angles. Different angles include different contexts, different fields or different themes, etc. Collecting first question-and-answer combinations from different angles helps to ensure the diversity and comprehensiveness of the first question-and-answer combinations and improves the recall rate of the first question-and-answer combinations.
[0063] In some embodiments, a preset knowledge base is retrieved by means of semantic vector retrieval to obtain at least one semantic vector corresponding to the input statement, and the preset knowledge base is retrieved based on the at least one semantic vector to obtain at least one second Q&A combination corresponding to the semantic vector.
[0064] Among them, the at least one semantic vector also helps to ensure the diversity of the at least one second Q&A combination, so that the at least one second Q&A combination can interpret the input statement from multiple angles.
[0065] In some embodiments, the obtaining of at least one semantic vector corresponding to the input statement and the retrieving of the preset knowledge base based on the at least one semantic vector to obtain at least one second Q&A combination corresponding to the semantic vector include: obtaining at least one semantic vector corresponding to the input statement under each description classification, and retrieving the preset knowledge base based on the at least one semantic vector to obtain at least one second Q&A combination corresponding to the semantic vector. The description classification includes at least one of the following: context; domain; theme.
[0066] Among them, the semantic vector is obtained by inputting the input statement into a word vector model or a large-scale language model. Each description classification is also to enable the obtained semantic vectors to cover various fields, contexts or themes, ensure the diversity of the semantic vectors, and thus ensure the diversity and comprehensiveness of the at least one second Q&A combination, and improve the recall rate of the second Q&A combination.
[0067] In some embodiments, the collecting of the at least one first Q&A combination and the at least one second Q&A combination to obtain the at least two Q&A combinations includes: collecting the at least one first Q&A combination and the at least one second Q&A combination to obtain a Q&A set; and performing a deduplication process on each Q&A combination in the Q&A set to obtain the at least two Q&A combinations.
[0068] Among them, although the at least one first Q&A combination and the at least one second Q&A combination are obtained based on different retrieval methods, they are all related to various fields, themes or contexts of the input statement, and there may be duplicate question statements and reply statements in the Q&A combinations. A deduplication process needs to be performed here, which helps to improve the output efficiency of the target reply statement of the automatic Q&A method according to the embodiments of the present disclosure.
[0069] It should be noted that the object of the deduplication process is the Q&A combination, that is, when the question statements of two Q&A combinations are the same and the reply statements are also the same, the two are determined to be duplicate Q&A combinations, and one of them is removed. When the question statements in the two Q&A combinations are the same but the reply statements are different, or the question statements are different but the reply statements are the same, the two are determined not to be duplicate Q&A combinations.
[0070] It is understandable that a question-and-answer set is obtained through at least two types of retrieval (including ES and semantic vector retrieval). In the embodiments of the present disclosure, it is not necessary to precisely sort each question statement and answer statement in the question-and-answer set. Only simple duplicate removal is required, and the obtained at least two question-and-answer combinations can answer the user's input statement more comprehensively.
[0071] In an exemplary embodiment, it is assumed that the user's input statement is "It should be in your shopping cart and you forgot to take it." The at least two question-and-answer combinations obtained by starting at least two types of retrieval methods to retrieve the FAQ knowledge base include:
[0072] Q1: Forgot to take something just bought
[0073] A1: Hello, to avoid losing the goods, please go to the store service desk as soon as possible to ask the staff to help you handle it, or you can also transfer to [Artificial Customer Service] for online processing. Thank you!
[0074] Q2: Forgot to pick up the goods
[0075] A2: Dear, the self-pickup time cannot be modified. If there are no fresh products in your order, you can go to the store for self-pickup within 24 hours. If there are fresh products, please pick up the goods in time to avoid quality problems.
[0076] Q3: Can you help me find something that was forgotten in the shopping cart?
[0077] A3: Hello, please contact the artificial customer service to help you provide the store phone number for contact. Thank you~
[0078] Q4: I forgot to bring back the receipt. I used a shopping card to purchase.
[0079] A4: Hello, to query the order, you can click [Member Center] -> [All Orders] in the [Member Center], and enter the order details to view the detailed information of the order (including logistics information). Warm reminder: If the order exceeds 30 minutes and is not paid, the system will cancel it for you, and you can place a new order. (Note: To query the cancelled order: Member Center - All Orders - Cancelled Orders)
[0080] Q5: I can't see the goods in my shopping cart.
[0081] A5: Sorry, the store where you purchased the goods is intensively replenishing and adjusting the goods. It is recommended that you can choose other similar products to place an order. If your shopping needs are not met, please transfer to [Artificial Customer Service] for consultation. Thank you for your understanding!
[0082] Among them, Q1 and A1 represent a Q&A combination {Q1, A1}, Q2 and A2 represent a Q&A combination {Q2, A2}, Q3 and A3 represent a Q&A combination {Q3, A3}, Q4 and A4 represent a Q&A combination {Q4, A4}, Q5 and A5 represent a Q&A combination {Q5, A5}. The five Q&A combinations from {Q1, A1} to {Q5, A5} form at least two Q&A combinations of the embodiments of the present disclosure.
[0083] Step S13: Input the input statement and the at least two Q&A combinations into a large language model to generate a target response statement corresponding to the input statement.
[0084] Among them, the large language model includes: GPT-3 or its similar models. The large language model has been pre-trained on large-scale text data, so it has excellent semantic understanding and text generation capabilities. Due to the powerful text generation ability of the large language model, it can comprehensively consider all information from the Q&A set and generate more accurate, more appropriate and more natural and fluent answers (i.e., target response statements), making the target response statement consistent with the context, theme or field of the input statement.
[0085] In an exemplary embodiment, according to the example in step S12, the input statement is "It should be in your shopping cart and you forgot to take it", and the five Q&A combinations from {Q1, A1} to {Q5, A5} are input into GPT-3. The target response statement output by GPT-3 is "Hello, we are very sorry for the trouble brought to you. The shopping cart is a list of items you added in the online mall, and we cannot help you retrieve the items you forgot to take. It is recommended that you contact the store staff or transfer to the artificial customer service as soon as possible, and they will help you handle it. Thank you!"
[0086] The automatic Q&A method provided by the embodiments of the present disclosure can start multiple preset retrieval methods to retrieve in a preset knowledge base for an input statement, and obtain multiple Q&A combinations related to the input statement. This helps to more comprehensively retrieve at least two Q&A combinations related to the input statement. Among them, each Q&A combination includes a question statement and a response statement. Inputting the input statement and at least two Q&A combinations into a large language model to generate a target response statement, the large language model can more comprehensively understand the user's input statement based on at least two Q&A combinations, and then more accurately generate a target response statement corresponding to the input statement, making the target response statement closer to the true intention of the input statement, and improving the user experience and satisfaction.
[0087] It can be understood that the above-mentioned method embodiments mentioned in the present disclosure can be combined with each other to form combined embodiments without violating the principle logic. Due to space limitations, the present disclosure will not elaborate further. Those skilled in the art can understand that in the above-mentioned method of the specific implementation manner, the specific execution order of each step should be determined according to its function and possible internal logic.
[0088] It should be noted that the execution subject of an automatic question answering method provided by the present disclosure can be an automatic question answering device or a control module in the automatic question answering device. In the embodiments of the present disclosure, taking the automatic question answering device executing the automatic question answering method as an example, the automatic question answering device of the embodiments of the present disclosure is described.
[0089] Figure 2 It is a schematic block diagram of an automatic question answering device provided by an embodiment of the present disclosure.
[0090] Referring to Figure 2 , an embodiment of the present disclosure provides an automatic question answering device, and the automatic question answering device includes:
[0091] A response module 21, configured to start at least two preset retrieval methods in response to an input statement;
[0092] A retrieval module 22, configured to retrieve a preset knowledge base through the at least two preset retrieval methods, and generate at least two question-answer combinations related to the input statement, where the question-answer combination includes a question statement and a reply statement;
[0093] A generation module 23, configured to input the input statement and the at least two question-answer combinations into a large language model, and generate a target reply statement corresponding to the input statement.
[0094] Each module in the above automatic question answering device can be implemented in whole or in part by software, hardware, and their combination. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above-mentioned modules.
[0095] Figure 3 It schematically shows an application scenario diagram of an automatic question answering method and device provided by an embodiment of the present disclosure.
[0096] As Figure 3As shown in the figure, the text of the question raised by the user is obtained through the input system, that is, the input statement in the above embodiment. The input statement is retrieved in multiple ways to obtain a question-and-answer set. Among them, multiple retrievals at least include ES or semantic vector retrieval. Through the ES retrieval method, multiple FAQ examples are retrieved in the FAQ knowledge base, that is, at least one first question-and-answer combination in the above embodiment. Through the semantic vector retrieval method, multiple FAQ examples are retrieved in the FAQ knowledge base, that is, at least one second question-and-answer combination in the above embodiment. The first question-and-answer combination and the second question-and-answer combination are collected to obtain the question-and-answer set. For the specific retrieval process, refer to the retrieval method in the above embodiment, which will not be elaborated here.
[0097] The question-and-answer set obtained through retrieval includes multiple question statements and answer statements. It is worth noting that the multiple question statements and answer statements obtained through the above retrieval are question-and-answer combinations for different aspects or information of the input statement, such as the field, theme, context, etc. of the input statement. Therefore, the diversity of the question-and-answer set is ensured, and the limitation of a single retrieval result in the prior art is avoided. Finally, the question-and-answer set and the input statement are simultaneously input into the large-scale language model. Utilizing the excellent semantic understanding and text generation capabilities of the large-scale language model, an accurate target answer statement that better conforms to the intention of the input statement is obtained, and the target answer statement is output to the user.
[0098] It can be understood that through multiple retrieval methods, multiple question-and-answer combinations, that is, the question-and-answer set, are obtained, so as to obtain more comprehensive information about the input statement. In addition, the question-and-answer set helps the large-scale language model better understand the intention of the input statement, generate more relevant answers, that is, the target answer statement, making the answer more natural and flexible, no longer limited to a single retrieval result, improving the response accuracy, and enhancing the user experience.
[0099] Figure 4 This is a structural block diagram of an electronic device provided by an embodiment of the present disclosure.
[0100] Referring to Figure 4 , an embodiment of the present disclosure provides an electronic device, which includes: at least one processor 41; at least one memory 42, and one or more I / O interfaces 43 connected between the processor 41 and the memory 42; wherein, the memory 42 stores one or more computer programs executable by at least one processor 41, and the one or more computer programs are executed by at least one processor 41 so that at least one processor 41 can execute the above automatic question-and-answer method.
[0101] Each module in the above-mentioned electronic device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above modules can be embedded in the processor in the computer device in hardware form or be independent of it, or can be stored in the memory in the computer device in software form, so that the processor can call and execute the operations corresponding to each of the above modules.
[0102] An embodiment of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor / processing core, the above-mentioned automatic question-answering method is implemented. The computer-readable storage medium can be a volatile or non-volatile computer-readable storage medium.
[0103] An embodiment of the present disclosure also provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in the processor of the electronic device, the processor in the electronic device executes the above-mentioned automatic question-answering method.
[0104] Those of ordinary skill in the art can understand that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, and appropriate combinations thereof. In the hardware implementation, the division of the functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component can have multiple functions, or a function or step can be executed by several physical components in cooperation. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or be implemented as hardware, or be implemented as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable storage medium, which can include a computer storage medium (or a non-transitory medium) and a communication medium (or a transitory medium).
[0105] As is known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information such as computer-readable program instructions, data structures, program modules, or other data. Computer storage media includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), flash memory or other memory technologies, portable compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical disc storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. Additionally, as is known to those of ordinary skill in the art, communication media typically embodies computer-readable program instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and can include any information delivery media.
[0106] The computer-readable program instructions described herein can be downloaded to each computing / processing device from a computer-readable storage medium or downloaded to an external computer or external storage device through a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network may include copper transmission cables, optical fiber transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing / processing device.
[0107] The computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine - related instructions, microcode, firmware instructions, state - setting data, or source code or object code written in any combination of one or more programming languages, including object - oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer - readable program instructions may be executed entirely on the user's computer, partially on the user's computer, executed as a stand - alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider). In some embodiments, by using the state information of the computer - readable program instructions to customize an electronic circuit, such as a programmable logic circuit, a field - programmable gate array (FPGA), or a programmable logic array (PLA), the electronic circuit can execute the computer - readable program instructions to implement various aspects of the present disclosure.
[0108] The computer program product described herein may be implemented specifically in the form of hardware, software, or a combination thereof. In an alternative embodiment, the computer program product is specifically embodied as a computer storage medium. In another alternative embodiment, the computer program product is specifically embodied as a software product, such as a Software Development Kit (SDK), etc.
[0109] Aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present disclosure. It should be understood that each block of the flowcharts and / or block diagrams, and the combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer - readable program instructions.
[0110] These computer-readable program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus to produce a machine such that the instructions, when executed by the processor of the computer or other programmable data processing apparatus, create means for implementing the functions / acts specified in one or more boxes of the flowchart and / or block diagram. These computer-readable program instructions may also be stored in a computer-readable storage medium that causes a computer, a programmable data processing apparatus, and / or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises a manufacture including instructions for implementing various aspects of the functions / acts specified in one or more boxes of the flowchart and / or block diagram.
[0111] The computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other devices to produce a computer-implemented process such that the instructions executed on the computer, other programmable data processing apparatus, or other devices implement the functions / acts specified in one or more boxes of the flowchart and / or block diagram.
[0112] The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a portion of an instruction, which comprises one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions noted in the boxes may occur out of the order noted in the figures. For example, two consecutive blocks may in fact be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block of the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented by special-purpose hardware-based systems that perform the specified functions or acts, or by combinations of special-purpose hardware and computer instructions.
[0113] Example embodiments have been disclosed herein, and while specific terms have been employed, they have been used in a generic and descriptive sense only and not for purposes of limitation. In some instances, it will be apparent to those skilled in the art that, unless otherwise explicitly stated, features, characteristics, and / or elements described in connection with a particular embodiment may be used singly or in combination with features, characteristics, and / or elements described in connection with other embodiments. Accordingly, it will be understood by those skilled in the art that various forms and details may be changed without departing from the scope of the present disclosure as set forth by the appended claims.
Claims
1. An automatic question-answering method, characterized in that, it includes: In response to an input statement, at least two preset retrieval methods are started; Retrieve a preset knowledge base through the at least two preset retrieval methods to generate at least two question-answer combinations related to the input statement, where the question-answer combinations include question statements and reply statements; Input the input statement and the at least two question-answer combinations into a large language model to generate a target reply statement corresponding to the input statement.
2. The automatic question-answering method according to claim 1, characterized in that, the at least two preset retrieval methods at least include: keyword retrieval method and semantic vector retrieval method.
3. The automatic question-answering method according to claim 2, characterized in that, the retrieving the preset knowledge base through the at least two preset retrieval methods to generate at least two question-answer combinations related to the input statement includes: Extract at least one keyword from the input statement, and retrieve the preset knowledge base based on the at least one keyword to obtain at least one first question-answer combination corresponding to the at least one keyword; Obtain at least one semantic vector corresponding to the input statement, and retrieve the preset knowledge base based on the at least one semantic vector to obtain at least one second question-answer combination corresponding to the semantic vector; Collect the at least one first question-answer combination and the at least one second question-answer combination to obtain the at least two question-answer combinations.
4. The automatic question-answering method according to claim 3, characterized in that, the collecting the at least one first question-answer combination and the at least one second question-answer combination to obtain the at least two question-answer combinations includes: Collect the at least one first question-answer combination and the at least one second question-answer combination to obtain a question-answer set; Deduplicate each question-answer combination in the question-answer set to obtain the at least two question-answer combinations.
5. The automatic question-answering method according to claim 3, characterized in that, the extracting at least one keyword from the input statement and retrieving the preset knowledge base based on the at least one keyword to obtain at least one first question-answer combination corresponding to the at least one keyword includes: Perform word segmentation on the input statement to obtain each keyword and the description classification corresponding to each keyword, and retrieve the preset knowledge base according to each keyword and the description classification corresponding to each keyword to obtain at least one first question-answer combination corresponding to the keyword of each description classification.
6. The automatic question-answering method according to claim 3, characterized in that, the obtaining at least one semantic vector corresponding to the input statement and retrieving the preset knowledge base based on the at least one semantic vector to obtain at least one second question-answer combination corresponding to the semantic vector includes: Obtain at least one semantic vector corresponding to the input statement under each description classification, and retrieve the preset knowledge base based on the at least one semantic vector to obtain at least one second question-answer combination corresponding to the semantic vector.
7. The automatic question-answering method according to claim 1, characterized in that, The preset knowledge base includes a FAQ knowledge base.
8. An automatic question-answering method according to claim 5 or 6, wherein, the description classification includes at least one of the following: Context; Domain; Subject.
9. An automatic question-answering device, wherein, it includes: A response module, configured to initiate at least two preset retrieval methods in response to an input statement; A retrieval module, configured to retrieve a preset knowledge base through the at least two preset retrieval methods, and generate at least two question-answer combinations related to the input statement, where the question-answer combination includes a question statement and a reply statement; A generation module, configured to input the input statement and the at least two question-answer combinations into a large language model to generate a target reply statement corresponding to the input statement.
10. An electronic device, wherein, it includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, the memory stores one or more computer programs executable by the at least one processor, and the one or more computer programs are executed by the at least one processor so that the at least one processor can execute the automatic question-answering method according to any one of claims 1-8.
11. A computer-readable storage medium, on which a computer program is stored, wherein, the computer program, when executed by a processor, implements the automatic question-answering method according to any one of claims 1-8.