Question and answer method, device and equipment
Through a question-and-answer method, the user's question text and target reference text are obtained, and the second question text is generated based on the user's operations, and a large language model is input to obtain more accurate answers. This solves the problem that the user's answer does not meet expectations due to unclear propt description, which improves the accuracy and efficiency of the answer.
Patent Information
- Application Number
- CN202411731359.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-04-01
AI Technical Summary
When using a large language model, the user's unclear description of the propt, resulting in the answers generated by the model not meeting expectations. The existing solutions require users to have professional knowledge and take a long time, but it is still difficult to obtain satisfactory answers.
A question-and-answer method is provided, by obtaining the first question text and the corresponding target reference text input by the user, outputting relevant information, and generating the second question text according to the user's operations, determining the target prompt information, and inputting the target model to obtain more accurate answers.
This method can guide users to propose more detailed requirements, improve the accuracy of answers, and reduce the time and expertise requirements for users to adjust the project.
Smart Images

Figure CN119739822A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to a question-answering method, device and equipment. Background Art
[0002] When using a large language model, users may not be able to clearly describe the prompt, which may result in the model generating an answer that does not meet their expectations. The existing solution is usually for users to continuously adjust and optimize the prompt until they get a satisfactory answer.
[0003] However, this method has the following disadvantages: users need to have certain professional knowledge to adjust the prompt, the adjustment process may take a long time, and the answer generated by the model based on the adjusted prompt still does not meet expectations. Summary of the invention
[0004] The embodiments of the present application provide a question-answering method, device, and equipment.
[0005] The technical solution of this application is implemented as follows:
[0006] In a first aspect, an embodiment of the present application provides a question-answering method, comprising:
[0007] Get the first question text entered by the user;
[0008] Obtaining a target reference text corresponding to the first question text;
[0009] Output text information corresponding to the output target reference text;
[0010] Acquire a second question text obtained based on a target operation, where the target operation is an operation performed by the user after outputting the output text information corresponding to the target reference text;
[0011] Determine target prompt information according to the second question text;
[0012] The target prompt information is input into the target model to obtain the target answer generated by the target model and corresponding to the second question text. The target model can convert the input instruction information into a feature sequence and obtain the output result based on the feature sequence reasoning.
[0013] In the above question-answering method, obtaining the target reference text corresponding to the first question text includes:
[0014] When the first question text meets the target condition, a target reference text corresponding to the first question text is obtained.
[0015] In the above question-and-answer method, the method further comprises:
[0016] When it is detected that the first question text includes the specific prompt identifier, it is determined that the first question text meets the target condition.
[0017] In the above question-and-answer method, the method further comprises:
[0018] When it is detected that the number of words corresponding to the first question text is less than the target threshold, it is determined that the first question text meets the target condition.
[0019] In the above question-answering method, obtaining the target reference text corresponding to the first question text includes:
[0020] Determine a first prompt text according to the first question text, the first prompt text includes a target text instruction, and the target text instruction is used to instruct the model to generate a reference text;
[0021] The first prompt text is input into the target model to obtain a target reference text generated by the target model.
[0022] In the above question-answering method, obtaining the target reference text corresponding to the first question text includes:
[0023] A target reference text is obtained by matching a plurality of preset prompt word templates according to the first question text.
[0024] In the above question-answering method, the output text information corresponding to the output target reference text includes:
[0025] Determine at least one candidate output text according to the first question text and the target reference text;
[0026] outputting at least one alternative output text;
[0027] The target operation includes an operation for selecting a second question text from at least one candidate output text.
[0028] In the above question-answering method, the output text information corresponding to the output target reference text includes:
[0029] Display output text information, including target reference text;
[0030] The target operation includes an operation of the user inputting a second question text.
[0031] In a second aspect, an embodiment of the present application provides a question-answering device, including:
[0032] An acquisition unit, used for acquiring a first question text input by a user;
[0033] The acquisition unit is further used to acquire a target reference text corresponding to the first question text;
[0034] An output unit, used for outputting output text information corresponding to the target reference text;
[0035] The acquisition unit is further used to acquire a second question text obtained based on a target operation, where the target operation is an operation performed by the user after outputting the output text information corresponding to the target reference text;
[0036] A determination unit, configured to determine target prompt information according to the second question text;
[0037] The input unit is used to input the target prompt information into the target model to obtain the target answer generated by the target model and corresponding to the second question text. The target model can convert the input instruction information into a feature sequence and obtain the output result based on the feature sequence reasoning.
[0038] In a third aspect, an embodiment of the present application provides a question-and-answer device, comprising: a processor, a memory, and a communication bus; when the processor executes a running program stored in the memory, it implements any of the above methods applied to the question-and-answer device. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 A flow chart of a question-and-answer method provided in an embodiment of the present application;
[0040] Figure 2 An exemplary flow chart of a question-and-answer method provided in an embodiment of the present application;
[0041] Figure 3 A schematic diagram of the structure of a question-and-answer device provided in an embodiment of the present application;
[0042] Figure 4 A schematic diagram of the composition structure of a question-and-answer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0043] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0044] The present application embodiment provides a question-answering method, which is applied to a question-answering device. Figure 1 A flow chart of a question-and-answer method provided in an embodiment of the present application is as follows: Figure 1 As shown, the question-answering method may include the following steps S101 to S106:
[0045] Step S101: Obtain a first question text input by a user.
[0046] In the embodiment of the present application, the question-answering device obtains a first question text input by a user.
[0047] In some embodiments, the first question text is a question input by a user to the question-and-answer device. For example, the user inputs "How to optimize the performance of a Java program" to the question-and-answer device, and the first question text is "How to optimize the performance of a Java program"; the specific first question text can be determined based on actual conditions, and the embodiments of the present application do not make specific limitations here.
[0048] In some embodiments, the question-and-answer device can be a personal laptop computer, a mobile terminal (such as a smart phone or tablet computer), a smart home device, or a vehicle-mounted device that can interact with the user; the specific question-and-answer device can be determined based on actual conditions, and the embodiments of the present application do not make specific limitations here.
[0049] In some embodiments, the question-and-answer device has an input box, in which the user can input the first question text by text or voice; the specific input method of the first question text can be selected according to actual conditions, and the embodiments of the present application do not make specific limitations here.
[0050] Step S102: Obtain a target reference text corresponding to the first question text.
[0051] In the embodiment of the present application, after obtaining the first question text input by the user, the question-answering device obtains the target reference text corresponding to the first question text.
[0052] In some embodiments, after obtaining a first question text input by a user, the question-and-answer device may input the first question text into a large language model, use the large language model to parse the first question text, identify the core content of the first question text, and thereby determine what detailed information needs to be further obtained before solving the first question text, and then generate at least one sub-question text for obtaining relevant detailed information.
[0053] In some embodiments, after obtaining at least one sub-question text for obtaining relevant detail information, a reference text for each sub-question text can also be obtained through a large language model to provide the user with a reference for answering the sub-question text, thereby obtaining at least one reference text corresponding to the at least one sub-question text, i.e., the target reference text.
[0054] For example, the first question text is "How to optimize the performance of a Java program", and the question-answering device can input "How to optimize the performance of a Java program" into the large language model, and the large language model first parses it and determines that before solving "How to optimize the performance of a Java program", it is necessary to ask the user at least one of the following sub-question texts for the user to further improve the specific question details of the first question text:
[0055] 1. What is the purpose of the Java program you want to optimize?
[0056] 2. What specific performance bottleneck did you encounter?
[0057] 3. What optimization measures have you tried?
[0058] 4. What is the goal you want to optimize?
[0059] Furthermore, after obtaining the at least one sub-question text, a reference answer to each sub-question may be provided to the user for reference:
[0060] 1. For the question “What is the purpose of the Java program you want to optimize?”, corresponding reference answers can be provided to the user at the same time. The reference answers may include “Web (web page) application”, “data processing”, and “game development”, etc.
[0061] 2. In response to the question "What specific performance bottleneck did you encounter?", corresponding reference answers can be provided to the user at the same time. The reference answers may include "too high memory usage", "too high central processing unit (CPU) utilization", and "too slow I / O (read / write) operations".
[0062] 3. For the question “What optimization measures have you tried?”, you can provide users with corresponding reference answers. The reference answers may include “using multi-threading”, “adjusting garbage collection strategy”, and “optimizing algorithm”.
[0063] 4. For the question “What is your goal to optimize?”, you can provide users with corresponding reference answers, which may include “reduce memory usage”, “increase execution speed”, and “reduce response time”.
[0064] Step S103: output text information corresponding to the output target reference text.
[0065] In the embodiment of the present application, after acquiring the target reference text, the question-answering device outputs output text information corresponding to the target reference text.
[0066] In some embodiments, referring to the above embodiments, the question-and-answer device can generate at least one sub-question text based on the first question text for obtaining details related to the first question text, and obtain a reference answer for each sub-question text. Thus, the question-and-answer device can combine each sub-question text with the corresponding reference answer to generate output text information, and can output the output text information to the user in a display box.
[0067] For example, the output text information may be as follows:
[0068] 1. What is the purpose of the Java program you want to optimize? (For example: Web application, data processing, game development, etc.)
[0069] 2. What specific performance bottleneck did you encounter? (For example: excessive memory usage, high CPU utilization, slow I / O operations, etc.)
[0070] 3. What optimization measures have you tried? (For example: using multithreading, adjusting garbage collection strategies, optimizing algorithms, etc.)
[0071] 4. What is your goal for optimization? (For example: reduce memory usage, increase execution speed, reduce response time, etc.)
[0072] Step S104: obtaining a second question text based on a target operation, where the target operation is an operation performed by the user after outputting the output text information corresponding to the target reference text.
[0073] In an embodiment of the present application, after outputting the output text information corresponding to the target reference text, the question-and-answer device obtains a second question text based on a target operation, where the target operation is an operation performed by the user after outputting the output text information corresponding to the target reference text.
[0074] In some embodiments, when the user views the output text information output by the question-and-answer device, the user can supplement the details of the first question text according to the output text information, that is, input a second question text into the question-and-answer device.
[0075] Exemplarily, after the user supplements the details of the above output text information, a second question text is obtained:
[0076] 1. The Java program I want to optimize is for data processing.
[0077] 2. The specific performance bottleneck I encountered was high memory usage.
[0078] 3. I have tried using multithreading and adjusting the garbage collection strategy.
[0079] 4. I hope the goal of optimization is to reduce memory usage.
[0080] It can be seen that the second question text includes at least one answer generated by the user for each sub-question text and the given reference answer.
[0081] Step S105: determine target prompt information according to the second question text.
[0082] In the embodiment of the present application, after obtaining the second question text, the question-answering device determines the target prompt information according to the second question text.
[0083] In some embodiments, after the user inputs the second prompt text into the question-answering device, the question-answering device may determine target prompt information for prompting relevant details in the first question text based on the second question text.
[0084] For example, the target prompt information for “how to optimize the performance of a Java program” may be:
[0085] 1. Optimized Java programs are used for data processing.
[0086] 2. The current problem with Java programs is that memory usage is too high.
[0087] 3. Attempts have been made to optimize the Java program by using multithreading and adjusting the garbage collection strategy.
[0088] 4. Hope that the memory usage can be reduced after optimization.
[0089] Step S106: input the target prompt information into the target model to obtain the target answer generated by the target model and corresponding to the second question text. The target model can convert the input instruction information into a feature sequence and obtain the output result based on the feature sequence reasoning.
[0090] In an embodiment of the present application, after determining the target prompt information based on the second question text, the question-answering device inputs the target prompt information into the target model to obtain the target answer generated by the target model corresponding to the second question text. The target model can convert the input instruction information into a feature sequence and obtain the output result based on the feature sequence reasoning.
[0091] In some embodiments, after determining the target prompt information for the first prompt text, the question-and-answer device can input the target prompt information into the target model, and use the target prompt information to prompt the target model to consider the aspects given by the above target prompt information when giving the target answer to the first question text. When the question-and-answer device gives the target answer corresponding to the target prompt information, when the target prompt information includes multiple pieces of information, a corresponding target answer can be given for each piece of target prompt information.
[0092] In some embodiments, the target model is one of the following: a large language model (LLM), a multimodal large model, a model capable of generating text, a model with an adjustable parameter amount greater than 100 million, a model that can output corresponding results according to input natural language instructions, a model that can convert input natural language instructions into feature sequences and infer output results based on feature sequences, and a model that can convert input information into feature sequences and infer subsequent features of feature sequences; the specific target model can be selected according to actual conditions, and the embodiments of the present application are not specifically limited here.
[0093] Exemplarily, the question-answering device may return the following target answer to the user based on the target prompt information supplemented by the user:
[0094] To optimize memory usage in your data processing program, you can try the following:
[0095] 1. Use memory analysis tools (such as VisualVM) to find memory leaks.
[0096] 2. Optimize data structure and choose more efficient collection classes (such as ArrayList instead of LinkedList).
[0097] 3. Implement object pooling and reuse objects instead of frequently creating and destroying objects.
[0098] 4. Use compressed data format to reduce data usage in memory.
[0099] In an optional implementation, the question-answering device obtains a target reference text corresponding to a first question text, including the following steps: when the first question text meets a target condition, obtaining the target reference text corresponding to the first question text.
[0100] In some embodiments, when the question-and-answer device determines that the first question text triggers the question-and-answer operation implemented through the above process, it obtains the target reference text corresponding to the first question text.
[0101] It is understandable that when the first question text input by the user is relatively professional and the user wants to obtain a relatively standard target answer, the user can trigger the above process to obtain a relatively standard target answer to the professional question.
[0102] In an optional implementation, the question-answering device may further perform the following steps: when it is detected that the first question text includes a specific prompt identifier, determining that the first question text meets the target condition.
[0103] In some embodiments, it can be arranged that the above process can be triggered by a specific prompt identifier, that is, when the user wants to trigger the above question and answer process, the user can add a specific prompt identifier when entering the first question text. Thus, when the question and answer device detects that the first question text includes the specific prompt identifier, it can determine that the first question text meets the target condition and trigger the above process, thereby obtaining a more standardized target answer for the first question text.
[0104] Exemplarily, the specific prompt identifier can be “@@”, or “!!”, or “**”; the specific specific prompt identifier and the number of specific prompt identifiers can be set according to actual conditions, and the embodiments of the present application do not make specific limitations here.
[0105] In some embodiments, the position of a specific prompt identifier in the first question text can also be agreed upon. It is usually agreed that the specific prompt identifier needs to be at the very beginning of the first question text. Of course, it can also be agreed that the specific prompt identifier is at the end of the first question text. The specific position of the specific prompt identifier in the first question text can be agreed upon based on actual conditions, and the embodiments of the present application do not make any specific limitations here.
[0106] Exemplarily, taking the specific prompt identifier "@@" as an example, the first question text can be "@@How to optimize the performance of a Java program", and the first question text can also be "How to optimize the performance of a Java program@@", which is not limited in the embodiments of the present application.
[0107] In an optional implementation, the question-answering device may further perform the following steps: when it is detected that the number of words corresponding to the first question text is less than the target threshold, determining that the first question text meets the target condition.
[0108] In some embodiments, the above process can also be set to be triggered when the number of words in the first question text is less than the target threshold, that is, the above process can be triggered when the number of words in the first question text input by the user is small. Thus, the question-and-answer device can allow the user to supplement the relevant question details through the above process, thereby improving the accuracy of the target answer given for the first question text.
[0109] In an optional embodiment, the question-answering device obtains a target reference text corresponding to a first question text, including the following steps: determining a first prompt text based on the first question text, the first prompt text including a target text instruction, and the target text instruction is used to instruct the model to generate a reference text; inputting the first prompt text into the target model to obtain a target reference text generated by the target model.
[0110] For example, taking the first question text as “@@How to optimize the performance of a Java program” as an example, the first prompt text determined by the question-answering device may be:
[0111] The question is "@@How to optimize the performance of a Java program";
[0112] Please give reference texts that solve the above problems.
[0113] Therefore, after the question-answering device outputs the first prompt text to the target model, the target model can generate a target reference text based on the first prompt text.
[0114] In an optional implementation, the question-answering device obtains a target reference text corresponding to a first question text, including the following steps: obtaining the target reference text by matching a plurality of preset prompt word templates according to the first question text.
[0115] In some embodiments, the question-and-answer device pre-stores the correspondence between multiple preset prompt word templates and multiple reference texts. After obtaining the first question text, it can match the multiple prompt words included in the first question text, and obtain the target reference text from the correspondence between the multiple preset prompt word templates and the multiple reference texts, and then output text information corresponding to the target reference text is output in the display box.
[0116] In an optional embodiment, the question-and-answer device outputs output text information corresponding to the target reference text, including the following steps: determining at least one alternative output text based on the first question text and the target reference text; outputting at least one alternative output text; wherein the target operation includes an operation for selecting a second question text from the at least one alternative output text.
[0117] In some embodiments, referring to the above embodiments, the question-and-answer device can generate at least one sub-question text for obtaining relevant details of the first question text based on the first question text, and obtain the target reference text, and directly split the first question text into at least one alternative output text according to the target reference text, and then output the at least one alternative output text in the display box. Based on this, the user can reply to each alternative output text in the input box, that is, enter the second question text.
[0118] In an optional implementation, the question-and-answer device outputs output text information corresponding to the target reference text, including the following steps: displaying the output text information, the output text information including the target reference text; wherein the target operation includes an operation in which the user inputs a second question text.
[0119] In some embodiments, after acquiring the target reference text corresponding to the first question text, the question-answering device displays output text information including the target reference text in a display box, whereby the user can input a second question text for the output text information in the input box.
[0120] An embodiment of the present application provides a question-and-answer method, the method comprising: obtaining a first question text input by a user; obtaining a target reference text corresponding to the first question text; outputting output text information corresponding to the target reference text; obtaining a second question text obtained based on a target operation, the target operation being an operation performed by the user after outputting the output text information corresponding to the target reference text; determining target prompt information according to the second question text; inputting the target prompt information into a target model to obtain a target answer corresponding to the second question text generated by the target model, the target model being able to convert the input instruction information into a feature sequence, and obtaining an output result based on feature sequence reasoning; by adopting the above implementation scheme, the present application can guide the user to raise more detailed requirements during the interaction with the user, thereby being able to give targeted answers to the detailed requirements raised by the user, and this method can improve the accuracy of the answer returned to the user when the question initially raised by the user is more professional.
[0121] Based on the above embodiments, reference Figure 2 This application explains the above question-and-answer process through an exemplary embodiment, and the specific steps are as follows:
[0122] Step S201: The user inputs a first question text into the question-answering device.
[0123] Specifically, the user inputs “@@how to optimize the performance of a Java program,” @@” can trigger the question-and-answer process proposed in this application.
[0124] Step S202: the question-answering device outputs output text information obtained based on the first question text to the user.
[0125] Specifically, the output text information output by the question-answering device may be as follows:
[0126] 1. What is the purpose of the Java program you want to optimize? (For example: Web application, data processing, game development, etc.)
[0127] 2. What specific performance bottleneck did you encounter? (For example: excessive memory usage, high CPU utilization, slow I / O operations, etc.)
[0128] 3. What optimization measures have you tried? (For example: using multithreading, adjusting garbage collection strategies, optimizing algorithms, etc.)
[0129] 4. What is your goal for optimization? (For example: reduce memory usage, increase execution speed, reduce response time, etc.)
[0130] Step S203: The user inputs a second question text into the question-answering device according to the output text information.
[0131] Specifically, the second question text can be as follows:
[0132] 1. The Java program I want to optimize is for data processing.
[0133] 2. The specific performance bottleneck I encountered was high memory usage.
[0134] 3. I have tried using multithreading and adjusting the garbage collection strategy.
[0135] 4. I hope the goal of optimization is to reduce memory usage.
[0136] Step S204: the question-answering device outputs a target answer to the user according to the second question text.
[0137] Specifically, the target answer can be as follows:
[0138] To optimize memory usage in your data processing program, you can try the following:
[0139] 1. Use memory analysis tools (such as VisualVM) to find memory leaks.
[0140] 2. Optimize data structure and choose more efficient collection classes (such as ArrayList instead of LinkedList).
[0141] 3. Implement object pooling and reuse objects instead of frequently creating and destroying objects.
[0142] 4. Use compressed data format to reduce data usage in memory.
[0143] Based on the above embodiment, in another embodiment of the present application, a question-answering device 3 is provided. Figure 3 A schematic diagram of the structure of a question-and-answer device provided in this application is shown in FIG. Figure 3 As shown, the question-answering device 3 includes:
[0144] An acquisition unit 300 is used to acquire a first question text input by a user;
[0145] The acquisition unit 300 is further used to acquire a target reference text corresponding to the first question text;
[0146] An output unit 301 is used to output output text information corresponding to the target reference text;
[0147] The acquisition unit 300 is further used to acquire a second question text obtained based on a target operation, where the target operation is an operation performed by the user after outputting the output text information corresponding to the target reference text;
[0148] A determination unit 302, configured to determine target prompt information according to the second question text;
[0149] The input unit 303 is used to input the target prompt information into the target model to obtain the target answer generated by the target model and corresponding to the second question text. The target model can convert the input instruction information into a feature sequence and obtain the output result based on the feature sequence reasoning.
[0150] In some embodiments, the acquisition unit 300 is further configured to acquire a target reference text corresponding to the first question text when the first question text satisfies the target condition.
[0151] In some embodiments, the determination unit 302 is further configured to determine that the first question text meets the target condition when it is detected that the first question text includes a specific prompt identifier.
[0152] In some embodiments, the determination unit 302 is further configured to determine that the first question text meets the target condition when it is detected that the number of words corresponding to the first question text is less than the target threshold.
[0153] In some embodiments, the determination unit 302 is further used to determine a first prompt text according to the first question text, the first prompt text includes a target text instruction, and the target text instruction is used to instruct the model to generate a reference text;
[0154] The input unit 303 is further used to input the first prompt text into the target model to obtain a target reference text generated by the target model.
[0155] In some embodiments, the question-answering device 3 further includes: a matching unit;
[0156] The matching unit is used to match a target reference text from a plurality of preset prompt word templates according to the first question text.
[0157] In some embodiments, the determination unit 302 is further configured to determine at least one candidate output text according to the first question text and the target reference text;
[0158] The output unit 301 is further used to output at least one candidate output text; wherein the target operation includes an operation for selecting a second question text from the at least one candidate output text.
[0159] In some embodiments, the question-answering device 3 further includes: a display unit;
[0160] The display unit is used to display output text information, wherein the output text information includes a target reference text; wherein the target operation includes an operation in which a user inputs a second question text.
[0161] An embodiment of the present application provides a question-and-answer device, which includes: an acquisition unit, which is used to acquire a first question text input by a user; the acquisition unit, which is also used to acquire a target reference text corresponding to the first question text; an output unit, which is used to output output text information corresponding to the target reference text; the acquisition unit, which is also used to acquire a second question text obtained based on a target operation, where the target operation is an operation performed by the user after outputting the output text information corresponding to the target reference text; a determination unit, which is used to determine target prompt information based on the second question text; an input unit, which is used to input the target prompt information into a target model to obtain a target answer corresponding to the second question text generated by the target model, wherein the target model can convert the input instruction information into a feature sequence and obtain an output result based on the feature sequence reasoning; by adopting the above implementation scheme, the present application can guide the user to raise more detailed requirements during the interaction with the user, so as to give targeted answers to the detailed requirements raised by the user. This method can improve the accuracy of the answer returned to the user when the question initially raised by the user is more professional.
[0162] Figure 4 This is a schematic diagram of the composition structure of a question-answering device provided in an embodiment of the present application. In practical applications, based on the same public concept of the above embodiments, Figure 4 As shown, the question-answering device 4 of this embodiment includes: a processor 400 , a memory 401 and a communication bus 402 .
[0163] In the specific embodiment, the processor 400 can be at least one of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a CPU, a controller, a microcontroller, and a microprocessor. It can be understood that for different question-and-answer devices 4, the electronic device used to implement the above-mentioned processor function can also be other, and this embodiment does not specifically limit it.
[0164] In the embodiment of the present application, the processor 400 implements the following question-answering method:
[0165] Get the first question text entered by the user;
[0166] Obtaining a target reference text corresponding to the first question text;
[0167] Output text information corresponding to the output target reference text;
[0168] Acquire a second question text obtained based on a target operation, where the target operation is an operation performed by the user after outputting the output text information corresponding to the target reference text;
[0169] Determine target prompt information according to the second question text;
[0170] The target prompt information is input into the target model to obtain the target answer generated by the target model and corresponding to the second question text. The target model can convert the input instruction information into a feature sequence and obtain the output result based on the feature sequence reasoning.
[0171] In some embodiments, the processor 400 is further configured to obtain a target reference text corresponding to the first question text when the first question text satisfies a target condition.
[0172] In some embodiments, the processor 400 is further configured to determine that the first question text satisfies the target condition when it is detected that the first question text includes a specific prompt identifier.
[0173] In some embodiments, the processor 400 is further configured to determine that the first question text satisfies the target condition when it is detected that the number of words corresponding to the first question text is less than a target threshold.
[0174] In some embodiments, the processor 400 is further used to determine a first prompt text based on the first question text, the first prompt text includes a target text instruction, and the target text instruction is used to instruct the model to generate a reference text; the first prompt text is input into the target model to obtain a target reference text generated by the target model.
[0175] In some embodiments, the processor 400 is further configured to obtain a target reference text by matching a plurality of preset prompt word templates according to the first question text.
[0176] In some embodiments, the processor 400 is further used to determine at least one alternative output text based on the first question text and the target reference text; output at least one alternative output text; wherein the target operation includes an operation for selecting a second question text from the at least one alternative output text.
[0177] In some embodiments, the processor 400 is further configured to display output text information, wherein the output text information includes a target reference text; wherein the target operation includes an operation in which a user inputs a second question text.
[0178] The embodiment of the present application provides a computer-readable storage medium, which stores one or more computer programs, and the one or more computer programs can be executed by one or more processors to implement the above method. The computer-readable storage medium can be a volatile memory (volatile memory), such as a random access memory (Random-Access Memory, RAM); or a non-volatile memory (non-volatile memory), such as a read-only memory (Read-Only Memory, ROM), a flash memory (flash memory), a hard disk (Hard Disk Drive, HDD) or a solid-state drive (Solid-State Drive, SSD); or it can be a respective device including one or any combination of the above memories, such as a mobile phone, a computer, a tablet device, a personal digital assistant, etc.
[0179] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of hardware embodiments, software embodiments, or embodiments in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) that contain computer-usable program code.
[0180] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0181] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0182] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0183] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A question-answering method, the method comprising: Get the first question text entered by the user; Obtaining a target reference text corresponding to the first question text; Outputting output text information corresponding to the target reference text; Acquire a second question text obtained based on a target operation, wherein the target operation is an operation performed by the user after outputting the output text information corresponding to the target reference text; Determining target prompt information according to the second question text; The target prompt information is input into a target model to obtain a target answer generated by the target model and corresponding to the second question text. The target model can convert the input instruction information into a feature sequence and obtain an output result based on the feature sequence inference.
2. According to the method of claim 1, the step of obtaining the target reference text corresponding to the first question text comprises: When the first question text meets the target condition, a target reference text corresponding to the first question text is obtained.
3. The method according to claim 2, further comprising: In the case where it is detected that the first question text includes a specific prompt identifier, it is determined that the first question text meets the target condition.
4. The method according to claim 2, further comprising: When it is detected that the number of words corresponding to the first question text is less than the target threshold, it is determined that the first question text meets the target condition.
5. According to the method of claim 1, the step of obtaining the target reference text corresponding to the first question text comprises: Determine a first prompt text according to the first question text, wherein the first prompt text includes a target text instruction, and the target text instruction is used to instruct the model to generate a reference text; The first prompt text is input into the target model to obtain the target reference text generated by the target model.
6. According to the method of claim 1, the step of obtaining the target reference text corresponding to the first question text comprises: The target reference text is obtained by matching a plurality of preset prompt word templates according to the first question text.
7. According to the method of claim 1, the step of outputting the output text information corresponding to the target reference text comprises: Determine at least one candidate output text according to the first question text and the target reference text; outputting the at least one alternative output text; The target operation includes an operation for selecting the second question text from the at least one candidate output text.
8. According to the method of claim 1, the step of outputting the output text information corresponding to the target reference text comprises: Displaying the output text information, wherein the output text information includes the target reference text; The target operation includes an operation of a user inputting the second question text.
9. A question-answering device, comprising: An acquisition unit, used for acquiring a first question text input by a user; The acquisition unit is further used to acquire a target reference text corresponding to the first question text; An output unit, used to output output text information corresponding to the target reference text; The acquisition unit is further used to acquire a second question text obtained based on a target operation, where the target operation is an operation performed by the user after outputting the output text information corresponding to the target reference text; A determination unit, configured to determine target prompt information according to the second question text; An input unit is used to input the target prompt information into a target model to obtain a target answer generated by the target model and corresponding to the second question text. The target model can convert the input instruction information into a feature sequence and obtain an output result based on the feature sequence inference.
10. A question-answering device, comprising: Processor, memory and communication bus; When the processor executes the running program stored in the memory, the method according to any one of claims 1 to 8 is implemented.