A terminal and a question-answering method based on a large language model

By implementing a user-interventable question-and-answer process on the terminal, users are allowed to continue writing or replace the reply text generated by the large language model, solving the problems of poor question-and-answer effects and low accuracy in the prior art, and improving user experience and question-and-answer effects.

CN119782455AInactive Publication Date: 2025-04-08QINGDAO HISENSE ELECTRONICS TECH CONSULTANCY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411630653.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-04-08
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, large language models may not meet preset expectations when generating reply text, resulting in poor question-and-answer effects and low accuracy.

Method used

It provides a terminal and a question-and-answer method based on a large language model, which generates the first reply text by displaying the question text input by the user, and allows the user to continue writing or replace it on the basis of the first reply text to generate different reply text.

Benefits of technology

Through the user's interventional operations, the answers needed by users can be generated more quickly, improving the user experience, and improving the accuracy and effectiveness of question-and-answer questions and answers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119782455A_ABST
    Figure CN119782455A_ABST
Patent Text Reader

Abstract

The present application relates to the field of data processing technology, and in particular to a terminal and a question-and-answer method based on a large language model. Compared with the traditional question-and-answer solution in which users cannot intervene, the embodiment of the present application provides users with an intervenible question-and-answer process. The terminal generates and displays the first reply text corresponding to the question text based on the large language model. The user can make a variety of generation choices based on the first reply text to adjust the first reply text, instead of relying on the user to repeatedly write prompt words, or relying on the overly technical parameter settings of the large language model to obtain a variety of generation results. While improving the user experience, it can generate the answers required by the user more quickly.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a terminal and a question-answering method based on a large language model. Background Art

[0002] With the development of large language model technology, large language models have been applied to various industries and fields, and generating corresponding reply text based on the user's question text is one aspect of it.

[0003] However, in actual applications, the response text generated by the large language model for the question text may not meet the preset expectations, resulting in poor question-answering results and low accuracy. Summary of the invention

[0004] The present application provides a terminal and a question-answering method based on a large language model, which is used to solve the problems of poor question-answering effect and low accuracy in the prior art.

[0005] In a first aspect, an embodiment of the present application provides a terminal, wherein the terminal includes a display and a processor:

[0006] The display is configured as:

[0007] Display the first response text generated for the question text entered by the user;

[0008] The processor is configured to:

[0009] If a selection operation of a first text starting from the first character of the first reply text is received from the user, the display is controlled to display a first instruction dialog box for continuing to write the first text;

[0010] If a click operation on the first instruction dialog box is received, the first text is continued according to the large language model to determine a second reply text; wherein the second reply text is different from the first reply text.

[0011] The above technical solution has the following advantages or beneficial effects: compared with the traditional question-and-answer solution in which users cannot intervene, the embodiment of the present application provides users with an intervenible question-and-answer process. The terminal generates and displays the first reply text corresponding to the question text based on the large language model. The user can make a variety of generation choices based on the first reply text to adjust the first reply text, instead of relying on the user to repeatedly write prompt words, or relying on the overly technical parameter settings of the large language model to obtain a variety of generation results. While improving the user experience, the answers required by the user can be generated more quickly.

[0012] In some embodiments of the present application, the processor is specifically configured to:

[0013] Obtaining a saved target prompt word, wherein the target prompt word is a prompt word used when generating the first reply text;

[0014] The target prompt word is concatenated with the first text, and the obtained concatenated prompt word is input into the large language model, so that the large language model determines the second reply text according to the concatenated prompt word; wherein the second reply text includes the first text and the continuation text.

[0015] The above technical solution has the following advantages or beneficial effects: it enables the continuation of the first text through a large language model.

[0016] In some embodiments of the present application, the processor is further configured to:

[0017] If an input for selecting a second text in the first reply text is received, and the second text does not contain the first character, controlling the display to display a second instruction dialog box for replacing the second text;

[0018] If a click operation on the second instruction dialog box is received, generating a third text that is synonymous with the second text and has different content according to the large language model;

[0019] The second text in the first reply text is replaced according to the third text to obtain a third reply text.

[0020] The above technical solution has the following advantages or beneficial effects: it realizes the replacement of part of the text in the first reply text, instead of relying on the user to repeatedly write the prompt words, or relying on the overly technical parameter settings of the large language model to obtain a variety of generation results, thereby improving the user experience and generating the answers the user needs more quickly.

[0021] In some embodiments of the present application, the display is further configured as:

[0022] Display every third text;

[0023] The processor is specifically configured to:

[0024] receiving a selection operation of a target third text input by a user;

[0025] The target third text is used to replace the second text in the first reply text.

[0026] The above technical solution has the following advantages or beneficial effects: it realizes diversified replacement of part of the text in the first reply text.

[0027] In some embodiments of the present application, the display is further configured as:

[0028] Displays a text input box for entering text;

[0029] The processor is further configured to:

[0030] If a fourth text input by the user based on the text input box is received, the fourth text is used to replace the second text in the first reply text to obtain a third reply text.

[0031] In some embodiments of the present application, the second text is one of a character, a word, a short sentence or a whole sentence.

[0032] The above technical solution has the following advantages or beneficial effects: it realizes diversified replacement of part of the text in the first reply text.

[0033] In some embodiments of the present application, the display is specifically configured as:

[0034] Displaying a first reply text carrying a setting identifier, wherein the setting identifier is used to indicate that there are multiple options for the current location;

[0035] The processor is further configured to:

[0036] Receiving an input selection operation of the set identifier in the currently displayed first reply text;

[0037] A fifth text before the set identifier in the first reply text is obtained, and the fifth text is continued according to the large language model to determine a fourth reply text; wherein the fourth reply text is different from the first reply text.

