Intelligent question and answer method and device, electronic equipment and storage medium
By determining the type of user questions in the automatic question answering system and generating answers based on FAQ files or product documents, the problem of poor automatic question answering in the prior art is solved, and the efficiency and accuracy of the answers are improved.
Patent Information
- Application Number
- CN202411889232.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-03-28
AI Technical Summary
The existing automatic question and answer system is not effective in dealing with user questions, and it is difficult to accurately match and generate answers.
By receiving questions entered by users, determine whether they contain product information. If they do not include them, they will match the answer based on the FAQ file. If the match is inaccurate, predicted answers will be generated based on the product document; if the product information is included, the answer will be generated directly based on the document file of the corresponding product.
It improves the answer efficiency and accuracy of the automatic question-and-answer system, and can handle user questions more effectively and generate accurate answers.
Smart Images

Figure CN119719305A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method, device, electronic device and storage medium for intelligent question answering. Background Art
[0002] Large financial institutions have a large number of business documents and FAQ (Frequently Asked Questions) files, and these documents and FAQ files have corresponding product information. If users' questions are answered manually, it will consume a lot of human resources and time. Therefore, many companies choose to develop automatic question-and-answer systems to automatically answer users' questions.
[0003] However, existing solutions usually set several common questions for users to choose and answer, and the effect of self-service question and answer is not good. Summary of the invention
[0004] In view of this, the present application provides a method, device, electronic device and storage medium for intelligent question answering to solve the above problems.
[0005] To achieve the above objectives, this application provides the following technical solutions:
[0006] The first aspect of the present application discloses an intelligent question-answering method, which is applied to a question-answering robot. The method comprises:
[0007] When receiving a question input by a user, determining the question type of the input question; wherein the question type includes a question containing product information and a question not containing product information;
[0008] For questions that do not contain product information, matching answers to the input questions and product information based on the FAQ file;
[0009] If the matched answer and product information are inaccurate, generating predicted answers and product information for the input question based on the document files of each product;
[0010] For questions containing product information, a predicted answer to the input question is generated based on a document file of the product corresponding to the input question.
[0011] Optionally, in the above method, for questions that do not contain product information, matching answers to the input questions and product information based on a FAQ file includes:
[0012] Finding N standard questions matching the input question based on the FAQ file;
[0013] Calculating the similarity between each of the standard questions and the input question, and selecting the standard questions whose similarity meets the preset conditions;
[0014] According to the FAQ file, the standard answers and product information corresponding to the screened standard questions are found.
[0015] Optionally, in the above method, the step of screening out standard questions whose similarity meets a preset condition includes:
[0016] Determine whether there is a high-similarity standard question among the standard questions based on the similarity; wherein the high-similarity standard question is a standard question whose similarity is greater than a preset first threshold;
[0017] If there are multiple high-similar standard questions and they belong to the same product, the standard question with the highest similarity is selected from the multiple high-similar standard questions;
[0018] If there are multiple high-similar standard questions and they do not belong to the same product, each high-similar standard question is sent to the front end for the user to select, and the standard question clicked by the user is screened out according to the user's operation result;
[0019] If there is no high similarity standard question, determine whether there is a medium similarity standard question; wherein the medium similarity standard question is a standard question whose similarity is greater than a preset second threshold;
[0020] If there are standard questions with medium similarity, each standard question with medium similarity is sent to the front end for the user to select, and the standard question clicked by the user is screened out according to the operation result of the user.
[0021] Optionally, in the above method, generating the predicted answer to the input question and the product information based on the document files of each product includes:
[0022] Searching for a document fragment matching the input question from the document files of each product; wherein the document fragment carries corresponding product information;
[0023] If the found document fragments are all document fragments of the same product, the input question and the document fragments are input into a pre-built question-answering model to obtain a predicted answer;
[0024] If the document fragment is a document fragment of multiple products, each product corresponding to the document fragment is sent to the front end for the user to select;
[0025] According to the product selected by the user, filter out document fragments belonging to the product selected by the user from the document fragments;
[0026] The input question and the filtered document fragments are input into the question-answering model to obtain a predicted answer.
[0027] Optionally, the above method further includes:
[0028] According to the product dimension, the FAQ file and the document file are vectorized and stored according to a preset storage structure.
[0029] The second aspect of the present application discloses an intelligent question-answering device, which is applied to a question-answering robot, and the device comprises:
[0030] A determination unit, configured to determine the question type of the input question upon receiving the input question from the user; wherein the question type includes a question containing product information and a question not containing product information;
[0031] A matching unit, for matching answers to the input questions and product information based on the FAQ file for questions that do not contain product information;
[0032] A first generating unit, configured to generate a predicted answer to the input question and product information based on a document file of each product if the matched answer and product information are inaccurate;
[0033] The second generating unit is used to generate a predicted answer to the input question based on the document file of the product corresponding to the input question for the question containing product information.
[0034] Optionally, in the above device, the matching unit includes:
[0035] A first search subunit is used to search N standard questions matching the input question based on the FAQ file;
[0036] A first screening subunit is used to calculate the similarity between each of the standard questions and the input question, and screen out the standard questions whose similarity meets the preset conditions;
[0037] The second search subunit is used to search for standard answers and product information corresponding to the screened standard questions according to the frequently asked questions answering file.
[0038] Optionally, in the above device, the first screening subunit includes:
[0039] A first determining subunit is used to determine whether there is a high-similarity standard question among the standard questions based on the similarity; wherein the high-similarity standard question is a standard question whose similarity is greater than a preset first threshold;
[0040] A second screening subunit is used to screen out the standard question with the highest similarity from the multiple high-similarity standard questions if there are multiple high-similarity standard questions and they belong to the same product;
[0041] The third screening subunit is used for, if there are multiple high-similarity standard questions and they do not belong to the same product, sending each high-similarity standard question to the front end for the user to select, and screening the standard question clicked by the user according to the operation result of the user;
[0042] A second determination subunit is used to determine whether there is a medium similarity standard question if there is no high similarity standard question; wherein the medium similarity standard question is a standard question whose similarity is greater than a preset second threshold value;
[0043] The fourth screening subunit is used to send each medium similarity standard question to the front end for the user to select if there are medium similarity standard questions, and screen out the standard question clicked by the user according to the operation result of the user.
[0044] The third aspect of the present application discloses an electronic device, comprising:
[0045] one or more processors;
[0046] a storage device having one or more programs stored thereon;
[0047] When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of the first aspects of the present invention.
[0048] A fourth aspect of the present application discloses a computer storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method described in any one of the first aspects of the present invention is implemented.
[0049] It can be seen from the above technical scheme that in a method of intelligent question and answer provided by the present application, when receiving a user's input question, the question type of the input question is determined. For questions that do not contain product information, the answers and product information of the input questions are matched based on the frequently asked questions file. If the matched answers and product information are inaccurate, the predicted answers and product information of the input questions are generated based on the document files of each product. For questions that contain product information, the predicted answers to the input questions are generated based on the document files of the products corresponding to the input questions. It can be seen that by using the method of the present application, different methods can be automatically selected to generate answers for questions raised by users, which improves the efficiency and accuracy of answers and solves the problem of poor automatic question and answer effects in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0051] Figure 1 A flowchart of an intelligent question-answering method disclosed in an embodiment of the present application;
[0052] Figure 2 An example diagram of a frequently asked questions answering document disclosed in an embodiment of the present application;
[0053] Figure 3 A storage structure diagram of a vectorized file of frequently asked questions disclosed in an embodiment of the present application;
[0054] Figure 4 This is an example diagram of a document management page for a document file disclosed in an embodiment of the present application;
[0055] Figure 5 A storage structure diagram of a document vectorization file disclosed in an embodiment of the present application;
[0056] Figure 6 This is a flowchart of an implementation of step S102 disclosed in an embodiment of the present application;
[0057] Figure 7 This is a flowchart of an implementation of step S602 disclosed in an embodiment of the present application;
[0058] Figure 8 This is a flowchart of an implementation of step S103 disclosed in an embodiment of the present application;
[0059] Fig. 9 A system framework diagram of an intelligent question-answering system disclosed in an embodiment of the present application;
[0060] Fig.10 A schematic diagram of an intelligent question-answering device disclosed in an embodiment of the present application;
[0061] Fig.11 A schematic diagram of an electronic device disclosed in an embodiment of the present application. DETAILED DESCRIPTION
[0062] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0063] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.
[0064] Furthermore, in this document, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0065] The present application embodiment provides an intelligent question-answering method, which is applied to a question-answering robot, such as Figure 1 As shown, specifically including:
[0066] S101. Upon receiving a question input from a user, determine the question type of the input question; wherein the question type includes a question containing product information and a question not containing product information.
[0067] It should be noted that users can ask questions on different question-and-answer terminals, including question-and-answer terminals where products cannot be selected and question-and-answer terminals where products can be selected. When users ask questions, due to the different question-and-answer terminals selected, the input questions may or may not contain product information. Upon receiving the user's input question, the question-and-answer robot first determines the question type of the input question; wherein the question type includes questions containing product information and questions not containing product information.
[0068] Optionally, in another embodiment of the present application, before executing step S101, the following may also be included:
[0069] According to the product dimension, the FAQ file and the document file are vectorized and stored according to a preset storage structure.
[0070] It should be noted that the administrator enters the management system and creates robots with specific functions according to business needs. For example, a question-and-answer robot R is created for the account managers of UnionPay Business, and a product P is created under the robot R.
[0071] For FAQ files, users first enter the FAQ management page, where they can upload FAQ files in batches. FAQ files are required to be in Excel format, with the first column being the standard questions and the second column being the standard answers. Figure 2 Of course, you can also modify or delete the uploaded FAQ, or manually add a FAQ and write the FAQ and product name into the database.
[0072] Then click the vectorization button, that is, the "Batch Learning" button on the page, to vectorize the standard questions of the FAQ under the product P to form a vectorized file of the product dimension. Vectorization is to convert the text content into a vector of a certain dimension. The more similar the semantics of the two texts are, the higher the similarity value of the two vectors. The vectorized file of product P will be stored in a folder named P. At the same time, the standard questions of the FAQ under the product P are incrementally vectorized to the robot R to form a vectorized file of the robot dimension. When incrementally vectorizing to the robot dimension, the product name will be used as metadata information and stored in the vector file. The storage structure of the FAQ vectorized file is as follows: Figure 3 shown.
[0073] For document files, users first enter the document management page, upload business documents on this page, select the document segmentation method and segment them, mainly including by sentence, by fixed length, by paragraph, etc. Figure 4 shown.
[0074] Then click the vectorization button, that is, the "Batch Learning" button on the page, and the documents will be vectorized one by one to form a vectorized file of the document dimension. The vectorized file of document D will be stored in a folder named D. Incrementally vectorize document D to product P to form a vectorized file of the product dimension. The vectorized file of product P will be stored in a folder named P. As with the FAQ, the document D under product P is also incrementally vectorized to robot R to form a vectorized file of the robot dimension. When incrementally vectorizing to the robot dimension, the product name will be stored in the vector file as metadata information. The document vectorization file storage structure is as follows: Figure 5 shown.
[0075] S102: For questions that do not contain product information, match answers to the input questions and product information based on the FAQ file.
[0076] It should be noted that for questions that do not contain product information, the question-answering robot matches the standard question corresponding to the input question based on the FAQ file, and returns the standard answer and product information corresponding to the standard question.
[0077] Optionally, in another embodiment of the present application, an implementation of the above step S102 is as follows: Figure 6 As shown, this may include:
[0078] S601: Find N standard questions matching the input question based on the FAQ file.
[0079] It should be noted that the robot searches for N standard questions matching the input question from the FAQ file, where N is a preset integer, such as 5.
[0080] S602: Calculate the similarity between each of the standard questions and the input question, and select the standard questions whose similarity meets a preset condition.
[0081] It should be noted that the feature vector of each of the standard questions and the feature vector of the input question are obtained, the similarity between each of the standard questions and the input question is calculated using cosine similarity, and the standard questions whose similarity meets the preset conditions are screened out. The preset conditions can be set according to actual conditions, for example, the highest similarity.
[0082] Optionally, in another embodiment of the present application, an implementation of the above step S602 is as follows: Figure 7 As shown, this may include:
[0083] S701. Determine whether there is a high-similarity standard question among the standard questions based on the similarity; wherein the high-similarity standard question is a standard question whose similarity is greater than a preset first threshold.
[0084] It should be noted that whether there is a high-similarity standard question among the standard questions is determined based on the similarity; wherein the high-similarity standard question is a standard question whose similarity is greater than a preset first threshold, and the first threshold can be set according to actual conditions, such as 0.95.
[0085] S702: If there are multiple high-similarity standard questions and they belong to the same product, select the standard question with the highest similarity from the multiple high-similarity standard questions.
[0086] It should be noted that if there are multiple high-similarity standards among the above N standard questions, and they all belong to questions under the same product, then the standard question with the highest similarity is selected from these high-similarity standard questions as the final question to find the answer.
[0087] S703: If there are multiple high-similarity standard questions and they do not belong to the same product, each high-similarity standard question is sent to the front end for the user to select, and the standard question clicked by the user is screened out according to the user's operation result.
[0088] It should be noted that if there are multiple high-similar standard questions, and they do not belong to the same product, but are questions under multiple products, each high-similar standard question will be sent to the front end for the user to select. After the user completes the selection, the standard question clicked by the user is filtered out as the final question to find the answer based on the user's operation results.
[0089] S704: If there is no high-similarity standard question, determine whether there is a medium-similarity standard question; wherein the medium-similarity standard question is a standard question whose similarity is greater than a preset second threshold.
[0090] It should be noted that if there is no high similarity standard question, it is determined whether there is a medium similarity standard question; wherein the medium similarity standard question is a standard question whose similarity is greater than a preset second threshold, and the first threshold can be set according to actual conditions, such as 0.85.
[0091] S705: If there are standard questions with medium similarity, each standard question with medium similarity is sent to the front end for the user to select, and the standard question clicked by the user is screened out according to the operation result of the user.
[0092] It should be noted that if there are standard questions with medium similarity, each standard question with medium similarity will be sent to the front end for the user to choose. After the user completes the selection, the standard question clicked by the user is filtered out as the final question to find the answer based on the user's operation result.
[0093] It should also be noted that if there is neither a high-similarity standard question nor a medium-similarity standard question, the system will directly return "Sorry, I cannot answer this question for the time being". At the same time, the system will record the question and the administrator will supplement the answer to the question later.
[0094] S603: According to the FAQ file, find out the standard answers and product information corresponding to the screened standard questions.
[0095] It should be noted that after screening out the standard questions whose similarity meets the preset conditions, the standard answers corresponding to the screened standard questions are found according to the FAQ file, and product information is returned, for example: the answer is xxxxx (source: xxx standard question of xxx product).
[0096] S103: If the matched answer and product information are inaccurate, generate a predicted answer to the input question and product information based on the document files of each product.
[0097] It should be noted that if the answers to the input questions and product information matched based on the FAQ file are inaccurate and not what the user wants, then the document fragments matching the input questions are found based on the document files of each product, and the input questions and document fragments are input into the pre-built question-answering model to generate the predicted answers to the input questions and product information. The question-answering model is a neural network model trained based on sample data.
[0098] Optionally, in another embodiment of the present application, an implementation of step S103 is as follows: Figure 8 As shown, this may include:
[0099] S801. Find a document fragment matching the input question from the document files of each product; wherein the document fragment carries corresponding product information.
[0100] It should be noted that, according to the input question, a document fragment matching the input question is searched from the document files of each product; wherein the document fragment carries corresponding product information.
[0101] S802: If the found document fragments are all document fragments of the same product, the input question and the document fragments are input into a pre-built question-answering model to obtain a predicted answer.
[0102] It should be noted that if the found document fragments only involve one product, the input question and the document fragment are encapsulated and input into a pre-built question-answering model to obtain a predicted answer.
[0103] S803: If the document fragment is a document fragment of multiple products, each product corresponding to the document fragment is sent to the front end for the user to select.
[0104] It should be noted that if the found document fragment involves multiple products, the products corresponding to the document fragment are sent to the front end for the user to select to see if there is product information that the user wants to ask about.
[0105] S804: According to the product selected by the user, filter out document fragments belonging to the product selected by the user from the document fragments.
[0106] S805: Input the input question and the filtered document fragments into the question-answering model to obtain a predicted answer.
[0107] S104: For questions containing product information, generate a predicted answer to the input question based on a document file of the product corresponding to the input question.
[0108] It should be noted that for questions containing product information, the question-answering stage based on the FAQ file is skipped, and the document file of the product corresponding to the input question is directly obtained, and the document fragments are matched from it. The input question and document fragments are input into the question-answering model to generate a predicted answer to the input question.
[0109] In a method for intelligent question-and-answer provided in an embodiment of the present application, when a user's input question is received, the question type of the input question is determined. For questions that do not contain product information, the answers to the input questions and product information are matched based on a frequently asked questions file. If the matched answers and product information are inaccurate, the predicted answers to the input questions and product information are generated based on the document files of each product. For questions that contain product information, the predicted answers to the input questions are generated based on the document files of the products corresponding to the input questions. It can be seen that by utilizing the method of the present application, different methods can be automatically selected to generate answers to questions raised by users, thereby improving the efficiency and accuracy of answers and solving the problem of poor automatic question-and-answer effects in the prior art.
[0110] For ease of understanding, another embodiment of the present application combines the above method into an actual application scenario, as follows:
[0111] Step 1: The user selects the Q&A terminal. The Q&A terminal includes the Q&A terminal where products cannot be selected and the Q&A terminal where products can be selected.
[0112] Step 2-1-1: If you choose to use the question-and-answer terminal that cannot select products, such as an internal group chat, after the user enters the question, use the 5 standard questions under the user question recall robot dimension and return the product information at the same time, such as Product 1: Question 1 (similarity), calculate the number of high-similarity standard questions, and high similarity is defined as a similarity of 0.95 and above.
[0113] Step 2-1-2: If there is only one standard question with high similarity, query the database based on the standard question and product information, return the standard answer, and return the product name at the same time, for example: the answer is xxxxx (source: xxx standard question of xxx product). The user confirms whether it is the product and question they want to ask based on the product name and standard question. If it is what they want to ask, the user successfully obtains the answer.
[0114] Step 2-1-3: If it is not what the user wants to ask, the document fragment under the robot dimension is recalled according to the user's question, that is, the FAQ question and answer has been skipped at this time, and the document question and answer stage has been entered. If there is a relevant fragment recalled, and the document fragment only involves one product, the user question and the relevant fragment encapsulated prompt words are input into the big model, and the big model returns the answer and the product name at the same time. At this time, the user confirms whether the product he wants to ask and whether the answer is useful. If it is the product he wants to ask and the answer is useful, the user successfully obtains the answer; if the answer is useless, the user can click the feedback button, the system records the problem, and the administrator will supplement the answer to the question later.
[0115] Step 2-1-4: If there are relevant fragments to recall, and the document fragments involve multiple products, the relevant fragments and the corresponding product name list will be returned, but the front end will only display the product name. At this time, the user confirms whether there is a product in the product list that he wants to ask about. If so, after the user clicks the corresponding product name, the system will encapsulate the user's question and the relevant fragments of the selected product into the prompt word and enter it into the big model. The big model returns the answer, and the user can further determine whether the answer is useful. If there is no product in the product list that he wants to ask about, the user clicks the feedback button, the system records the question, and the administrator will supplement the answer to the question later.
[0116] Step 2-1-5: If there is no relevant fragment recall, the system will directly return "Sorry, I can't answer this question at the moment". At the same time, the system will record the question and the administrator will supplement the answer later.
[0117] Step2-1-6: Go back to Step2-1-2. If there are multiple standard questions with high similarity, determine whether these standard questions belong to the same product. If they do, input the user question and multiple standard question package prompts into the big model. The big model returns the standard question with high similarity that is closest to the user question. Then follow the steps from Step2-1-2 to Step2-1-5.
[0118] Step2-1-7: If multiple high-similar standard questions in Step2-1-6 belong to multiple products, the high-similar standard questions and corresponding product names are returned together. The user confirms whether there are products and standard questions that he wants to ask in the list. If so, the user clicks on the desired standard question and product, and the database is queried according to the standard question and product name, and the answer is returned. If not, follow Step2-1-3~Step2-1-5.
[0119] Step2-1-8: Go back to Step2-1-2. If there is no high-similarity standard question, then determine whether there is a medium-similarity standard question. If so, return the medium-similarity standard question and the corresponding product name together, and follow the steps in Step2-1-7 to confirm whether the user has the product and standard question he wants to ask in the list and subsequent steps.
[0120] Step 2-2-1: If you choose to use the Q&A terminal with selectable products, but if the user does not know which product the question corresponds to, then follow steps Step 2-1-1 to Step 2-1-8, which is the same as the Q&A terminal process where products cannot be selected.
[0121] Step 2-2-2: If the user knows which product the question corresponds to, the user selects the specific product.
[0122] Step 2-2-3: If the user needs to ask a question about a single document of the product, the user will select a specific document under the product. The system will use the user's question to recall the fragments under the document dimension. If there is a fragment, the user's question and the relevant fragment encapsulation prompt words are input into the big model. The big model returns the answer. The user can judge the answer. If it is useful, the question and answer ends. If it is not useful, the user clicks the feedback button, the system records the question, and the administrator will supplement the answer to the question later. If it returns nothing, that is, there is no relevant fragment, the system returns "Sorry, I can't answer this question for the time being", and the system records the question, and the administrator will supplement the answer to the question later.
[0123] Step 2-2-4: If the user does not need to ask questions about a single document of the product, that is, to ask questions about the entire product, use the 5 standard questions under the user question recall robot dimension. If there is a high-similarity standard question, and there is only one, query the database based on the high-similarity standard question and product information, and return the answer. The user can confirm whether he wants to ask a question based on the standard question. If he does, the user's question and answer session ends. If he does not, the user clicks the feedback button, the system records the question, and the administrator will supplement the answer to the question later. If there is more than one high-similarity standard question, the user question and multiple standard questions are packaged into the large model. The large model returns a high-similarity standard question that is closest to the user's question, and then the above process of a high-similarity standard question is followed.
[0124] Step2-2-5: If there are no high-similarity standard questions, but there are medium-similarity standard questions, the list of medium-similarity standard questions will be returned, and the user will confirm whether there are standard questions that he or she wants to ask in the list. If so, the user clicks on the standard question he or she wants, and the database is queried based on the standard question and product name, and the answer is returned. If there is no standard question that he or she wants in the medium-similarity standard questions, or there is no medium-similarity standard question, the system uses the user's question to recall the fragments under the product dimension, and then follows the steps of a single document in Step2-2-3, that is, if there are fragments returned, the user's question and the relevant fragment encapsulated prompt words are input into the big model, and the big model returns the answer. The user can judge the answer. If it is useful, the question and answer session ends. If it is not useful, the user clicks the feedback button, the system records the question, and the administrator will supplement the answer to the question later. If it is returned empty, that is, there is no relevant fragment, the system returns "Sorry, I can't answer this question for the time being", and the system records the question, and the administrator will supplement the answer to the question later.
[0125] In another embodiment of the present application, an intelligent question-answering system is also provided, and its system framework is as follows: Fig. 9 As shown, specifically including:
[0126] Q&A client (PC):
[0127] A front-end system that provides users with questions and answers. The system supports the selection of questions and answers based on single document, product, and robot dimensions.
[0128] Q&A user terminal (mobile terminal):
[0129] A front-end system that provides users with questions and answers. This system only supports robot-dimensional questions and answers.
[0130] Question and answer server:
[0131] The specific implementation logic of the business question-and-answer research method for processing multiple products includes accepting user questions, calling FAQ recall questions and answers, document question-and-answer services, and other services.
[0132] Vectorization and recall services:
[0133] Vectorize FAQ and document sentences and convert text content into vectors of a certain length. At the same time, based on user questions and combined with the vector database, recall several sentences that are most similar to the user's questions.
[0134] Large Model Service:
[0135] Used to combine the recalled content with user questions and summarize the final answer.
[0136] Question and answer management end:
[0137] Provide business administrators with operation pages for FAQ management, document management, product management, and robot management.
[0138] File System:
[0139] Vectorized files used to store FAQ and document sentences.
[0140] Another embodiment of the present application also discloses a device for intelligent question answering, such as Fig.10 As shown, specifically including:
[0141] The determination unit 1001 is used to determine the question type of the input question when receiving the user's input question; wherein the question type includes questions containing product information and questions not containing product information.
[0142] The matching unit 1002 is used to match the answer to the input question and the product information based on the FAQ file for the question that does not contain product information.
[0143] The first generating unit 1003 is configured to generate a predicted answer to the input question and product information based on the document files of each product if the matched answer and product information are inaccurate.
[0144] The second generating unit 1004 is configured to generate, for a question containing product information, a predicted answer to the input question based on a document file of the product corresponding to the input question.
[0145] In this embodiment, the specific execution process of the determination unit 1001, the matching unit 1002, the first generation unit 1003 and the second generation unit 1004 can be referred to the corresponding Figure 1 The content of the method embodiment will not be repeated here.
[0146] In an intelligent question-and-answer device provided in an embodiment of the present application, when the determination unit 1001 receives an input question from a user, it determines the question type of the input question. For questions that do not contain product information, the matching unit 1002 matches the answer to the input question and the product information based on the FAQ file. If the matched answer and product information are inaccurate, the first generation unit 1003 generates a predicted answer and product information for the input question based on the document files of each product. For questions that contain product information, the second generation unit 1004 generates a predicted answer to the input question based on the document file of the product corresponding to the input question. It can be seen that by using the method of the present application, different methods can be automatically selected to generate answers for questions raised by users, thereby improving the efficiency and accuracy of answers and solving the problem of poor automatic question-and-answer effects in the prior art.
[0147] Optionally, in another embodiment of the present application, an implementation of the matching unit 1002 includes:
[0148] The first search subunit is used to search for N standard questions matching the input question based on the FAQ file.
[0149] The first screening subunit is used to calculate the similarity between each of the standard questions and the input question, and screen out the standard questions whose similarity meets the preset conditions.
[0150] The second search subunit is used to search for standard answers and product information corresponding to the screened standard questions according to the frequently asked questions answering file.
[0151] In this embodiment, the specific execution process of the first search subunit, the first screening subunit, and the second search subunit can be referred to in the corresponding Figure 6 The content of the method embodiment will not be repeated here.
[0152] Optionally, in another embodiment of the present application, an implementation of the first screening subunit includes:
[0153] The first determining subunit is configured to determine whether there is a high-similarity standard question among the standard questions based on the similarity; wherein the high-similarity standard question is a standard question whose similarity is greater than a preset first threshold.
[0154] The second screening subunit is used for screening out the standard question with the highest similarity from among the multiple high-similar standard questions if there are multiple high-similar standard questions and they belong to the same product.
[0155] The third screening subunit is used to send each high-similarity standard question to the front end for the user to select if there are multiple high-similarity standard questions that do not belong to the same product, and screen the standard question clicked by the user according to the user's operation result.
[0156] The second determining subunit is configured to determine whether there is a medium similarity standard question if there is no high similarity standard question; wherein the medium similarity standard question is a standard question whose similarity is greater than a preset second threshold value.
[0157] The fourth screening subunit is used to send each medium similarity standard question to the front end for the user to select if there are medium similarity standard questions, and screen out the standard question clicked by the user according to the operation result of the user.
[0158] In this embodiment, the specific execution process of the first determining subunit, the second screening subunit, the third screening subunit, the second determining subunit, and the fourth screening subunit can be referred to in the corresponding Figure 7The content of the method embodiment will not be repeated here.
[0159] Another embodiment of the present application further provides an electronic device, such as Fig.11 As shown, specifically including:
[0160] One or more processors 1101.
[0161] The storage device 1102 stores one or more programs.
[0162] When one or more programs are executed by one or more processors 1101 , the one or more processors 1101 implement any one of the methods in the above embodiments.
[0163] Another embodiment of the present application further provides a computer storage medium on which a computer program is stored, wherein when the computer program is executed by a processor, any one of the methods in the above embodiments is implemented.
[0164] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.
[0165] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0166] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for intelligent question answering, characterized in that: Applied to a question-answering robot, the method comprises: When receiving a question input by a user, determining the question type of the input question; wherein the question type includes a question containing product information and a question not containing product information; For questions that do not contain product information, matching answers to the input questions and product information based on the FAQ file; If the matched answer and product information are inaccurate, generating predicted answers and product information for the input question based on the document files of each product; For questions containing product information, a predicted answer to the input question is generated based on a document file of the product corresponding to the input question.
2. The method according to claim 1, characterized in that For questions that do not contain product information, matching answers to the input questions and product information based on the FAQ file includes: Finding N standard questions matching the input question based on the FAQ file; Calculating the similarity between each of the standard questions and the input question, and screening out the standard questions whose similarity meets the preset conditions; According to the FAQ file, the standard answers and product information corresponding to the screened standard questions are found.
3. The method according to claim 2, characterized in that The step of screening out standard questions whose similarities meet preset conditions includes: Determine whether there is a high-similarity standard question among the standard questions based on the similarity; wherein the high-similarity standard question is a standard question whose similarity is greater than a preset first threshold; If there are multiple high-similar standard questions and they belong to the same product, the standard question with the highest similarity is selected from the multiple high-similar standard questions; If there are multiple high-similar standard questions and they do not belong to the same product, each high-similar standard question is sent to the front end for the user to select, and the standard question clicked by the user is screened out according to the user's operation result; If there is no high similarity standard question, determining whether there is a medium similarity standard question; wherein the medium similarity standard question is a standard question whose similarity is greater than a preset second threshold; If there are standard questions with medium similarity, each standard question with medium similarity is sent to the front end for the user to select, and the standard question clicked by the user is screened out according to the operation result of the user.
4. The method according to claim 1, characterized in that The generating of the predicted answer to the input question and the product information based on the document files of each product includes: Searching for a document fragment matching the input question from the document files of each product; wherein the document fragment carries corresponding product information; If the found document fragments are all document fragments of the same product, the input question and the document fragments are input into a pre-built question-answering model to obtain a predicted answer; If the document fragment is a document fragment of multiple products, each product corresponding to the document fragment is sent to the front end for the user to select; According to the product selected by the user, filtering out document fragments belonging to the product selected by the user from the document fragments; The input question and the filtered document fragments are input into the question-answering model to obtain a predicted answer.
5. The method according to claim 1, characterized in that Also includes: According to the product dimension, the FAQ file and the document file are vectorized and stored according to a preset storage structure.
6. An intelligent question-answering device, characterized in that: Applied to a question-answering robot, the device comprises: A determination unit, configured to determine the question type of the input question upon receiving the question input by the user; wherein the question type includes a question containing product information and a question not containing product information; A matching unit, for matching answers to the input questions and product information based on the FAQ file for questions that do not contain product information; A first generating unit, configured to generate a predicted answer to the input question and product information based on a document file of each product if the matched answer and product information are inaccurate; The second generating unit is used to generate a predicted answer to the input question based on the document file of the product corresponding to the input question for the question containing product information.
7. The device according to claim 6, characterized in that The matching unit comprises: A first search subunit is used to search N standard questions matching the input question based on the FAQ file; A first screening subunit is used to calculate the similarity between each of the standard questions and the input question, and screen out the standard questions whose similarity meets the preset conditions; The second search subunit is used to search for standard answers and product information corresponding to the screened standard questions according to the frequently asked questions answering file.
8. The device according to claim 7, characterized in that The first screening subunit comprises: A first determining subunit is used to determine whether there is a high-similarity standard question among the standard questions based on the similarity; wherein the high-similarity standard question is a standard question whose similarity is greater than a preset first threshold; A second screening subunit is used to screen out the standard question with the highest similarity from the multiple high-similarity standard questions if there are multiple high-similarity standard questions and they belong to the same product; The third screening subunit is used for, if there are multiple high-similarity standard questions and they do not belong to the same product, sending each high-similarity standard question to the front end for the user to select, and screening the standard question clicked by the user according to the operation result of the user; A second determination subunit is used to determine whether there is a medium similarity standard question if there is no high similarity standard question; wherein the medium similarity standard question is a standard question whose similarity is greater than a preset second threshold value; The fourth screening subunit is used to send each medium similarity standard question to the front end for the user to select if there are medium similarity standard questions, and screen out the standard question clicked by the user according to the operation result of the user.
9. An electronic device, characterized in that: include: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the method according to any one of claims 1 to 5.
10. A computer storage medium, characterized in that: A computer program is stored thereon, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.