Question and answer processing method and device, electronic equipment and computer readable medium
By disassembling user requests and calling knowledge plug-in for search, prompt words are generated to improve the accuracy and comprehensiveness of answering questions in fields that the big model has not been exposed to, and solves the wrong answers and omissions of big models when answering questions in fields that have not been exposed to. Answer the question.
Patent Information
- Application Number
- CN202411240230.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-05
- Publication Date
- 2024-12-31
AI Technical Summary
Large language models are prone to missed answers when answering questions from professional fields that they have never been exposed to, and cannot provide accurate and comprehensive answers.
By obtaining the question data requested by the user, determine the domain identifier. If the identifier does not exist in the preset library, it is disassembled to obtain new question data, and call the corresponding knowledge plug-in for parallel search, and summarize the search results to generate a prompt word and enter it into Big model to get answers.
It improves the accuracy and comprehensiveness of the answers of large models on untouched domain questions, and reduces the possibility of wrong answers and missed answers.
Smart Images

Figure CN119226457A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a question-answering processing method, device, electronic device, and computer-readable medium. Background Art
[0002] At present, with the advent of chatGPT, artificial intelligence technology has reached a new peak. Large language models (LLMs) technology such as chatGPT can answer any questions of users, such as article creation, news summaries, report writing, intelligent customer service, code generation and many other applications. The large model cannot correctly answer the knowledge in some professional fields that it has never been exposed to, and can only answer based on the knowledge it has learned. This problem is usually called the "hallucination" of the large model. When relying on the existing large model to answer user questions in fields that have never been exposed to, it is easy to make wrong answers or missed answers. Summary of the invention
[0003] In view of this, the embodiments of the present application provide a question-answering processing method, device, electronic device and computer-readable medium, which can solve the problem of incorrect answers and missed answers when relying on existing large models to answer user questions in fields that have never been touched before.
[0004] To achieve the above-mentioned purpose, according to one aspect of an embodiment of the present application, a question and answer processing method is provided, including: in response to a user request, obtaining corresponding question data, and then determining the corresponding domain identifier; in response to the domain identifier not existing in a preset domain identifier library, determining the nature of the user request, and judging whether a knowledge background of a field other than the field corresponding to the domain identifier is required based on the nature and the domain identifier, and if so, disassembling the question data based on the field corresponding to the required knowledge background to obtain disassembled data, and then deriving new question data corresponding to the field corresponding to the required knowledge background based on the disassembled data; determining the knowledge plug-in corresponding to the new question data, calling the knowledge plug-in to perform parallel retrieval based on the new question data, and aggregating the retrieval result data; generating prompt words based on the retrieval result data; and inputting the prompt words into the large model to obtain answer result data.
[0005] Optionally, determining the corresponding domain identifier includes: disassembling the question data to obtain disassembled data; matching the disassembled data with the domain description data corresponding to each domain identifier in the domain identifier pool, and determining the domain identifier corresponding to the matched domain description data as the domain identifier corresponding to the question data.
[0006] Optionally, the question and answer processing method also includes: disassembling the question data through a large model to obtain disassembled data, and then deriving the disassembled data to obtain new question data.
[0007] Optionally, determining the knowledge plug-in corresponding to the new question data includes: determining the knowledge plug-in corresponding to the domain identifier as the knowledge plug-in corresponding to the new question data.
[0008] Optionally, generating a prompt word includes: replacing a corresponding placeholder in a prompt word generation template with the search result data to generate a corresponding prompt word.
[0009] Optionally, the retrieval result data is summarized, including: calling sub-threads in parallel to utilize knowledge plug-ins to execute retrieval tasks corresponding to corresponding new question data; in response to all sub-threads executing retrieval tasks completing execution, calling the main thread to summarize the execution results to obtain retrieval result data.
[0010] In addition, the present application also provides a question and answer processing device, including: an acquisition unit, configured to respond to a user request, acquire corresponding question data, and then determine the corresponding domain identifier; a disassembly unit, configured to determine the nature of the user request in response to the domain identifier not existing in the preset domain identifier library, and judge whether the knowledge background of the field other than the field corresponding to the domain identifier is required based on the nature and the domain identifier, and if so, disassemble the question data based on the field corresponding to the required knowledge background to obtain disassembled data, and then derive new question data corresponding to the field corresponding to the required knowledge background based on the disassembled data; a retrieval unit, configured to determine the knowledge plug-in corresponding to the new question data, call the knowledge plug-in to perform parallel retrieval based on the new question data, and summarize the retrieval result data; a prompt word generation unit, configured to generate prompt words based on the retrieval result data; an input unit, configured to input the prompt words into the large model to obtain answer result data.
[0011] Optionally, the acquisition unit is further configured to: disassemble the question data to obtain disassembled data; match the disassembled data with the domain description data corresponding to each domain identifier in the domain identifier pool, and determine the domain identifier corresponding to the matched domain description data as the domain identifier corresponding to the question data.
[0012] Optionally, the disassembling unit is further configured to: disassemble the question data through the large model to obtain disassembled data, and then derive the disassembled data to obtain new question data.
[0013] Optionally, the retrieval unit is further configured to: determine the knowledge plug-in corresponding to the domain identifier as the knowledge plug-in corresponding to the new question data.
[0014] Optionally, the prompt word generation unit is further configured to: replace corresponding placeholders in the prompt word generation template with the search result data to generate corresponding prompt words.
[0015] Optionally, the retrieval unit is further configured to: call sub-threads in parallel to utilize the knowledge plug-in to execute the retrieval task corresponding to the corresponding new question data; in response to all sub-threads executing the retrieval task completing execution, call the main thread to summarize the execution results to obtain retrieval result data.
[0016] In addition, the present application also provides a question and answer processing electronic device, including: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by one or more processors, the one or more processors implement the question and answer processing method as described above.
[0017] In addition, the present application also provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, the question-and-answer processing method as described above is implemented.
[0018] To achieve the above objective, according to another aspect of the embodiments of the present application, a computer program product is provided.
[0019] A computer program product according to an embodiment of the present application includes a computer program, which, when executed by a processor, implements the question and answer processing method provided by the embodiment of the present application.
[0020] One embodiment of the above invention has the following advantages or beneficial effects: the application obtains the corresponding question data in response to the user request, and then determines the corresponding domain identification; in response to the domain identification not existing in the preset domain identification library, determines the nature of the user request, and judges whether the knowledge background of the field other than the field corresponding to the domain identification is required based on the nature and the domain identification, and if so, disassembles the question data based on the field corresponding to the required knowledge background to obtain disassembled data, and then derives new question data corresponding to the field corresponding to the required knowledge background based on the disassembled data; determines the knowledge plug-in corresponding to the new question data, calls the knowledge plug-in to perform parallel retrieval based on the new question data, and summarizes the retrieval result data; generates prompt words based on the retrieval result data; inputs the prompt words into the large model to obtain the answer result data. This improves the accuracy and comprehensiveness of the large model when answering user questions in fields that have never been touched.
[0021] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The accompanying drawings are used to better understand the present application and do not constitute an improper limitation on the present application.
[0023] Figure 1 is a schematic diagram of the main process of the question-answering processing method according to an embodiment of the present application;
[0024] Figure 2 is a schematic diagram of the main process of the question-answering processing method according to an embodiment of the present application;
[0025] Figure 3 is a schematic diagram of a business architecture of a question-and-answer processing method according to an embodiment of the present application;
[0026] Figure 4 It is a schematic diagram of the main flow of a question-answering processing method according to an embodiment of the present application;
[0027] Figure 5 is a schematic diagram of the main units of the question and answer processing device according to an embodiment of the present application;
[0028] Figure 6 is an exemplary system architecture diagram to which the embodiments of the present application can be applied;
[0029] Figure 7 It is a structural diagram of a computer system of a terminal device or server suitable for implementing an embodiment of the present application. DETAILED DESCRIPTION
[0030] The following is a description of the exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, and they should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of known functions and structures is omitted in the following description. It should be noted that the acquisition, transmission, storage, use, and processing of data in the technical solution of the present application are in compliance with the relevant provisions of national laws and regulations. It should be noted that in the embodiments of the present application, certain software, components, models, and other existing solutions in the industry may be mentioned, which should be considered as exemplary, and their purpose is only to illustrate the feasibility of the implementation of the technical solution of the present application, but it does not mean that the applicant has or must have used the solution. In the technical solution of the present application, the collection, analysis, use, transmission, storage, and other aspects of the user's personal information involved are in compliance with the provisions of relevant laws and regulations, and are used for legal and reasonable purposes, and are not shared, leaked, or sold outside of these legal uses, and are subject to supervision and management by regulatory authorities. Take necessary measures to prevent illegal access to such personal information, ensure that persons with access to personal information comply with relevant laws and regulations, and ensure the security of personal information. Once such personal information is no longer needed, risks should be minimized by limiting or even prohibiting data collection and / or deleting data.
[0031] When used, including in certain related applications, user privacy is protected by de-identifying data, such as by removing specific identifiers when used, controlling the amount or specificity of data stored, controlling how data is stored, and / or other methods of de-identification.
[0032] Figure 1 is a schematic diagram of the main process of the question-answering processing method according to an embodiment of the present application, such as Figure 1 As shown, the question-answering processing method mainly includes the following steps S101 to S105.
[0033] Step S101, in response to a user request, obtaining corresponding question data, and then determining a corresponding field identifier.
[0034] In the embodiments of the present application, the large model, namely the large language model (LLM), such as the financial AI large model, refers to a deep learning model trained with a large amount of text data, which can generate natural language text or understand the meaning of language text. The large language model can handle a variety of natural language tasks, such as text classification, question and answer, dialogue, etc., and is a breakthrough technology in the field of artificial intelligence cognition. Prompt: Prompt, which is an instruction to the financial AI large model. Prompt can be a piece of text, such as your conversation with ChatGPT, etc., or it can be a parameter description in a certain format, such as AI drawing software, which uses parameters more often. Agent: Intelligent body, a kind of "simulated subjectivity" similar to that of a person with subjective initiative. This quasi-subjectivity means that the Agent imitates humans to implement processes such as "planning", "organization", "execution", and "learning" until a task is completed.
[0035] In this embodiment, the execution entity of the question-and-answer processing method (for example, it may be a server) may receive a user request through a wired connection or a wireless connection. The user request may be, for example, a business processing request in the financial field. The present embodiment of the application does not specifically limit the content of the user request. After receiving the user request, the execution entity may obtain the question data corresponding to the request. For example, the question data may be "Credit card processing?" Based on the question data, the corresponding field is analyzed and determined, and then the corresponding field identifier is determined. The field identifier may be represented by numbers or letters or a combination of numbers and letters. The present embodiment of the application does not specifically limit the field identifier.
[0036] Step S102, in response to the domain identifier not existing in the preset domain identifier library, determine the nature of the user request, and judge whether knowledge background of a field other than the field corresponding to the domain identifier is required based on the nature and the domain identifier. If so, decompose the question data based on the field corresponding to the required knowledge background to obtain decomposed data, and then derive new question data corresponding to the field corresponding to the required knowledge background based on the decomposed data.
[0037] When the execution subject determines that the domain corresponding to the determined domain identifier is a domain corresponding to knowledge in some professional fields that the large model has never touched, it can trigger the call of the Agent service to perform task decomposition and planning, so as to accurately process relevant user requests.
[0038] In some embodiments, the execution subject can extract keywords from the user request and match the keywords with the description data of the business in each preset field to determine the nature of the user request. For example, the user request involves credit card processing in the financial field, or the user request involves document query in the Internet field, or the user request involves the principle of automatic driving in the field of artificial intelligence. The embodiment of the present application does not specifically limit the nature of the user request. After determining the nature of the user request, the execution subject can judge whether the knowledge background of the field other than the field corresponding to the field identifier is needed according to the nature of the user request and the field identifier. For example, when the field corresponding to the field identifier is the field of credit card processing, the execution subject can determine that the user also needs the knowledge background of the Internet field and the artificial intelligence field according to the data related to the nature of the user request "the user request involves credit card processing in the financial field, the user request involves document query in the Internet field, and the user request involves the principle of automatic driving in the field of artificial intelligence". If (that is, it is determined that the user also needs the knowledge background of the field other than the field corresponding to the field identifier, such as the knowledge background of the Internet field and the artificial intelligence field), the question data is disassembled based on the field corresponding to the required knowledge background (such as the Internet field and the artificial intelligence field) (for example, the fields related to the Internet field and the artificial intelligence field in the question data are extracted respectively) to obtain the disassembled data, and then the new question data corresponding to the field corresponding to the required knowledge background is derived based on the disassembled data. Specifically, the fields related to the Internet field and the artificial intelligence field (i.e., disassembled data) in the question data extracted respectively can be used to generate new question data in the Internet field according to the question data generation method corresponding to the Internet field (the new question data corresponds to the question data corresponding to the user request), and to generate new question data in the artificial intelligence field according to the question data generation method in the artificial intelligence field (the new question data corresponds to the question data corresponding to the user request). This ensures the scientificity and accuracy of data derivation and improves the accuracy of question and answer processing.
[0039] In some embodiments, the question and answer processing method further includes: decomposing the question data through a large model to obtain decomposed data, and then deriving the decomposed data to obtain new question data.
[0040] The big model of the embodiment of the present application can be a financial AI big model, serving the financial field, and the Agent service can be called and used by the financial AI big model. When the domain identifier does not exist in the preset domain identifier library, the execution subject can call the financial AI big model to disassemble and derive the question data by calling the Agent service, and then assemble new question data.
[0041] For example, the question data may be "Apply for a credit card?", and the corresponding new question data may include "How to apply for a credit card", "What are the conditions for applying for a credit card", "Can an individual apply for a credit card online", etc. The embodiment of the present application does not specifically limit the content and quantity of the new question data.
[0042] Step S103, determining the knowledge plug-in corresponding to the new question data, calling the knowledge plug-in to perform parallel retrieval based on the new question data, and summarizing the retrieval result data.
[0043] Specifically, determining the knowledge plug-in corresponding to the new question data includes: determining the knowledge plug-in corresponding to the domain identifier as the knowledge plug-in corresponding to the new question data.
[0044] For example, when the domain identifier corresponds to the financial domain, the financial domain knowledge base may be determined as the knowledge plug-in corresponding to the new question data.
[0045] Specifically, the retrieval result data is summarized, including: calling sub-threads in parallel to use knowledge plug-ins to execute retrieval tasks corresponding to corresponding new question data; in response to all sub-threads executing retrieval tasks completing execution, calling the main thread to summarize the execution results to obtain retrieval result data.
[0046] When the number of knowledge plug-ins corresponding to the determined new question data exceeds a preset threshold (for example, the preset threshold may be 1, and the present application embodiment does not specifically limit the preset threshold), tasks may be executed in parallel, and sub-threads may be called in parallel to utilize the determined knowledge plug-ins (e.g., one or more of a financial field knowledge base, a knowledge base in other fields, an Internet search, etc.) to perform search tasks corresponding to the corresponding new question data, such as querying the financial field knowledge base to determine how to apply for a credit card; querying the financial field knowledge base to determine what conditions are required to apply for a credit card; querying the financial field knowledge base to determine whether an individual can apply for a credit card online; querying other field knowledge bases to determine the appropriate age for a user to have a tooth implanted; performing an Internet search to determine the age of children when they can ride high-speed rail for free, etc.
[0047] Aggregate the search result data obtained using each knowledge plug-in.
[0048] Step S104: Generate prompt words based on the search result data.
[0049] Specifically, generating the prompt word includes: replacing the corresponding placeholder in the prompt word generation template with the search result data to generate the corresponding prompt word.
[0050] For example, the corresponding placeholder in the prompt word generation template may be {quote}, and the embodiment of the present application does not specifically limit the form and content of the placeholder.
[0051] Step S105, input the prompt word into the large model to obtain the answer result data.
[0052] The execution subject can input the generated prompt words into the financial AI big model to achieve a basis for reference, so that the financial AI big model can accurately obtain the answer result data corresponding to the user's request based on the reference materials in the input prompt words (i.e. the summarized search result data). Improve the accuracy of question and answer processing.
[0053] Based on vector knowledge base retrieval and agent technology, we can improve the illusion problem of large models and enhance the professional capabilities of large models. This will improve the user experience of financial large models. We use vector knowledge base retrieval to provide professional contextual knowledge for large models, so that large models can answer professional knowledge in the financial field. Using agent technology, large models can access various knowledge acquisition plug-ins, so that large models can independently select the corresponding knowledge base to retrieve the knowledge they need.
[0054] This embodiment obtains the corresponding question data in response to the user request, and then determines the corresponding field identification; in response to the field identification not existing in the preset field identification library, determines the nature of the user request, and judges whether the knowledge background of the field other than the field corresponding to the field identification is required based on the nature and the field identification, and if so, disassembles the question data based on the field corresponding to the required knowledge background to obtain disassembled data, and then derives new question data corresponding to the field corresponding to the required knowledge background based on the disassembled data; determines the knowledge plug-in corresponding to the new question data, calls the knowledge plug-in to perform parallel retrieval based on the new question data, and summarizes the retrieval result data; generates prompt words based on the retrieval result data; inputs the prompt words into the large model to obtain the answer result data. This improves the accuracy and comprehensiveness of the large model when answering user questions in fields that have never been touched.
[0055] Figure 2 is a schematic diagram of the main flow of a question-answering processing method according to an embodiment of the present application. Figure 2As shown, the question-answering processing method mainly includes the following steps S201 to S207.
[0056] Step S201, in response to a user request, obtaining corresponding question data.
[0057] The execution subject can obtain the question data from the location corresponding to the link carried in the user request. The question data can be data such as "suitable age for dental implants" or "age of children who can ride high-speed rail for free". The present embodiment of the application does not specifically limit the content of the question data.
[0058] Step S202, disassemble the question data to obtain disassembled data.
[0059] After obtaining the question data, the execution subject can perform word segmentation processing on the question data based on the preset dimension to disassemble the question data and obtain disassembled data. Specifically, the preset dimension can be a word class dimension or a punctuation mark dimension. Specifically, in the word class dimension, the word class division is hierarchical. Words can be divided into content words and function words. Content words include body words, predicates, etc. Body words can be divided into nouns and pronouns. The punctuation mark dimension divides the question data according to punctuation marks, and splits the data on both sides of the punctuation marks to obtain disassembled data. After disassembling the question data, the meaning of the question data can be understood more accurately, and it is convenient to derive data based on the disassembled data to accurately process user requests.
[0060] Step S203, matching the disassembled data with the domain description data corresponding to each domain identifier in the domain identifier pool, and determining the domain identifier corresponding to the matched domain description data as the domain identifier corresponding to the question data.
[0061] Calculate the vector inner product of each disassembled data and the domain description data corresponding to each domain identifier in the domain identifier pool, and match the disassembled data with the domain description data corresponding to each domain identifier in the domain identifier pool based on the calculated vector inner products. The domain identifier corresponding to the domain description data corresponding to the vector inner product greater than the preset threshold is determined as the domain identifier corresponding to the question data. It can be understood that the number of domain identifiers corresponding to the question data can be multiple, each domain identifier corresponds to one domain, and the question data can correspond to multiple domains. When the question data corresponds to multiple domains that have never been touched by the large model, the number of different knowledge plug-ins that need to be used is multiple.
[0062] Step S204, in response to the domain identifier not existing in the preset domain identifier library, determine the nature of the user request, and judge whether knowledge background of a field other than the field corresponding to the domain identifier is required based on the nature and the domain identifier. If so, decompose the question data based on the field corresponding to the required knowledge background to obtain decomposed data, and then derive new question data corresponding to the field corresponding to the required knowledge background based on the decomposed data.
[0063] If not (ie, knowledge background in a field other than the field corresponding to the field identifier is not needed), the execution subject can directly call the knowledge plug-in corresponding to the question data corresponding to the user request to perform a search based on the question data to obtain search result data.
[0064] The domain identifier does not exist in the preset domain identifier library, that is, the domain corresponding to the domain identifier is a domain that the financial AI large model has never touched before. In this case, the execution entity can disassemble the question data based on the domain corresponding to the required knowledge background, and derive new question data based on the disassembled data. According to the new question data, the required knowledge plug-in can be determined.
[0065] Step S205: determine the knowledge plug-in corresponding to the new question data, call the knowledge plug-in to perform parallel retrieval based on the new question data, and summarize the retrieval result data.
[0066] The execution subject can determine the knowledge plug-in corresponding to the new question data according to the nouns in the new question data. Specifically, the execution subject can determine the knowledge plug-in corresponding to the new question data according to the field to which the nouns in the new question data belong. The determined knowledge plug-ins are called in parallel to perform corresponding searches, and finally the results of the searches of each knowledge plug-in are summarized to obtain the search result data.
[0067] Step S206: Generate prompt words based on the search result data.
[0068] The summarized search result data can be used as the basis for the financial AI big model to process user requests. The search result data is filled into the corresponding placeholders in the prompt word generation template to obtain a complete prompt word.
[0069] Step S207, input the prompt word into the large model to obtain answer result data.
[0070] The generated complete prompt words carrying the search result data are input into the financial AI big model, so that the financial AI big model has a basis to rely on and processes user requests to accurately obtain answer result data.
[0071] Figure 3 Schematic diagram of the business architecture of the question-answering processing method according to an embodiment of the present application. Figure 3As shown, it mainly includes three layers. The first is the application layer, which includes the financial question-and-answer assistant and the financial robot. The application layer is responsible for accessing the agent service, and after completing the business question-and-answer request, it displays the results and feeds them back to the user. The second is the agent service layer, which provides agent services. This layer is used as the middle core layer to interact with the basic capability layer. It includes modules such as task decomposition and planning, task parallel execution, task execution result summary, and final result generation. Finally, there is the basic capability layer, which includes the financial AI big model and three knowledge source plug-ins, namely the financial field knowledge base, other field knowledge base, and Internet knowledge retrieval plug-ins.
[0072] Figure 4 FIG. 1 is a schematic diagram of the main flow of a question-answering processing method according to an embodiment of the present application. Figure 4 As shown in the figure, the user asks the financial question-and-answer assistant on the application side a question, "How to apply for a credit card?" The application side sends the user request to the Agent service. The Agent service first performs task decomposition and planning. This step mainly assembles the following prompt and inputs it into the financial AI model to return specific task decomposition and planning content:
[0073] For example, the task breakdown and planning prompt is as follows:
[0074] Your task:
[0075] Understand the user's needs and determine whether financial or other knowledge background is needed based on the nature of the user's request. If you need to search for knowledge plug-ins, please understand the user's needs and break them down, then give three complete questions for searching separately. The knowledge plug-ins you can use include: financial knowledge base, other knowledge bases, and Internet knowledge search.
[0076] It is important to note the following guidelines:
[0077] - You don’t need to answer users’ questions
[0078] - Your response should be provided strictly in the following JSON format. Do not return thought processes, other information, or answers:
[0079]
[0080] For example, the knowledge plug-in in the embodiment of the present application is Figure 4The knowledge query plug-in in can include financial domain knowledge base, other domain knowledge base and Internet search, etc. After understanding the user's needs and breaking them down, the three complete questions given can form a question list List. For example, the question list List can include tasks task1, task2, and task3, among which task1: how to apply for a credit card, the corresponding knowledge query plug-in is the financial domain knowledge base; task2: what conditions are required to apply for a credit card, the corresponding knowledge query plug-in is the financial domain knowledge base; task3: can an individual apply for a credit card online, the corresponding knowledge query plug-in is the financial domain knowledge base.
[0081] The second step of the Agent service is to execute tasks in parallel, that is, to parse the specific task content returned by the large model and call the corresponding knowledge plug-in to perform retrieval in parallel. Here, multi-threading technology is used to execute the task of calling the corresponding plug-in for query in parallel.
[0082] The third step of the Agent service is to summarize the task execution results, that is, to summarize the results of each plug-in query. Using thread synchronizer technology, the main thread waits for all sub-threads that execute query tasks to complete execution before summarizing. After summarizing, it will be assembled into the following prompt:
[0083] The final result generates prompt:
[0084] Your tasks include:
[0085] 1. Understand the user's needs and answer the user's questions based on the reference information already obtained;
[0086] 2. References are your most important and highly credible source of reference knowledge. If there is content in [References], you should first retrieve useful knowledge from it to reply to users. If there is no content in [References], or the information in it is not enough to answer the question, you can use your own knowledge to reply; you need to examine the source of your answer knowledge and clearly inform users of your source of knowledge;
[0087] 3. If the question is about personal information, you must strictly adhere to the description of personal information in the reference material. If it involves personal privacy information not mentioned in the reference material, you must kindly inform the question that it involves personal privacy information and politely refuse to answer;
[0088] 4. If there is confusion and conflict in the knowledge in the reference materials, you can point out the differences between different sources to facilitate user identification. If necessary, you can also ask the user to further refine the direction of the question.
[0089] Here are the references you get by calling different actions:
[0090] ```json
[0091] {quote}
[0092] ```
[0093] The historical interactions are as follows
[0094] {history}
[0095] Now, please respond to the question asked by the user:
[0096] “user”: {user_question}
[0097] The last step of the Agent service is to generate the final result, which is to replace the position of the prompt template placeholder with the corresponding content (that is, the summarized search result data), and then send it to the financial AI big model to generate the final question and answer result.
[0098] The question-and-answer processing method of the embodiment of the present application can achieve cost reduction and efficiency improvement, and can replace all manual processing links of bank customer service in the process of work order text processing, while improving processing efficiency. The accuracy of work order information extraction based on the large model is also higher than manual processing, which can greatly reduce the labor cost of work order text processing. Low intrusion: "zero intrusion" to the original work order text processing system can be achieved, that is, the original work order text processing system does not need to modify any code, and the intermediate manual operation links can be replaced seamlessly. Low transformation complexity: The process can be replaced modularly. For example, the large model service can be replaced with a large language model built by the user himself.
[0099] Figure 5 Schematic diagram of the main units of the question-answer processing device according to an embodiment of the present application. Figure 5 As shown, the question and answer processing device 500 includes an acquisition unit 501, a decomposition unit 502, a retrieval unit 503, a prompt word generation unit 504 and an input unit 505.
[0100] The acquisition unit 501 is configured to acquire corresponding question data in response to a user request, and then determine a corresponding domain identifier.
[0101] The disassembling unit 502 is configured to determine the nature of the user request in response to the domain identifier not existing in the preset domain identifier library, and judge whether the knowledge background of the field other than the field corresponding to the domain identifier is required based on the nature and the domain identifier, and if so, disassemble the question data based on the field corresponding to the required knowledge background to obtain disassembled data, and then derive new question data corresponding to the field corresponding to the required knowledge background based on the disassembled data.
[0102] The retrieval unit 503 is configured to determine the knowledge plug-in corresponding to the new question data, call the knowledge plug-in to perform parallel retrieval based on the new question data, and summarize to obtain retrieval result data.
[0103] The prompt word generating unit 504 is configured to generate prompt words based on the search result data.
[0104] The input unit 505 is configured to input the prompt words into the large model to obtain answer result data.
[0105] In some embodiments, the acquisition unit 501 is further configured to: disassemble the question data to obtain disassembled data; match the disassembled data with the domain description data corresponding to each domain identifier in the domain identifier pool, and determine the domain identifier corresponding to the matched domain description data as the domain identifier corresponding to the question data.
[0106] In some embodiments, the disassembling unit 502 is further configured to: disassemble the question data through the large model to obtain disassembled data, and then derive the disassembled data to obtain new question data.
[0107] In some embodiments, the retrieval unit 503 is further configured to: determine the knowledge plug-in corresponding to the domain identifier as the knowledge plug-in corresponding to the new question data.
[0108] In some embodiments, the prompt word generation unit 504 is further configured to replace the corresponding placeholder in the prompt word generation template with the search result data to generate the corresponding prompt word.
[0109] In some embodiments, the retrieval unit 503 is further configured to: call sub-threads in parallel to utilize the knowledge plug-in to execute the retrieval task corresponding to the corresponding new question data; in response to all sub-threads executing the retrieval task completing execution, call the main thread to summarize the execution results to obtain the retrieval result data.
[0110] It should be noted that the question and answer processing method and question and answer processing device of the present application have a corresponding relationship in terms of specific implementation content, so the repeated content will not be explained again.
[0111] Figure 6 An exemplary system architecture 600 to which the question and answer processing method or the question and answer processing apparatus according to the embodiment of the present application can be applied is shown.
[0112] like Figure 6As shown, system architecture 600 may include terminal devices 601, 602, 603, network 604 and server 605. Network 604 is used to provide a medium for communication links between terminal devices 601, 602, 603 and server 605. Network 604 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0113] The user can use the terminal devices 601, 602, 603 to interact with the server 605 through the network 604 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 601, 602, 603, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).
[0114] The terminal devices 601, 602, 603 may be various electronic devices having a question-answering processing screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0115] Server 605 can be a server that provides various services, such as a background management server that provides support for user requests submitted by users using terminal devices 601, 602, and 603 (only as an example). The background management server can respond to user requests, obtain corresponding question data, and then determine the corresponding field identification; in response to the field identification not existing in the preset field identification library, determine the nature of the user request, and judge whether the knowledge background of the field other than the field corresponding to the field identification is required based on the nature and the field identification. If so, the question data is disassembled based on the field corresponding to the required knowledge background to obtain disassembled data, and then derive new question data corresponding to the field corresponding to the required knowledge background based on the disassembled data; determine the knowledge plug-in corresponding to the new question data, call the knowledge plug-in to perform parallel retrieval based on the new question data, and summarize the retrieval result data; generate prompt words based on the retrieval result data; input the prompt words into the large model to obtain the answer result data. Thereby improving the accuracy and comprehensiveness of the large model when answering user questions in fields that have never been touched.
[0116] It should be noted that the question and answer processing method provided in the embodiment of the present application is generally executed by the server 605 , and accordingly, the question and answer processing device is generally set in the server 605 .
[0117] It should be understood that Figure 6 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0118] Reference below Figure 7, which shows a schematic diagram of the structure of a computer system 700 of a terminal device suitable for implementing an embodiment of the present application. Figure 7 The terminal device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0119] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 to a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the computer system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0120] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed so that a computer program read therefrom is installed into the storage section 708 as needed.
[0121] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, the above-mentioned functions defined in the system of the present application are executed.
[0122] It should be noted that the computer-readable medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. Computer-readable storage media may include, for example, but are not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0123] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0124] The units involved in the embodiments described in the present application may be implemented by software or hardware. The units described may also be set in a processor, for example, it may be described as: a processor includes an acquisition unit, a disassembly unit, a retrieval unit, a prompt word generation unit and an input unit. The names of these units do not constitute limitations on the units themselves in some cases.
[0125] As another aspect, the present application also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs. When the above one or more programs are executed by a device, the device responds to the user request, obtains the corresponding question data, and then determines the corresponding domain identification; in response to the domain identification not existing in the preset domain identification library, determines the nature of the user request, and judges whether the knowledge background of the domain other than the domain corresponding to the domain identification is required according to the nature and the domain identification, and if so, disassembles the question data based on the domain corresponding to the required knowledge background to obtain disassembled data, and then derives new question data corresponding to the domain corresponding to the required knowledge background based on the disassembled data; determines the knowledge plug-in corresponding to the new question data, calls the knowledge plug-in to perform parallel retrieval based on the new question data, and summarizes the retrieval result data; generates prompt words based on the retrieval result data; inputs the prompt words into the large model to obtain the answer result data.
[0126] The computer program product of the present application includes a computer program, and when the computer program is executed by a processor, it implements the question and answer processing method in the embodiment of the present application.
[0127] According to the technical solution of the embodiment of the present application, the accuracy and comprehensiveness of the large model in answering user questions in areas that have never been touched before can be improved.
[0128] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.
Claims
1. A question-answering processing method, characterized in that: include: In response to a user request, obtaining corresponding question data, and then determining a corresponding domain identifier; In response to the domain identifier not existing in the preset domain identifier library, determining the nature of the user request, judging whether a knowledge background of a field other than the field corresponding to the domain identifier is required based on the nature and the domain identifier, and if so, disassembling the question data based on the field corresponding to the required knowledge background to obtain disassembled data, and further deriving new question data corresponding to the field corresponding to the required knowledge background based on the disassembled data; Determine the knowledge plug-in corresponding to the new question data, call the knowledge plug-in to perform parallel retrieval based on the new question data, and summarize to obtain retrieval result data; Based on the search result data, generating prompt words; The prompt words are input into the large model to obtain answer result data.
2. The method according to claim 1, characterized in that The determining of the corresponding domain identifier includes: Decomposing the question data to obtain decomposition data; The disassembled data is matched with the domain description data corresponding to each domain identifier in the domain identifier pool, and the domain identifier corresponding to the matched domain description data is determined as the domain identifier corresponding to the question data.
3. The method according to claim 1, characterized in that The method further comprises: The question data is disassembled by a large model to obtain disassembled data, and the disassembled data is further derived to obtain new question data.
4. The method according to claim 1, characterized in that The determining the knowledge plug-in corresponding to the new question data includes: The knowledge plug-in corresponding to the domain identifier is determined as the knowledge plug-in corresponding to the new question data.
5. The method according to claim 1, characterized in that The generating prompt words comprises: The corresponding placeholder in the prompt word generation template is replaced with the search result data to generate the corresponding prompt word.
6. The method according to claim 1, characterized in that The search result data obtained by the aggregation includes: Calling the child threads in parallel to use the knowledge plug-in to execute the retrieval task corresponding to the corresponding new question data; In response to all sub-threads executing the retrieval task finishing their execution, the main thread is called to summarize the execution results to obtain retrieval result data.
7. A question-answer processing device, characterized in that: include: an acquisition unit, configured to acquire corresponding question data in response to a user request, and then determine a corresponding domain identifier; a disassembly unit configured to, in response to the domain identifier not existing in a preset domain identifier library, determine the nature of the user request, and judge whether a knowledge background of a field other than the field corresponding to the domain identifier is required based on the nature and the domain identifier, and if so, disassemble the question data based on the field corresponding to the required knowledge background to obtain disassembled data, and further derive new question data corresponding to the field corresponding to the required knowledge background based on the disassembled data; A retrieval unit is configured to determine the knowledge plug-in corresponding to the new question data, call the knowledge plug-in to perform parallel retrieval based on the new question data, and summarize the retrieval result data; A prompt word generating unit, configured to generate a prompt word based on the search result data; The input unit is configured to input the prompt word into the large model to obtain answer result data.
8. The device according to claim 7, characterized in that The acquisition unit is further configured to: Decomposing the question data to obtain decomposition data; The disassembled data is matched with the domain description data corresponding to each domain identifier in the domain identifier pool, and the domain identifier corresponding to the matched domain description data is determined as the domain identifier corresponding to the question data.
9. The device according to claim 7, characterized in that The disassembly unit is further configured to: The question data is disassembled by a large model to obtain disassembled data, and the disassembled data is further derived to obtain new question data.
10. The device according to claim 7, characterized in that The retrieval unit is further configured to: The knowledge plug-in corresponding to the domain identifier is determined as the knowledge plug-in corresponding to the new question data.
11. The device according to claim 7, characterized in that The prompt word generating unit is further configured to: The corresponding placeholder in the prompt word generation template is replaced with the search result data to generate the corresponding prompt word.
12. The device according to claim 7, characterized in that The retrieval unit is further configured to: Calling the child threads in parallel to use the knowledge plug-in to execute the retrieval task corresponding to the corresponding new question data; In response to all sub-threads executing the retrieval task finishing their execution, the main thread is called to summarize the execution results to obtain retrieval result data.
13. An electronic device for question and answer processing, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
14. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Cited By
Multi-vector library parallel retrieval method and device based on retrieval enhancement
CN119988430A