[0038] The above technical solution has the following advantages or beneficial effects: it realizes different ways of continuing the first text in the first reply text, and realizes the identification of diversified selection of the first reply text in the generation process of the large language model.

[0039] In some embodiments of the present application, the display is further configured as:

[0040] Displaying the first reply text and the fourth reply text;

[0041] The processor is further configured to:

[0042] If a selection operation on the first reply text is received, outputting the first reply text;

[0043] If a selection operation on the fourth reply text is received, the fourth reply text is output.

[0044] The above technical solution has the following advantages or beneficial effects: interaction between the user and the terminal is realized.

[0045] In some embodiments of the present application, the processor is specifically configured to:

[0046] During the generation process of the first reply text, if it is determined that the preset multiple selection conditions are currently met, the setting identifier is added to the current position of the first reply text.

[0047] The above technical solution has the following advantages or beneficial effects: in the process of generating the first reply text, adding an identifier for indicating the existence of multiple selected settings in the first reply text can clearly show which positions have good continuation effects, provide users with selection ideas, and further improve the interactivity of questions and answers.

[0048] In a second aspect, an embodiment of the present application further provides a question-answering method based on a large language model, the method comprising:

[0049] Displaying a first reply text generated for the question text input by the user; if a selection operation of a first text starting from the first character of the first reply text is received from the user, displaying a first instruction dialog box for continuing to write the first text;

[0050] If a click operation on the first instruction dialog box is received, the first text is continued according to the large language model to determine a second reply text; wherein the second reply text is different from the first reply text.

[0051] The embodiment of the present application provides a terminal, which includes a display and a processor: the display is configured to display a first reply text generated for a question text input by a user; the processor is configured to: if a selection operation of a first text starting from the first character of the first reply text input by the user is received, then a first instruction dialog box for continuing to write the first text is displayed; if a click operation on the first instruction dialog box is received, the first text is continued according to the large language model to determine a second reply text; wherein the second reply text is different from the first reply text. In the embodiment of the present application, compared with the traditional question-and-answer solution in which the user cannot intervene, the embodiment of the present application provides the user with an intervened question-and-answer process, the terminal generates and displays the first reply text corresponding to the question text based on the large language model, the user can make a variety of generation choices based on the first reply text, and adjust the first reply text, instead of relying on the user to repeatedly write prompt words, or relying on the overly technical parameter settings of the large language model to obtain a variety of generation results, while improving the user experience, it can generate the answers required by the user more quickly. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0053] Figure 1 A schematic diagram of a terminal provided in an embodiment of the present application;

[0054] Figure 2 A schematic diagram of the structure of a terminal provided in an embodiment of the present application;

[0055] Figure 3 A continuation flow chart based on a large language model provided in an embodiment of the present application;

[0056] Figure 4 A continuation flow chart based on a large language model provided in an embodiment of the present application;

[0057] Figure 5 A schematic diagram of a first instruction dialog box provided in an embodiment of the present application;

[0058] Figure 6 A schematic diagram of a display provided in an embodiment of the present application;

[0059] Figure 7 A schematic diagram of a "waiting" style mouse provided in an embodiment of the present application;

[0060] Figure 8 A schematic diagram of a display showing each third text and a text input box provided by an embodiment of the present application;

[0061] Fig. 9 A schematic diagram of a third reply text provided in an embodiment of the present application;

[0062] Fig.10 A schematic diagram of setting an identifier provided in an embodiment of the present application;

[0063] Fig.11 A determination flow chart for setting condition 1 for generating an identifier provided in an embodiment of the present application;

[0064] Fig.12 A determination flow chart for setting the second identifier generation condition provided in an embodiment of the present application;

[0065] Fig.13 A schematic diagram of a display showing two texts is provided for an embodiment of the present application;

[0066] Fig.14 A schematic diagram of a question-answering process based on a large language model provided in an embodiment of the present application;

[0067] Fig.15 A schematic diagram of the structure of a question-answering device based on a large language model provided in an embodiment of the present application;

[0068] Fig.16 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0069] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field belong to the scope of protection of this application.

[0070] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0071] It should be noted that the terms "including" and "having" and their variations involved in the documents of this application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0072] The terms "first" and "second" in this document are used for descriptive purposes only and should not be understood as explicitly or implicitly indicating relative importance or implicitly indicating the number of technical features indicated. Therefore, features defined as "first" and "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of this application, unless otherwise specified, "plurality" means two or more.

[0073] The word “exemplary” is used hereinafter to mean “serving as an example, example, or illustration.” Any embodiment described as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0074] At present, with the development of large language model technology, large language models have been applied to various industries and fields, and generating corresponding reply text based on the user's question text is one aspect of it.

[0075] However, in actual applications, the response text generated by the large language model for the question text may not meet the preset expectations, resulting in poor question-answering results and low accuracy.

[0076] Based on this, an embodiment of the present application provides a terminal, a question-and-answer method, an apparatus, and a medium based on a large language model, wherein the terminal includes a display and a processor: the display is configured to display a first reply text generated for a question text input by a user; the processor is configured to: if a selection operation of a first text starting from the first character of the first reply text input by the user is received, a first instruction dialog box for continuing to write the first text is displayed; if a click operation on the first instruction dialog box is received, the first text is continued according to the large language model to determine a second reply text; wherein the second reply text is different from the first reply text.

[0077] For example, the terminal used in the question-and-answer process may be a mobile phone, on which an application is installed, and the application can be used for question-and-answer. When performing corresponding operations, functions such as sound collection, image collection, video collection, and sound playback can be realized through the support of terminal hardware. Figure 1 A schematic diagram of a terminal provided in an embodiment of the present application, such as Figure 1 As shown, the terminal can be configured with a microphone, a display screen, and a speaker, wherein the microphone is used for sound collection, the display screen is used for information display, and the speaker is used for sound playback.

