A question and answer processing method and device, electronic equipment, storage medium and product
By identifying and expanding target domain terms in a large language model, and combining database retrieval and encoding vector merging, the problem of low response accuracy in LLM is solved, achieving more accurate and reliable question-answering processing and meeting diverse user needs.
Patent Information
- Application Number
- CN202410869505.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2044-06-28
AI Technical Summary
Large Language Models (LLMs) lack prior knowledge verification when generating content, which can easily lead to illusions and reduce the accuracy of responses. Existing retrieval enhancement generation methods rely on user query requests, which may be inaccurate and fail to meet user needs.
By identifying the first target domain term in the question statement, expanding it to obtain the second target domain term, retrieving it from the target domain database, and combining encoding vector merging and similarity calculation, accurate target retrieval results are selected, and response results are generated based on a generative model.
It expands the search space, improves search accuracy and reliability, enhances the authenticity and accuracy of responses, meets diverse user needs, and improves the user interaction experience.
Smart Images

Figure CN119166759B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a question-and-answer processing method, apparatus, electronic device, storage medium, and product. Background Technology
[0002] With the development of artificial intelligence, large language models (LLMs) can be applied to many language-related domain tasks. They can answer user questions based on LLMs. However, the content generated by LLMs is prone to illusions when it is not verified by prior knowledge, which reduces accuracy. Summary of the Invention
[0003] This disclosure provides a question-and-answer processing method, apparatus, electronic device, storage medium, and product.
[0004] Firstly, this disclosure provides a question-and-answer processing method, which includes:
[0005] Obtain the question statement and determine the first target domain word in the question statement, wherein the first target domain word represents the word in the target domain corresponding to the question statement;
[0006] Expand the first target domain terms to obtain the second target domain terms;
[0007] Based on the first target domain term and the second target domain term, a search is performed in the database corresponding to the target domain to obtain the target search results, and based on the target search results, the first response result for the question statement is obtained.
[0008] Secondly, this disclosure provides a question-and-answer processing apparatus, which includes:
[0009] A determination module is used to acquire a question statement and determine a first target domain word in the question statement, wherein the first target domain word represents a word in the target domain corresponding to the question statement;
[0010] An extension module is used to extend the first target domain term to obtain a second target domain term;
[0011] The retrieval module is used to retrieve the target domain from the database corresponding to the target domain based on the first target domain term and the second target domain term, and obtain the target retrieval result;
[0012] The processing module is used to obtain the first response result of the question statement based on the target retrieval results.
[0013] Thirdly, this disclosure provides an electronic device comprising: 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, the one or more computer programs being executed by the at least one processor to enable the at least one processor to perform the above-described question-and-answer processing method.
[0014] Fourthly, this disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the above-described question-and-answer processing method.
[0015] Fifthly, this disclosure provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code, wherein when the computer-readable code is run in a processor of an electronic device, the processor in the electronic device performs the above-described question-and-answer processing method.
[0016] The question-and-answer processing method provided in this embodiment obtains a question statement and determines a first target domain term in the question statement. The first target domain term is then expanded to obtain a second target domain term. Based on the first and second target domain terms, a search is performed in the database corresponding to the target domain to obtain target search results. Finally, a first response result is obtained based on the target search results. By expanding the first target domain term before searching, instead of directly searching based on the question statement, the search space is expanded, and the accuracy and reliability of the search are improved. Therefore, responding based on the target search results also improves the authenticity and accuracy of the response.
[0017] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0018] The accompanying drawings are provided to further illustrate the present disclosure and form part of the specification. They are used together with the embodiments of the present disclosure to explain the disclosure and do not constitute a limitation thereof. The above and other features and advantages will become more apparent to those skilled in the art from the detailed description of exemplary embodiments with reference to the accompanying drawings, in which:
[0019] Figure 1 This is an application scenario diagram of the question-and-answer processing method and apparatus provided in the embodiments of this disclosure;
[0020] Figure 2A flowchart of a question-and-answer processing method provided in this embodiment of the disclosure;
[0021] Figure 3 This is a schematic diagram of the interface of the problem-solving method in the embodiments of this disclosure;
[0022] Figure 4 This is an overall logic block diagram of the problem-solving method in the embodiments of this disclosure;
[0023] Figure 5 A block diagram of a question-and-answer processing apparatus provided in an embodiment of this disclosure;
[0024] Figure 6 This is a block diagram of an electronic device provided in an embodiment of the present disclosure. Detailed Implementation
[0025] To enable those skilled in the art to better understand the technical solutions of this disclosure, exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments of this disclosure to aid understanding. These should be considered merely exemplary. Therefore, those skilled 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 this disclosure. Similarly, for clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0026] Where there is no conflict, the various embodiments of this disclosure and the features thereof in the embodiments may be combined with each other.
[0027] As used herein, the term “and / or” includes any and all combinations of one or more related enumerated entries.
[0028] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. As used herein, the singular forms “a” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that when the terms “comprising” and / or “made of” are used in this specification, the presence of the stated feature, integral, step, operation, element, and / or component is specified, but the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof is not excluded. Words such as “connected” or “linked” are not limited to physical or mechanical connections but can include electrical connections, whether direct or indirect.
[0029] Unless otherwise specified, all terms used herein (including technical and scientific terms) 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 should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this disclosure, and will not be interpreted as having an idealized or overly formal meaning, unless expressly so defined herein.
[0030] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information in this technical solution comply with relevant laws and regulations and do not violate public order and good morals. The use of user data in this technical solution follows relevant national laws and regulations (e.g., the "Information Security Technology - Personal Information Security Specification"). For example, appropriate measures are taken for personal information access control; restrictions are imposed on the display of personal information; the purpose of using personal information does not exceed the scope of direct or reasonable association; and explicit identity targeting is eliminated when using personal information to avoid precisely identifying specific individuals.
[0031] Currently, models such as Large Language Models (LLMs) can answer user questions. However, the content generated by LLMs is prone to illusions when it is not verified by prior knowledge, reducing accuracy. Related technologies also offer a Retrieval Augmentation Generation (RAG) method, which retrieves relevant content to provide external knowledge sources for LLMs. However, these methods primarily rely on direct recall and similarity comparison based on user queries. Since user queries may be inaccurate, the search results may not meet user needs, being incomplete or inaccurate, thus reducing the accuracy of LLM responses.
[0032] This disclosure provides a question-and-answer processing method. It identifies a first target domain term in a question statement, expands the first target domain term to obtain a second target domain term, and retrieves a target search result from a database corresponding to the target domain based on the first and second target domain terms. Then, based on the target search result, it obtains a first response result for the question statement. By expanding the first target domain term in the target domain involved in the question statement, the search content can be expanded in the source domain, increasing the search space and improving search accuracy. Therefore, based on the more accurate target search result, the question statement can be answered, and the accuracy and reliability of the response are improved.
[0033] Figure 1 The diagram illustrates an application scenario of the question-and-answer processing method and apparatus provided in the embodiments of this disclosure.
[0034] like Figure 1 As shown, the application scenario of this disclosure embodiment may include terminal device 101, network 103, and server 102. Network 103 is used as a medium to provide a communication link between terminal device 101 and server 102. Network 103 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.
[0035] Users can use terminal device 101 to interact with server 102 via network 103 to receive or send messages, etc. Various communication client applications can be installed on terminal device 101, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (for example only).
[0036] Terminal device 101 can be various electronic devices with a display screen and support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0037] Server 102 can be a server providing various services, such as a backend management server supporting websites browsed by users using terminal device 101 (this is just an example). The backend management server can analyze and process received user requests and other data, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device. For example, in this embodiment, a user can use terminal device 101 to input a question. After receiving the question, server 102 can obtain a response based on the question-and-answer processing method in this embodiment and return it to terminal device 101, which can then display the response to the user.
[0038] It should be noted that the question-and-answer processing method and apparatus provided in this disclosure embodiment can be executed by server 102. Accordingly, the question-and-answer processing method and apparatus provided in this disclosure embodiment can be set in server 102. The question-and-answer processing method and apparatus provided in this disclosure embodiment can also be executed by a server or server cluster that is different from server 102 and is capable of communicating with terminal device 101 and / or server 102. Accordingly, the question-and-answer processing method and apparatus provided in this disclosure embodiment can also be set in a server or server cluster that is different from server 102 and is capable of communicating with terminal device 101 and / or server 102.
[0039] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0040] Figure 2A flowchart illustrating a question-and-answer processing method provided in an embodiment of this disclosure. (Refer to...) Figure 2 The method includes:
[0041] S201: Obtain the question statement and determine the first target domain word in the question statement, wherein the first target domain word represents the word in the target domain corresponding to the question statement.
[0042] This disclosure embodiment can be applied to question and answer in any field or scenario, such as the medical field, the transportation field, the intelligent customer service field, etc., without limitation. Users can input question statements through the dialogue process in the terminal device, and then the terminal device can send the question statements to the server to request the server to answer. For example, the question statement can be to query certain information.
[0043] In this step S201, which involves determining the first target domain word in the question statement, this disclosure also provides several possible implementation methods: 1) In one possible implementation method, keyword extraction is performed on the question statement, the extracted keywords are used for domain identification, the target domain corresponding to the question statement is determined, and the keywords associated with the target domain are used as the first target domain word.
[0044] 2) In another possible implementation, the target domain of the question statement is determined based on the functional module or tool selected when the question statement is input, and the mapping relationship between the domain and the functional module or tool, and the first target domain word associated with the target domain is extracted from the question statement.
[0045] For example, a functional module or tool can be provided for each different field to be presented to the user. The user can choose to use the corresponding functional module or tool to ask questions in a certain field according to their needs. The question entered through the functional module or tool can be considered to belong to the target field corresponding to that functional module or tool.
[0046] 3) In another possible implementation, semantic analysis of the question statement can be performed based on the domain recognition model to determine the target domain of the question statement, and the first target domain word associated with the target domain can be extracted from the question statement according to the target domain.
[0047] For example, if the target field is determined to be the medical field, then medical terms can be extracted from the question statement.
[0048] Of course, other methods can also be used to determine the target domain and the first target domain words of the problem statement, and this disclosure does not impose any restrictions on this.
[0049] S202: Expand the first target domain terminology to obtain the second target domain terminology.
[0050] Regarding step S202, this disclosure provides a possible embodiment, including:
[0051] 1) Based on the knowledge base of the target domain, perform similarity matching on the first target domain words in the knowledge base.
[0052] 2) Filter out target content in the knowledge base that meets the similarity criteria to the first target domain term.
[0053] For example, if the target domain is the medical field, a medical knowledge graph can be obtained. Similarity matching can be performed on words in the first target domain, such as by performing vector encoding and cosine similarity calculation, to filter out target content with similarity greater than a certain threshold or the top n similarity. The target content can be words, medical or pathological description text, or even image content, without any restrictions.
[0054] 3) Based on the selected target content, obtain the second target domain terms expanded from the first target domain terms.
[0055] The second domain term is an extension of the first target domain term, such as a synonym or near-synonym of the first target domain term.
[0056] Thus, in this embodiment of the disclosure, expanding the first target domain term based on the target domain knowledge base can broaden the retrieval scope, provide better domain knowledge understanding and retrieval results, and ensure that the expanded second target domain term still belongs to the target domain, thereby improving the accuracy of subsequent recall and retrieval.
[0057] S203: Based on the first target domain term and the second target domain term, perform a search in the database corresponding to the target domain to obtain the target search results, and based on the target search results, obtain the first response result for the question statement.
[0058] In this embodiment, a question statement is obtained, and a first target domain term is identified within the question statement. The first target domain term is then expanded to obtain a second target domain term. Based on the first and second target domain terms, a search is performed in the database corresponding to the target domain to obtain target search results. Subsequently, a first response result for the question statement is obtained based on the target search results. In this way, a search can be performed within the relevant target domain, and the obtained target search results can provide more authentic and reliable evidence and contextual supplementary information for answering the question statement, improving the accuracy and reliability of the response results. Furthermore, expanding the first target domain term in the question statement during the search expands the search space and improves the comprehensiveness and accuracy of the search.
[0059] Based on the above embodiments, step S203 will be described in detail below.
[0060] Regarding step S203 above, this disclosure provides possible implementation methods, which can be described in the following two parts, including:
[0061] 1) First part: Based on the first target domain term and the second target domain term, search the database corresponding to the target domain to obtain the target search results.
[0062] In one possible implementation of this disclosure, the step includes:
[0063] S1. Based on the first target domain term, retrieve from the database corresponding to the target domain to obtain the first candidate search result, and based on the second target domain term, retrieve from the database to obtain the second candidate search result.
[0064] There are no restrictions on the format of the content stored in the database, such as Word, PDF, Hyper Text Markup Language (HTML) page format, Comma-Separated Values (CSV) format, etc. There are also no restrictions on the format of the stored image content, such as JPG, Joint Photographic Experts Group (JPGE) format, Portable Network Graphics (PNG) format, etc. During the retrieval, the first target domain term and the second target domain term can be used to retrieve text data or image data of different formats, respectively. The first candidate retrieval result and the second candidate retrieval result can be one or more.
[0065] Furthermore, the recall method is not limited in this embodiment. For example, recall can be carried out based on the first target domain term and the second target domain term, combined with information such as the popularity and attention of the content stored in the database, which can further improve the recall accuracy.
[0066] S2. Merge the first target domain term and the second target domain term to obtain the merged content.
[0067] S3. Determine the similarity between the merged content and the first and second candidate search results, and obtain the target search results based on the determined similarity.
[0068] Specifically, regarding steps S2 and S3, one possible embodiment of this disclosure includes:
[0069] 1) Determine the first encoding vector of the first target domain term and the second encoding vector of the second target domain term, and determine the third encoding vector set of the first candidate search result and the fourth encoding vector set of the second candidate search result.
[0070] In this embodiment, the encoding vector can be obtained based on the encoding model. Furthermore, the encoding model can be trained using a knowledge base of the target domain or other training samples corresponding to the target domain. In this way, the trained encoding model is more suitable for the target domain, thereby improving the accuracy of vector encoding in the target domain.
[0071] Furthermore, in this embodiment of the disclosure, there are usually multiple first candidate search results and second candidate search results obtained through recall. By performing vector encoding on each first candidate search result and each second candidate search result, their corresponding third encoding vector set and fourth encoding vector set can be obtained.
[0072] 2) Merge the first encoding vector and the second encoding vector to obtain the merged encoding vector.
[0073] For example, the first and second encoding vectors can be concatenated to obtain a merged encoding vector. Alternatively, the first and second encoding vectors can be weighted and averaged based on the similarity between the first and second target domain words to obtain a merged encoding vector.
[0074] 3) Determine the first similarity between the merged encoding vector and the third encoding vector set, and the second similarity between the merged encoding vector and the fourth encoding vector set.
[0075] For example, the first and second similarities can be determined using the cosine similarity calculation formula.
[0076] 4) Based on the first similarity and the second similarity, sort the first candidate search results and the second candidate search results from largest to smallest.
[0077] 5) Filter out the top preset number of the first candidate search results and / or the second candidate search results to obtain the target search results.
[0078] In other words, in this embodiment of the disclosure, the first target domain term and the second target domain term can be combined to sort the recalled first candidate search results and second candidate search results as a whole, and the top-ranked, i.e., the most similar, number of results can be selected as the final target search results.
[0079] In addition, in this embodiment of the disclosure, when calculating the target retrieval result based on the merged content, the first candidate retrieval result and the second candidate retrieval result, the Best Matching 25 (BM25) method can also be used. The BM25 method is mainly used to determine the relevance between the document and the user query. Its basic principle is based on term frequency and inverse document frequency, and it also introduces the document length information to calculate the relevance between the document and the query.
[0080] Thus, in this embodiment of the disclosure, based on the first target domain term and the extended second target domain term, the retrieved encoding vector can be extended to the encoding vector set, expanding the retrieval domain and reducing the dependence on the encoding method in terms of semantic understanding and retrieval effect, thereby improving the accuracy of similarity calculation, improving the ranking accuracy, and further improving the accuracy and reliability of retrieval results.
[0081] 2) Part Two: Based on the target search results, obtain the first response result for the question statement.
[0082] In one possible embodiment, obtaining a first response result for the question statement based on the target retrieval results includes:
[0083] S1. Based on the generative model, the intent of the question statement is identified to determine the target intent of the question statement, where the target intent represents the ability requirement to respond to the question statement.
[0084] S2. Based on the association between intent category and functional module, determine the target functional module that matches the target intent. Different functional modules have different capabilities.
[0085] For example, intent categories can include any of the following: statistical intent, graphic intent, search intent, etc. The functional module associated with statistical intent is the statistical function module, which can analyze the numerical content in the target search results and output statistical indicators; the functional module associated with graphic intent is the graphic function module, which can visualize the target search results according to drawing needs; the functional module associated with search intent is the search function module, which can represent the need for timeliness in the search, and can obtain real-time search results on the search URL through the search function module.
[0086] S3. Based on the target functional module and generative model, generate the first response result for the question statement according to the target retrieval results.
[0087] In this step, this disclosure also provides possible embodiments for different target intentions.
[0088] In one scenario, where the target intent is statistical intent and the matched target functional module is a statistical functional module, the generative model is used to extract and classify the objects to be statistically analyzed in the target retrieval results, and the statistical functional module is called to input the extracted and classified objects to be statistically analyzed into the statistical functional module to obtain the statistical results.
[0089] For example, the object to be statistically analyzed can be numerical content or other content, and the statistical results include statistical indicators and the statistical analysis results of the statistical indicators (such as trends).
[0090] In one scenario, where the target intent is drawing and the target functional module is a drawing functional module, the generative model is used to extract the graphic description information of the object to be drawn from the target retrieval results. The target functional module is then called, and the graphic description information of the object to be drawn is input into the target functional module to generate the graphic generation result corresponding to the graphic description information.
[0091] For example, it can create data visualization analysis charts of the target search results, and it can also create the required images.
[0092] In one scenario, where the target intent is a search intent and the target functional module is a search functional module, a generative model is used to perform inductive processing based on the target retrieval results and / or question statements to generate a semantically identical search statement. Then, based on the search functional module, a search is performed on the retrieval URL targeting the search statement to obtain search results that match the search statement.
[0093] Furthermore, to improve accuracy, the search results obtained by the search function module can be input into the generative model, and the search results can be summarized based on the generative model to obtain the final first response result.
[0094] Thus, in this embodiment of the disclosure, by identifying intent, the target functional module to be called is determined, and the target functional modules of the generative model can work together to generate first response results for different needs, expand more functions, answer more questions with different needs, and improve answering capabilities and accuracy.
[0095] In another possible embodiment, based on the target retrieval results, obtaining the first response result for the question statement includes:
[0096] S1. Based on the generative model, the intent of the question statement is identified to determine the target intent of the question statement, where the target intent represents the ability requirement to respond to the question statement.
[0097] S2. Based on the generative model, generate the first response result corresponding to the target intent of the question statement according to the target retrieval results.
[0098] For example, if the target intent is to summarize, the generative model summarizes and generalizes the target retrieval results to generate summary text content, thereby obtaining the first response result for the question statement.
[0099] For example, generative models can also be made capable of statistical intent, graphic intent, and search intent, thereby enabling the generation of statistical results, graphic generation results, or search results based on generative models.
[0100] In this embodiment of the disclosure, the target retrieval result can be used as context, and the target retrieval result and the question statement can be filled into the prompt statement and input into the generative model. Then, based on the background knowledge of the target retrieval result, the first response result of the question statement can be generated. For example, the prompt statement is: Please answer the question statement based on the target retrieval result.
[0101] In addition, in this embodiment of the disclosure, keywords in the question statement can be identified to trigger the corresponding target function module or generate a first response result corresponding to different target intentions. For example, if the question statement is found to include drawing keywords, the drawing function module is triggered.
[0102] Thus, in this embodiment of the disclosure, by recognizing the intent of the question statement, multiple forms and diverse response results can be output, which can support multiple forms of enhanced functions, meet more needs, and improve performance.
[0103] Furthermore, in this embodiment of the present disclosure, after obtaining the target search result and the first response result, in order to satisfy the user's further understanding of the target search result, further dialogue can be conducted with the user. Specifically, this disclosure provides a possible implementation method, including: outputting the target search result and the first response result through a dialogue process; obtaining the next round of question statements input in the dialogue process in response to the target search result, and determining the second response result of the next round of question statements based on the target search result.
[0104] For example, in this embodiment of the disclosure, a chatbot can be constructed to establish a dialogue process with the user. The user can input the questions they want to ask in the dialogue process, and then the chatbot can answer the user's questions based on the target search results. In this way, the user's dialogue needs for the target search results can be met, thereby improving the user experience.
[0105] The following uses the medical field as an example to briefly illustrate the problem-solving methods in the embodiments of this disclosure through specific implementation examples. (See attached document.) Figure 3 The diagram shown is an interface schematic of the problem-solving method in an embodiment of this disclosure.
[0106] like Figure 3As shown, users can use their terminal devices to trigger a conversation with the chatbot. The chatbot can output in the interface: "What information would you like to inquire about? Please describe the content you want to inquire about in general." Then, the user can enter a question, such as "I want to inquire about tumor information."
[0107] The server can, based on the problem-handling method in this embodiment, determine that the first target domain term in the problem statement is "tumor," and can expand the first target domain term to obtain a second target domain term, such as multiple words with the same semantic meaning as tumor. Based on the first and second target domain terms, the server performs a search in a medical database, such as a pathology database of a hospital, to obtain target search results and a summary text of the target search results. The server then displays the target search results and the summary text to the user, for example, such as... Figure 3 As shown, the target search results are multiple pathological information about tumors. The target search results can be displayed in tabular form without restriction. The summary text is as follows: The above is the content of the preliminary recall results. The total number of samples in the final search results is 100. These samples mainly involve various types of biopsy results of the stomach, esophagus, and duodenum.
[0108] Furthermore, based on the search results, if users have further questions, they can input questions for the next round of inquiry, such as... Figure 3 As shown, if the user inputs the following question for the next round: "What samples are related to the duodenum? Please provide details," the server can then determine the duodenal samples and their detailed information based on the target search results. For example, it can determine the specific sample number, pathology number, and pathological description information, etc. Figure 3 As shown, the chatbot can output: "Sample number x1, pathology number y1 is consistent with duodenal neoplastic polyp".
[0109] In this embodiment, the first target domain terms in the question statement can be expanded and extended, enabling direct expansion of the search content in the source domain, increasing the search space, improving search accuracy and reliability, and enhancing search performance. Based on the obtained target search results, the response results for the question statement can be obtained, improving the accuracy and authenticity of the response, reducing the illusion problem of the model. Furthermore, in this embodiment, multiple structures and formats of results, such as tables, statistical analysis charts, and summary text content, can be output in the dialog interface to meet different user query needs and improve the user interaction experience.
[0110] The overall logic of the problem-solving method in the embodiments of this disclosure is explained below, taking the target intent as an example. Figure 4The diagram shown is an overall logic block diagram of the problem-solving method in this embodiment of the present disclosure.
[0111] like Figure 4 As shown, the overall solution of the problem-solving method in this embodiment may include a divergent, a recaller, a retrievaler, and a summarizer, and may also include a chatbot and a user.
[0112] Specifically, the user inputs a question statement, the divergent is used to determine the first target domain term in the question statement, and based on the knowledge base of the target domain, it expands the first target domain term to obtain the second target domain term.
[0113] The recall function is used to retrieve first candidate search results and second candidate search results from the database corresponding to the target domain based on the first target domain term and the second target domain term, respectively.
[0114] The retrieval system calculates the similarity between the merged content (combined from the first target domain term and the second target domain term) and the first and second candidate retrieval results, and then selects the top preset number of first and / or second candidate retrieval results with the highest similarity to obtain the target retrieval result.
[0115] The summarizer is used to summarize and generalize the target retrieval results based on the generative model to obtain summary text content.
[0116] In this embodiment of the disclosure, a chatbot can be constructed. Through the chatbot's dialogue process, the target search results and summary text content are returned to the user. The user can then continue to have a conversation with the chatbot, satisfying the user's need for further understanding of the search results and their need for dialogue, thereby improving the user's interactive experience.
[0117] Thus, in this embodiment of the disclosure, based on the knowledge base of the target domain, the first target domain words in the question statement are expanded, so that the expanded second target domain words are also more in line with the target domain, thereby expanding the search space and improving the search effect. Furthermore, in this embodiment of the disclosure, multiple forms of result output can be provided to meet different user needs.
[0118] It is understood that the various method embodiments mentioned above in this disclosure can be combined with each other to form combined embodiments without violating the principle and logic. Due to space limitations, this disclosure will not elaborate further. Those skilled in the art will understand that in the above methods of specific implementation, the specific execution order of each step should be determined by its function and possible internal logic.
[0119] In addition, this disclosure also provides a question-and-answer processing device, an electronic device, and a computer-readable storage medium, all of which can be used to implement any of the question-and-answer processing methods provided in this disclosure. The corresponding technical solutions and descriptions are described in the corresponding section of the method and will not be repeated here.
[0120] Figure 5 This is a block diagram of a question-and-answer processing device provided in an embodiment of the present disclosure.
[0121] Reference Figure 5 This disclosure provides a question-and-answer processing apparatus, which includes:
[0122] The determining module 51 is used to obtain the question statement and determine the first target domain word in the question statement, wherein the first target domain word represents the word in the target domain corresponding to the question statement;
[0123] Extension module 52 is used to extend the first target domain words to obtain the second target domain words;
[0124] The retrieval module 53 is used to perform a retrieval from the database corresponding to the target domain based on the first target domain term and the second target domain term to obtain the target retrieval result;
[0125] Processing module 54 is used to obtain the first response result of the question statement based on the target retrieval result.
[0126] In one possible embodiment, when expanding the first target domain term to obtain the second target domain term, the expansion module 52 is used to:
[0127] Based on the knowledge base of the target domain, the words in the first target domain are matched for similarity in the knowledge base;
[0128] Filter out target content in the knowledge base that meets the similarity criteria to the first target domain term;
[0129] Based on the selected target content, a second target domain term is obtained by expanding the first target domain term.
[0130] In one possible embodiment, when retrieving the target search results from the database corresponding to the target domain based on the first target domain term and the second target domain term, the retrieval module 53 is used to:
[0131] Based on the first target domain term, a retrieval is performed from the database corresponding to the target domain to obtain a first candidate retrieval result, and based on the second target domain term, a retrieval is performed from the database to obtain a second candidate retrieval result;
[0132] The first target domain term and the second target domain term are merged to obtain the merged content;
[0133] The similarity between the merged content and the first candidate search result and the second candidate search result is determined, and the target search result is obtained based on the determined similarity.
[0134] In one possible embodiment, when merging the first target domain term and the second target domain term to obtain merged content, determining the similarity between the merged search content and the first candidate search result and the second candidate search result respectively, and obtaining the target search result based on the determined similarity, the retrieval module 53 is used to:
[0135] Determine the first encoding vector of the first target domain word and the second encoding vector of the second target domain word, and determine the third encoding vector set of the first candidate retrieval result and the fourth encoding vector set of the second candidate retrieval result;
[0136] The first encoding vector and the second encoding vector are merged to obtain a merged encoding vector;
[0137] Determine a first similarity between the merged encoding vector and the third encoding vector set, and a second similarity between the merged encoding vector and the fourth encoding vector set;
[0138] Based on the first similarity and the second similarity, the first candidate search results and the second candidate search results are sorted from largest to smallest;
[0139] The first and / or second candidate search results are selected from the top-ranked preset number of results to obtain the target search result.
[0140] In one possible embodiment, when obtaining the first response result for the question statement based on the target retrieval result, the processing module 54 is used to:
[0141] Based on a generative model, the intent of the question statement is identified to determine the target intent of the question statement, wherein the target intent represents the capability requirement to respond to the question statement;
[0142] Based on the association between intent categories and functional modules, target functional modules that match the target intent are determined, wherein different functional modules implement different capabilities;
[0143] Based on the target functional module and the generative model, the first response result for the question statement is generated according to the target retrieval result.
[0144] In one possible embodiment, when obtaining the first response result for the question statement based on the target retrieval result, the processing module 54 is used to:
[0145] Based on a generative model, the intent of the question statement is identified to determine the target intent of the question statement, wherein the target intent represents the capability requirement to respond to the question statement;
[0146] Based on the generative model, and according to the target retrieval results, a first response result corresponding to the target intent is generated for the question statement.
[0147] In one possible embodiment, the dialogue module 55 is further configured to:
[0148] The target search result and the first response result are output through the dialogue process;
[0149] Obtain the next round of question statements input in the dialogue process in response to the target search result, and determine the second response result of the next round of question statements based on the target search result.
[0150] Each module in the aforementioned question-and-answer processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0151] Figure 6 This is a block diagram of an electronic device provided in an embodiment of the present disclosure.
[0152] Reference Figure 6 This disclosure provides an electronic device, which includes: at least one processor 601; at least one memory 602; and one or more I / O interfaces 603 connected between the processor 601 and the memory 602; wherein the memory 602 stores one or more computer programs that can be executed by the at least one processor 601, and the one or more computer programs are executed by the at least one processor 601 to enable the at least one processor 601 to perform the above-described question-and-answer processing method.
[0153] The modules in the aforementioned electronic devices can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0154] This disclosure also provides a computer-readable storage medium storing a computer program thereon, wherein the computer program, when executed by a processor, implements the above-described question-and-answer processing method. The computer-readable storage medium may be volatile or non-volatile.
[0155] This disclosure also provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code, wherein when the computer-readable code is run in a processor of an electronic device, the processor in the electronic device executes the above-described question-and-answer processing method.
[0156] Those skilled in the art will understand that all or some of the steps, systems, and apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software can be distributed on a computer-readable storage medium, which may include computer storage media (or non-transitory media) and communication media (or transient media).
[0157] As is known to those skilled 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 cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, it is known to those skilled in the art that communication media typically contain computer-readable program instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0158] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic 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 them to the computer-readable storage media in the respective computing / processing device.
[0159] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status 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 execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via 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., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions to implement various aspects of this disclosure.
[0160] The computer program product described herein can be implemented specifically through hardware, software, or a combination thereof. In one alternative embodiment, the computer program product is specifically embodied in a computer storage medium; in another alternative embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.
[0161] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0162] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0163] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0164] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0165] Example embodiments have been disclosed herein, and while specific terminology has been used, it is for illustrative purposes only and should be construed as such, and is not intended to be limiting. In some instances, it will be apparent to those skilled in the art that features, characteristics, and / or elements described in connection with particular embodiments may be used alone, or in combination with features, characteristics, and / or elements described in connection with other embodiments, unless otherwise expressly indicated. Therefore, those skilled in the art will understand that various changes in form and detail may be made without departing from the scope of this disclosure as set forth by the appended claims.
Claims
1. A question-and-answer processing method, characterized in that, include: Obtain the question statement and determine the first target domain word in the question statement, wherein the first target domain word represents the word in the target domain corresponding to the question statement; Based on the knowledge base of the target domain, the first target domain words are expanded to obtain second target domain words; Based on the first target domain term and the second target domain term, a search is performed from the database corresponding to the target domain to obtain target search results, including: based on the first target domain term, recalling from the database corresponding to the target domain to obtain a first candidate search result, and based on the second target domain term, recalling from the database to obtain a second candidate search result; based on an encoding model, determining a first encoding vector of the first target domain term and a second encoding vector of the second target domain term, and determining a third encoding vector set of the first candidate search result and a fourth encoding vector set of the second candidate search result, wherein the encoding model is obtained through the knowledge base of the target domain or the... The target domain is obtained by training on training samples. Based on the similarity between the first and second target domain words, the first and second encoding vectors are weighted and averaged to obtain a merged encoding vector. A first similarity is determined between the merged encoding vector and the third encoding vector set, and a second similarity is determined between the merged encoding vector and the fourth encoding vector set. Based on the first and second similarities, the first and second candidate search results are sorted from largest to smallest. A predetermined number of the top-ranked first and / or second candidate search results are selected to obtain the target search result. Based on the target search results, the first response result for the question statement is obtained.
2. The question-and-answer processing method according to claim 1, characterized in that, The step of expanding the first target domain term to obtain the second target domain term includes: Based on the knowledge base of the target domain, the words in the first target domain are matched for similarity in the knowledge base; Filter out target content in the knowledge base that meets the similarity criteria to the first target domain term; Based on the selected target content, a second target domain term is obtained by expanding the first target domain term.
3. The question-and-answer processing method according to any one of claims 1-2, characterized in that, The step of obtaining a first response result for the question statement based on the target retrieval result includes: Based on a generative model, the intent of the question statement is identified to determine the target intent of the question statement, wherein the target intent represents the capability requirement to respond to the question statement; Based on the association between intent categories and functional modules, target functional modules that match the target intent are determined, wherein different functional modules implement different capabilities; Based on the target functional module and the generative model, the first response result for the question statement is generated according to the target retrieval result.
4. The question-and-answer processing method according to any one of claims 1-2, characterized in that, The step of obtaining a first response result for the question statement based on the target retrieval result includes: Based on a generative model, the intent of the question statement is identified to determine the target intent of the question statement, wherein the target intent represents the capability requirement to respond to the question statement; Based on the generative model, and according to the target retrieval results, a first response result corresponding to the target intent is generated for the question statement.
5. The question-and-answer processing method according to claim 1, characterized in that, The method further includes: The target search result and the first response result are output through the dialogue process; Obtain the next round of question statements input in the dialogue process in response to the target search result, and determine the second response result of the next round of question statements based on the target search result.
6. A question-and-answer processing device, characterized in that, include: A determination module is used to acquire a question statement and determine a first target domain word in the question statement, wherein the first target domain word represents a word in the target domain corresponding to the question statement; The extension module is used to expand the first target domain words based on the knowledge base of the target domain to obtain second target domain words; A retrieval module is configured to retrieve target search results from a database corresponding to the target domain based on the first target domain term and the second target domain term. Specifically, the retrieval module is configured to: retrieve first candidate search results from the database corresponding to the target domain based on the first target domain term; and retrieve second candidate search results from the database based on the second target domain term. Furthermore, based on an encoding model, the module determines a first encoding vector for the first target domain term and a second encoding vector for the second target domain term, as well as a third encoding vector set for the first candidate search results and a fourth encoding vector set for the second candidate search results. The encoding model is based on the target domain term and the second target domain term. The target domain knowledge base or training samples corresponding to the target domain are used for training. Based on the similarity between the first target domain words and the second target domain words, the first encoding vector and the second encoding vector are weighted and averaged to obtain a merged encoding vector. A first similarity is determined between the merged encoding vector and the third encoding vector set, and a second similarity is determined between the merged encoding vector and the fourth encoding vector set. Based on the first similarity and the second similarity, the first candidate search results and the second candidate search results are sorted from largest to smallest. A predetermined number of the top-ranked first candidate search results and / or second candidate search results are selected to obtain the target search result. The processing module is used to obtain the first response result of the question statement based on the target retrieval results.
7. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores one or more computer programs that can be executed by the at least one processor, the one or more computer programs being executed by the at least one processor to enable the at least one processor to perform the question-and-answer processing method as described in any one of claims 1-5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the question-and-answer processing method as described in any one of claims 1-5.
9. A computer program product, characterized in that, Includes computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code, wherein when the computer-readable code is run in a processor of an electronic device, the processor in the electronic device performs the question-and-answer processing method as described in any one of claims 1-5.
Citation Information
Patent Citations
Question answering system and dealing method thereof
CN103902672A
Intelligent retrieval method and system based on exploration and development knowledge graph and storage medium
CN116401350A
Cross-domain problem processing method and device, electronic equipment and storage medium
CN116842168A
