Individualized question interaction method, device, related equipment and computer program product
By using knowledge base search and large-model-driven interaction methods in individualized problem interaction, a problem form is generated and user feedback is obtained through one round of interaction, the problem of multiple rounds of invalid interaction in the existing technology is solved, and the interaction efficiency and the accuracy of the answer is improved.
Patent Information
- Application Number
- CN202411867579.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-04-08
AI Technical Summary
In the process of individualized problem interaction, the prior art is difficult to effectively identify the premise and implicit information of user problems, resulting in multiple rounds of invalid interactions, users are prone to fatigue or impatient, and the answers are not effective.
By acquiring user questions and retrieving matching target knowledge in the configured knowledge base, we can judge whether further interaction is needed to collect information. If necessary, a question form is generated to contain problem information that needs to be interacted with, and a user feedback is obtained through a round of interaction. Based on the interaction results and target knowledge, we drive the big model to generate answers through instructions.
The premise and implicit information of effectively identifying user problems, reduce multiple rounds of interaction, improve interaction efficiency, enhance user experience, and improve the accuracy of answering individualized questions.
Smart Images

Figure CN119782473A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and more specifically, to an individualized problem interaction method, apparatus, related equipment and computer program product. Background Art
[0002] Individualized questions are questions that require a combination of individual circumstances or background information to arrive at a conclusion or solution. There is no single standard answer to these questions, and judgments must be made based on the unique circumstances of the questioner. For example, the answers to questions about treatment for a disease, medication advice, financial investment, legal aid, educational guidance, etc. will vary from person to person.
[0003] With the development of big model technology, big models can be applied to solve individualized problem interaction solutions. However, when interacting with individualized problems, big model technology still faces many challenges. For example, when the questions input by users are not comprehensive enough, the big model may not be able to recognize the premise and implicit information of the questions, which leads to the inability of the big model to give effective answers to the user's questions. Some existing technologies may frequently ask users to supplement information for individualized questions through multiple rounds of interactions, hoping to answer users' individualized questions by integrating multiple rounds of supplementary information. However, in the process of long conversations with multiple rounds, users are prone to fatigue or impatience due to multiple rounds of invalid interactions. The lengthy and unclear conversation process may make users lose patience and even terminate the conversation early, which is not effective in answering individualized questions. Summary of the invention
[0004] In view of the above problems, this application is proposed to provide a personalized question interaction method, apparatus, related equipment and computer program product to solve the defects of traditional solutions in the personalized question interaction process. The specific solution is as follows:
[0005] In a first aspect, a personalized problem interaction method is provided, comprising:
[0006] Obtain user questions and retrieve target knowledge matching the user questions from a configured knowledge base;
[0007] Based on the user question and the target knowledge, determine whether further interaction is required to collect information to answer the user question, and determine the question information and number of questions that require interaction;
[0008] If it is determined based on the judgment result that further interaction is required, and the number of questions requiring interaction is greater than 1, a question form is generated and output, wherein the question form includes information about the questions requiring interaction;
[0009] The interactive result of the user's feedback on the question form is obtained, and based on the interactive result, the user question and the target knowledge, the large model is driven by instructions to obtain the answer corresponding to the user question, and the answer is output.
[0010] In a possible design, in another implementation of the first aspect of the embodiment of the present application, the method further includes:
[0011] If it is determined based on the judgment result that further interaction is required, and the number of questions requiring interaction is equal to 1, the question information requiring interaction is output, and the interaction result of the user's feedback on the question information is obtained. Based on the interaction result, the user question and the target knowledge, the answer corresponding to the user question is obtained through the instruction-driven large model, and the answer is output.
[0012] In a possible design, in another implementation of the first aspect of the embodiment of the present application, the method further includes:
[0013] If it is determined based on the judgment result that no further interaction is required, then based on the user question and the target knowledge, the large model is driven by instructions to obtain the answer corresponding to the user question and output the answer.
[0014] In a possible design, in another implementation of the first aspect of the embodiment of the present application, based on the user question and the target knowledge, determining whether further interaction is required to collect information to answer the user question, and determining the question information and the number of questions that require interaction, includes:
[0015] The big model is called to instruct the big model to refer to the user question and the target knowledge, determine whether further interaction is required to collect information to answer the user question, and when it is determined that further interaction is required, determine the question information and number of questions that need to be interacted.
[0016] In a possible design, in another implementation of the first aspect of the embodiment of the present application, calling the big model to instruct the big model to refer to the user question and the target knowledge, determine whether further interaction is required to collect information to answer the user question, and when it is determined that further interaction is required, determine the question information and the number of questions that need to be interacted, including:
[0017] Obtain a first prompt instruction prompt format template, the template including a task instruction, a question slot and a knowledge slot, the task instruction is used to instruct the large model to refer to the user question in the question slot and the target knowledge in the knowledge slot, determine whether further interaction is required to collect information to answer the user question, and when it is determined that further interaction is required, provide the question information and the number of questions that need to be interacted;
[0018] Fill the user question into the question slot, fill the target knowledge into the knowledge slot, obtain a first prompt instruction prompt, input the first prompt instruction prompt into the big model, and obtain the result output by the big model.
[0019] In a possible design, in another implementation of the first aspect of the embodiment of the present application, the task instruction in the first prompt instruction prompt format template is also used to instruct the large model to give an answer corresponding to the user question when it is determined that no further interaction is required;
[0020] The method also includes:
[0021] If it is determined based on the output result of the large model that no further interaction is required, the answer corresponding to the user question output by the large model will be output.
[0022] In a possible design, in another implementation of the first aspect of the embodiment of the present application, based on the interaction result, the user question and the target knowledge, a process of obtaining an answer corresponding to the user question by driving the large model through instructions includes:
[0023] Obtain a second prompt instruction prompt format template, the template including a task instruction, a question slot, a supplementary interaction slot and a knowledge slot, the task instruction is used to instruct the large model to answer the user question by referring to the user question in the question slot, the interaction result in the supplementary interaction slot and the target knowledge in the knowledge slot;
[0024] Fill the user question into the question slot, fill the interaction result into the supplementary interaction slot, fill the target knowledge into the knowledge slot, obtain a second prompt instruction prompt, input the second prompt instruction prompt into the big model, and obtain the answer corresponding to the user question output by the big model.
[0025] In a possible design, in another implementation of the first aspect of the embodiment of the present application, the process of retrieving target knowledge matching the user question in the configured knowledge base includes:
[0026] Extract key information from the user's question;
[0027] Using the key information as a search condition, the target knowledge matching the user question is searched in the configured knowledge base.
[0028] In a possible design, in another implementation of the first aspect of the embodiment of the present application, the process of retrieving the target knowledge matching the user question in the configured knowledge base using the key information as a retrieval condition includes:
[0029] Taking the key information as the search condition, it is determined whether there is knowledge in the knowledge base that completely matches the key information. If so, the completely matching knowledge is used as the target knowledge for matching the user question.
[0030] In a possible design, in another implementation of the first aspect of the embodiment of the present application, the method further includes:
[0031] If there is no knowledge that completely matches the key information in the knowledge base, then searching for candidate knowledge that roughly matches the key information;
[0032] Based on the candidate knowledge, generating and outputting an interactive question, wherein the interactive question is used to instruct the user to confirm the standard name corresponding to the key information in the candidate knowledge;
[0033] The interactive result fed back by the user in response to the interactive question is obtained, and the target knowledge matching the user question is retrieved in the knowledge base using the interactive result as a retrieval condition.
[0034] In a second aspect, an individualized question interaction device is provided, comprising:
[0035] A question acquisition unit, used to acquire user questions;
[0036] A knowledge retrieval unit, used to retrieve target knowledge matching the user question in a configured knowledge base;
[0037] An interaction round determination unit, configured to determine whether further interaction is required to collect information to answer the user question based on the user question and the target knowledge, and to determine the question information and number of questions that require interaction;
[0038] A form processing unit, configured to generate and output a question form when it is determined based on the judgment result that further interaction is required and the number of questions requiring interaction is greater than 1, wherein the question form includes information about the questions requiring interaction;
[0039] The first answer processing unit is used to obtain the interaction result of the user's feedback on the question form, and based on the interaction result, the user question and the target knowledge, obtain the answer corresponding to the user question through the instruction-driven large model, and output the answer.
[0040] In a third aspect, an electronic device is provided, comprising: a memory and a processor;
[0041] The memory is used to store programs;
[0042] The processor is used to execute the program to implement each step of the individualized question interaction method described in any one of the first aspects of the present application.
[0043] In a fourth aspect, a readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the various steps of the individualized question interaction method described in any one of the aforementioned first aspects of the present application are implemented.
[0044] In a fifth aspect, a computer program product is provided, including a computer program, which, when executed by a processor, implements the various steps of the individualized question interaction method described in any one of the aforementioned first aspects of the present application.
[0045] By means of the above technical solution, the present application searches for matching target knowledge in the knowledge base for user questions. On this basis, based on the user questions and target knowledge, it is determined whether further interaction is required to collect information to answer the user questions. When it is determined that it is necessary, the question information and the number of questions that need to be interacted are further determined. If the number of questions that need to be interacted is greater than 1, in order to avoid multiple rounds of interaction that may easily cause user disgust, the present application generates a question form containing the information of each question that needs to be interacted, and then outputs the question form through a round of interaction, and obtains the interaction results fed back by the user for the question form. Based on the interaction results, user questions and target knowledge, the answer corresponding to the user question is obtained through the large model and output. Obviously, when the present application is aimed at individualized questions, it actively judges whether further interaction is required to answer the user question based on the user questions and target knowledge, as well as the question information and the number of questions that need to be interacted. By determining the question information that needs to be interacted, the premise and implicit information of the user question can be identified, so that the large model can give a more accurate answer. In addition, when it is determined that the number of questions that require interaction is greater than 1, the traditional one-to-one multi-round inquiry method is changed to a one-round scale method, that is, the information of each question that requires interaction is summarized through a question form and output to the user through a round of interaction. This alleviates the user's resistance to multiple rounds of repeated questioning, simplifies and improves the interaction efficiency, and is more conducive to quickly collecting the required information, which is then used as a reference for the large model to generate answers. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0047] Figure 1 A schematic diagram of an implementation system architecture of the individualized question interaction method provided in an embodiment of the present application;
[0048] Figure 2 A schematic diagram of a terminal structure provided in an embodiment of the present application;
[0049] Figure 3 A schematic diagram of a server structure provided in an embodiment of the present application;
[0050] Figure 4 A schematic diagram of a process flow of the individualized question interaction method provided in an embodiment of the present application;
[0051] Figure 5 An example of a schematic diagram of knowledge sources in various fields is provided;
[0052] Figure 6 Another schematic diagram of the process of the individualized question interaction method provided in the embodiment of the present application;
[0053] Figure 7 An example of a human-computer interaction dialogue scenario diagram is provided;
[0054] Figure 8 Another schematic diagram of a human-computer dialogue scenario is illustrated;
[0055] Fig. 9 A schematic diagram of the structure of an individualized question interaction device provided in an embodiment of the present application;
[0056] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] Before introducing this application solution, the relevant concepts involved in this article are first explained:
[0058] prompt: Instructions. When interacting with AI (such as an artificial intelligence model), you need to send instructions to AI. It can be a text description, such as "Please recommend me a pop song" when you interact with AI, or it can be a parameter description in a certain format. For example, if you want AI to draw in a certain format, you need to describe the relevant drawing parameters.
[0059] Large models: In the field of artificial intelligence, large models usually refer to large-scale pre-trained models. Such models are called "large" because they can be pre-trained on a large amount of data and can be transferred to a variety of downstream tasks. Their full English name is Large Pre-Trained Models or Large-Scale Pre-Training Models. Large models are characterized by their large scale and contain billions or even more parameters, which help them learn complex patterns in the data. The emerging capabilities of large models include but are not limited to: contextual learning, instruction following, code generation, step-by-step reasoning capabilities, etc. Large models can include large language models (LLMs) and multimodal large models. Large language models are mainly used to process text modal data. Multimodal large models further integrate multimodal capabilities on the basis of large language models and can process information in multiple modalities, such as images, text, audio, etc.
[0060] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0061] This application provides an individualized problem interaction method that can be applied to Figure 1 The system architecture shown in FIG. 1 may include a terminal 100 and a server 200. The server 200 may include one or more servers ( Figure 1 A server is included as an example for explanation).
[0062] The terminal 100 or the server 200 can be used alone to execute the individualized question interaction method provided in the embodiment of the present application. In addition, the terminal 100 and the server 200 can also be used in collaboration to execute the individualized question interaction method provided in the embodiment of the present application.
[0063] Next describe Figure 1 The product form of the mid-terminal 100;
[0064] The terminal 100 in the embodiment of the present application can be a mobile phone, a tablet computer, a learning machine, a robot, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc., and the embodiment of the present application does not impose any restrictions on this.
[0065] Figure 2 An optional hardware structure diagram of the terminal 100 is shown.
[0066] refer to Figure 2 As shown, the terminal 100 may include a radio frequency unit 110, a memory 120, an input unit 130, a display unit 140, a camera 150 (optional), an audio circuit 160, a speaker 161, a microphone 162, an earphone jack 163 (optional), a processor 170, an external interface 180, a power supply 190 and other components. Those skilled in the art will appreciate that Figure 2 These are merely examples of terminals or multi-function devices and do not constitute limitations on the terminals or multi-function devices, which may include more or fewer components than those shown in the figures, or combinations of certain components, or different components.
[0067] The input unit 130 can be used to receive input digital or character information, and generate key signal input related to the user settings and function control of the portable multifunctional device. Specifically, the input unit 130 may include a touch screen 131 and / or other input devices 132. The touch screen 131 can collect the user's touch operations on or near it (such as the user's operation on or near the touch screen using any suitable object such as fingers, joints, stylus, etc.), and drive the corresponding connection device according to a pre-set program. The touch screen can detect the user's touch action on the touch screen, convert the touch action into a touch signal and send it to the processor 170, and can receive and execute the command sent by the processor 170; the touch signal at least includes the touch point coordinate information. The touch screen 131 can provide an input interface and an output interface between the terminal 100 and the user. In addition, the touch screen can be implemented using multiple types such as resistive, capacitive, infrared and surface acoustic wave. In addition to the touch screen 131, the input unit 130 can also include other input devices. Specifically, other input devices 132 may include, but are not limited to, one or more of a physical keyboard, function keys (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, and the like.
[0068] Among them, other input devices 132 can receive input data and so on.
[0069] The display unit 140 can be used to display information input by the user or information provided to the user, various menus of the terminal 100, interactive interfaces, file display and / or playback of any multimedia file. In the embodiment of the present application, the display unit 140 can be used to display various interactive interfaces, processing results, etc. in the individualized problem interaction method.
[0070] The memory 120 can be used to store instructions and data. The memory 120 can mainly include an instruction storage area and a data storage area. The data storage area can store various data, such as multimedia files, texts, etc.; the instruction storage area can store software units such as operating systems, applications, instructions required for at least one function, or their subsets and extensions. It can also include a non-volatile random access memory; provide the processor 170 with hardware, software and data resources including management of computing and processing equipment, and support control software and applications. It is also used for the storage of multimedia files, and the storage of running programs and applications.
[0071] The processor 170 is the control center of the terminal 100. It uses various interfaces and lines to connect various parts of the entire terminal 100. By running or executing instructions stored in the memory 120 and calling data stored in the memory 120, it executes various functions of the terminal 100 and processes data, thereby controlling the terminal device as a whole. Optionally, the processor 170 may include one or more processing units; preferably, the processor 170 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application program, and the modem processor mainly processes wireless communication. It is understandable that the above-mentioned modem processor may not be integrated into the processor 170. In some embodiments, the processor and the memory may be implemented on a single chip, and in some embodiments, they may also be implemented separately on separate chips. The processor 170 may also be used to generate corresponding operation control signals, send them to corresponding components of the computing and processing device, read and process data in the software, especially read and process data and programs in the memory 120, so that each functional module therein performs corresponding functions, thereby controlling the corresponding components to act according to the requirements of the instructions.
[0072] Among them, the memory 120 can be used to store software codes related to the individualized question interaction method, the processor 170 can execute the steps of the individualized question interaction method, and can also schedule other units (such as the above-mentioned input unit 130 and display unit 140) to achieve corresponding functions.
[0073] The radio frequency unit 110 (optional) can be used for receiving and sending information or receiving and sending signals during a call, for example, after receiving the downlink information of the base station, it is sent to the processor 170 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, LNA), a duplexer, etc. In addition, the radio frequency unit 110 can also communicate with network devices and other devices through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile communication (Global System of Mobile communication, GSM), General Packet Radio Service (General Packet Radio Service, GPRS), Code Division Multiple Access (Code Division Multiple Access, CDMA), Wideband Code Division Multiple Access (Wideband Code Division Multiple Access, WCDMA), Long Term Evolution (Long Term Evolution, LTE), email, Short Messaging Service (SMS), etc.
[0074] In this embodiment of the present application, the RF unit 110 can send data to the server 200 and receive the processing result sent by the server 200. Exemplarily, the RF unit 110 sends the received user's question information to the server 200, and the server 200 obtains the reply answer corresponding to the question information and returns the reply answer to the terminal 100 for output.
[0075] It should be understood that the radio frequency unit 110 is optional and can be replaced by other communication interfaces, such as a network port.
[0076] The terminal 100 also includes a power supply 190 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 170 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption.
[0077] The terminal 100 further includes an external interface 180 , which may be a standard Micro USB interface or a multi-pin connector, and may be used to connect the terminal 100 to communicate with other devices, or to connect a charger to charge the terminal 100 .
[0078] Although not shown, the terminal 100 may also include a flashlight, a wireless fidelity (WiFi) module, a Bluetooth module, sensors with different functions, etc., which are not described in detail here. Some or all of the methods described below may be applied in the following embodiments. Figure 2 In the terminal 100 shown.
[0079] Next describe Figure 1 The product form of the server 200;
[0080] Figure 3 A structural diagram of a server 200 is provided, such as Figure 3 As shown, the server 200 includes a bus 201, a processor 202, a communication interface 203, and a memory 204. The processor 202, the memory 204, and the communication interface 203 communicate with each other via the bus 201.
[0081] The bus 201 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0082] The processor 202 may be any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0083] The memory 204 may include a volatile memory, such as a random access memory (RAM). The memory 204 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0084] The memory 204 may be used to store software codes related to the individualized question interaction method, and the processor 202 may execute the steps of the individualized question interaction method, and may also schedule other units to implement corresponding functions.
[0085] It should be understood that the above-mentioned terminal 100 and server 200 can be centralized or distributed devices, and the processors in the above-mentioned terminal 100 and server 200 (such as processor 170 and processor 202) can be hardware circuits (such as application specific integrated circuit (ASIC), field-programmable gate array (FPGA), general-purpose processor, digital signal processor (DSP), microprocessor or microcontroller, etc.), or a combination of these hardware circuits. For example, the processor can be a hardware system with an instruction execution function, such as a CPU, DSP, etc., or a hardware system without an instruction execution function, such as an ASIC, FPGA, etc., or a combination of the above-mentioned hardware systems without an instruction execution function and hardware systems with an instruction execution function.
[0086] It is understandable that before using the technical solutions disclosed in the embodiments of this application, the type, scope of use, usage scenarios, etc. of the personal information involved in this application should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0087] When interacting with individual professional issues, large models face multiple challenges that affect the quality of user experience. By analyzing these issues, we can understand the limitations of large models in practical applications and areas that need improvement. These issues will be elaborated in detail below.
[0088] Context understanding: The context understanding problem is the first obstacle that large models need to overcome. In multi-round conversations, the model needs to accurately understand the context and nuances of the user's questions. This usually means identifying the user's question premise and implicit information. If the model cannot process these effectively, it may give inappropriate or irrelevant answers, causing the user to feel frustrated with the interaction.
[0089] Number of interaction rounds: Too many rounds of interaction may cause users to be disgusted. In long conversations, users are easily tired or impatient due to multiple rounds of ineffective interactions. Lengthy and unclear conversations may make users lose patience, so the model needs to answer accurately in as few rounds as possible to improve user experience.
[0090] Friendly information collection: In personalized problem consultation, the model cannot obtain important personalized information of users in real time (such as personal medical records or lifestyle in health consultation scenarios), which limits its ability to provide fully personalized advice. To make up for this deficiency, a possible solution is to ask users for information in multiple rounds, but this may cause resistance.
[0091] Expression and wording: These issues are also key to successful interaction. The expertise level of user groups varies greatly, and the model needs to flexibly adjust the complexity of the language and the use of terminology to ensure that the information is effectively conveyed. If the language is not appropriate, it may lead to misunderstandings or appear too professional and alienate ordinary users.
[0092] In summary, large models face many challenges when dealing with individualized problems. Overcoming these obstacles requires continuous optimization of the model's capabilities and enhancing its interactive effects in various user scenarios. This will enhance the model's practical application value and increase user satisfaction.
[0093] In response to the various challenges faced by the above-mentioned large model when dealing with individualized problems, an embodiment of the present application provides an individualized problem interaction method to at least solve some of the defects existing in the current large model when dealing with individualized problems.
[0094] The embodiment of the present application provides an individualized question interaction method, which is illustrated by applying the method to a computer device. The computer device may be Figure 1 The terminal 100 or the system consisting of the terminal 100 and the server 200. Figure 4 , the individualized problem interaction method specifically includes the following steps:
[0095] Step S100: Obtain a user question, and retrieve target knowledge matching the user question from a configured knowledge base.
[0096] Specifically, during the human-computer interaction process, the question information input by the user can be obtained. The user question can be an individualized question, and the fields corresponding to the individualized question include but are not limited to the following situations:
[0097] 1. Medical field: Common problems such as disease diagnosis, treatment (surgery, medication, rehabilitation) plans, etc., all require specific analysis based on the patient's physical condition, medical history and symptoms.
[0098] 2. Legal field: Different cases have different backgrounds, legal constraints and parties involved, so legal advice or judgments need to be personalized.
[0099] 3. Educational field: Learning plans and educational suggestions need to be formulated based on factors such as students’ learning ability, interests, goals and current level.
[0100] 4. Finance and investment: Differences in individual financial status, risk tolerance, market knowledge, etc. will also lead to differences in financial management or investment advice.
[0101] With the popularization of the Internet and digital services, users' demand for answers to personalized questions is growing rapidly, including but not limited to:
[0102] Medical consultation: Users want personalized health advice, including symptom answers, medication guidance, disease prevention, etc.
[0103] Legal Aid: Many people seek legal advice related to their situations through online channels.
[0104] Educational guidance: Personalized learning plans, learning material recommendations, etc. have also become important needs of online users.
[0105] Financial advice: Users expect to receive financial advice or investment strategies based on their personal financial situation.
[0106] When dealing with individualized problems, it is usually necessary to refer to various authoritative and professional knowledge resources. Therefore, in the method provided in this embodiment, a knowledge base is pre-equipped, which contains knowledge information related to the field described in the individualized problem. In this step, according to the obtained user problem, the target knowledge matching the user problem can be retrieved in the knowledge base.
[0107] Reference Figure 5 , which exemplifies several reference sources of knowledge in different fields:
[0108] Medical field: ① Textbooks and basic medical knowledge: This is the basis of all medical practice, including anatomy, physiology, pathology, etc. Doctors need to understand the development mechanism of the disease based on this basic knowledge during diagnosis and treatment. ② Drug instructions: Drug instructions provide detailed drug information, including indications, contraindications, drug interactions, dosage recommendations, side effects, etc. When doctors choose drugs for patients, they need to carefully refer to the drug instructions to ensure that the drugs are safe and effective for specific patients. ③ Clinical guidelines: These are standardized treatment recommendations based on the latest research evidence issued by authoritative medical institutions or professional organizations. Clinical guidelines help doctors treat common diseases according to the norms. In terms of individualized problems, they need to be appropriately adjusted according to the specific circumstances of the patient. ④ Clinical research and medical literature: Individualized problems sometimes involve the latest medical advances or rare diseases. Doctors need to consult the latest results of relevant clinical studies, journal articles or academic conferences in order to provide patients with treatment plans based on the latest evidence.
[0109] Education: Teachers or education consultants need to refer to textbooks (such as pedagogy books), teaching cases, practice reports, etc. to develop learning plans that meet the individual needs of students.
[0110] Legal field: When dealing with individualized issues, legal practitioners need to refer to legal textbooks, regulations, judicial interpretations, precedents, and related legal reviews.
[0111] Financial field: Financial advisors or investment analysts need to provide personalized financial or investment advice based on investment guides, financial statements, market reports, economics books, etc.
[0112] In this step, by retrieving the target knowledge that matches the user's question, a data basis is provided for the processing of subsequent steps.
[0113] Step S110: Based on the user question and target knowledge, determine whether answering the user question requires further interaction to collect information, and determine the question information and number of questions that require interaction.
[0114] In this embodiment, after the target knowledge matching the user question is retrieved, the large model is not directly called to generate an answer based on the user question and the target knowledge, but a judgment processing logic is added, that is, judging whether the answer corresponding to the user question can be given based on the current target knowledge and the user question description. When the judgment result is that the answer corresponding to the user question cannot be given, it is necessary to collect information through further interaction, and the collected information is used to assist in answering the answer corresponding to the user question. At this time, the question information that needs to be interacted is further determined, and the number of questions that need to be interacted is determined.
[0115] Step S120: If it is determined based on the judgment result that further interaction is required, and the number of questions requiring interaction is greater than 1, a question form is generated and output, wherein the question form includes information about the questions requiring interaction.
[0116] Specifically, when the judgment result of the previous step indicates that further interaction is required to collect information, and the number of questions that require interaction is greater than 1, in order to avoid causing user disgust through multiple rounds of inquiries, in this step, the various question information that require interaction are organized into a question form, and the question form is output through one round of interaction, which simplifies the interaction process and improves the interaction efficiency, so that users can give feedback on each question in the question form through one round of interaction.
[0117] Step S130: Obtain the interaction result of the user's feedback on the question form, and based on the interaction result, the user question and the target knowledge, obtain the answer corresponding to the user question through the instruction-driven large model, and output the answer.
[0118] Specifically, in a round of interaction on the question form, the user's interaction results on the question form can be obtained, and the interaction results contain feedback information on each question in the question form. On this basis, the big model can be called based on the interaction results, user questions and target knowledge to generate answers corresponding to the user questions and output the answers.
[0119] The method provided in the embodiment of the present application has advantages in context understanding and user interaction efficiency. The method of the present application focuses on dynamically understanding user intentions, reducing the number of unnecessary interactions, and making conversations more natural and efficient. In addition, the method of the present application considers whether the current user questions obtained and the retrieved target knowledge contain the user's implicit information and problem premise when solving individualized problems, that is, whether it is sufficient to support the large model to give accurate answers to user questions. When it is judged that it is not enough to give accurate answers, a round of interactive question forms is used to fully obtain information to understand the user's implicit information and problem premise, which not only improves the accuracy of problem solving, but also enhances the overall user experience.
[0120] This application method collects important user information in advance by designing a question form, which can alleviate user resistance caused by repeated questioning in multiple rounds of interactions and provide a more feasible solution for long-term interaction improvement.
[0121] This application method emphasizes the strategy of focusing on users filling out comprehensive question forms at the beginning of the interaction to ensure the efficiency and pertinence of subsequent conversations.
[0122] In some embodiments of the present application, another implementation of the individualized question interaction method is provided, referring to Figure 6 As shown:
[0123] After obtaining the user's question, the matching target knowledge is retrieved in the configured knowledge base. If the match fails, that is, the target knowledge matching the user's question cannot be retrieved, the ability of the base large model can be called to directly generate the answer corresponding to the user's question and output the answer.
[0124] When the match is successful, it can be determined based on the user's question and target knowledge whether it is necessary to continue to interact to obtain the collected information, as well as the question information and number of questions that need to be interacted. There are three types of judgment results:
[0125] Case 1: No interaction is required based on the judgment result:
[0126] At this time, based on the user's question and target knowledge, the large model can be driven by instructions to obtain the answer corresponding to the user's question and output the answer.
[0127] That is, the user questions and target knowledge currently obtained are sufficient for the large model to generate accurate answers. At this time, the large model can be called to directly generate answers based on the user questions and target knowledge without having to ask the user again.
[0128] Case 2: Based on the judgment result, it is determined that further interaction is required, and the number of questions that require interaction is equal to 1:
[0129] Since there is only one question that needs to be interacted with, a round of interaction with the user can be conducted to output the information of the question that needs to be interacted with, and the interaction result of the user's feedback on the question information can be obtained. The large model is called to generate and output the answer corresponding to the user's question based on the interaction result, user question and target knowledge.
[0130] Case 3: Based on the judgment result, it is determined that further interaction is required, and the number of questions that require interaction is greater than 1:
[0131] Since the number of questions that need to be interacted is greater than 1, if one question is interacted with in each round according to the traditional solution, multiple rounds of interaction with the user are required, and frequent questions are asked to the user, which is inefficient and easy to cause user disgust. This application organizes the various question information that need to be interacted into a question form, and then outputs the question form to the user through a round of interaction, obtains the interaction results fed back by the user for the question form, calls the large model, and generates and outputs the answer corresponding to the user question based on the interaction results, user questions and target knowledge.
[0132] In a possible implementation, while outputting the answer to the user, the application can also further indicate the source of the knowledge used to generate the answer, that is, provide knowledge traceability. On the one hand, it can enhance the interpretability of the reply answer, and on the other hand, when the user has doubts about the answer replied by the large model, the knowledge traceability can assist the user in making further judgments.
[0133] In some embodiments of the present application, the aforementioned step S100, the process of retrieving target knowledge matching the user question in the configured knowledge base, is described.
[0134] In a possible implementation, the user's question can be directly used as a retrieval condition to retrieve the target knowledge matching the user's question in the knowledge base.
[0135] In another possible implementation, key information may be first extracted from the user question, for example, by performing entity extraction on the user question to obtain the extracted key information.
[0136] The above process of extracting key information from user questions can extract key information according to pre-configured extraction rules. Alternatively, a pre-trained key information extraction model can be used, or a large model can be directly used to extract key information, etc.
[0137] Furthermore, the key information is used as the retrieval condition to retrieve the target knowledge matching the user's question in the knowledge base.
[0138] In order to facilitate retrieval, classification labels can be pre-built for each piece of knowledge content in the knowledge base, so that the target knowledge can be quickly matched and located according to the classification labels during retrieval.
[0139] When searching the knowledge base with key information as the retrieval condition, it can be determined whether there is knowledge in the knowledge base that completely matches the key information. If so, the completely matching knowledge is used as the target knowledge for matching the user's question; if not, each candidate knowledge that roughly matches the key information can be retrieved.
[0140] Furthermore, since the target knowledge that completely matches the user's question is not retrieved in the knowledge base, a round of interaction can be performed with the user to ask the user. Specifically, an interactive question can be generated and output based on the candidate knowledge obtained by the rough matching, and the interactive question is used to instruct the user to confirm the standard name corresponding to the key information in the candidate knowledge.
[0141] The interactive results fed back by the user for the interactive question are further obtained, and the interactive results are used as retrieval conditions to retrieve the target knowledge matching the user question in the knowledge base.
[0142] That is, by outputting the above interactive questions, users can confirm what they really mean from the candidate knowledge, that is, confirm the standard name (or full name) corresponding to the key information, and then re-search in the knowledge base according to the standard name fed back by the user to retrieve the matching target knowledge.
[0143] Next, let's use a specific example from a medical consultation scenario to illustrate.
[0144] The user's question is: Can I take ibuprofen when I have a fever?
[0145] There are two key pieces of information extracted from this user question, namely [Symptoms]: fever, and [Medicine]: ibuprofen.
[0146] The above key information is used to search in the knowledge base. Since "ibuprofen" has multiple dosage forms in the knowledge base, it is impossible to retrieve completely matched target knowledge. However, coarsely matched candidate knowledge can be obtained, such as "ibuprofen tablets", "ibuprofen suspension", "ibuprofen sustained-release capsules", and "arginine ibuprofen granules".
[0147] At this point, an interactive question can be generated based on the roughly matched candidate knowledge and output for display. The effect is as follows: Figure 7 shown.
[0148] The user can give feedback on the interactive question. For example, if the user selects "ibuprofen sustained-release capsules", "ibuprofen sustained-release capsules" can be used as key information to continue matching the target knowledge in the knowledge base.
[0149] In a possible implementation, the process of generating interactive questions based on the candidate knowledge obtained by rough matching can be a template-based generation method, that is, the interactive question template can be pre-configured. When generating, the "key information" that cannot be matched to the target knowledge in the knowledge base and the "candidate knowledge" obtained by rough matching are filled into the question template to obtain the edited interactive question.
[0150] In addition, a generative model may be used to complete the generation of the above interactive questions, such as by designing a prompt instruction prompt to instruct the generative model to generate the above interactive questions. This embodiment will not be described in detail.
[0151] In some embodiments of the present application, the process of step S110 in the aforementioned embodiment, determining whether answering the user's question requires further interaction to collect information based on the user's question and target knowledge, and determining the question information and number of questions that require interaction, is described.
[0152] In one possible implementation, the big model can be called to instruct the big model to refer to user questions and target knowledge, determine whether answering user questions requires further interaction to collect information, and when it is determined that further interaction is required, determine the question information and number of questions that need to be interacted with.
[0153] Optionally, step S110 can be divided into two stages: the first stage is to determine whether further interaction is required to answer the user's question; the second stage is to determine the question information and the number of questions that require interaction when the judgment result of the first stage is that further interaction is required.
[0154] The ability of the large model introduced in this embodiment can be called to complete step S110. In a possible implementation, a prompt instruction can be used to instruct the large model to complete the tasks of the above two stages at the same time, for example:
[0155] Obtain a first prompt instruction prompt format template, wherein the template includes a task instruction, a question slot and a knowledge slot. The task instruction is used to instruct the large model to refer to the user question in the question slot and the target knowledge in the knowledge slot, determine whether further interaction is required to collect information to answer the user question, and when it is determined that further interaction is required, provide the question information and the number of questions that need to be interacted with.
[0156] Taking the medical consultation field as an example, the following provides an optional example of the first prompt format template:
[0157] “The following is a set of medical knowledge and the user’s specific questions. Please evaluate whether the user’s questions can be answered directly based on the medical knowledge. If they cannot be answered directly, what kind of further interaction is needed? Please list the questions that require interaction based on the given medical knowledge and output them in the form of a list.
[0158] The following are the output requirements:
[0159] As an experienced clinical pharmacist, you try to ask the patient as many questions as possible. All outputs are given in the form of json (dictionary + list). The key of the dictionary is whether it can be answered directly. Each question in the list contains the question id, question type (multiple choice, essay question), option content, etc.
[0160] [Knowledge slot]
[0161] [Question slot]".
[0162] Further, the user question is filled into the question slot, the target knowledge is filled into the knowledge slot, and a first prompt instruction prompt is obtained. The first prompt instruction prompt is input into the large model to obtain the result output by the large model.
[0163] Still taking the first prompt format template in the above example as an example. Assume that the user's question is "Can I take ibuprofen when I have a fever?", and the corresponding target knowledge is the drug instructions for ibuprofen sustained-release capsules. After filling the user's question into the question slot and the target knowledge into the knowledge slot, the first prompt instruction prompt is obtained and sent to the large model. The output result of the large model is as follows:
[0164] {
[0165] "Can answer directly": false,
[0166] "Question List": [
[0167] {
[0168] "questionid":1,
[0169] "Question type":"Multiple choice",
[0170] Question content: "Are you allergic to ibuprofen, aspirin, or other nonsteroidal anti-inflammatory drugs?",
[0171] "Options": [ "yes", "no"]
[0172] },
[0173] {
[0174] "question id": 2,
[0175] "Question type":"Multiple choice",
[0176] "Question content": "Are you currently pregnant or breastfeeding?",
[0177] "Options": [ "yes", "no"]
[0178] },
[0179] {
[0180] "question id": 3,
[0181] "Question type":"Multiple choice",
[0182] Question content: "Do you have a history of gastrointestinal diseases, such as ulcers or gastrointestinal bleeding?"
[0183] "Options": [ "yes", "no"]
[0184] },
[0185] {
[0186] "question id": 4,
[0187] "Question type":"Multiple choice",
[0188] Question content: "Do you have liver disease, kidney disease or heart disease?",
[0189] "Options": [ "yes", "no"]
[0190] },
[0191] {
[0192] "question id": 5,
[0193] "Question type":"Multiple choice",
[0194] Question Content: "Have you recently undergone coronary artery bypass surgery?",
[0195] "Options": [ "yes", "no"]
[0196] },
[0197] {
[0198] "question id": 6,
[0199] "Question type":"Multiple choice",
[0200] Question content: "Do you have a history of allergic reactions such as asthma, urticaria, or rhinitis?",
[0201] "Options": [ "yes", "no"]
[0202] },
[0203] {
[0204] "question id": 7,
[0205] "Question type":"Multiple choice",
[0206] Question content: "Have you had a fever for more than three days?"
[0207] "Options": [ "yes", "no"]
[0208] },
[0209] }.
[0210] From the output of the above large model, we can see that the large model cannot directly answer user questions. The maximum number of question IDs that require further interaction is 7, which means that the number of questions that require interaction is 7, which exceeds 1. Therefore, the 7 interactive questions can be further organized into a question form and output, such as Figure 8 shown.
[0211] In another possible implementation, two different prompt instructions may be used to instruct the large model to complete the two-stage tasks included in step S110, which will not be described in detail here.
[0212] Furthermore, for the first prompt format template in the above example, further restrictions on the output results may be added, such as adding requirements on the expression method and word usage of the output results. Taking the example of the first prompt format template in the above example, examples of output requirements that may be added include: the question should be as colloquial as possible, medical terms should not be used as much as possible, the reference should be as clear as possible, and options such as "this product" and "others" should not be used when necessary.
[0213] By adding conditional restrictions on the output results in the template, the complexity of the language can be flexibly adjusted to meet the needs of different user groups, avoiding alienating ordinary users due to overly specialized terminology, and improving the effectiveness and accuracy of information communication.
[0214] Further optionally, based on the above-mentioned first prompt instruction prompt format template, the task instructions therein can also be further used to instruct the large model to give the answer corresponding to the user question when it is determined that no further interaction is required. That is, the task instructions in the template are specifically used to: instruct the large model to refer to the user question in the question slot and the target knowledge in the knowledge slot, determine whether further interaction is required to collect information to answer the user question, and when it is determined that further interaction is required, give the question information and the number of questions that need to be interacted, and when it is determined that no further interaction is required, give the answer corresponding to the user question.
[0215] Taking the medical consultation field as an example, another optional example of the first prompt format template is provided as follows:
[0216] “The following is a piece of medical knowledge and the user’s specific questions. Please evaluate whether the user’s questions can be answered directly based on the medical knowledge. If they can be answered directly, please give the answers. If they cannot be answered directly, what kind of further interaction is required? Please list the questions that require interaction based on the given medical knowledge and output them in the form of a list.
[0217] The following are the output requirements:
[0218] As an experienced clinical pharmacist, you try to ask the patient as many questions as possible. All outputs are given in the form of json (dictionary + list). The key of the dictionary is whether it can be answered directly. Each question in the list contains the question id, question type (multiple choice, essay question), option content, etc.
[0219] [Knowledge slot]
[0220] [Question slot]".
[0221] When the first prompt instruction prompt format template provided in this embodiment is used, after the first prompt instruction prompt is generated and sent to the large model, the output result of the large model is obtained. If it is determined based on the output result that no further interaction is required, the answer corresponding to the user question output by the large model can be directly output to the user, without calling the large model a second time to perform the task of answer generation, thereby improving processing efficiency.
[0222] In some embodiments of the present application, the process of obtaining the answer corresponding to the user question by driving the large model through instructions based on the interaction results, user questions and target knowledge in step S130 in the aforementioned embodiment is explained.
[0223] In order to be able to call the big model to generate answers to user questions, a prompt format template is designed in this embodiment, which is defined as the second prompt instruction prompt format template. The template includes task instructions, question slots, supplementary interaction slots and knowledge slots. The task instructions are used to instruct the big model to refer to the user questions in the question slot, the interaction results in the supplementary interaction slot and the target knowledge in the knowledge slot to answer the user questions.
[0224] The following is an optional example of the second prompt format template, taking the medical consultation field as an example:
[0225] “Here are the questions from users:
[0226] [Question slot]
[0227] The following is additional interactive information provided by users:
[0228] [Add interactive slot]
[0229] The following is medical knowledge for reference:
[0230] [Knowledge slot]
[0231] Please refer to the given medical knowledge and the supplementary interactive information provided by the user to answer the user's questions."
[0232] Furthermore, the acquired user question is filled into the question slot, the interaction result of the user's feedback on the question form is filled into the supplementary interaction slot, the target knowledge is filled into the knowledge slot, and a second prompt instruction prompt is obtained. The second prompt instruction prompt is input into the big model to obtain the answer corresponding to the user question output by the big model.
[0233] Taking the user question in the above embodiment as an example, the interactive result and target knowledge of the question form feedback as an example, after generating the second prompt instruction prompt and sending it to the large model, the output result of the large model is as follows:
[0234] "You can take ibuprofen when you have a fever. Please follow the instructions and take 1 tablet twice a day (morning and evening). If the symptoms do not improve for more than 3 days, it is recommended to consult a doctor. It is best to take it with or after meals, and avoid drinking alcohol."
[0235] By adopting the individualized question interaction method of this embodiment, after the above-mentioned complete interaction process, reliable answer responses can be obtained based on professional knowledge, while avoiding problems such as information loss in multiple rounds of interaction and too many interaction rounds affecting user experience.
[0236] The individualized question interaction device provided in an embodiment of the present application is described below. The individualized question interaction device described below and the individualized question interaction method described above can be referenced to each other.
[0237] See also Fig. 9 , Fig. 9 This is a schematic diagram of the structure of an individualized question interaction device disclosed in an embodiment of the present application.
[0238] like Fig. 9 As shown, the device may include:
[0239] A question acquisition unit 11, used to acquire user questions;
[0240] A knowledge retrieval unit 12, used to retrieve target knowledge matching the user question in a configured knowledge base;
[0241] An interaction round determination unit 13 is used to determine whether further interaction is required to collect information to answer the user question based on the user question and the target knowledge, and to determine the question information and the number of questions that need to be interacted with;
[0242] The form processing unit 14 is used to generate and output a question form when it is determined based on the judgment result that further interaction is required and the number of questions that require interaction is greater than 1, wherein the question form includes information about the questions that require interaction;
[0243] The first answer processing unit 15 is used to obtain the interaction result of the user's feedback on the question form, and based on the interaction result, the user question and the target knowledge, obtain the answer corresponding to the user question through the instruction-driven large model, and output the answer.
[0244] In a possible implementation, the device of the present application further includes:
[0245] A question processing unit, configured to output information about questions that require interaction when it is determined based on the judgment result that further interaction is required and the number of questions that require interaction is equal to 1;
[0246] The second answer processing unit is used to obtain the interaction result of the user's feedback on the question information, and based on the interaction result, the user question and the target knowledge, obtain the answer corresponding to the user question through instruction-driven large model, and output the answer.
[0247] In a possible implementation, the device of the present application further includes:
[0248] The third answer processing unit is used to obtain the answer corresponding to the user question based on the user question and the target knowledge through instructions to drive the large model, and output the answer when it is determined based on the judgment result that no further interaction is required.
[0249] In a possible implementation, the process in which the interaction round determination unit determines whether further interaction is required to collect information to answer the user question based on the user question and the target knowledge, and determines the question information and the number of questions that need to be interacted includes:
[0250] The big model is called to instruct the big model to refer to the user question and the target knowledge, determine whether further interaction is required to collect information to answer the user question, and when it is determined that further interaction is required, determine the question information and number of questions that need to be interacted.
[0251] In a possible implementation, the interaction round determination unit calls the big model to instruct the big model to refer to the user question and the target knowledge, determine whether further interaction is required to collect information to answer the user question, and when it is determined that further interaction is required, determine the question information and the number of questions that need to be interacted, including:
[0252] Obtain a first prompt instruction prompt format template, the template including a task instruction, a question slot and a knowledge slot, the task instruction is used to instruct the large model to refer to the user question in the question slot and the target knowledge in the knowledge slot, determine whether further interaction is required to collect information to answer the user question, and when it is determined that further interaction is required, provide the question information and the number of questions that need to be interacted;
[0253] Fill the user question into the question slot, fill the target knowledge into the knowledge slot, obtain a first prompt instruction prompt, input the first prompt instruction prompt into the big model, and obtain the result output by the big model.
[0254] In a possible implementation, the task instruction in the first prompt instruction prompt format template is also used to instruct the large model to give an answer corresponding to the user question when it is determined that no further interaction is required. On this basis, the device of the present application also includes:
[0255] The fourth answer processing unit is used to output the answer corresponding to the user question output by the big model when it is determined that no further interaction is required based on the output result of the big model.
[0256] In a possible implementation, the process in which the third answer processing unit drives the large model through instructions to obtain the answer corresponding to the user question based on the interaction result, the user question and the target knowledge includes:
[0257] Obtain a second prompt instruction prompt format template, the template including a task instruction, a question slot, a supplementary interaction slot and a knowledge slot, the task instruction is used to instruct the large model to answer the user question by referring to the user question in the question slot, the interaction result in the supplementary interaction slot and the target knowledge in the knowledge slot;
[0258] Fill the user question into the question slot, fill the interaction result into the supplementary interaction slot, fill the target knowledge into the knowledge slot, obtain a second prompt instruction prompt, input the second prompt instruction prompt into the big model, and obtain the answer corresponding to the user question output by the big model.
[0259] In a possible implementation, the process of the knowledge retrieval unit retrieving target knowledge matching the user question from the configured knowledge base includes:
[0260] Extract key information from the user's question;
[0261] Using the key information as a search condition, the target knowledge matching the user question is searched in the configured knowledge base.
[0262] In a possible implementation, the process of the knowledge retrieval unit using the key information as a retrieval condition to retrieve target knowledge matching the user question in the configured knowledge base includes:
[0263] Taking the key information as the search condition, it is determined whether there is knowledge in the knowledge base that completely matches the key information. If so, the completely matching knowledge is used as the target knowledge for matching the user question.
[0264] In a possible implementation, the process in which the knowledge retrieval unit uses the key information as a retrieval condition to retrieve target knowledge matching the user question in a configured knowledge base also includes:
[0265] If there is no knowledge that completely matches the key information in the knowledge base, then searching for candidate knowledge that roughly matches the key information;
[0266] Based on the candidate knowledge, generating and outputting an interactive question, wherein the interactive question is used to instruct the user to confirm the standard name corresponding to the key information in the candidate knowledge;
[0267] The interactive result fed back by the user in response to the interactive question is obtained, and the target knowledge matching the user question is retrieved in the knowledge base using the interactive result as a retrieval condition.
[0268] The present application also provides an electronic device in an embodiment. Fig.10As shown, it shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present application. The electronic device in the embodiment of the present application may include but is not limited to terminals such as mobile phones, tablet computers, learning machines, robots, wearable devices, etc. Fig.10 The electronic 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.
[0269] like Fig.10 As shown, the electronic device may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 to a random access memory (RAM) 603 to implement the individualized problem interaction method of the aforementioned embodiment of the present application. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0270] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a memory card, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Fig.10 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0271] An embodiment of the present application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any one of the individualized question interaction methods provided in the embodiments of the present application.
[0272] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any individualized question interaction method provided in the embodiment of the present application.
[0273] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
[0274] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0275] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0276] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
[0277] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can refer to each other.
Claims
1. An individualized problem interaction method, characterized in that: include: Obtain user questions and retrieve target knowledge matching the user questions from a configured knowledge base; Based on the user question and the target knowledge, determine whether further interaction is required to collect information to answer the user question, and determine the question information and number of questions that require interaction; If it is determined based on the judgment result that further interaction is required, and the number of questions requiring interaction is greater than 1, a question form is generated and output, wherein the question form includes information about the questions requiring interaction; The interactive result of the user's feedback on the question form is obtained, and based on the interactive result, the user question and the target knowledge, the large model is driven by instructions to obtain the answer corresponding to the user question, and the answer is output.
2. The method according to claim 1, characterized in that: Also includes: If it is determined based on the judgment result that further interaction is required, and the number of questions requiring interaction is equal to 1, the question information requiring interaction is output, and the interaction result of the user's feedback on the question information is obtained. Based on the interaction result, the user question and the target knowledge, the answer corresponding to the user question is obtained through the instruction-driven large model, and the answer is output.
3. The method according to claim 1, characterized in that: Also includes: If it is determined based on the judgment result that no further interaction is required, then based on the user question and the target knowledge, the large model is driven by instructions to obtain the answer corresponding to the user question and output the answer.
4. The method according to claim 1, characterized in that The process of judging whether further interaction is required to collect information to answer the user question based on the user question and the target knowledge, and determining the question information and the number of questions that need to be interacted with, includes: The big model is called to instruct the big model to refer to the user question and the target knowledge, determine whether further interaction is required to collect information to answer the user question, and when it is determined that further interaction is required, determine the question information and number of questions that need to be interacted.
5. The method according to claim 4, characterized in that The process of calling the big model to instruct the big model to refer to the user question and the target knowledge, determine whether further interaction is required to collect information to answer the user question, and when it is determined that further interaction is required, determine the question information and the number of questions that need to be interacted, includes: Obtain a first prompt instruction prompt format template, the template including a task instruction, a question slot and a knowledge slot, the task instruction is used to instruct the large model to refer to the user question in the question slot and the target knowledge in the knowledge slot, determine whether further interaction is required to collect information to answer the user question, and when it is determined that further interaction is required, provide the question information and the number of questions that need to be interacted; Fill the user question into the question slot, fill the target knowledge into the knowledge slot, obtain a first prompt instruction prompt, input the first prompt instruction prompt into the big model, and obtain the result output by the big model.
6. The method according to claim 5, characterized in that The task instruction in the first prompt instruction prompt format template is also used to instruct the large model to give an answer corresponding to the user question when it is determined that no further interaction is required; The method also includes: If it is determined based on the output result of the large model that no further interaction is required, the answer corresponding to the user question output by the large model will be output.
7. The method according to claim 1, characterized in that The process of obtaining an answer corresponding to the user question by driving the large model through instructions based on the interaction result, the user question and the target knowledge includes: Obtain a second prompt instruction prompt format template, the template including a task instruction, a question slot, a supplementary interaction slot and a knowledge slot, the task instruction is used to instruct the large model to answer the user question by referring to the user question in the question slot, the interaction result in the supplementary interaction slot and the target knowledge in the knowledge slot; Fill the user question into the question slot, fill the interaction result into the supplementary interaction slot, fill the target knowledge into the knowledge slot, obtain a second prompt instruction prompt, input the second prompt instruction prompt into the big model, and obtain the answer corresponding to the user question output by the big model.
8. The method according to any one of claims 1 to 7, characterized in that: The process of retrieving target knowledge matching the user question in the configured knowledge base includes: Extract key information from the user's question; Using the key information as a retrieval condition, the target knowledge matching the user question is retrieved in the configured knowledge base.
9. The method according to claim 8, characterized in that The process of retrieving target knowledge matching the user question in the configured knowledge base using the key information as a retrieval condition includes: Taking the key information as the search condition, it is determined whether there is knowledge in the knowledge base that completely matches the key information. If so, the completely matching knowledge is used as the target knowledge for matching the user question.
10. The method according to claim 9, characterized in that Also includes: If there is no knowledge that completely matches the key information in the knowledge base, then searching for candidate knowledge that roughly matches the key information; Based on the candidate knowledge, generating and outputting an interactive question, wherein the interactive question is used to instruct the user to confirm the standard name corresponding to the key information in the candidate knowledge; The interactive result fed back by the user in response to the interactive question is obtained, and the target knowledge matching the user question is retrieved in the knowledge base using the interactive result as a retrieval condition.
11. An individualized question interaction device, characterized in that: include: A question acquisition unit, used to acquire user questions; A knowledge retrieval unit, used to retrieve target knowledge matching the user question in a configured knowledge base; An interaction round determination unit, configured to determine whether further interaction is required to collect information to answer the user question based on the user question and the target knowledge, and to determine the question information and number of questions that require interaction; A form processing unit, configured to generate and output a question form when it is determined based on the judgment result that further interaction is required and the number of questions requiring interaction is greater than 1, wherein the question form includes information about the questions requiring interaction; The first answer processing unit is used to obtain the interaction result of the user's feedback on the question form, and based on the interaction result, the user question and the target knowledge, obtain the answer corresponding to the user question through the instruction-driven large model, and output the answer.
12. An electronic device, characterized in that: include: Memory and processor; The memory is used to store programs; The processor is used to execute the program to implement each step of the individualized question interaction method as described in any one of claims 1 to 10.
13. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step of the individualized question interaction method as described in any one of claims 1 to 10 is implemented.
14. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, each step of the individualized question interaction method as described in any one of claims 1 to 10 is implemented.
Citation Information
Cited By
Domain knowledge base establishment and question answering method and system, storage medium and program product
CN121480638A