[0078] It should be noted that the above examples are only for ease of understanding. The terminal is not limited to mobile phones, but can also be other devices, such as computers, tablets, etc. Of course, even if the terminal is a mobile phone, the functions of the mobile phone are not limited to the above examples. The following will describe the process of question and answer based on the terminal in combination with various embodiments. Figure 2 A structural schematic diagram of a terminal provided for an embodiment of the present application, the terminal 10 includes a display 101 and a processor 102, wherein the display 101 is configured to: display a first reply text generated for a question text input by a user; the processor 102 is configured to: if a selection operation of a first text starting from the first character of the first reply text input by the user is received, control the display 101 to display a first instruction dialog box for continuing to write the first text; if a click operation on the first instruction dialog box is received, continue to write the first text according to a large language model to determine a second reply text; wherein the second reply text is different from the first reply text.

[0079] In the embodiment of the present application, the terminal includes a display 101 and a processor 102, wherein the display 101 is used to display content. The terminal receives a question text input by a user, and uses a large language model to generate a first reply text corresponding to the question text, and displays it in the display 101.

[0080] However, in actual application, the first reply text displayed in the display 101 may not be what the user wants. Based on this, the user can interact with the terminal to make the terminal finally display the second reply text that the user wants.

[0081] Specifically, in the embodiment of the present application, the user can select the first text from the displayed first reply text, and after the processor 102 of the terminal receives the selection operation of the first text, the processor 102 determines to perform the continuation process, and then the processor 102 displays a first instruction dialog box for continuing to write the first text. The first character of the first text is the first character of the first reply text, and the last character of the first text is any character before the last character of the first reply text.

[0082] That is, in the embodiment of the present application, when the processor 102 of the terminal recognizes that the user starts to select the first character of the first reply text, the processor 102 of the terminal predicts that the selected first text needs to be continued, and the processor 102 of the terminal controls the display 101 to display the first instruction dialog box for continuing to write the first text.

[0083] If the user wants to continue writing, the user can click on the first instruction dialog box. After the terminal processor 102 receives the user's input click operation on the first instruction dialog box, it determines that the first text needs to be continued. Then, the processor 102 continues to write the first text according to the large language model and determines the second reply text; wherein the second reply text is different from the first reply text.

[0084] Specifically, the processor 102 can concatenate the first text with the question text corresponding to the first reply text, then call the large language model, and force the large language model to generate a second reply text, wherein the second reply text is composed of the first text and the continuation text. In the process of generating the continuation text, the large language model will also ensure that the first character in the continuation text is inconsistent with the first character after the first text in the first reply text, thereby realizing the continuation of the first text, and the final second reply text is different from the first reply text. Among them, the large language model called by the processor 102 can be the large language model used when generating the first reply text, or other large language models, which are not limited here.

[0085] Specifically, the large language model can determine that the subsequent generated content of the continued text is not completely consistent with the subsequent original generated content of the first reply text by checking that the first character of the continued text generated is inconsistent with the first character after the first text in the first reply text. This is because after the generation process of the large language model generates the first inconsistent character, the subsequent query and attention related to the character will be different, so the subsequent generated content will be greatly different.

[0086] It should be noted that a large language model stores a vocabulary, which contains many words (tokens). Token is the smallest generation unit of the large language model. When determining each character to be output, the large language model calculates the probability of being output corresponding to each token in the vocabulary, and determines the token corresponding to the maximum probability as the character to be output.

[0087] Based on this, if the large language model determines that the first character of the continued text is consistent with the first character after the first text in the first reply text, the large language model will determine the token corresponding to the second highest probability as the first character of the continued text and output it.

[0088] In order to improve the question-answering effect and the accuracy of question-answering, based on the above embodiment, in the embodiment of the present application, the processor is specifically configured as follows:

[0089] Obtaining a saved target prompt word, wherein the target prompt word is a prompt word used when generating the first reply text;

[0090] The target prompt word is concatenated with the first text, and the obtained concatenated prompt word is input into the large language model, so that the large language model determines the second reply text according to the concatenated prompt word; wherein the second reply text includes the first text and the continuation text.

[0091] In the embodiment of the present application, when the terminal determines the second reply text based on the large language model, the input of the large language model may be the target prompt word and the first text used when generating the first reply text.

[0092] Specifically, in an embodiment of the present application, after the processor 102 of the terminal receives the question text input by each user, the processor 102 of the terminal configures a user id for the question text of each user, and stores the question text, the first reply text generated for the question text, the target prompt word (prompet) used to generate the first reply text, and the user id in correspondence. When it is necessary to continue the first text in the first reply text, the corresponding prompet can be found according to the user id corresponding to the first reply text; the first text and the prompet are spliced, and the large language model is called according to the spliced ​​prompt word obtained by splicing, so that the large language model outputs the continued text. The processor 102 splices the first text with the continued text output by the large language model to obtain a second reply text.

[0093] The following is a detailed description with a specific flowchart. Figure 3 A continuation flow chart based on a large language model is provided in the embodiment of the present application, such as the Figure 3 As shown, the process includes:

[0094] S301: Obtain the first text selected by the user and the subsequent first character t.

[0095] S302: Obtain the user ID corresponding to the first reply text, and determine the saved prompet used to generate the first reply text according to the user ID.

[0096] S303: splicing the first text and the prompet.

[0097] S304: Based on the concatenated prompet, the original large language model is re-called or a new large language model is called.

[0098] S305: Check whether the first character a of the continued text is consistent with t. If they are consistent, execute S306; if they are inconsistent, execute S307.

[0099] S306: Select the second most likely character b to replace a.

[0100] S307: Continue to generate other subsequent characters until the end.

