Intelligent question and answer method and electronic equipment
By distinguishing between simple and complex questions and using intelligent agents and external computing tools to collaboratively generate answers, the problem of intelligent question-answering systems being unable to accurately answer mathematical questions has been solved, achieving higher accuracy and diversity.
Patent Information
- Application Number
- CN202411537147.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2026-05-01
AI Technical Summary
Existing intelligent question-answering systems struggle to accurately answer complex questions, especially those involving mathematical calculations, leading to inaccurate answers.
By distinguishing between simple and complex problems, the solution for simple problems is generated directly using an intelligent agent, while for complex problems, the solution is generated collaboratively using an intelligent agent and external computing tools. This includes interrupting the reasoning process when encountering mathematical operations and calling external computing tools for calculation.
It improves the accuracy and diversity of intelligent question-answering systems for complex questions, enabling them to better handle a wide variety of user questions, especially those involving mathematical calculations.
Smart Images

Figure CN121960719A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of large model technology, and more particularly to an intelligent question answering method and electronic device. Background Technology
[0002] A dialogue agent is a type of intelligent software based on artificial intelligence technology. It achieves human-computer interaction through natural language processing, understanding and analyzing human language, and providing corresponding answers, information, suggestions, or tasks based on the user's questions or needs. Intelligent question answering refers to the process where a user inputs a question via text, voice, or other input methods on an electronic device, and the corresponding dialogue agent, using a large-scale question-and-answer model, generates an answer, which is then fed back to the user through the electronic device.
[0003] However, with the continuous development of technology, the questions users may ask are becoming more and more diverse. They may ask questions such as "Today's weather" or "How long did I sleep last night?" or "Help me start a running plan", "What was my highest blood pressure last week?" or "How many times have I run this month?" The questions asked by users are becoming more complex and professional, and the existing intelligent question answering solutions are increasingly unable to cope with the variety of questions, especially for questions that require mathematical calculations. Due to the inherent weakness of the large question answering model itself in terms of computing power, it is almost impossible to give the correct answer. Summary of the Invention
[0004] This application provides an intelligent question-answering method and electronic device that can improve reasoning performance and thus enhance the accuracy of answers.
[0005] Firstly, an intelligent question-answering method is provided, comprising: acquiring a first question input by a user through a first application of an electronic device; determining whether the first question is a simple question or a complex question, wherein a simple question represents a question that can be answered by searching data in a database, and a complex question represents a question that requires mathematical calculations using data in a database before it can be answered; if the first question is a complex question, determining a first answer corresponding to the first question using a first intelligent agent corresponding to the first question and an external computing tool; or, if the first question is a simple question, determining a first answer corresponding to the first question using a first intelligent agent; and displaying the first answer on an electronic device through the first application.
[0006] In this technical solution, the input question is categorized as either simple or complex based on whether it involves mathematical operations. Simple questions are answered directly using a corresponding intelligent agent, while complex questions are answered using both an intelligent agent and external computing tools. This solution overcomes the limitations of traditional intelligent question answering methods that cannot accurately address mathematical questions, enabling accurate answers to complex questions that encompass mathematical concepts. By first distinguishing between simple and complex questions and then employing different processing strategies for different types of questions, this solution ensures that subsequent reasoning is more suitable for different types of questions, meeting the diverse question-answering needs.
[0007] In conjunction with the first aspect, in certain implementations of the first aspect, when the first question is a complex question, the first answer corresponding to the first question is determined using a first intelligent agent corresponding to the first question and an external computing tool. This includes: using the first intelligent agent to obtain first data, which represents the data corresponding to the first question retrieved from the database; using a question-and-answer big data model to determine a first calculation formula, which is used to calculate a first value based on the first data, and the first value represents the value that needs to be included in the first answer; calling an external computing tool to calculate the first value based on the first calculation formula and the first data; and using the question-and-answer big data model to integrate the first question and the first value to obtain the first answer. In this implementation, for complex questions, during the reasoning process of the question-and-answer big data model, when mathematical operations are involved, the question-and-answer big data model determines the required calculation formula, then calls an external computing tool to complete the calculation, and inserts the calculation result (the first value) into the answer.
[0008] In conjunction with the first aspect, in certain implementations of the first aspect, when the first question is a simple question, a first agent determines the first answer corresponding to the first question. This includes: the first agent acquiring first data, which represents the data corresponding to the first question retrieved from the database; and using a large question-answering model, integrating the first question and the first data to obtain the first answer. In this implementation, for simple questions, the large question-answering model only needs to directly insert the read data into the answer, without requiring additional mathematical calculations.
[0009] In conjunction with the first aspect, in certain implementations of the first aspect, when the first question is a complex question, the first agent corresponding to the first question determines the first answer to the first question. This includes: using a personalization module to add cognitive enhancement prompts to the first question to obtain the second question; using a planning module to add thought chain prompts to the second question to obtain the third question, which contains multiple reasoning steps; using an action module to progressively invoke the question-answering model to reason according to the reasoning steps in the third question to obtain the first answer; during the reasoning process of the question-answering model, whenever a calculation formula is detected, the reasoning is interrupted, an external calculation tool is invoked to complete the calculation according to the detected formula, and the calculation result is inserted after the reasoning result to continue the subsequent reasoning until the first answer is obtained. In this implementation, for complex questions, in addition to adding general cognitive enhancement prompts, thought chain prompts are also added to guide the question-answering model to progressively reason for the answer according to the thought chain, and the various modules work together, interrupting the reasoning process when encountering calculations, and resuming the reasoning process after the calculation is completed, until the complete answer is obtained.
[0010] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: acquiring user information using a first intelligent agent; and integrating the user information into the first answer during the process of determining the first answer. In this implementation, adjustments are made based on the user's personal information when answering a user's question, making the answer more in line with the user's needs.
[0011] In conjunction with the first aspect, in some implementations of the first aspect, the first application is a sports and health application or a smart interactive assistant, and the first problem is a sports or health issue. Sports and health issues are more likely to involve mathematical calculations, and in addition to the already exemplified exercise and sleep, they may also involve other issues such as blood pressure and heart rate, which will not be listed one by one.
[0012] In conjunction with the first aspect, in some implementations of the first aspect, the database is either stored in the local storage unit of the electronic device, or it is a cloud database not located in the electronic device. That is to say, when retrieving relevant data, it may not necessarily be obtained from a cloud database, but may be read directly from the electronic device's own storage unit.
[0013] In one example, relevant data for the first question is first read from the local storage of the electronic device. If the relevant data is not found in the local storage, the process switches to reading the relevant data from the cloud database. In this example, prioritizing local reading and only reading from the cloud when the data is not found improves reading efficiency and saves reading time.
[0014] In conjunction with the first aspect, in some implementations of the first aspect, the first answer is displayed on an electronic device through the first application, including: gradually displaying the first answer on the screen of the electronic device; or playing the first answer via voice. That is to say, the presentation method of the first answer is not unique and can be set as needed.
[0015] In a second aspect, an intelligent question-answering device is provided, comprising a unit consisting of software and / or hardware for performing any of the methods of the first aspect.
[0016] Thirdly, an electronic device is provided, comprising: one or more processors, and a memory; the memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, wherein the one or more processors invoke the computer instructions to enable the electronic device to implement any of the methods of the first aspect.
[0017] Fourthly, a chip system is provided, the chip system being applied to an electronic device, the chip system including one or more processors, the one or more processors being configured to invoke computer instructions to enable the electronic device to implement any of the methods of the first aspect.
[0018] Optionally, the chip system also includes a memory electrically connected to the processor.
[0019] Optionally, the chip system may also include a communication interface.
[0020] Fifthly, a computer-readable storage medium is provided, the computer-readable storage medium including instructions that, when executed on an electronic device, enable the electronic device to implement any of the methods of the first aspect.
[0021] In a sixth aspect, a computer program product is provided, comprising a computer program that, when executed by an electronic device, can implement any of the methods of the first aspect. Attached Figure Description
[0022] Figure 1 This is an interactive schematic diagram of an intelligent question-and-answer scenario applicable to an embodiment of this application.
[0023] Figure 2 This is a schematic diagram of an intelligent question-and-answer result according to an embodiment of this application.
[0024] Figure 3 This is a schematic diagram illustrating intelligent question-and-answer functionality in an intelligent interactive assistant, according to an embodiment of this application.
[0025] Figure 4This is a schematic flowchart of an intelligent question-answering method according to an embodiment of this application.
[0026] Figure 5 This is a schematic diagram of an intelligent question-answering scenario applicable to an embodiment of this application.
[0027] Figure 6 This is a schematic flowchart of an intelligent problem-solving method according to an embodiment of this application.
[0028] Figure 7 This is a schematic diagram illustrating the training and reasoning process of an intelligent question-answering system according to an embodiment of this application.
[0029] Figure 8 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application.
[0030] Figure 9 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0031] The embodiments of this application will now be described in conjunction with the accompanying drawings.
[0032] Figure 1 This is an interactive diagram illustrating an intelligent question-and-answer scenario applicable to an embodiment of this application. For example... Figure 1 As shown in interface 101, assuming a user clicks the icon of a sports and health application (app) on an electronic device, the electronic device responds to the click and displays the content shown in interface 102. Interface 102 is an example of the running interface of the sports and health app. Interface 102 includes control A, which can be used to access the intelligent question and answer interface of the sports and health app. However, it should be understood that this application does not limit the shape, color, position, etc. of control A, as long as it can be used to access the intelligent question and answer interface. When the user clicks control A in interface 102, the electronic device responds to the click and displays interface 103, which is an example of the intelligent question and answer interface. As shown in interface 103, this interface includes an input box, where the user can input the question they want to ask using text or voice.
[0033] Suppose a user enters the question "How many steps did I take today?" on interface 103. After receiving this input, the electronic device converts it into text and displays it on the intelligent question-and-answer interface, as shown in interface 104. The question is then transmitted to the corresponding intelligent agent in the sports and health app, which can be called the sports and health intelligent agent. This agent queries the relevant data in the database based on the question and integrates the answer using the sports and health big model. The answer is then displayed on interface 104. The answer, as shown in interface 104, is "You took a total of 18225 steps today." This is an example of how a simple question is answered. Since this simple question only requires querying stored data from the database and does not require further calculation, when integrating the answer, the question-and-answer big model (in this case, the sports and health big model) only needs to generate the answer template "You took a total of... steps today" and add the retrieved step count "18225" to the corresponding position in the template (i.e., the position indicated by the ellipsis above).
[0034] Suppose a user enters the question "How long did I run last week?" on interface 103. After receiving the input, the electronic device converts the question into text and displays it on the intelligent question-and-answer interface, as shown in interface 104. The question is then transmitted to the sports and health intelligent agent. The agent queries relevant data in its database and integrates the answer using the sports and health big data model. However, a problem arises in this process: the question cannot be answered in one step; it requires finding the daily running time and then summing it up. But the sports and health big data model is a question-and-answer model with weak mathematical problem-solving capabilities. This causes the model to be unable to fill in the correct value (calculated result) in the generated answer template "You walked a total of... steps today".
[0035] To address this issue, this application proposes a novel intelligent question-answering scheme. For complex questions that require mathematical calculations, external computing tools are used to obtain the answer. For simple questions that do not require mathematical calculations, the original method of directly obtaining the answer using an intelligent agent continues.
[0036] It should be understood that this application, in addressing the aforementioned issues, does not employ the method of training a large question-answering model to possess strong mathematical computational capabilities. This is because the primary function of a large question-answering model is to integrate answers based on corpora, and its mathematical computational capabilities are far from sufficient. Forcibly adding such a new function, which differs significantly from its original function, would lead to a decline in its inherently powerful ability to integrate questions and answers (question-answering ability). Considering the potentially counterproductive consequences, this application does not adopt such a solution. This application specifically addresses the weakness of large question-answering models in computational capability, addressing only this single deficiency and ultimately compensating for it with external computational tools. Furthermore, considering that simple questions do not require computation, the application first distinguishes between two types of questions and only uses external computational tools for complex questions, rather than involving external computational tools for all questions, making the solution more reasonable and efficient. If we assume that we don't distinguish between simple and complex problems and use external calculation tools for all problems indiscriminately, then every time, regardless of the problem, the external calculation tool will be called. However, for simple problems, the data retrieved is the final calculation result, and the external calculation tool simply outputs the value input into the calculator directly as the calculation result. Obviously, this process adds unnecessary steps. For complex problems, the data retrieved still needs to be calculated before the result can be obtained. The above method can also ensure the accuracy of the answer, but it will introduce unnecessary operations of calling external calculation tools.
[0037] Regarding the answering of complex questions, this application aims to achieve the following: Figure 2 The question-and-answer effect shown. Figure 2 This is a schematic diagram of an intelligent question-answering result according to an embodiment of this application. For example... Figure 2 As shown in interface 105, assuming a user inputs the question "How many days did I achieve high-intensity fitness this month?" through the input box, the electronic device, upon receiving this input, determines whether to distribute the question to the sports and health intelligent agent based on the key information of the question. Then, it adds prompts for reinforcement, and a planner plans the reasoning steps (behavioral steps or action steps, etc.). The health intelligent agent then performs reasoning step by step based on these reasoning steps. During this process, it calls a large question-and-answer model to gradually generate answer templates, pausing at points requiring calculation, calling external computing tools to calculate the answer, and then proceeding with further reasoning. In other words, Figure 2 The answer is to gradually display everything on the screen in a flowing manner, rather than flashing all the content onto the screen directly.
[0038] The following is about Figure 2The process of displaying the answer is explained below. After receiving the question, the sports and health intelligent agent, based on the planner's feedback and the question reinforced with reinforcement words, calls the question-and-answer model to generate an answer template: "We have retrieved your medium-to-high intensity exercise data for this month. To answer your question, we need to first determine the completion status of your daily medium-to-high intensity exercise, and then calculate the total number of days." This is displayed on the screen. Then, based on the data retrieved from the database, it is further displayed as: "We have retrieved your medium-to-high intensity exercise data for this month. To answer your question, we need to first determine the completion status of your daily medium-to-high intensity exercise, and then calculate the total number of days. The exercise duration from July 7th to 8th was 76 minutes, the exercise duration from July 7th to 7th was 47 minutes, the exercise duration from July 6th to 75 minutes, and the exercise duration from July 5th to 7th was..." The total exercise time was 39 minutes on July 4th, 15 minutes on July 3rd, 22 minutes on July 2nd, 128 minutes on July 1st, and 95 minutes on July 1st, with a target duration of 30 minutes. The daily exercise durations can be directly retrieved from the database. Since the target duration can also be found in the database, the display continues as follows: "We have retrieved your high-intensity exercise data for this month. To answer your question, we need to first determine the completion status of each day's high-intensity exercise, and then calculate the total number of days. The exercise time on July 8th was 76 minutes, on July 7th it was 47 minutes, on July 6th it was 75 minutes, and on July 5th it was 3 minutes." The exercise duration was 9 minutes on July 4th, 15 minutes on July 3rd, 22 minutes on July 2nd, 128 minutes on July 1st, and 95 minutes on July 1st. The target exercise time was 30 minutes. Days with exercise duration exceeding 30 minutes included… (Pause here and invoke external calculation tools to obtain the results, then integrate them into the answer, continuing to display: "We have retrieved your high-intensity exercise data for this month. To answer your question, we need to first determine the completion status of high-intensity exercise each day, then calculate the total number of days. The exercise duration was 76 minutes on July 8th, 47 minutes on July 7th, 75 minutes on July 6th, and 39 minutes on July 5th.") The exercise duration on July 4th was 15 minutes, on July 3rd it was 22 minutes, on July 2nd it was 128 minutes, and on July 1st it was 95 minutes. The target exercise duration was 30 minutes. The days with exercise durations exceeding 30 minutes were July 8th, 7th, 6th, 5th, 2nd, and 1st. The formula to be calculated is 1+1+1+1+1+1=". At this point, after pausing again and calling an external calculation tool, the result of this formula is 6. This result is then integrated into the answer, displaying "Your high-intensity exercise data for this month has been retrieved. To answer your question, we need to first determine the completion rate of high-intensity exercise each day, and then calculate the total number of days."The workout duration was 76 minutes on July 7th, 47 minutes on July 7th, 75 minutes on July 6th, 39 minutes on July 5th, 15 minutes on July 4th, 22 minutes on July 3rd, 128 minutes on July 2nd, and 95 minutes on July 1st. The target workout duration was 30 minutes. The days with workouts exceeding 30 minutes were July 8th, 7th, 6th, 5th, 2nd, and 1st. The formula for calculation is 1+1+1+1+1+1=6. Therefore, you achieved your high-intensity workout target for 6 days this month.
[0039] As can be seen, in this process of gradually revealing the answer, the question-and-answer model generates the answer step by step. When encountering mathematical calculations (i.e., when an equal sign or formula is recognized), the reasoning pauses, an external calculation tool is invoked to complete the calculation, and the result is filled into the answer being generated. Then, the generation of subsequent answers continues. The external calculation tool only performs the specific mathematical calculations; the calculation formulas are generated by the question-and-answer model. The reasoning steps for the gradual reasoning are generated by the planner through behavior planning.
[0040] It should be understood that Figure 2 This only provides an example of a step-by-step answer to a complex question. In practice, you can simply display the final result without showing the reasoning process. For example, you could directly display "You achieved the high-intensity target for 6 days this month." The latter display method is simpler, but it may also cause delays in the reasoning process, making users feel like they have been waiting a long time for a response. This is because the step-by-step reasoning process still needs to be executed even if it is not presented to the user. In addition, an overly simple answer makes it impossible for users to verify whether the answer is correct.
[0041] Figure 1 and Figure 2 These examples all involve accessing the smart Q&A interface from a fitness and health app. Since the smart Q&A interface accessed in this way is confirmed to be from the fitness and health app, the required agent must be the fitness and health agent. However, in reality, electronic devices may also have centralized smart Q&A apps. When asking a question using such an app, it's necessary to determine which agent should answer based on the key information of the question. Electronic devices contain multiple agents, each corresponding to an application. Therefore, when asking a question from a centralized smart interaction app, there's also the process of distributing the question to which agent.
[0042] Figure 3 This is a schematic diagram illustrating intelligent question-and-answer functionality in an intelligent interactive assistant, according to an embodiment of this application. Figure 3As shown in interface 106, this intelligent interactive app (also known as an intelligent interactive assistant) includes multiple functions. "Dialogue" is the intelligent question-and-answer function, and it also includes other functional modules such as "Recommendation," "Text Creation," and "Knowledge Base." In the "Dialogue" interface, assuming a user inputs the question "How long did I sleep last night?", after receiving the question, the electronic device needs to first determine which intelligent agent can answer it based on the key information of the question, i.e., the user's intent. The question clearly asks about sleep duration, so the sports and health intelligent agent can answer it. Therefore, the electronic device confirms that the sports and health intelligent agent can answer the question and distributes the question to it. After receiving the question through the sports and health intelligent agent, the sports and health big model confirms that the callable function interface is getSleepData(), and therefore calls this interface to read data. The planner plans the reasoning steps based on the question and informs the sports and health intelligent agent. The sports and health intelligent agent then rationally calls the sports and health big model and reads data from the database based on these reasoning steps, so that the sports and health big model can integrate the answer to the question and send it to the display module for display. As shown in interface 106, the answer to this question is "You slept for 8 hours and 45 minutes last night." In addition, interface 106 also shows that the source of this answer is the sports and health app, allowing the user to know which app's AI agent responded to the question. Interface 106 also displays additional statements such as "Good sleep quality, normal sleep duration," which are derived from the user's personal information. For example, based on the user's age and other information, it can determine whether the sleep duration last night was normal and present it to the user as an additional response.
[0043] Figure 3 This paper presents an example of how to respond to a simple question asked through a general intelligent interactive assistant or an app considered a centralized intelligent interaction platform. The question can be answered based on data retrieved from a database. Furthermore, in addition to answering the user's question, the system provides additional hints based on the user's personal information, allowing the user to know extra information related to the answer, resulting in a more user-friendly and accurate response.
[0044] Users can enter interface 106 by clicking the icon of the intelligent interactive assistant on the desktop, or by waking it up with their voice. Other possible scenarios will not be listed one by one, as long as the intelligent interactive assistant can be activated.
[0045] Figure 4 This is a schematic flowchart illustrating an intelligent question-answering method according to an embodiment of this application. The following is a description of... Figure 4 The steps shown are explained below.
[0046] S401. Obtain the first question input by the user through the first application of the electronic device.
[0047] The first application could be, for example, Figure 1 and Figure 2 A sports and health app, it can also be Figure 3 A smart interactive assistant, or other apps that can answer questions intelligently. Figure 1 The questions in the text include "How many steps did I take today?" and "How long did I run last week?" Figure 2 The question "How long did I run last week?" Figure 3 The question "How long did I sleep last night?" Figure 6 The "total number of workouts I did this week" and Figure 6 The question "How many times did I exercise this week?" can be considered an example of the first question; other cases will not be listed one by one.
[0048] The electronic device can be a mobile phone, tablet computer, laptop computer, in-vehicle system, smart wearable device, or any other electronic device capable of conducting intelligent question and answer.
[0049] The input method for the first question can be text or voice. For voice input, it can be inputting text into a text input box using a speech-to-text conversion method. If the first application was launched using voice wake-up, it could also be a pure voice input method question while still being voice-activated.
[0050] In one implementation, the first application is a sports and health app or a smart interactive assistant, and the first question is a sports or health issue. Sports and health issues are more likely to involve mathematical calculations, and in addition to the already exemplified issues of exercise and sleep, they may also involve other issues such as blood pressure and heart rate, which will not be listed one by one.
[0051] S402. Determine whether the first problem is a simple problem or a complex problem.
[0052] In this application's embodiments, "simple question" refers to a question that can be answered by searching data in a database, while "complex question" refers to a question that requires mathematical calculations using data from a database before it can be answered. It can be seen that the distinction between "simple question" and "complex question" in this application is based solely on whether mathematical calculations are required to answer them, not on the length of the answer. For example, "Help me write an essay on the theme of spring," even if it contains a lot of content, still falls under the category of a simple question.
[0053] However, it should be understood that this application does not specify whether the mathematical operations are limited to the four basic arithmetic operations (addition, subtraction, multiplication, and division) or include other operations. For example, "help me count the number of steps I've taken over the past three days" involves addition and summation. Another example is "what was my highest blood pressure last week?" which involves finding the maximum value. Yet another example is "how many times my blood pressure exceeded the healthy range last week?" which involves numerical comparison and summation. Other cases will not be listed individually.
[0054] In this application embodiment, the main focus is on recognizing the inherent disadvantage of large question-answering models in accurately responding to mathematical questions. By adopting a different processing strategy for these types of questions than for other questions, the accuracy of intelligent question answering is improved, making the questions that intelligent question answering can answer more diverse.
[0055] In one implementation, the aforementioned database is either stored in the local storage unit of the electronic device, or it is a cloud database not located in the electronic device. That is to say, the data retrieved may not necessarily be... Figure 5 As shown, it may be obtained from a cloud database, or it may be read directly from the electronic device's own storage unit.
[0056] In one example, relevant data for the first question is first read from the local storage of the electronic device. If the relevant data is not found in the local storage, the process switches to reading the relevant data from the cloud database. In this example, prioritizing local reading and only reading from the cloud when the data is not found improves reading efficiency and saves reading time.
[0057] S403. If the first problem is a complex problem, the first answer corresponding to the first problem is determined by using the first intelligent agent corresponding to the first application and an external computing tool; or, if the first problem is a simple problem, the first answer corresponding to the first problem is determined by using the first intelligent agent.
[0058] After distinguishing between simple and complex problems, for simple problems, only the agent corresponding to that problem needs to be used to answer. It should be understood that this uses the first agent corresponding to the first problem, not the agent corresponding to the first application, because if the user is similar to... Figure 1 and Figure 2 When you enter a question into this application, it uses the application's corresponding AI agent to answer it. However, if the user is similar to... Figure 3 When a question is entered into this application, it is also necessary to distinguish which agent should answer it.
[0059] In one implementation, when the first question is a complex question, the first answer is determined using a first agent corresponding to the first question and an external computing tool. This includes: using the first agent to acquire first data, which represents the data corresponding to the first question retrieved from a database; using a question-and-answer model to determine a first calculation formula, which is used to calculate a first value based on the first data, and the first value represents the value that needs to be included in the first answer; calling the external computing tool to calculate the first value based on the first calculation formula and the first data; and using the question-and-answer model to integrate the first question and the first value to obtain the first answer. In this implementation, for complex questions, during the reasoning process of the question-and-answer model, when mathematical operations are involved, the question-and-answer model determines the required calculation formula, then calls the external computing tool to complete the calculation, and inserts the calculation result (the first value) into the answer.
[0060] In one implementation, when the first question is a simple question, a first agent determines the first answer corresponding to the first question. This includes: the first agent acquiring first data, which represents the data corresponding to the first question retrieved from the database; and using a large question-answering model, integrating the first question and the first data to obtain the first answer. In this implementation, for simple questions, the large question-answering model only needs to directly insert the retrieved data into the answer, without requiring additional mathematical calculations.
[0061] In one implementation, when the first question is complex, the first agent corresponding to the first question determines the first answer. This includes: using a personalization module to add cognitive enhancement prompts to the first question, resulting in a second question; using a planning module to add thought chain prompts to the second question, resulting in a third question, which contains multiple reasoning steps; using an action module to progressively invoke the question-answering model based on the reasoning steps in the third question, obtaining the first answer; during the reasoning process of the question-answering model, whenever a calculation formula is detected, the reasoning is interrupted, an external calculation tool is invoked to complete the calculation based on the detected formula, and the calculation result is inserted into the reasoning result to continue subsequent reasoning until the first answer is obtained. In this implementation, for complex questions, in addition to adding general cognitive enhancement prompts, thought chain prompts are also added to guide the question-answering model to progressively reason for the answer based on the thought chain. Furthermore, the various modules work collaboratively, interrupting reasoning when encountering calculations, and resuming reasoning after the calculation is completed, until a complete answer is obtained.
[0062] S404. Display the first answer on an electronic device through the first application.
[0063] The first answer can be output in the form of text or audio on the screen.
[0064] In one implementation, step S404 includes: progressively displaying the first answer on the screen of the electronic device; and / or playing the first answer via voice playback. That is, the presentation method of the first answer is not unique and can be set as needed.
[0065] In one example, the way the first answer is displayed is consistent with the way the first question is entered.
[0066] In one example, the first answer is displayed progressively on the screen of the electronic device, including: if the first question is a complex question, displaying the response template and related values of the first answer progressively according to the reasoning steps corresponding to the first question; pausing when displaying to the point where an external calculation tool needs to be invoked; waiting for the calculation result to be obtained by calling the external calculation tool; filling the calculation result into the response template; and continuing to display subsequent response templates as reasoning progresses until the entire first answer is fully displayed. In this example, for complex questions, the relevant content of the reasoning process is displayed progressively, making it convenient for users to view the detailed reasoning process and determine whether the reasoning result is accurate. In addition, the progressive display format results in a shorter user waiting time compared to flashing the first answer only after it is fully generated, providing a better user experience. It should also be understood that in this example, the process of displaying the first answer and obtaining the first answer are interleaved and parallel, that is, steps S404 and S403 are executed alternately.
[0067] In one implementation, the method further includes: acquiring user information using a first intelligent agent; and integrating the user information into the first answer during the process of determining the first answer. In this implementation, adjustments are made based on the user's personal information when answering a user's question, making the answer more tailored to the user's needs. For example... Figure 2 As shown, the system combines information such as the user's age and average sleep duration to determine whether the sleep duration is normal.
[0068] Figure 4 The method described primarily categorizes input questions as simple or complex based on whether they involve mathematical operations. For simple questions, the corresponding intelligent agent directly generates the answer; for complex questions, both the corresponding intelligent agent and external computing tools are used to generate the answer. This approach overcomes the limitations of traditional intelligent question answering methods that cannot accurately address mathematical questions, enabling accurate answers to complex questions encompassing mathematical concepts. By first distinguishing between simple and complex questions and then employing different processing strategies for different types of questions, this approach ensures that subsequent reasoning is more suitable for different question types, meeting the diverse question-answering needs.
[0069] Figure 5 This is a schematic diagram of an intelligent question-answering scenario applicable to an embodiment of this application. Figure 5 The process in the intelligent question-answering scenario shown can utilize Figure 4 The method shown is used for implementation. The interactive results of the intelligent question-answering shown in interfaces 104, 105, and 106 above can all be achieved using this method. Figure 5 The execution process is shown.
[0070] like Figure 5 As shown, the sequence of execution steps is numbered with circled numbers. The entire intelligent question-answering process is explained below.
[0071] Step 1: The user inputs the question "How long did I sleep last night?" through the electronic device. It should be understood that this question is for ease of understanding the overall solution and has no limitations; the user can input any question they wish to ask. Step 2: The electronic device adds today's date to the question and sends this information to the fine-tuning module, which is the fine-tuning module of the question-and-answer model. Step 2 also allows the question-and-answer model to determine which function to call to retrieve the relevant data. Step 3: The question-and-answer model determines which function to call based on the received question and provides feedback to the electronic device. When returning the function interface in Step 3, the question-and-answer model also returns the corresponding parameters. For example, for the question "How long did I sleep last night?", the question-and-answer model returns a call to the getSleepData() function, carrying the relevant parameters (assuming today's date is August 31st): starttime: 20240830, endtime: 20240830. Step 4: The electronic device calls the above function interface and, carrying the above relevant parameters, queries the cloud database of the cloud device for the relevant data. Step 5: The cloud database of the cloud device returns the queried and stored data (here, sleep time: 8:45) to the sports and health intelligent agent. Step 6: Based on the received data, the sports and health intelligent agent calls the question-and-answer model (here, the sports and health model) to integrate the answer "You slept for 8 hours and 45 minutes last night," and outputs this answer to the display module of the electronic device. Step 7: The electronic device displays the received answer on the screen.
[0072] Step ① can be executed using the method of step S401 or the method of step S404. In the scheme of this application, in step ⑥, during the generation of the answer, the agent will also execute steps S402-S403 to obtain the answer.
[0073] Figure 6 This is a schematic flowchart of an intelligent problem-solving method according to an embodiment of this application. Figure 6 It can be seen as Figure 4 Examples of the steps involved in the illustrated scheme. For example... Figure 6 As shown, the sequence of execution steps is numbered with circled numbers. The entire process is explained below.
[0074] like Figure 6 As shown, the agent needs to be trained before online inference, but it should be understood that the so-called training of the agent in this application is essentially training a large model, which is scheduled by the agent.
[0075] The first step is personalized training, which involves infusing the agent with knowledge so that it learns new knowledge through training, specifically the ability to answer questions about sports and health. This process requires acquiring training data and then reinforcing it with prompts before inputting it into a large-scale question-answering model for training.
[0076] In one implementation, the agent can be personalized through a fine-tuning module (fine-tuning the training model) and a prompt project. Personalized training needs to be completed offline. First, the answer labeling module labels the original question. Then, the natural language generalization module rewrites the original question using other large models and combines it with human annotations to generalize the original question. Next, the cognitive reinforcement prompting module uses different prompt words to combine the original question-answer pairs, and then feeds them into the question-answering large model for training, along with other corpora. It should be understood that the large model used to rewrite the question is another large model, not the question-answering large model we are training here. This is because the other large model is only used to generate richer similar questions, that is, to generate multiple linguistic expressions for the same semantically identical question. Therefore, we can directly use an existing large model that can achieve this function. This approach avoids the limitations and tediousness of manually rewriting questions. The relevant training process can also be referenced... Figure 7 The relevant content will not be repeated here.
[0077] After personalized training, it can be used for online inference. In the online inference phase, when a user asks a question (e.g., the first question), the electronic device determines which agent needs to answer it. The selected target agent (e.g., the first agent) executes step ②, requesting the planner (planning module) to perform behavior planning. Behavior planning is about determining how to break down the question and answer it step by step. It can be understood as the inference steps or the steps to answer the question. In other words, it requires the large model (in this case, the question needs to be answered by the sports and health large model, hence the sports and health large model) to reason step by step according to the inference steps planned by the planner.
[0078] Step 3: Based on the user's question, the planner uses the target large model (a large model that the target agent can schedule, here it's the sports and health large model, an example of the question-and-answer large model mentioned above) to plan subsequent actions and returns the determined action steps (reasoning steps, behavioral steps) to the target agent. The target agent then schedules the target large model to perform step-by-step reasoning based on the instructions of these action steps. Here, the thought chain is determined based on the difficulty of the question to perform multi-step reasoning. In the offline training phase, the offline thought chain prompting module formalizes the question into a thought chain and then combines it with other corpora for training the large model. In the online reasoning phase, the few-shot cotprompting module adds a small number of thought chain examples to the prompt words. After formalization (i.e., after adding thought chain prompt text to the question), it is input into the large model, instructing the large model to perform step-by-step online reasoning according to the reasoning steps indicated by the thought chain prompt text.
[0079] Step 4: The agent requests to read long-term memory from the memory module. Long-term memory refers to the long-term storage of the user's personal information. This memory module contains a user information database, and the data in this database can be retrieved from a Hive table. Step 5: After receiving the request to read long-term memory, the memory module retrieves the user information from the Hive table and returns it to the agent. The agent then incorporates this user information as part of the prompts in subsequent online reasoning processes. A Hive table can be understood as a medium for querying database data, mapping data from the database to a Hive table, allowing the desired data to be quickly retrieved from the database.
[0080] Step 6: The action module executes specific actions based on the behavior plan generated by the planner. The scheduling target model uses a thought chain approach to reason step by step, ultimately arriving at the answer. If a mathematical problem exists in a step, the calculation formulas appearing during the reasoning process are matched, and an external calculation tool (such as a Python calculator) is called to perform the calculation. The result is then added to the corresponding position in the answer, and subsequent answers are generated until a complete answer is generated.
[0081] In step 6, you can first execute 6.1 to determine the actions to be performed according to the planner's instructions, and then execute 6.2 to determine whether the problem is simple or complex based on its difficulty. Simple problems do not require breaking down the problem, while complex problems require breaking it down for step-by-step thinking. When step-by-step thinking is required, execute step 6.3 to determine the thought process chain; when step-by-step thinking is not required, directly use the large model to generate the answer. After executing step 6.3, the thought process chain (CoT) is determined, which mainly includes three steps: 1. Querying data; 2. Determining the calculation formula; 3. Integrating the calculation results into the answer. At this point, according to the instructions of this thought process chain, use the large model to reason and generate the answer step by step (that is, execute step 6.5). During the reasoning process of generating the answer, execute step 6.4 to call external computing tools for mathematical calculations as needed, and integrate the calculation results into the answer before continuing subsequent reasoning until the complete answer is displayed. It should be understood that step 6.4 is executed during the execution of step 6.5. For simple problems, step 6.4 does not need to be executed during the execution of step 6.5. For complex problems, step 6.4 must be executed at least once during the execution of step 6.5.
[0082] Figure 7 This is a schematic diagram illustrating the training and reasoning process of an intelligent question-answering system according to an embodiment of this application.
[0083] A large model, before training, is a structured model that lacks any reasoning ability. It requires extensive training data to develop this ability. The large question-answering model used in this application is one capable of intelligent question answering. Since the questions involve different domains, different domains require different large question-answering models. For example, since this application primarily targets questions in the sports and health domain, the large question-answering model can be a sports and health model.
[0084] The initial training of large-scale models is extremely complex, tedious, and time-consuming, placing high demands on both the hardware and software of the training equipment. Therefore, large-scale models are typically trained using powerful electronic devices such as large servers or cloud computing devices. Once trained, the large-scale model possesses pre-defined inference capabilities (obtained using training data and its labels). After obtaining the trained model, it can be deployed to electronic devices with relatively weaker computing power, such as mobile phones, tablets, and laptops—that is, deployed to inference devices. This allows it to assist the existing hardware and software resources on the inference device in performing corresponding inference tasks and implementing new functions. Because the hardware and software configuration of inference devices is relatively lower than that of training devices, the scale of large-scale models is limited, and it is impossible to directly train a large-scale model entirely on the inference device. Furthermore, different electronic devices may have individual differences. If the same large-scale model is used indiscriminately on all inference devices, the inference accuracy of the large-scale model on some devices may be affected. In addition, different electronic devices may apply the same large-scale model to different new functions, leading to varying requirements for the large-scale model. Therefore, a fine-tuning training module (fine-tuning module) was introduced to enable personalized training that fine-tunes a large model. This keeps the overall parameters of the large model largely unchanged, only adding instructions on how to fine-tune it after personalization (meaning that the fine-tuning module allows for personalized adjustments without affecting the original functionality of the large model). Fine-tuning a question-answering model that already possesses mature reasoning capabilities significantly reduces training intensity and complexity compared to training an initial large model (without any reasoning ability) into a domain-specific question-answering model. It also greatly reduces the hardware and software requirements for training equipment.
[0085] like Figure 7As shown, in the offline training phase, the large-scale sports and health model undergoes personalized training. Step ① involves acquiring training samples. Each training sample includes a question-answer pair, i.e., a question and its label (answer). However, it should be understood that since answering the question involves numerical calculations, the numerical values used also need to be included as part of the training sample. Here, we use the question "How many times did I exercise this week?" as an example. The training samples are then input into the answer labeling module, the natural language generalization module, and the offline thought chain prompting module. Step ② involves the offline thought chain prompting module of the planning module generating thought chain prompts for the question in the training sample, and then summarizing the thought chain prompts as part of the prompt words in the training data. The thought process chain here can be structured as follows: 1. Query data (simple query of basic data); 2. Determine the calculation formula (planning the calculation process in the step-by-step reasoning process; complex mathematical problems may require multiple calculations, i.e., step 2 can be repeated multiple times); 3. Integrate results (summarize the calculation results). Combining this with the training sample question "How many times did I exercise this week?", the generated thought process chain would be: "1. Your exercise data for this week is as follows: 2 times on July 1st, 5 times on July 2nd, 11 times on July 3rd, 7 times on July 4th, and 3 times on July 5th. 2. The required calculation formula is: 2 + 5 + 11 + 7 + 3 = 3. According to the calculation results, you exercised a total of 38 times this week." In other words, during training, the sports and health model should output this content according to this thought process chain. Step 3: The answer annotation module annotates the questions in the training samples with the answer "How many times did I exercise this week? -38 times". This is a "original question-answer" annotation. The natural language generalization module then rewrites the data using various large models that can be used for sentence rewriting. The large model used here can be any open-source large model without any restrictions. The rewritten questions can be, for example, "How many times did I exercise this week? -38 times", "How many times did I exercise this week? -38 times", "How many times did I exercise this week? -38 times", etc. This is a different expression with the same semantics as the original question. After that, manual annotation and correction are performed to check and correct the annotated answers (-38 times) of these generalized questions. This generates multiple new training samples (generalized question-answer sets) and sends these new training samples to the cognitive reinforcement prompting module. Step 4: The cognitive enhancement prompt module adds prompts to these new training samples, such as "You are a professional sports and health assistant. Today is July 5, 2024. You need to give professional answers to user questions..." or "You are a professional sports and health assistant. You need to give professional answers to user questions..."It should be understood that cognitive reinforcement prompts will change according to business needs. For example, "You are a sports and health assistant" enhances the ability to respond in professional fields, and "If the data does not specify units, process it in SI" enhances the understanding and response ability of units. Other cases will not be listed one by one. The training data of multiple training samples with added reinforcement prompts were also summarized.
[0086] Step 5: Use the aggregated training data to train the sports and health big model offline. This training process will only fine-tune the already trained sports and health big model, rather than training an initial sports and health big model from scratch.
[0087] To illustrate the above example, let's take a training session with a single training sample as an example. The input training sample could be: "You are a professional sports and health assistant. Today is July 5, 2024. You need to provide a professional response to the user's question. The user's question is, 'How many times have I exercised this week?' You need to answer according to the following thought process: 1. Query the number of daily exercises from July 1, 2024 to July 5, 2024; 2. Determine the calculation formula to add up the number of daily exercises from July 1, 2024 to July 5, 2024; 3. Integrate the above calculation results into..." The "answer" requires you to follow a thought process step by step. The predicted output of the sports and health model could be: "Your exercise data for this week is as follows: 2 times on July 1st, 5 times on July 2nd, 11 times on July 3rd, 7 times on July 4th, and 3 times on July 5th. Your total number of exercises this week is: 2 + 5 + 11 + 7 + 3 = 38. According to the calculation, you exercised a total of 38 times this week." Then, 38 and the data retrieved above are compared with the corresponding values in the labels, thereby adjusting the parameters of the sports and health model based on the differences. Examples of other training samples are similar and will not be elaborated further.
[0088] After offline personalized training, the resulting large-scale sports and health model can be used for inference.
[0089] It should be understood that there is no restriction on the order of steps ② and ③ / ④, and they can be executed simultaneously.
[0090] like Figure 7As shown, in the online inference phase, assuming the user inputs the question "How many times have I exercised this week?", it's clear that this is not the same as the offline training question "How many times have I exercised this week?". Without natural language generalization, the agent might struggle to answer quickly. However, natural language generalization generalizes the question into multiple questions with the same meaning, increasing the probability of the question being answered correctly. After inputting the question into the personalization module, the cognitive enhancement prompt module adds prompt words to the question, generating a new question (step ①), such as "You are a professional sports and health assistant. Today is July 5, 2024. You need to provide a professional response based on the user's question, 'How many times have I exercised this week?'". Then, it requests to read the user's personal information from the memory module (step ②), such as age, gender, preferences, etc., and adds this personal information to the prompt words (step ③). Finally, the small-sample thought chain prompt module further adds a small number of thought chain samples to the prompt words, inspiring the large model to generate a response according to the thought chain pattern. The following is an example of a few additional thought chain prompts: "A thought chain example is given below: Question: How many times did I run last week? Answer: 1. Your running count last week is as follows: ... 2. The required calculation formula is ... 3. Based on the calculation results, ... Now begin answering. Remember to follow the specified format step-by-step reasoning before giving the final answer..." Finally, the text processed by these modules is input into the sports and health model via the intelligent agent for online reasoning (step ④). The answer is then output.
[0091] The methods of the embodiments of this application have been described above with reference to the accompanying drawings. It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially, these steps are not necessarily executed in the order shown in the figures. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the steps or stages of other steps. The apparatus of the embodiments of this application will now be described with reference to the accompanying drawings.
[0092] Figure 8 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Figure 8 As shown, the device 2000 includes an acquisition unit 2001 and a processing unit 2002. The device 2000 can be an electronic device such as a mobile phone, tablet computer, laptop computer, computer, or vehicle infotainment system, which is an inference device.
[0093] The device 2000 can be used to execute any of the intelligent question-answering methods described above. For example, the acquisition unit 2001 can be used to execute step S401, and the processing unit 2002 can be used to execute steps S402-S404. The device 2000 can also be used to execute... Figures 1-3 The interactive process shown, and the method for execution Figures 5-7 The steps will not be described in detail here.
[0094] In one implementation, the device 2000 may further include a storage unit for storing relevant data. This storage unit may be integrated into any of the aforementioned units, or it may be a unit independent of all of the aforementioned units.
[0095] Figure 9 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of this application. Figure 9 As shown, the electronic device 900 may include a processor 910, an external memory interface 920, an internal memory 921, an audio module 970, a speaker 970A, a receiver 970B, a microphone 970C, a headphone jack 970D, a sensor module 980, a display screen 994, etc. The sensor module 980 may include a pressure sensor 980A, a touch sensor 980K, etc.
[0096] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 900. In other embodiments of this application, the electronic device 900 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0097] For example, Figure 9 The processor 910 shown may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). These different processing units may be independent devices or integrated into one or more processors.
[0098] The controller can be the nerve center and command center of the electronic device 900. The controller can generate operation control signals based on the instruction opcode and timing signals to control the fetching and execution of instructions.
[0099] The processor 910 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 910 is a cache memory. This memory can store instructions or data that the processor 910 has just used or that are used repeatedly. If the processor 910 needs to use the instruction or data again, it can directly retrieve it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 910, and thus improves the efficiency of the system.
[0100] Electronic device 900 implements display functions through a GPU, a display screen 994, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 994 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 910 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0101] The display screen 994 is used to display images, videos, etc. The display screen 994 includes a display panel. In some embodiments, the electronic device 900 may include one or N display screens 994, where N is a positive integer greater than 1.
[0102] Electronic device 900 can implement audio functions through audio module 970, speaker 970A, receiver 970B, microphone 970C, headphone jack 970D, and application processor, such as music playback and recording.
[0103] The audio module 970 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 970 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 970 may be located in the processor 910, or some functional modules of the audio module 970 may be located in the processor 910.
[0104] Speaker 970A, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. Electronic device 900 can listen to music or make hands-free calls through speaker 970A. Receiver 970B, also known as a "handpiece," is used to convert audio electrical signals into sound signals. When electronic device 900 answers a phone call or voice message, the receiver 970B can be brought close to the user's ear to hear the voice. Microphone 970C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to microphone 970C, inputting the sound signal into microphone 970C. Electronic device 900 can have at least one microphone 970C. In some embodiments, electronic device 900 can have two microphones 970C, which, in addition to collecting sound signals, can also achieve noise reduction. In other embodiments, electronic device 900 can also have three, four, or more microphones 970C, which can collect sound signals, reduce noise, identify the sound source, and achieve directional recording functions, etc. The 970D headphone jack is used to connect wired headphones. The 970D headphone jack can be a USB 930 interface or a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface, a CTIA (Cellular Telecommunications Industry Association of the USA) standard interface.
[0105] Pressure sensor 980A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 980A can be disposed on display screen 994. There are many types of pressure sensors 980A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may include at least two parallel plates with conductive material. When force is applied to pressure sensor 980A, the capacitance between the electrodes changes. Electronic device 900 determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 994, electronic device 900 detects the intensity of the touch operation based on pressure sensor 980A. Electronic device 900 can also calculate the touch position based on the detection signal from pressure sensor 980A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation commands. For example, when a touch operation with an intensity less than a first pressure threshold is applied to the SMS application icon, a command to view an SMS is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the SMS application icon, a command to create a new SMS is executed.
[0106] Touch sensor 980K, also known as a "touch panel," can be located on display screen 994. The touch sensor 980K and display screen 994 together form a touchscreen, also known as a "touchscreen." Touch sensor 980K detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 994. In some embodiments, touch sensor 980K may also be located on the surface of electronic device 900, in a different position than display screen 994.
[0107] In this embodiment of the application, the display 994 can primarily display, for example... Figures 1-3 The UI interface can display the first question and the first answer; audio data can be output using the speaker 970A, receiver 970B and headphone jack 970D, such as playing the first answer by voice; and the question can be input using the microphone 970C or sensor module 980.
[0108] Taking the intelligent question-and-answer format for the first question as an example, when the first application is running, the user can input the first question via voice input using the microphone 970C. The audio module 970 receives the audio signal and transmits it to the processor 910, which converts it into text and displays it on the display 994. Alternatively, the user can input the first question via text input using the sensor module 980 and touchscreen operation. The processor 910 then displays the text-input first question on the display 994. Afterward, the processor 910 performs subsequent steps to distinguish whether the first question is simple or complex, and to generate and output the first answer. The first answer can be converted into an audio signal by the audio module 970 and output via voice broadcast through the speaker 970A, receiver 970B, or headphone jack 970D. Alternatively, the first answer can be displayed as text on the display 994.
[0109] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0110] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0111] This application also provides an electronic device, which includes: one or more processors and a memory; the memory is coupled to one or more processors, and the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to enable the electronic device to perform the steps in any of the above methods.
[0112] This application also provides a chip system applied to an electronic device. The chip system includes one or more processors, which invoke computer instructions to cause the electronic device to perform the steps in any of the methods described above. Optionally, the chip system further includes a memory electrically connected to the processor. Optionally, the chip system may also include a communication interface.
[0113] This application also provides a computer-readable storage medium storing instructions that, when executed by an electronic device, can implement any of the methods described above. This computer-readable medium may include at least: any entity or device capable of carrying computer program code (instructions) to a photographic device / electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0114] This application also provides a computer program product, which includes a computer program that, when executed by an electronic device, can implement any of the above-described methods. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form.
[0115] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0116] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0117] In the embodiments provided in this application, it should be understood that the disclosed apparatus / devices and methods can be implemented in other ways. For example, the apparatus / device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0118] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0119] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0120] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0121] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0122] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0123] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. An intelligent question-answering method, characterized in that, include: The first question is obtained through the first application of the electronic device; The first question is determined to be either a simple question or a complex question. A simple question is defined as a question that can be answered by looking up data in the database, while a complex question is defined as a question that requires mathematical calculations using data in the database to be answered. In the case where the first problem is a complex problem, the first answer to the first problem is determined by using the first intelligent agent corresponding to the first problem and external computing tools. or, If the first question is a simple question, the first agent is used to determine the first answer to the first question. The first answer is displayed on the electronic device through the first application.
2. The method according to claim 1, characterized in that, In the case that the first problem is a complex problem, determining the first answer corresponding to the first problem using the first intelligent agent corresponding to the first problem and an external computing tool includes: The first intelligent agent is used to obtain first data, which represents the data corresponding to the first question retrieved from the database; The first calculation formula is determined using the question-and-answer model. The first calculation formula is used to calculate a first value based on the first data. The first value is used to represent the value that needs to be included in the first answer. The external calculation tool is invoked to calculate the first value based on the first calculation formula and the first data; Using the aforementioned question-and-answer model, the first answer is obtained by integrating the first question and the first numerical value.
3. The method according to claim 2, characterized in that, When the first question is a simple question, determining the first answer corresponding to the first question using the first agent includes: The first intelligent agent acquires first data, which represents the data corresponding to the first question retrieved from the database; Using the aforementioned question-and-answer model, the first answer is obtained by integrating the first question and the first data.
4. The method according to any one of claims 1 to 3, characterized in that, In the case that the first problem is a complex problem, determining the first answer corresponding to the first problem using the first intelligent agent corresponding to the first problem includes: By using a personalized module to add cognitive enhancement prompts to the first question, a second question is obtained. The planning module is used to add thought chain hints to the second question to obtain the third question, which contains multiple reasoning steps. Using the action module, the reasoning steps in the third question are invoked step by step to perform reasoning in the question-answering model, and the first answer is obtained. During the reasoning process of the question-answering big model, whenever a calculation formula is detected, the reasoning is interrupted, an external calculation tool is invoked to complete the calculation according to the detected calculation formula, and the calculation result is inserted into the reasoning result to continue the subsequent reasoning until the first answer is obtained.
5. The method according to any one of claims 1 to 3, characterized in that, The method further includes: Use the first intelligent agent to obtain user information; In the process of determining the first answer, the user information is integrated into the first answer.
6. The method according to any one of claims 1 to 3, characterized in that, The first application is a sports and health application or a smart interactive assistant, and the first question is a sports or health issue.
7. The method according to any one of claims 1 to 3, characterized in that, The database is either a database stored in the local storage unit of the electronic device, or a cloud database not located in the electronic device.
8. The method according to any one of claims 1 to 3, characterized in that, The step of displaying the first answer on the electronic device through the first application includes: The first answer is displayed step by step on the screen of the electronic device; and / or the first answer is played by voice playback.
9. An electronic device, characterized in that, The electronic device includes: one or more processors, and memory; The memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, the one or more processors invoking the computer instructions to cause the electronic device to perform the method as described in any one of claims 1 to 8.
10. A chip system, characterized in that, The chip system is applied to an electronic device, the chip system including one or more processors, the one or more processors being used to invoke computer instructions to cause the electronic device to perform the method as described in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1 to 8.
12. A computer program product, characterized in that, The computer program product includes a computer program that, when run on an electronic device, causes the electronic device to perform the method as described in any one of claims 1 to 8.