[0101] It should be noted that, in the embodiment of the present application, the above method of determining the continued text is not based on the kv calculated by the original large language model during the first reply text generation process, but is based on the method of re-calling the original large language model or a new large language model.

[0102] However, since the final second reply text contains the first text, and the first text has already been calculated once in the first reply text, based on this, in order to reduce the amount of calculation of the large language model and improve the efficiency of question and answer, in an embodiment of the present application, the large language model can also use the probability records generated by each character in the first reply text, as well as the kv saved in the generated kv cache of the first text and the question text, to regenerate the second reply text.

[0103] Specifically, the processor 102 of the terminal finds the corresponding prompet according to the user id corresponding to the first reply text; concatenates the first text and the prompet, and the large language model calls the tokenizer to convert the concatenated prompet into input_id, and extracts the kv corresponding to the input_id from the kv cache. The large language model obtains the output probability corresponding to the subsequent characters by extracting or recalculating the database, and selects the character corresponding to the second highest probability token as the first character of the continued text. The large language model continues the subsequent generation process based on the first character.

[0104] The following is a detailed description with a specific flowchart. Figure 4 A continuation flow chart based on a large language model is provided in the embodiment of the present application, such as the Figure 4 As shown, the process includes:

[0105] S401: Obtain the first text selected by the user and the subsequent first character t.

[0106] S402: Obtain the user ID corresponding to the first reply text, and determine the saved prompet used to generate the first reply text according to the user ID.

[0107] S403: splicing the first text and the prompet.

[0108] S404: Call tokenizer to convert the concatenated prompet into input_id.

[0109] S405: extract the kv corresponding to the input_id from the kv cache.

[0110] S406: Obtain the output probability corresponding to the subsequent characters in a manner of extracting or recalculating the database.

[0111] S407: Select the character corresponding to the second highest probability token as the first character of the continued text.

[0112] S408: Continue generating until the end.

[0113] Figure 5 A schematic diagram of a first instruction dialog box provided in an embodiment of the present application, such as the Figure 5 As shown, the user inputs a selection operation, and the first text selected is "Polar bears are called the king of Arctic animals, mainly for the following reasons: 1. Body shape". After the processor 102 receives the selection operation, it controls the display 101 to display the first instruction dialog box "Regenerate subsequent content" for continuing to write the first text.

[0114] In order to improve the question-answering effect and the accuracy of the question-answering, on the basis of the above embodiments, in the embodiment of the present application, the processor 102 is further configured to:

[0115] If an input for selecting a second text in the first reply text is received, and the second text does not contain the first character, controlling the display 101 to display a second instruction dialog box for replacing the second text;

[0116] If a click operation on the second instruction dialog box is received, generating a third text that is synonymous with the second text and has different content according to the large language model;

[0117] The second text in the first reply text is replaced according to the third text to obtain a third reply text.

[0118] In an embodiment of the present application, the terminal may also use a large language model to replace part of the text in the first reply text.

[0119] Specifically, the user can select part of the text in the first reply text. For the convenience of description, in the embodiment of the present application, the selected text is referred to as the second text. After receiving the selection operation input by the user, the processor 102 of the terminal determines whether the second text contains the first character of the first reply text. If it is determined that the second text does not contain the first character, the processor 102 predicts that an update operation may be performed on the second text. The controller 102 controls the display 101 to display a second instruction dialog box for replacing the second text.

[0120] The user inputs an update instruction to the terminal by clicking on the second instruction dialog box. If the processor 102 receives the click operation on the second instruction dialog box, the large language model is called to generate a third text that is synonymous with the second text but has different content, and the third text is used to replace the second text in the first reply text to obtain a third reply text.

[0121] Specifically, in the embodiment of the present application, the processor 102 stores a prompt for prompting the large language model to generate synonymous content. The processor 102 can splice the prompt for prompting the large language model to generate synonymous content with the second text and the first reply text, and input the spliced content into the large language model to obtain a third text that is synonymous with the second text but has different content output by the large language model.

[0122] Among them, the prompt for prompting the large language model to generate synonymous content can be "You are now a text editing expert, and your current task is to perform synonymous substitution on the content selected by the user in combination with the article content."

[0123] The following is illustrated with a specific embodiment. Figure 6 It is a schematic diagram of the display of the display provided by the embodiment of the present application. As shown in Figure 6 the figure, the first reply text is: "The polar bear is known as the king of Arctic animals, mainly for the following reasons: 1. Size and strength: The polar bear is one of the largest land carnivorous mammals in the world. The weight of an adult polar bear can reach 500 to 1500 kilograms. Its powerful strength and size enable it to occupy the top position in the Arctic food chain. 2. Hunting ability: The polar bear is an excellent hunter, especially good at hunting seals. They can swim in the water for a long time and even dive in the icy sea water for several minutes, which enables them to track and capture prey. 3. Adaptability: The polar bear has adapted to the extremely cold environment and has a thick layer of fat and dense hair, which enables it to survive and reproduce in the harsh Arctic environment. 4. Ecological role: As a top predator, the polar bear plays an important role in maintaining ecological balance. Their hunting activities help control the prey population and maintain the health of the marine ecosystem. 5. Symbolic meaning: Due to its unique living environment and powerful image, the polar bear has become one of the most representative species in the Arctic region and is often regarded as a symbol of strength and adaptability. Therefore, considering these factors comprehensively, the polar bear is known as the king of Arctic animals." The second text selected by the user through the selection operation is "thick". At this time, the second instruction dialog box "Regenerate selected content" is displayed on the display 101. If a click operation on this second instruction dialog box is received, the processor determines that the input to the large language model is:

[0124] "#You are now a text editing expert, and your current task is to perform synonymous substitution on the content selected by the user in combination with the article content. The content selected by the user is:

[0125] "thick"

[0126] The original text is, where the content selected by the user is marked with mask in the original text:

[0127] The polar bear is known as the king of Arctic animals for several reasons:

[0128] 1. Size and strength: The polar bear is one of the largest land carnivorous mammals in the world. The weight of an adult polar bear can reach 500 to 1500 kilograms. Its powerful strength and size enable it to occupy the top position in the Arctic food chain.

[0129] 2. Hunting ability: The polar bear is an excellent hunter, especially good at hunting seals. They can swim in the water for a long time and even dive in the icy sea water for several minutes, which allows them to track and capture their prey.

[0130] 3. Adaptability: The polar bear has adapted to the extremely cold environment, with a thick layer of fat and dense fur, which enables it to survive and reproduce in the harsh Arctic environment.

[0131] 4. Ecological role: As a top predator, the polar bear plays an important role in maintaining ecological balance. Its hunting activities help control the prey population and maintain the health of the marine ecosystem.

[0132] 5. Symbolic meaning: Due to its unique living environment and powerful image, the polar bear has become one of the most representative species in the Arctic region and is often regarded as a symbol of strength and adaptability.

[0133] Therefore, considering these factors comprehensively, the polar bear is hailed as the king of Arctic animals.

[0134] Please feedback the replaceable content of the user's selected content in JSON format. The replaceable content can be one or more. When the user selects A, the replaceable content is B or C. The JSON example is: {"user_select":A, "replace":[B,C]}.

[0135] The replaceable content of the currently selected content by the user is: {"user_select": "thick", "replace": [""]}.

[0136] In addition, in the embodiments of this application, during the process that the terminal obtains the third text with the same meaning but different content as the second text through the large language model, the mouse displayed on the display 101 can change to a "waiting" style, indicating that the operation of regenerating the selected content by the user is currently being executed and waiting for the backend to generate the content to be replaced.

[0137] Figure 7 For the schematic diagram of the mouse in the "waiting" style provided by the embodiments of this application, as shown Figure 7 in the figure, the mouse displayed on the display 101 can change to a circular shape, which is used to indicate that the operation of regenerating the selected content by the user is currently being executed and waiting for the backend to generate the content to be replaced.

[0138] In order to improve the question-answering effect and the accuracy of the question-answering, on the basis of the above embodiments, in the embodiment of the present application, the display 101 is further configured as follows:

[0139] Display every third text;

[0140] The processor 102 is specifically configured to:

[0141] receiving a selection operation of a target third text input by a user;

[0142] The target third text is used to replace the second text in the first reply text.

[0143] In an embodiment of the present application, when the large language model generates a third text that is synonymous with the second text but has different content, the number of third texts determined by the large language model may be multiple. In order to better meet the needs of users, the processor 102 of the terminal will control the display 101 to display each third text for user selection. The user inputs a selection operation for the target third text, and the processor 102 uses the target third text to replace the second text in the first reply text.

[0144] The target third text is one of each third text displayed on the display.

[0145] In the embodiment of the present application, the replacement operation is selected, and in the case of comprehensive overall semantics of the passage, corresponding replacement options for the words, phrases, short sentences, or whole sentences are generated by the large language model at the position of the words, phrases, short sentences, or whole sentences selected by the user, and the replacement is selected by the user.

[0146] In order to improve the question-answering effect and the accuracy of the question-answering, on the basis of the above embodiments, in the embodiment of the present application, the display 101 is further configured as follows:

[0147] Displays a text input box for entering text;

[0148] The processor 102 is further configured to:

[0149] If a fourth text input by the user based on the text input box is received, the fourth text is used to replace the second text in the first reply text to obtain a third reply text.

[0150] In order to improve the question-answering effect and accuracy, on the basis of the above embodiments, in an embodiment of the present application, the second text is one of a character, a word, a short sentence or a whole sentence.

[0151] In an embodiment of the present application, in order to make the Q&A more diversified and better meet user needs, in this embodiment of the present application, a text input box for inputting text is further displayed on the display 101 of the terminal. Based on this text input box, the user can input a fourth text that wants to replace the second text. After the processor 102 receives the fourth text input by the user, it uses the fourth text to replace the second text in the first reply text to obtain a third reply text.

[0152] Among them, in this embodiment of the present application, the second text is one of a character, a word, a short sentence, or a whole sentence.

[0153] Figure 8 This is a schematic diagram of the display of each third text and the text input box provided by the embodiment of the present application. As shown in this Figure 8 figure, the large language model determines that the third texts corresponding to the second text "thick" are "vigorous" and "thick". Then, the controller 101 of the terminal controls the display 102 to display "vigorous" and "thick". And, the controller 101 of the terminal controls the display 102 to display the text input box "Fill in manually". The user can select a suitable third text to replace the second text. The user can also select to fill in manually and manually edit the fourth text to replace the second text.

[0154] In Figure 8 this Fig. 9 basis, Fig. 9 This is a schematic diagram of the third reply text provided by the embodiment of the present application. As shown in this

[0155] In this embodiment of the present application, the determination process of the fourth text is the way of active editing by the user to achieve content replacement, that is, text text replacement.

[0156] In order to improve the Q&A effect and Q&A accuracy rate, on the basis of the above embodiments, in this embodiment of the present application, the display 101 is specifically configured to:

[0157] display the first reply text carrying a set identifier, where the set identifier is used to indicate that there are multiple choices at the current position;

[0158] The processor 102 is further configured to:

[0159] receive a selection operation on the set identifier in the currently displayed first reply text;

[0160] A fifth text before the set identifier in the first reply text is obtained, and the fifth text is continued according to the large language model to determine a fourth reply text; wherein the fourth reply text is different from the first reply text.

[0161] In an embodiment of the present application, during the generation process of the first reply text, or at the end of the generation, a setting prompt may be added to the first reply text to prompt that there are multiple choices at the current position. The user can generate a fourth reply text different from the first reply text by clicking on the setting prompt and taking the characters corresponding to the setting prompt as the starting point.

[0162] Based on this, in an embodiment of the present application, the user inputs a selection operation for setting an identifier. After receiving the selection operation, the processor 102 obtains the fifth text before the set identifier in the first reply text, and continues to write the fifth text according to the large language model to determine the fourth reply text; wherein the fourth reply text is different from the first reply text.

[0163] The process of the processor 102 continuing to write the fifth text based on the large language model is the same as the process of continuing to write the first text, which will not be described in detail here.

[0164] Fig.10 A schematic diagram of setting an identifier provided in an embodiment of the present application, such as the Fig.10 As shown, there are two set identifiers "①" and "②" in the first reply text. The user can generate various answers by clicking "①" and "②" by operating the mouse or touch operation. Among them, the various selection prompts presented here are when the perplexity reaches a certain threshold or the generation probability of the second candidate character is less than a certain threshold when the large language model is generated.

[0165] In order to improve the question-answering effect and the accuracy of question-answering, on the basis of the above embodiments, in the embodiment of the present application, the processor 102 is specifically configured as follows:

[0166] During the generation process of the first reply text, if it is determined that the preset multiple selection conditions are currently met, the setting identifier is added to the current position of the first reply text.

[0167] In an embodiment of the present application, during the generation process of the first reply text, or at the end of the generation, a setting prompt may be added to the first reply text to indicate that there are multiple options at the current location.

[0168] Among them, the effect of setting the prompt to actively prompt multiple answers is that the condition for the existence of the preset multiple choices can be that the confusion when selecting candidate characters during the generation process meets a certain threshold (the actual meaning is that the model does not know which of the candidate generated characters is more suitable, and the user is expected to try more) or that among the options to be selected, characters close to the highest probability of the candidate generated appear (the actual meaning is that in addition to the currently selected character with the highest probability to be generated, several other characters are also good choices, and the user can try to see which one meets the requirements better).

[0169] In actual implementation, if the above two conditions are met in either option, an identifier is set at the corresponding position of the generated character for user operation.

[0170] Among them, the calculation process of setting the prompt is mainly for the distribution of the probability distribution prediction generated when the large language model selects a new token during the generation process, that is, the output probability corresponding to each token in the vocabulary determined by the large language model, which can be expressed by a vector: out = [0.03, 0.001, 0.025, 0.0172, 0.321, 0.066...], where each dimension of the vector corresponds to a token in the vocabulary, and the value written in each dimension is the probability of the token corresponding to the dimension being output.

[0171] In the embodiment of the present application, during the character generation process, if at least one of the following preset multiple selection conditions is met, the large language model adds a setting identifier at the position of the character:

[0172] Condition 1 for multiple choices: The perplexity meets a certain threshold

[0173] Specifically, the electronic device is pre-configured with a perplexity threshold, and calculates the output probability corresponding to the top n tokens of the probability distribution, and the degree of deviation from the maximum output probability. The degree of deviation is determined as the perplexity corresponding to the current character. If the perplexity is less than the perplexity threshold, a set identifier is added at the position of the character, and the formula is as follows:

[0174]

[0175] Among them, θ1 represents the perplexity threshold, p i Indicates the output probability of the top n tokens, p max Represents the maximum output probability, where p max Can also be replaced by p e , p e It is expressed as the average output probability of the top n tokens.

[0176] Fig.11The determination flow chart of setting the identifier generation condition 1 provided in the embodiment of the present application is as follows: Fig.11 As shown, the process includes:

[0177] S1101: Obtain the output probability corresponding to each token in the vocabulary determined by the large language model at the current moment.

[0178] S1102: Determine the output probabilities of the top n ranked probability distributions.

[0179] S1103: Calculate the perplexity based on the first n output probabilities.

[0180] S1104: Determine whether the perplexity is less than the perplexity threshold, if so, execute S1105, if not, end.

[0181] S1105: Add diverse answer identifiers.

[0182] Condition 2 for multiple choices: The difference between the target token and the maximum output probability is within the preset threshold range.

[0183] Specifically, the large language model calculates the difference between the second largest output probability and the largest output probability. If the difference is less than a preset difference threshold, that is, the difference is within the preset threshold range, it is determined that condition two is met.

[0184] Fig.12 The determination flow chart of setting the identifier generation condition 2 provided in the embodiment of the present application is as follows: Fig.12 As shown, the process includes:

[0185] S1201: Obtain the output probability corresponding to each token in the vocabulary determined by the large language model at the current moment.

[0186] S1202: Determine the probabilities of the first two outputs with the highest probability.

[0187] S1203: Determine the difference between the two output probabilities.

[0188] S1204: Determine whether the difference is less than a preset difference threshold, if so, execute S1205, if not, end.

[0189] S1205: Add multiple answer identifiers.

[0190] Condition 3 for multiple choices: In the generation process of a large language model, there is a situation where the probability of generating a single token is high, but when generating subsequent tokens, the probability is low, resulting in a low joint probability distribution. For example, when generating the probability p of the sth character s , and the suboptimal probability is p s 'In the subsequent summary generation, the character generation probability p of s+1 and s+2 is s+1 、p s+2 And the probability p of generating characters s+1 and s+2 after selecting the suboptimal character for the sth character s+1 ' 、p s+2 ' The joint probability distribution of satisfies: s ×p s+1 ×p s+2 ≤p s ' ×p s+1 ' ×p s+2 ' , then a better generation path is generated at this time and provided to the user for selection, and the large language model can generate a selection identifier.

[0191] In order to improve the question-answering effect and the accuracy of the question-answering, on the basis of the above embodiments, in the embodiment of the present application, the display 101 is further configured as follows:

[0192] Displaying the first reply text and the fourth reply text;

[0193] The processor 102 is further configured to:

[0194] If a selection operation on the first reply text is received, outputting the first reply text;

[0195] If a selection operation on the fourth reply text is received, the fourth reply text is output.

[0196] In an embodiment of the present application, after the processor 102 of the terminal generates the fourth reply text based on the large language model, the display 101 of the terminal will display the first reply text and the fourth reply text, and the user can choose to output one of the first reply text and the fourth reply text.

[0197] Specifically, if the controller 102 receives a selection operation on the first reply text, the first reply text is output; if the controller 102 receives a selection operation on the fourth reply text, the fourth reply text is output.

[0198] Fig.13 A schematic diagram of a display showing two texts is provided for an embodiment of the present application, such as the Fig.13As shown, after the user clicks the setting mark "②" in the first reply text, the processor 102 generates a fourth reply text based on the breakpoint, and displays the fourth reply text on the right side of the first reply text. The user can click "Select this answer" during the generation process. After receiving the user's click operation, the processor 102 will eliminate the unselected reply text and present the selected reply text.

[0199] On the basis of the above embodiments, the embodiment of the present application further provides a question-answering method based on a large language model. The question-answering method based on a large language model is consistent with the methods in the above embodiments and will not be described in detail here. Fig.14 A schematic diagram of a question-answering process based on a large language model provided in an embodiment of the present application, the question-answering process based on a large language model includes:

[0200] S1401: Displaying a first reply text generated for a question text input by a user; if a selection operation of a first text starting from the first character of the first reply text is received from the user, displaying a first instruction dialog box for continuing to write the first text;

[0201] S1402: If a click operation on the first instruction dialog box is received, the first text is continued according to the large language model to determine a second reply text; wherein the second reply text is different from the first reply text.

[0202] In a possible implementation manner, continuing to write the first text according to the large language model to determine the second reply text includes:

[0203] Obtaining a saved target prompt word, wherein the target prompt word is a prompt word used when generating the first reply text;

[0204] The target prompt word is concatenated with the first text, and the obtained concatenated prompt word is input into the large language model, so that the large language model determines the second reply text according to the concatenated prompt word; wherein the second reply text includes the first text and the continuation text.

[0205] In a possible implementation manner, after displaying the first reply text generated for the question text input by the user, the method further includes:

[0206] If an input selection operation of a second text in the first reply text is received, and the second text does not contain the first character, a second instruction dialog box for replacing the first text is displayed;

[0207] If a click operation on the second instruction dialog box is received, generating a third text that is synonymous with the second text and has different content according to the large language model;

[0208] The second text in the first reply text is replaced with the third text to obtain a third reply text.

[0209] In a possible implementation, if the number of the third texts is at least two, before replacing the second text in the first reply text with the third text, the method further includes:

[0210] Display each third text, and receive a selection operation of a target third text input by a user;

[0211] The replacing the second text in the first reply text with the third text includes:

[0212] The target third text is used to replace the second text in the first reply text.

[0213] In a possible implementation, after receiving a click operation on the second instruction dialog box, the method further includes:

[0214] If a fourth text input by the user is received, the fourth text is used to replace the second text in the first reply text to obtain a third reply text.

[0215] In a possible implementation manner, the second text is one of a character, a word, a short sentence or a whole sentence.

[0216] In a possible implementation manner, after displaying the first reply text generated for the question text input by the user, the method further includes:

[0217] Receiving an input selection operation of a setting identifier in the currently displayed first reply text, wherein the setting identifier is used to indicate that there are multiple choices at the current position;

[0218] A fifth text before the set identifier in the first reply text is obtained, and the fifth text is continued according to the large language model to determine a fourth reply text; wherein the fourth reply text is different from the first reply text.

[0219] In a possible implementation, the process of determining the setting prompt includes:

[0220] During the generation process of the first reply text, if it is determined that the preset multiple selection conditions are currently met, the setting identifier is added to the current position of the first reply text.

[0221] In a possible implementation, the method further includes:

[0222] Displaying the first reply text and the second reply text;

[0223] If a selection operation on the first reply text is received, outputting the first reply text;

[0224] If a selection operation on the second reply text is received, the second reply text is output.

[0225] Based on the above embodiments, Fig.15 A schematic diagram of the structure of a question-answering device based on a large language model provided in an embodiment of the present application, the device comprising:

[0226] Processing module 1501 is used to display a first reply text generated for the question text input by the user; if a selection operation of a first text starting from the first character of the first reply text is received from the user, a first instruction dialog box for continuing to write the first text is displayed;

[0227] The continuation module 1502 is used to continue writing the first text according to the large language model to determine a second reply text if a click operation is received on the first instruction dialog box; wherein the second reply text is different from the first reply text.

[0228] In a possible implementation, the continuation module 1502 is specifically used to obtain a saved target prompt word, wherein the target prompt word is a prompt word used when generating the first reply text; concatenate the target prompt word with the first text, and input the obtained concatenated prompt word into the large language model, so that the large language model determines the second reply text according to the concatenated prompt word; wherein the second reply text includes the first text and the continuation text.

[0229] In a possible implementation, the processing module 1501 is further configured to display a second instruction dialog box for replacing the first text if an input selection operation for the second text in the first reply text is received and the second text does not contain the first character;

[0230] The device also includes:

[0231] The updating module 1503 is used for generating a third text which is synonymous with the second text but has different content according to the large language model if a click operation is received on the second instruction dialog box; and replacing the second text in the first reply text with the third text to obtain a third reply text.

[0232] In a possible implementation, if the number of the third texts is at least two, the processing module 1501 is further configured to display each third text and receive a selection operation of a target third text input by a user;

[0233] The updating module 1503 is specifically configured to replace the second text in the first reply text with the target third text.

[0234] In a possible implementation, the updating module 1503 is further configured to, if receiving a fourth text input by the user, replace the second text in the first reply text with the fourth text to obtain a third reply text.

[0235] In a possible implementation manner, the second text is one of a character, a word, a short sentence or a whole sentence.

[0236] In a possible implementation, the processing module 1501 is further configured to receive an input selection operation for a setting identifier in the currently displayed first reply text, wherein the setting identifier is used to indicate that there are multiple options at the current position;

[0237] The continuation module 1502 is further used to obtain a fifth text before the set identifier in the first reply text, and to continue writing the fifth text according to the large language model to determine a fourth reply text; wherein the fourth reply text is different from the first reply text.

[0238] In a possible implementation, the processing module 1501 is also used to display the first reply text and the second reply text; if a selection operation for the first reply text is received, the first reply text is output; if a selection operation for the second reply text is received, the second reply text is output.

[0239] In a possible implementation, the processing module 1501 is further configured to add the setting identifier at the current position of the first reply text if it is determined that a preset multiple selection condition is currently satisfied during the generation of the first reply text.

[0240] Based on the above embodiments, the present application also provides an electronic device, Fig.16 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Fig.16 As shown, it includes: a processor 1601, a communication interface 1602, a memory 1603 and a communication bus 1604, wherein the processor 1601, the communication interface 1602, and the memory 1603 communicate with each other through the communication bus 1604;

[0241] The memory 1603 stores a computer program. When the program is executed by the processor 1601, the processor 1601 executes the steps of the question-answering method based on a large language model as provided in the above-mentioned embodiments.

[0242] Since the principle of solving the problem by the above electronic device is similar to the question-answering method based on a large language model, the implementation of the above electronic device can refer to the embodiment of the method, and the repeated parts will not be repeated.

[0243] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface 1602 is used for communication between the above electronic device and other devices. The memory may include a random access memory (RAM) and may also include a non-volatile memory (NVM), such as at least one disk storage. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0244] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; it can also be a digital signal processing processor (Digital Signal Processing, DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.

[0245] On the basis of the above embodiments, an embodiment of the present invention further provides a computer-readable storage medium, which stores a computer program executable by a processor. When the program runs on the processor, the processor implements the steps of the question-answering method based on the large language model provided in the above embodiments.

[0246] 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 a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0247] 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 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 produce 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.

[0248] 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 including 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.

[0249] 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 in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0250] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A terminal, characterized in that: The terminal includes a display and a processor: The display is configured as: Display the first response text generated for the question text entered by the user; The processor is configured to: If a selection operation of a first text starting from the first character of the first reply text is received from the user, the display is controlled to display a first instruction dialog box for continuing to write the first text; If a click operation on the first instruction dialog box is received, the first text is continued according to the large language model to determine a second reply text; wherein the second reply text is different from the first reply text.

2. The terminal according to claim 1, characterized in that The processor is specifically configured to: Obtaining a saved target prompt word, wherein the target prompt word is a prompt word used when generating the first reply text; The target prompt word is concatenated with the first text, and the obtained concatenated prompt word is input into the large language model, so that the large language model determines the second reply text according to the concatenated prompt word; wherein the second reply text includes the first text and the continuation text.

3. The terminal according to claim 1, characterized in that: The processor is further configured to: If an input for selecting a second text in the first reply text is received, and the second text does not contain the first character, controlling the display to display a second instruction dialog box for replacing the second text; If a click operation on the second instruction dialog box is received, generating a third text that is synonymous with the second text and has different content according to the large language model; The second text in the first reply text is replaced according to the third text to obtain a third reply text.

4. The terminal according to claim 3, characterized in that: The display is further configured as: Display every third text; The processor is specifically configured to: receiving a selection operation of a target third text input by a user; The target third text is used to replace the second text in the first reply text.

5. The terminal according to claim 4, characterized in that: The display is further configured as: Displays a text input box for entering text; The processor is further configured to: If a fourth text input by the user based on the text input box is received, the fourth text is used to replace the second text in the first reply text to obtain a third reply text.

6. The terminal according to any one of claims 3-4, characterized in that: The second text is one of a character, a word, a short sentence or a whole sentence.

7. The terminal according to claim 1, characterized in that: The display is specifically configured as: Displaying a first reply text carrying a setting identifier, wherein the setting identifier is used to indicate that there are multiple options for the current location; The processor is further configured to: Receiving an input selection operation of the set identifier in the currently displayed first reply text; A fifth text before the set identifier in the first reply text is obtained, and the fifth text is continued according to the large language model to determine a fourth reply text; wherein the fourth reply text is different from the first reply text.

8. The terminal according to claim 7, characterized in that: The display is further configured as: Displaying the first reply text and the fourth reply text; The processor is further configured to: If a selection operation on the first reply text is received, outputting the first reply text; If a selection operation on the fourth reply text is received, the fourth reply text is output.

9. The terminal according to claim 7, characterized in that: The processor is specifically configured to: During the generation process of the first reply text, if it is determined that the preset multiple selection conditions are currently met, the setting identifier is added to the current position of the first reply text.

10. A question-answering method based on a large language model, characterized in that: The method comprises: Displaying a first reply text generated for the question text input by the user; if a selection operation of a first text starting from the first character of the first reply text is received from the user, displaying a first instruction dialog box for continuing to write the first text; If a click operation on the first instruction dialog box is received, the first text is continued according to the large language model to determine a second reply text; wherein the second reply text is different from the first reply text.