Text processing method and apparatus, and device and computer-readable storage medium

By generating query operation information, processing multiple subtexts to be queried in parallel, the problem of long and low efficiency in generating reply texts in the text generation model is solved, and the effect of efficiently generating multiple reply texts is achieved.

WO2025148356A1PCT designated stage expired Publication Date: 2025-07-17HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/116144
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-01-09
Filing Date
2024-08-30
Publication Date
2025-07-17

AI Technical Summary

Technical Problem

The existing text generation model takes a long time and is inefficient in generating reply text, and cannot efficiently process multiple text to be queried.

Method used

By generating query operation information, multiple subtexts to be queried are determined, and these subtexts are processed in parallel to shorten the generation time. Generative pre-trained Transformer model (GPT) is used to query the subtext in parallel.

Benefits of technology

It improves the efficiency of the text generation model to generate reply text, shortens the generation time, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024116144_17072025_PF_FP_ABST
    Figure CN2024116144_17072025_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of terminals. Provided are a text processing method and apparatus, and a device and a computer-readable storage medium. The method comprises: acquiring a text to be queried; on the basis of said text, generating query operation information, wherein the query operation information represents a query plan when said text is queried; on the basis of the query operation information, determining a plurality of sub-texts to be queried; and when a text generation model is used to perform first query processing on said plurality of sub-texts, performing parallel processing on at least two of said plurality of sub-texts. Therefore, the time during which a text generation model performs first query processing on a plurality of sub-texts to be queried is shortened, such that the time for generating a plurality of first sub-query results is shortened, thereby improving the efficiency of generation of the plurality of first sub-query results.
Need to check novelty before this filing date? Find Prior Art

Description

Text processing method, device, equipment and computer-readable storage medium

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on January 9, 2024, with application number 202410033263.6 and application name “A text processing method, device, equipment and computer-readable storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of terminals, and in particular to a text processing method, apparatus, device, and computer-readable storage medium. Background Art

[0003] With the development of natural language processing technology, text generation has gradually become a research hotspot in artificial intelligence. In the application of text generation technology, text generation models are typically used to process user questions and generate responses. However, due to the inherent characteristics of text generation models, responses are generated word by word, resulting in a long time-consuming and inefficient response generation.

[0004] Summary of the Invention

[0005] The present application provides a text processing method, apparatus, device and computer-readable storage medium, which shortens the time for a text generation model to perform first query processing on multiple sub-texts to be queried, thereby shortening the time for generating multiple first sub-query results (reply texts) and improving the efficiency of generating multiple first sub-query results.

[0006] In a first aspect, a text processing method is provided, comprising: obtaining a text to be queried; generating query operation information based on the text to be queried, wherein the query operation information represents a query plan when querying the text to be queried; determining a plurality of sub-texts to be queried based on the query operation information; performing a first query processing on the plurality of sub-texts to be queried using a text generation model, obtaining a first sub-query result corresponding to each sub-text to be queried, and outputting a plurality of first sub-query results, wherein the first query processing of at least two of the plurality of sub-texts to be queried is performed in parallel.

[0007] In an embodiment of the present application, the text to be queried is a text used to express information needs or solve problems; based on the text to be queried, the query operation information generated includes multiple query steps when querying the text to be queried; multiple sub-texts to be queried can be determined based on the query operation information, and when a text generation model is used for multiple sub-texts to be queried, at least two of the multiple sub-texts to be queried can be processed in parallel, shortening the time for the text generation model to perform the first query processing on the multiple sub-texts to be queried, and thereby shortening the time for the text generation model to generate multiple first sub-query results (reply texts), thereby improving the efficiency of the text generation model in generating reply texts; further, the time for users to wait for reviewing the reply text is shortened, thereby improving the user experience.

[0008] It should be understood that the text processing method provided in this application is applied to an electronic device, which may be a server or a terminal. When the electronic device is a terminal, the terminal may display and output the multiple first sub-query results on a display screen; when the electronic device is a server, the server may send the multiple first sub-query results to the user's terminal, and the terminal may display and output the received multiple first sub-query results on a display screen; wherein the display screen may be the terminal's own display screen or an external display screen connected to the terminal.

[0009] The query operation information at least includes the semantics of the text to be queried.

[0010] In one possible implementation, query operation information is generated based on the query text by: determining relevant information about the query text based on the query text; and generating query operation information based on the query text and the relevant information about the query text. The query operation information includes not only the semantics of the query text but also the semantics of the relevant information about the query text.

[0011] In an embodiment of the present application, the query text can be expanded to obtain relevant information of the query text, and then query operation information is generated based on the relevant information of the query text and the query text, thereby improving the richness and completeness of the query operation information obtained.

[0012] In a possible implementation, query operation information is generated based on the text to be queried. This can also be achieved by using an operation information generation model to process the text to be queried to obtain query operation information.

[0013] The query operation information includes not only the semantics of the text to be queried, but also the semantics of the related information of the text to be queried. The operation information generation model can be obtained by training the initial operation information generation model. The initial operation information generation model can be a neural network model containing ultra-large-scale parameters; of course, the initial operation information generation model can also be a deep neural network model with fewer parameters. Depending on the application scenario, a neural network model containing ultra-large-scale parameters or a deep neural network model with fewer parameters can be flexibly selected as the initial operation information generation model. The embodiments of this application do not specifically limit the initial operation information generation model.

[0014] Based on the above scheme, the text to be queried can be input into the operation information generation model. The operation information generation model processes the text to be queried to obtain the query operation information, which shortens the time to obtain the query operation information and improves the efficiency of obtaining the query operation information.

[0015] In one possible implementation, the operation information generation model is obtained by: obtaining sample text to be queried and sample query operation information corresponding to the sample text to be queried, the sample query operation information representing the query plan when querying the sample text to be queried; based on the sample text to be queried and the sample query operation information, training the initial operation information generation model to obtain the operation information generation model.

[0016] In an embodiment of the present application, a large number of question pairs can be obtained, each of which includes a question and an answer. The question can be used as a sample text to be queried, and in response to a user's editing operation, sample query operation information can be constructed based on the question and answer, or based only on the question. The sample query operation information can also be automatically constructed by the electronic device based on the question and answer, or automatically constructed by the electronic device based only on the question. The large number of question pairs can be input by the user, downloaded from the network in response to a user's acquisition instruction, or actively downloaded from the network by the electronic device.

[0017] In a possible implementation, determining multiple subtexts to be queried based on the query operation information can be achieved by: determining multiple initial subtexts to be queried from the query operation information; and using the multiple initial subtexts to be queried as multiple subtexts to be queried.

[0018] Based on the above scheme, the query operation information can be split and processed to obtain multiple initial subtexts to be queried. The initial subtexts to be queried are used as the subtexts to be queried, which simplifies the process of obtaining multiple subtexts to be queried and improves the efficiency of obtaining multiple subtexts to be queried.

[0019] In one possible implementation, multiple sub-texts to be queried are determined based on the query operation information, which can be achieved in the following manner: multiple initial sub-texts to be queried are determined from the query operation information; for each initial sub-text to be queried, a second query processing is performed on the initial sub-text to be queried through a search service to obtain a second sub-query result, and the second sub-query result and the initial sub-text to be queried are combined to obtain the sub-text to be queried.

[0020] Based on the above scheme, the initial sub-text to be queried and the second sub-query result corresponding to the initial sub-text to be queried are combined to obtain the sub-text to be queried, which improves the completeness and richness of the determined sub-text to be queried, and further improves the accuracy and completeness of the first sub-query result subsequently determined based on the sub-text to be queried.

[0021] In one possible implementation, a text generation model is used to perform first query processing on multiple sub-texts to be queried, and a first sub-query result corresponding to each sub-text to be queried is obtained. This can be achieved by using a generative pre-trained Transformer model (GPT) to perform first query processing on multiple sub-texts to be queried in parallel, and a first sub-query result corresponding to each sub-text to be queried is obtained, where the text generation model includes GPT.

[0022] Based on the above scheme, there is no need to consider whether there is a dependency relationship between multiple sub-texts to be queried. GPT is used to perform first query processing on multiple sub-texts to be queried in parallel to obtain the first sub-query result corresponding to each sub-text to be queried. This shortens the time required for GPT to perform first query processing on multiple sub-texts to be queried, thereby shortening the time taken by GPT to generate multiple first sub-query results and improving the efficiency of GPT in generating multiple first sub-query results (i.e., reply texts).

[0023] In one possible implementation, a text generation model is used to perform a first query processing on multiple sub-texts to be queried, and a first sub-query result corresponding to each sub-text to be queried is obtained. This can be achieved in the following way: when there is no dependency relationship between the multiple sub-texts to be queried, GPT is used to perform a first query processing on the multiple sub-texts to be queried in parallel, and a first sub-query result corresponding to each sub-text to be queried is obtained. The text generation model includes GPT.

[0024] In one possible implementation, a text generation model is used to perform a first query processing on multiple sub-texts to be queried, and a first sub-query result corresponding to each sub-text to be queried is obtained. This can be achieved in the following manner: when there is a dependency relationship between the multiple sub-texts to be queried, GPT is used to perform a first query processing on the multiple sub-texts to be queried, and a first sub-query result corresponding to each sub-text to be queried is obtained. The first query processing of at least two of the multiple sub-texts to be queried is performed in parallel, the number of the at least two sub-texts to be queried is less than the number of the multiple sub-texts to be queried, and the text generation model includes GPT.

[0025] Based on the above solution, when multiple sub-texts to be queried have dependencies among each other, some of the multiple sub-texts to be queried can be processed in parallel, thereby improving the flexibility of parallel processing.

[0026] In one possible implementation, when there is a dependency relationship between multiple sub-texts to be queried, GPT is used to perform a first query processing on the multiple sub-texts to be queried, and before obtaining the first sub-query result corresponding to each sub-text to be queried, it includes: when there is a dependency relationship between the multiple sub-texts to be queried, based on the dependency relationship, determining at least two sub-texts to be queried from the multiple sub-texts to be queried.

[0027] In one possible implementation, a text generation model is used to perform a first query processing on multiple sub-texts to be queried. Before obtaining the first sub-query result corresponding to each sub-text to be queried, it includes: based on the query operation information, determining whether there is a dependency relationship between the multiple sub-texts to be queried.

[0028] In a possible implementation, when a dependency relationship exists between multiple subtexts to be queried, multiple first subquery results are output based on the dependency relationship, wherein at least two of the multiple first subquery results are output in parallel.

[0029] In the above solution, when there are dependencies between multiple sub-texts to be queried, multiple first sub-query results can be output based on the dependencies, thereby ensuring the readability and coherence of the output multiple first sub-query results and improving the user experience.

[0030] In one possible implementation, obtaining the text to be queried can be achieved in the following manner: obtaining the information to be queried; when the format of the information to be queried is a text format, using the information to be queried as the text to be queried; when the format of the information to be queried is a non-text format, converting the format of the information to be queried to obtain the text to be queried.

[0031] The format of the information to be queried may include but is not limited to at least one of information formats such as text format, image format, and audio format.

[0032] In an embodiment of the present application, the information to be queried may be sent to the electronic device by other devices; of course, the information to be queried may also be obtained in response to a user's input operation; the information to be queried may also be generated by the electronic device according to an actual application scenario; in this way, at least one of the aforementioned methods may be used to obtain the information to be queried, thereby improving the flexibility of obtaining the information to be queried.

[0033] In a possible implementation, at least two first sub-query results among the multiple first sub-query results are output in parallel.

[0034] In an embodiment of the present application, when a text generation model is used and at least two sub-texts to be queried are processed in parallel, the first sub-query results corresponding to the at least two sub-texts to be queried can be output in parallel.

[0035] For example, when the text processing method is applied to a terminal, if the number of sub-texts to be queried is two, the terminal can use its own deployed text generation model to process the two sub-texts to be queried in parallel to obtain two first sub-query results, and output the two first sub-query results in parallel to the terminal's display screen for display. Specifically, when the two first sub-query results are output simultaneously by the text generation model, then outputting the two first sub-query results in parallel to the terminal's display screen for display means: displaying and outputting the two first sub-query results simultaneously on the terminal's display interface, with the start time of displaying the two first sub-query results being the same. When the two first sub-query results are output non-simultaneously by the text generation model, the first first sub-query result outputted by the text generation model can be outputted to the terminal's display screen for display; during the display of the first first sub-query result, i.e., before the first first sub-query result has finished displaying, if the text generation model outputs a second first sub-query result, the second first sub-query result can be displayed synchronously without waiting for the first first sub-query result to finish displaying, with the start times of displaying the two first sub-query results being different.

[0036] Based on the above solution, the two first sub-query results can be displayed to the user synchronously, which shortens the user's waiting time and improves the user experience.

[0037] For example, when the text processing method is applied to a server, if the number of the multiple sub-texts to be queried is two, the server can use its own deployed text generation model to process the two sub-texts to be queried in parallel to obtain two first sub-query results, and output the two first sub-query results in parallel to the terminal display screen for display. Specifically, when the two first sub-query results are output simultaneously by the text generation model, outputting the two first sub-query results in parallel means: sending the two first sub-query results to the terminal simultaneously; after the terminal receives the two first sub-query results, the two first sub-query results can be displayed simultaneously on the display screen interface; that is, the two first sub-query results can be seen on the display screen interface as being displayed simultaneously, i.e., the start time of displaying the two first sub-query results is the same, and there is no need to wait for the first first sub-query result to finish displaying before displaying the second first sub-query result.

[0038] When the two first sub-query results are not output simultaneously by the text generation model, the first first sub-query result output by the text generation model can be sent to the terminal; if the text generation model outputs the second first sub-query result during the process of sending the first first sub-query result, the second first sub-query result can be sent to the terminal; then the terminal can first display the received first first sub-query result, and in the process of displaying the first first sub-query result, if the second first sub-query result is received, the second first sub-query result can also be displayed; that is, on the display interface of the display screen, you can see that the first first sub-query result is displayed first, and in the process of displaying the first first sub-query result, that is, before the first first sub-query result is displayed, the second first sub-query result will also be displayed on the display interface, and there is no need to wait for the first first sub-query result to be displayed, and the second first sub-query result can be displayed synchronously.

[0039] Based on the above solution, the two first sub-query results can be displayed to the user synchronously, which shortens the user's waiting time and improves the user experience.

[0040] In a second aspect, a text processing method is provided, which is applied to a terminal, and the method includes: sending a query request for querying a text to be queried to a server in response to a target operation; receiving multiple first sub-query results sent by the server; wherein the multiple first sub-query results are obtained by the server generating query operation information based on the text to be queried in response to the query request, and using a text generation model to perform a first query processing on multiple sub-texts to be queried determined based on the query operation information, wherein the query operation information represents a query plan when querying the text to be queried; the first query processing of at least two of the multiple sub-texts to be queried is performed in parallel; and the multiple first sub-query results are displayed.

[0041] In a possible implementation, the query operation information is obtained by the server processing the query text using an operation information generation model.

[0042] In one possible implementation, the operation information generation model is obtained by the server obtaining sample text to be queried and sample query operation information corresponding to the sample text to be queried, and training the initial operation information generation model based on the sample text to be queried and the sample query operation information. The sample query operation information represents the query plan when querying the sample text to be queried.

[0043] In a possible implementation, at least two first sub-query results among the multiple first sub-query results are sent to the terminal in parallel by the server.

[0044] In a possible implementation, at least two first sub-query results among the multiple first sub-query results are displayed in parallel.

[0045] In one possible implementation, the multiple sub-texts to be queried are multiple initial sub-texts to be queried determined by the server from the query operation information; or, the multiple sub-texts to be queried are multiple initial sub-texts to be queried determined by the server from the query operation information, and for each initial sub-text to be queried, the server performs a second query processing on the initial sub-text to be queried through the search service to obtain a second sub-query result, and combines the second sub-query result with the initial sub-text to be queried.

[0046] In a possible implementation, the multiple first sub-query results are obtained by the server using a generative pre-trained model GPT to perform first query processing on multiple sub-texts to be queried in parallel, and the text generation model includes GPT.

[0047] In a possible implementation, the multiple first sub-query results are obtained by the server using GPT to perform first query processing on the multiple sub-texts to be queried in parallel when there is no dependency relationship between the multiple sub-texts to be queried, and the text generation model includes GPT.

[0048] In one possible implementation, multiple first sub-query results are obtained by the server using GPT to perform first query processing on the multiple sub-texts to be queried when there is a dependency relationship between the multiple sub-texts to be queried. The first query processing of at least two of the multiple sub-texts to be queried is performed in parallel, the number of at least two sub-texts to be queried is less than the number of the multiple sub-texts to be queried, and the text generation model includes GPT.

[0049] In a possible implementation, when there is a dependency relationship between multiple sub-texts to be queried, the server determines the at least two sub-texts to be queried from the multiple sub-texts to be queried based on the dependency relationship.

[0050] In a possible implementation, when there is a dependency relationship between multiple sub-texts to be queried, the server outputs the multiple first sub-query results to the terminal based on the dependency relationship.

[0051] In a third aspect, a text processing system is provided, which includes a server and a terminal, which are connected to the server, wherein: the terminal is used to send a query request for querying a text to be queried to the server in response to a target operation; the server is used to generate query operation information based on the text to be queried in response to the query request, wherein the query operation information represents a query plan when querying the text to be queried; based on the query operation information, multiple sub-texts to be queried are determined; a text generation model is used to perform a first query processing on the multiple sub-texts to be queried to obtain a first sub-query result corresponding to each sub-text to be queried, and the first query processing of at least two of the multiple sub-texts to be queried is performed in parallel; multiple first sub-query results are sent to the terminal; and the terminal is also used to receive the multiple first sub-query results sent by the server and display the multiple first sub-query results.

[0052] In a fourth aspect, a text processing device is provided, which includes: an acquisition unit for acquiring a text to be queried; a processing unit for generating query operation information based on the text to be queried, wherein the query operation information represents a query plan when querying the text to be queried; the processing unit is also used to determine multiple sub-texts to be queried based on the query operation information; the processing unit is also used to use a text generation model to perform a first query processing on the multiple sub-texts to be queried, and obtain a first sub-query result corresponding to each sub-text to be queried, and the first query processing of at least two of the multiple sub-texts to be queried is performed in parallel; and a communication unit is used to output multiple first sub-query results.

[0053] In a possible implementation, the processing unit is specifically configured to perform the following steps: processing the query text using an operation information generation model to obtain query operation information.

[0054] In one possible implementation, the processing unit is further used to perform the following steps: obtaining sample text to be queried and sample query operation information corresponding to the sample text to be queried, the sample query operation information representing the query plan when querying the sample text to be queried; based on the sample text to be queried and the sample query operation information, training the initial operation information generation model to obtain the operation information generation model.

[0055] In one possible implementation, the processing unit is specifically used to perform the following steps: determining multiple initial sub-texts to be queried from the query operation information; using the multiple initial sub-texts to be queried as multiple sub-texts to be queried; or, for each initial sub-text to be queried, performing a second query processing on the initial sub-text to be queried through a search service to obtain a second sub-query result, and combining the second sub-query result and the initial sub-text to be queried to obtain the sub-text to be queried.

[0056] In one possible implementation, the processing unit is specifically used to perform the following steps: using a generative pre-trained model GPT, performing a first query processing on multiple sub-texts to be queried in parallel, and obtaining a first sub-query result corresponding to each sub-text to be queried, and the text generation model includes GPT.

[0057] In one possible implementation, the processing unit is specifically used to perform the following steps: when there is no dependency relationship between multiple sub-texts to be queried, GPT is used to perform first query processing on multiple sub-texts to be queried in parallel to obtain a first sub-query result corresponding to each sub-text to be queried, and the text generation model includes GPT.

[0058] In one possible implementation, the processing unit is specifically used to perform the following steps: when there is a dependency relationship between multiple sub-texts to be queried, GPT is used to perform a first query processing on the multiple sub-texts to be queried to obtain a first sub-query result corresponding to each sub-text to be queried, the first query processing of at least two of the multiple sub-texts to be queried is performed in parallel, the number of at least two sub-texts to be queried is less than the number of multiple sub-texts to be queried, and the text generation model includes GPT.

[0059] In a possible implementation, the processing unit is further configured to perform the following steps: when a dependency relationship exists between the multiple sub-texts to be queried, determine at least two sub-texts to be queried from the multiple sub-texts to be queried based on the dependency relationship.

[0060] In a possible implementation, the processing unit is further configured to perform the following steps: based on the query operation information, determine whether there is a dependency relationship between the multiple sub-texts to be queried.

[0061] In a possible implementation, the communication unit is specifically configured to perform the following steps: when a dependency relationship exists between multiple sub-texts to be queried, output multiple first sub-query results based on the dependency relationship.

[0062] In one possible implementation, the acquisition unit is specifically used to perform the following steps: obtaining the information to be queried; when the format of the information to be queried is a text format, using the information to be queried as the text to be queried; when the format of the information to be queried is a non-text format, converting the format of the information to be queried to obtain the text to be queried.

[0063] In a possible implementation, at least two first sub-query results among the multiple first sub-query results are output in parallel.

[0064] In a fifth aspect, a text processing device is provided, which includes: a communication unit for sending a query request for querying a text to be queried to a server in response to a target operation; a communication unit for receiving multiple first sub-query results sent by the server; wherein the multiple first sub-query results are obtained by the server generating query operation information based on the text to be queried in response to the query request, and using a text generation model to perform a first query processing on multiple sub-texts to be queried determined based on the query operation information, wherein the query operation information represents a query plan when querying the text to be queried; the first query processing of at least two of the multiple sub-texts to be queried is performed in parallel; and a processing unit for displaying the multiple first sub-query results.

[0065] In a possible implementation, the device further includes an acquisition unit, which is used to obtain the text to be queried in response to the target operation; and the processing unit is further used to generate a query request carrying the text to be queried.

[0066] In a possible implementation, the query operation information is obtained by the server processing the query text using an operation information generation model.

[0067] In one possible implementation, the operation information generation model is obtained by the server obtaining sample text to be queried and sample query operation information corresponding to the sample text to be queried, and training the initial operation information generation model based on the sample text to be queried and the sample query operation information. The sample query operation information represents the query plan when querying the sample text to be queried.

[0068] In a possible implementation, at least two first sub-query results among the multiple first sub-query results are sent to the terminal in parallel by the server.

[0069] In a possible implementation, at least two first sub-query results among the multiple first sub-query results are displayed in parallel.

[0070] In one possible implementation, the multiple sub-texts to be queried are multiple initial sub-texts to be queried determined by the server from the query operation information; or, the multiple sub-texts to be queried are multiple initial sub-texts to be queried determined by the server from the query operation information, and for each initial sub-text to be queried, the server performs a second query processing on the initial sub-text to be queried through the search service to obtain a second sub-query result, and combines the second sub-query result with the initial sub-text to be queried.

[0071] In a possible implementation, the multiple first sub-query results are obtained by the server using a generative pre-trained model GPT to perform first query processing on multiple sub-texts to be queried in parallel, and the text generation model includes GPT.

[0072] In a possible implementation, the multiple first sub-query results are obtained by the server using GPT to perform first query processing on the multiple sub-texts to be queried in parallel when there is no dependency relationship between the multiple sub-texts to be queried, and the text generation model includes GPT.

[0073] In one possible implementation, multiple first sub-query results are obtained by the server using GPT to perform first query processing on the multiple sub-texts to be queried when there is a dependency relationship between the multiple sub-texts to be queried. The first query processing of at least two of the multiple sub-texts to be queried is performed in parallel, the number of at least two sub-texts to be queried is less than the number of the multiple sub-texts to be queried, and the text generation model includes GPT.

[0074] In a possible implementation, when there is a dependency relationship between multiple sub-texts to be queried, the server determines the at least two sub-texts to be queried from the multiple sub-texts to be queried based on the dependency relationship.

[0075] In a possible implementation, when there is a dependency relationship between multiple sub-texts to be queried, the server outputs the multiple first sub-query results to the terminal based on the dependency relationship.

[0076] In a sixth aspect, an electronic device is provided, which includes one or more processors and a memory, wherein the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute: obtaining a text to be queried; generating query operation information based on the text to be queried, wherein the query operation information represents a query plan when querying the text to be queried; determining multiple sub-texts to be queried based on the query operation information; using a text generation model, performing a first query processing on the multiple sub-texts to be queried, obtaining a first sub-query result corresponding to each sub-text to be queried, and outputting multiple first sub-query results, wherein the first query processing of at least two of the multiple sub-texts to be queried is performed in parallel.

[0077] Exemplarily, the electronic device is a server or a terminal.

[0078] In a possible implementation, one or more processors invoke computer instructions to enable the electronic device to execute: processing the query text using the operation information generation model to obtain query operation information.

[0079] In one possible implementation, one or more processors call computer instructions to enable the electronic device to execute: obtaining sample text to be queried and sample query operation information corresponding to the sample text to be queried, the sample query operation information representing a query plan when querying the sample text to be queried; and training an initial operation information generation model based on the sample text to be queried and the sample query operation information to obtain an operation information generation model.

[0080] In one possible implementation, one or more processors call computer instructions to cause the electronic device to execute: determining multiple initial sub-texts to be queried from query operation information; using the multiple initial sub-texts to be queried as multiple sub-texts to be queried; or, for each initial sub-text to be queried, performing a second query processing on the initial sub-text to be queried through a search service to obtain a second sub-query result, and combining the second sub-query result and the initial sub-text to be queried to obtain the sub-text to be queried.

[0081] In one possible implementation, one or more processors call computer instructions to enable the electronic device to execute: using a generative pre-trained model GPT, performing a first query processing on multiple sub-texts to be queried in parallel, and obtaining a first sub-query result corresponding to each sub-text to be queried, and the text generation model includes GPT.

[0082] In one possible implementation, one or more processors call computer instructions to enable an electronic device to execute: when there is no dependency between multiple sub-texts to be queried, use GPT to perform a first query processing on the multiple sub-texts to be queried in parallel to obtain a first sub-query result corresponding to each sub-text to be queried, and the text generation model includes GPT.

[0083] In one possible implementation, one or more processors call computer instructions to cause an electronic device to execute: when a dependency relationship exists between multiple sub-texts to be queried, using GPT, performing a first query processing on the multiple sub-texts to be queried, and obtaining a first sub-query result corresponding to each sub-text to be queried, the first query processing of at least two of the multiple sub-texts to be queried is performed in parallel, the number of the at least two sub-texts to be queried is less than the number of the multiple sub-texts to be queried, and the text generation model includes GPT.

[0084] In one possible implementation, one or more processors invoke computer instructions to cause the electronic device to execute: when there is a dependency relationship between multiple subtexts to be queried, determining at least two subtexts to be queried from the multiple subtexts to be queried based on the dependency relationship.

[0085] In a possible implementation, one or more processors invoke computer instructions to enable the electronic device to execute: determining whether a dependency relationship exists between multiple sub-texts to be queried based on the query operation information.

[0086] In a possible implementation, one or more processors invoke computer instructions to enable the electronic device to execute: when a dependency relationship exists between multiple subtexts to be queried, output multiple first sub-query results based on the dependency relationship.

[0087] In one possible implementation, one or more processors call computer instructions to enable the electronic device to execute: obtaining information to be queried; when the format of the information to be queried is a text format, using the information to be queried as the text to be queried; when the format of the information to be queried is a non-text format, converting the format of the information to be queried to obtain the text to be queried.

[0088] In a possible implementation, at least two first sub-query results among the multiple first sub-query results are output in parallel.

[0089] In a seventh aspect, an electronic device is provided, which includes one or more processors and a memory, wherein the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute: in response to a target operation, sending a query request for querying a text to be queried to a server; receiving multiple first sub-query results sent by the server; wherein the multiple first sub-query results are obtained by the server generating query operation information based on the text to be queried in response to the query request, and using a text generation model to perform a first query processing on multiple sub-texts to be queried determined based on the query operation information, wherein the query operation information represents a query plan when querying the text to be queried; the first query processing of at least two of the multiple sub-texts to be queried is performed in parallel; and the multiple first sub-query results are displayed.

[0090] In a possible implementation, the query operation information is obtained by the server processing the query text using an operation information generation model.

[0091] In one possible implementation, the operation information generation model is obtained by the server obtaining sample text to be queried and sample query operation information corresponding to the sample text to be queried, and training the initial operation information generation model based on the sample text to be queried and the sample query operation information. The sample query operation information represents the query plan when querying the sample text to be queried.

[0092] In a possible implementation, at least two first sub-query results among the multiple first sub-query results are sent to the terminal in parallel by the server.

[0093] In a possible implementation, at least two first sub-query results among the multiple first sub-query results are displayed in parallel.

[0094] In one possible implementation, the multiple sub-texts to be queried are multiple initial sub-texts to be queried determined by the server from the query operation information; or, the multiple sub-texts to be queried are multiple initial sub-texts to be queried determined by the server from the query operation information, and for each initial sub-text to be queried, the server performs a second query processing on the initial sub-text to be queried through the search service to obtain a second sub-query result, and combines the second sub-query result with the initial sub-text to be queried.

[0095] In a possible implementation, the multiple first sub-query results are obtained by the server using a generative pre-trained model GPT to perform first query processing on multiple sub-texts to be queried in parallel, and the text generation model includes GPT.

[0096] In a possible implementation, the multiple first sub-query results are obtained by the server using GPT to perform first query processing on the multiple sub-texts to be queried in parallel when there is no dependency relationship between the multiple sub-texts to be queried, and the text generation model includes GPT.

[0097] In one possible implementation, multiple first sub-query results are obtained by the server using GPT to perform first query processing on the multiple sub-texts to be queried when there is a dependency relationship between the multiple sub-texts to be queried. The first query processing of at least two of the multiple sub-texts to be queried is performed in parallel, the number of at least two sub-texts to be queried is less than the number of the multiple sub-texts to be queried, and the text generation model includes GPT.

[0098] In a possible implementation, when there is a dependency relationship between multiple sub-texts to be queried, the server determines the at least two sub-texts to be queried from the multiple sub-texts to be queried based on the dependency relationship.

[0099] In a possible implementation, when there is a dependency relationship between multiple sub-texts to be queried, the server outputs the multiple first sub-query results to the terminal based on the dependency relationship.

[0100] In an eighth aspect, a chip is provided, which is applied to an electronic device. The chip includes one or more processors, and the processor is used to call computer instructions to enable the electronic device to execute the first aspect or any one of the text processing methods in the first aspect, or to enable the electronic device to execute the second aspect or any one of the text processing methods in the second aspect.

[0101] In the ninth aspect, a computer-readable storage medium is provided, which stores a computer program code. When the computer program code is executed by an electronic device, the electronic device executes the first aspect or any one of the text processing methods in the first aspect, or the electronic device executes the second aspect or any one of the text processing methods in the second aspect.

[0102] In the tenth aspect, a computer program product is provided, which includes: computer program code, which, when executed by an electronic device, enables the electronic device to execute the first aspect or any one of the text processing methods in the first aspect, or enables the electronic device to execute the second aspect or any one of the text processing methods in the second aspect.

[0103] In an embodiment of the present application, query operation information is generated based on the text to be queried, and multiple sub-texts to be queried are determined based on the query operation information. When a text generation model is then used to perform first query processing on the multiple sub-texts to be queried, the first query processing is performed on at least two of the multiple sub-texts to be queried in parallel, thereby shortening the time for the text generation model to perform first query processing on the multiple sub-texts to be queried, thereby shortening the time for generating multiple first sub-query results, and improving the efficiency of generating multiple first sub-query results. There is no need to use a text generation model in the related art to directly process the text to be queried, which solves the problem of long time and low efficiency in generating reply text using a text generation model in the related art. BRIEF DESCRIPTION OF THE DRAWINGS

[0104] FIG1 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;

[0105] FIG2 is a software structure block diagram of the electronic device 100 according to an embodiment of the present application;

[0106] FIG3 is a schematic diagram showing the operation of a model decoder of a large model architecture in a text generation method provided in an embodiment of the present application;

[0107] FIG4 is a flow chart of a text generation method provided in an embodiment of the present application;

[0108] FIG5A is a schematic diagram of a target data structure in a text generation method provided in an embodiment of the present application;

[0109] FIG5B is a schematic diagram of query operation information in a text generation method provided in an embodiment of the present application;

[0110] FIG6A is a schematic diagram of a target data structure in another text generation method provided in an embodiment of the present application;

[0111] FIG6B is a schematic diagram of query operation information in another text generation method provided in an embodiment of the present application;

[0112] FIG7A is a schematic diagram of a target data structure in another text generation method provided in an embodiment of the present application;

[0113] FIG7B is a schematic diagram of query operation information in another text generation method provided in an embodiment of the present application;

[0114] FIG8 is a flow chart of another text generation method provided in an embodiment of the present application;

[0115] FIG9 is a flow chart of another text generation method provided in an embodiment of the present application;

[0116] FIG10 is a schematic diagram of the structure of an initial operation information generation model in a text generation method provided in an embodiment of the present application;

[0117] FIG11 is a schematic diagram of a UI interface in a text generation method provided in an embodiment of the present application;

[0118] FIG12 is a flow chart of a text generation method provided in another embodiment of the present application;

[0119] FIG13 is a schematic diagram showing multiple first sub-query results in a text generation method provided by an embodiment of the present application;

[0120] FIG14 is a schematic diagram showing multiple first sub-query results in another text generation method provided in an embodiment of the present application;

[0121] FIG15 is a schematic diagram showing multiple first sub-query results in a text generation method provided by another embodiment of the present application;

[0122] FIG16 is a schematic diagram showing multiple first sub-query results in another text generation method provided by another embodiment of the present application;

[0123] FIG17 is a flow chart of a text generation method provided in yet another embodiment of the present application;

[0124] FIG18 is a schematic diagram of a workflow of a text generation system provided in another embodiment of the present application;

[0125] FIG19 is a schematic structural diagram of a text processing device provided by an embodiment of the present application;

[0126] FIG20 is a schematic structural diagram of an electronic device provided in another embodiment of the present application. DETAILED DESCRIPTION

[0127] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0128] In the description of the embodiments of this application, unless otherwise specified, " / " means "or." For example, A / B can mean A or B. "And / or" in this document is simply a description of the association relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, or B exists alone. In addition, in the description of the embodiments of this application, "a plurality" means two or more than two.

[0129] In the following, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the technical features indicated. Therefore, a feature specified as "first," "second," or "third" may explicitly or implicitly include one or more of the features.

[0130] An embodiment of the present application provides an electronic device for executing the text processing method provided in the present application. In some embodiments of the present application, the electronic device may be a mobile phone, a tablet computer, a wearable device, an in-vehicle device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc., or may be other devices or apparatuses capable of text processing. The embodiments of the present application do not impose any restrictions on the specific type of the electronic device.

[0131] For example, FIG1 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.

[0132] As shown in Figure 1, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0133] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0134] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.

[0135] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0136] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly retrieve it from the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

[0137] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.

[0138] The processor 110 and the display screen 194 communicate via a DSI interface to implement the display function of the electronic device 100 .

[0139] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0140] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. The structures of Antenna 1 and Antenna 2 in Figure 1 are merely illustrative. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, Antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0141] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.

[0142] Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.

[0143] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0144] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be located on display screen 194. There are many types of pressure sensors 180A, such as resistive, inductive, and capacitive. A capacitive pressure sensor can include at least two parallel plates made of conductive material. When force is applied to pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 100 determines the intensity of the pressure based on this change in capacitance. When a touch operation is applied to display screen 194, electronic device 100 detects the touch intensity based on pressure sensor 180A. Electronic device 100 can also calculate the touch location based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch location but with different touch intensities can correspond to different operation instructions. For example, when a touch operation with an intensity less than a first pressure threshold is applied to a short message application icon, an instruction to view short messages is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to a short message application icon, an instruction to create a new short message is executed.

[0145] The touch sensor 180K is also called a "touch panel." The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen." The touch sensor 180K is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, in a location different from that of the display screen 194.

[0146] The buttons 190 include a power button, a volume button, and the like. The buttons 190 may be mechanical buttons or touch buttons. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.

[0147] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a microservice architecture, or a cloud architecture. In the embodiment of the present application, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 100.

[0148] FIG2 is a block diagram of the software structure of the electronic device 100 according to an embodiment of the present application.

[0149] It should be understood that the layered architecture can divide the software into several layers, each with a clear role and division of labor; the layers can communicate with each other through software interfaces.

[0150] As shown in Figure 2, the Android system can be divided into four layers: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer. The application layer can include a series of application packages.

[0151] As shown in FIG2 , the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short message.

[0152] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0153] As shown in FIG2 , the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.

[0154] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.

[0155] Content providers are used to store and retrieve data and make it accessible to applications. Data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0156] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.

[0157] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including answering, hanging up, etc.).

[0158] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0159] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically, without requiring user interaction. For example, the Notification Manager can be used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include displaying text messages in the status bar, emitting alert sounds, vibrating the device, or flashing indicator lights.

[0160] The Android runtime includes the core library and the virtual machine. The Android runtime is responsible for scheduling and management of the Android system.

[0161] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.

[0162] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.

[0163] The system library can include multiple functional modules, such as a surface manager, a media library, a 3D graphics processing library (such as the open graphics library for embedded systems (OpenGL ES)) and a 2D graphics engine (such as the skia graphics library (SGL)).

[0164] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.

[0165] The media library supports playback and recording of multiple audio and video formats, as well as still image files. It supports a variety of audio and video codecs, such as MPEG4, H.264, Moving Picture Experts Group Audio Layer III (MP3), Advanced Audio Coding (AAC), Adaptive Multi-Rate (AMR), Joint Photographic Experts Group (JPG), and Portable Network Graphics (PNG).

[0166] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0167] A 2D graphics engine is a drawing engine for 2D drawings.

[0168] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, and sensor driver.

[0169] For ease of understanding, the embodiment of the present application will take the electronic device shown in Figures 1 and 2 as an example, and combine the accompanying drawings and application scenarios to specifically explain the text processing method provided in the embodiment of the present application.

[0170] Currently, text generation models are widely used in the field of natural language processing. A text generation model can be a large model, which refers to a neural network model containing a super-large number of parameters. Among them, a large model can be, for example, the Generative Pre-Trained Transformer model (GPT). In the large model architecture, the model decoding uses an autoregressive decoder. The autoregressive decoder generates the response text in an autoregressive manner. The generation of the next word depends on the previous results, and each word in the response text can only be generated one by one.

[0171] Exemplarily, as shown in Figure 3, the model decoder in the large model architecture can first generate the four characters "公", "司", "发", "布" in sequence. Then, when generating the 5th character, it needs to rely on the 4 characters "公", "司", "发", "布" that have been generated. Among them, assuming that the 5th character generated is "新", then when generating the 6th character, it needs to rely on the 5 characters "公", "司", "发", "布", "新" that have been generated. Assuming that the 6th character generated is "款", then when generating the 7th character, it needs to rely on the 5 characters "司", "发", "布", "新", "款" that have been generated. Among them, the length of the processing window when generating the response text can be 5, and this length indicates that when generating the Nth character, the maximum number of generated characters that can be relied on is 5. N is a positive integer.

[0172] When the large model is applied to the text generation technology in the field of natural language processing, it usually receives a problem input by the user, inputs the problem into the large model, and the large model can understand and analyze the problem to generate a response text, and then presents the response text to the user. However, since the large model generates the response text character by character when processing the user's problem, it takes a long time to generate the response text and the efficiency is low.

[0173] Based on this, in the embodiments of the present application, a text generation method is provided. This method is applied to an electronic device, which can be a device with text processing functions. Exemplarily, for example, the electronic device can be a server or a terminal. As shown in Figure 4, this text generation method can be implemented through S301 to S304. The following will explain each step.

[0174] S301. Obtain the text to be queried.

[0175] Among them, the text to be queried is the text used to express information needs or solve problems; the text to be queried can be called a query or query text.

[0176] In the embodiments of the present application, the query text may be obtained in response to a user input operation. Of course, the query text may also be sent to the electronic device by another device; or the query text may be automatically generated by the electronic device based on the application scenario. In this way, the electronic device can obtain the query text based on at least one of the aforementioned methods, thereby increasing the flexibility of obtaining the query text.

[0177] Exemplarily, at time t1, the electronic device responds to the user's input operation, obtains the initial text to be queried, and uses the initial text to be queried as the text to be queried. It is also possible to obtain a first historical text to be queried before time t1 and within the target time from time t1, combine the first historical text to be queried and the initial text to be queried, and obtain the text to be queried; the target time can be, for example, 1 minute. Of course, it is also possible to obtain multiple historical first sub-query results corresponding to the first historical text to be queried, combine the first historical text to be queried, the initial text to be queried, and the multiple historical first sub-query results to obtain the text to be queried. It is also possible to obtain a second historical text to be queried that has a semantic association with the initial text to be queried from a database based on the initial text to be queried, and combine the initial text to be queried and the second historical text to be queried to obtain the text to be queried.

[0178] In a feasible implementation, the text to be queried may be a search keyword or phrase input by a user, which is used to find relevant web pages, documents or other information through a search.

[0179] Exemplarily, the text to be queried may be a search keyword entered by a user; the search keyword may be a product name or brand name entered by a user to find a specific product or products of different brands, for example, the search keyword may specifically be "Brand A TV"; the search keyword may also be the name of a movie or TV series to query information about the movie or TV series, for example, the name of the TV series may be "Three Lives XX"; the search keyword may also be a "character name", for example, a user may enter the name of a public figure or artist to find information about their life, achievements, works, etc.; the search keyword may also be geographic location information, for example, a user may enter an address location or landmark name to find basic information about the place.

[0180] In a feasible implementation, the text to be queried may also be a question input by a user, for obtaining answers to specific topics or questions.

[0181] For example, the text to be queried may be a question input by a user, for example, the question may be “Please introduce the four great inventions of China” or “Please introduce Chinese cuisine”.

[0182] S302: Generate query operation information based on the text to be queried.

[0183] The query operation information represents a query plan when querying the text to be queried; the query operation information includes multiple query steps when querying the text to be queried.

[0184] In an embodiment of the present application, semantic analysis can be performed on the query text to obtain relevant information of the query text, and query operation information can be generated based on the query text and the relevant information of the query text; of course, a pre-trained operation information generation model can also be called up, and the query text can be processed using the operation information generation model to obtain query operation information.

[0185] In a feasible implementation, the query operation information can be specifically understood as a natural language form for representing the target data structure of the query plan. The target data structure can be presented in the form of a graph, a table, a block diagram, etc. Among them, the target data structure can be a directed acyclic graph (DAG), abbreviated as a DAG graph. In the DAG graph, the nodes represent the steps in the query plan when querying the query text, and the edges in the DAG graph represent the dependencies between these steps. Exemplarily, the target data structures can be divided into three categories, and the following provides a detailed explanation of the three types of target data structures.

[0186] The first type of target data structure is a data structure that represents the independence between the various steps in the query plan, which can be called a "sub-data structure".

[0187] For example, the query text is "What should I do if I snore while sleeping?", and the target data structure is a query plan representing the query "What should I do if I snore while sleeping?". The target data structure is shown in FIG5A , and includes nodes 41 and 42. Nodes 41 and 42 represent steps in the query plan, and there is no dependency between nodes 41 and 42. Node 41 represents the step "Causes of snoring while sleeping," and node 42 represents the step "Treatments for snoring while sleeping." The query operation information is shown in FIG5B , and specifically may be "1. Causes of snoring while sleeping, 2. Treatments for snoring while sleeping."

[0188] The second type of target data structure is a data structure that represents that there is a dependency relationship between the various steps in the query plan and multiple steps depend on one step, which can be called a "total-part data structure".

[0189] For example, the query text is "Introduce China's Four Great Inventions," and the target data structure represents the query plan for the query "Introduce China's Four Great Inventions." The target data structure, as shown in FIG6A , includes nodes 51, 52, 53, 54, and 55. Nodes 51, 52, 53, 54, and 55 represent steps in the query plan, and nodes 52, 53, 54, and 55 are all dependent on node 51. Node 51 represents "List China's Four Great Inventions," node 52 represents "Introduce papermaking," node 53 represents "Introduce printing," node 54 represents "Introduce gunpowder," and node 55 represents "Introduce the compass." The query operation information, as shown in FIG6B , may specifically be "1. List China's Four Great Inventions; 2. Introduce papermaking; 3. Introduce printing; 4. Introduce gunpowder; 5. Introduce the compass."

[0190] The third type of target data structure is a data structure that represents the dependency between steps in the query plan and one step depends on multiple steps, which can be called a component-total data structure.

[0191] Exemplarily, the query text is "Which one has the largest screen, mobile phone A or mobile phone B?", and the target data structure is a query plan representing the query "Which one has the largest screen, mobile phone A or mobile phone B?". The target data structure is shown in FIG7A , and includes nodes 61, 62, and 63. Nodes 61, 62, and 63 represent steps in the query plan, and node 63 depends on nodes 61 and 62. Node 61 indicates "how big is the screen of mobile phone A," node 62 indicates "how big is the screen of mobile phone B," and node 63 indicates "whose screen is larger, mobile phone A or mobile phone B." The query operation information is shown in FIG7B , and specifically can be "1. How big is the screen of mobile phone A; 2. How big is the screen of mobile phone B; 3. Whose screen is larger, mobile phone A or mobile phone B."

[0192] In addition, the target data structure can also be obtained by combining at least two data structures of "sub-data structure", "total-sub-data structure" and sub-total data structure, for example, the target data structure can be "total-sub-total data structure" or "sub-total-sub-data structure".

[0193] The above solution generates query operation information based on the query text, which not only includes the original semantics of the query text, but also includes relevant information of the query text, thereby improving the richness and completeness of the generated query operation information.

[0194] S303: Determine multiple subtexts to be searched based on the query operation information.

[0195] The query operation information includes multiple query steps when querying the text to be queried. The multiple query steps depend not only on the semantic information of the text to be queried, but also on the relevant information of the text to be queried.

[0196] In an embodiment of the present application, each query step may be extracted from the query operation information, and the extracted query step may be used as an initial subtext to be queried. Based on the initial subtext to be queried, the subtext to be queried may be determined.

[0197] Specifically, the initial subtext to be queried can be used as the subtext to be queried; a second query process can also be performed on the initial subtext to be queried to obtain a second subquery result, with the initial subtext to be queried and the second subquery result being used as the subtext to be queried. The second query process is used to obtain a reply text corresponding to the initial subtext to be queried from the Internet, or to obtain a text that supplements the initial subtext to be queried (i.e., an expanded text of the initial subtext to be queried) from the Internet.

[0198] For example, as shown in FIG5B , the query operation information includes two query steps, namely "1. Causes of snoring while sleeping" and "2. Treatment methods for snoring while sleeping." The query steps can be used as the initial subtext to be queried. Thus, the first initial subtext to be queried is "1. Causes of snoring while sleeping," and the second initial subtext to be queried is "2. Treatment methods for snoring while sleeping." Taking the initial subtext to be queried as the subtext to be queried as an example, the number of subtexts to be queried is two, the first subtext to be queried is "1. Causes of snoring while sleeping," and the second subtext to be queried is "2. Treatment methods for snoring while sleeping."

[0199] Among them, taking the initial sub-text to be queried as an example, performing a second query processing on the initial sub-text to be queried to obtain a second sub-query result, and taking the initial sub-text to be queried and the second sub-query result as the sub-text to be queried, the first initial sub-text to be queried "1. Causes of snoring while sleeping" can be subjected to a second query processing to obtain the first second sub-query result; wherein, for example, the first second sub-query result can be "incorrect sleeping posture and too high body fat percentage", and "1. Causes of snoring while sleeping" and "incorrect sleeping posture and too high body fat percentage" can be combined to obtain the first sub-text to be queried; according to the same method as mentioned above, the second initial sub-text to be queried "2. Treatment methods for snoring while sleeping" is subjected to a second query processing to obtain the second second sub-query result, for example, the second second sub-query result can be "change sleeping posture, specifically can be..." and "lose weight, specifically can be...", and "2. Treatment methods for snoring while sleeping", "change sleeping posture, specifically can be..." and "lose weight, specifically can be..." can be combined to obtain the second sub-text to be queried.

[0200] The above scheme determines multiple sub-texts to be queried based on the query operation information, which is obviously different from simply splitting the text to be queried into multiple sub-texts to be queried. The multiple sub-texts to be queried determined based on the query operation information not only contain the original semantics of the text to be queried, but also contain relevant information of the text to be queried; in this way, the expansion of the text to be queried is achieved, the richness and completeness of the multiple sub-texts to be queried are improved, and the richness, completeness and accuracy of the reply text (i.e., multiple first sub-query results) subsequently determined based on the multiple sub-texts to be queried are further improved.

[0201] S304: Using a text generation model, perform first query processing on multiple sub-texts to be queried, obtain a first sub-query result corresponding to each sub-text to be queried, and output multiple first sub-query results. The first query processing of at least two sub-texts to be queried among the multiple sub-texts to be queried is performed in parallel.

[0202] The first query processing is different from the second query processing. The at least two sub-texts to be queried that need to be processed in parallel can be input into the text generation model simultaneously or sequentially.

[0203] In an embodiment of the present application, a text generation model may be used to perform a first query on multiple subtexts to be queried in parallel, obtaining a first subquery result corresponding to each subtext to be queried; wherein the number of at least two subtexts to be queried is the same as the number of the multiple subtexts to be queried. The text generation model may be GPT.

[0204] For example, the number of sub-texts to be queried may be two, the first sub-text to be queried is "1. Causes of snoring while sleeping", and the second sub-text to be queried is "2. Treatment methods for snoring while sleeping". "1. Causes of snoring while sleeping" and "2. Treatment methods for snoring while sleeping" may be input into the text generation model, so that the text generation model performs a first query processing on "1. Causes of snoring while sleeping" and "2. Treatment methods for snoring while sleeping" in parallel, obtaining a first sub-query result corresponding to "1. Causes of snoring while sleeping", such as "obesity, ..., sleeping posture problems, ..., muscle relaxation, ..., overwork", and a first sub-query result corresponding to "2. Treatment methods for snoring while sleeping", such as "weight loss, ..., changing sleeping posture, ..., avoiding alcohol, ..., paying attention to rest, ...".

[0205] Of course, it is also possible to consider whether there are dependencies between the multiple subtexts to be queried. If there are no dependencies between the multiple subtexts to be queried, the first query process can be performed on the multiple subtexts to be queried in parallel to obtain a first subquery result corresponding to each subtext to be queried; wherein the number of at least two subtexts to be queried is the same as the number of the multiple subtexts to be queried. If there are dependencies between the multiple subtexts to be queried, at least two subtexts to be queried can be determined from the multiple subtexts to be queried, and the number of at least two subtexts to be queried is less than the number of the multiple subtexts to be queried.

[0206] Specifically, if there are dependencies between multiple subtexts to be queried, the query operation rank of each subtext to be queried in the multiple subtexts to be queried can be determined based on the dependencies, and then whether the multiple query operation ranks have the same query operation rank. If the multiple query operation ranks have the same query operation rank, at least two subtexts to be queried are determined from the multiple subtexts to be queried; wherein the query operation rank of the at least two subtexts to be queried is the same, and the number of the at least two subtexts to be queried is less than the number of the multiple subtexts to be queried. If the multiple query operation ranks do not have the same query operation rank, at least two subtexts to be queried can be randomly determined from the multiple subtexts to be queried, and the number of the at least two subtexts to be queried is less than the number of the multiple subtexts to be queried.

[0207] Exemplarily, there is a dependency relationship between multiple sub-texts to be queried. For example, the number of multiple sub-texts to be queried can be 5, the first sub-text to be queried is "1. List the four great inventions of China", the second sub-text to be queried is "2. Introduce papermaking", the third sub-text to be queried is "3. Introduce printing", the fourth sub-text to be queried is "4. Introduce gunpowder", and the fifth sub-text to be queried is "5. Introduce the compass"; wherein, the dependency relationship represents that the second to fifth sub-texts to be queried depend on the first sub-text to be queried. Based on the dependency relationship, the query operation ranking of the first sub-text to be queried is determined to be "1", and the query operation rankings of the second to fifth sub-texts to be queried are all "2". The second to fifth sub-texts to be queried with query operation rankings of "2" can be used as sub-texts to be queried that need to be processed in parallel by the text generation model. The number of at least two sub-texts to be queried is 4. Among them, the first sub-text to be queried can be input into the text generation model first, and when the text generation model completes the first query processing of the first sub-text to be queried, or when the text generation model is performing the first query processing on the first sub-text to be queried, the second to fifth sub-texts to be queried can be input into the text generation model, so that the text generation model can perform the first query processing on the second to fifth sub-texts to be queried in parallel, and finally the first sub-query result corresponding to each sub-text to be queried can be obtained.

[0208] In an embodiment of the present application, based on the importance of the sub-text to be queried, at least two sub-texts to be queried whose importance meets the importance threshold can be determined from multiple sub-texts to be queried; wherein the number of the at least two sub-texts to be queried is less than the number of the multiple sub-texts to be queried.

[0209] It should be noted that the text generation model in the related art needs to understand and analyze the query text to generate the reply text word by word. The query text may be relatively complex, and it will take a lot of time to generate the reply text. In the embodiment of the present application, the text generation model can first generate query operation information based on the query text, and then determine multiple sub-texts to be queried based on the query operation information. Thereafter, the processing of at least two of the multiple sub-texts to be queried is performed in parallel, that is, the text generation model can generate first sub-query results corresponding to at least two sub-texts to be queried in parallel, which shortens the time spent on generating multiple first query results (reply texts) and improves the efficiency of generating multiple first query results (reply texts).

[0210] In an embodiment of the present application, a streaming output mode or a non-streaming output mode can be used to output the first sub-query result corresponding to each sub-text to be queried. Among them, the streaming output mode means that in the process of the text generation model processing the first query of multiple sub-texts to be queried, each time the text generation model outputs a word, the electronic device immediately outputs the word without waiting for the words generated later (that is, the text generation model is not required to output a complete answer, and the electronic device outputs the generated word each time the text generation model outputs a word). The non-streaming output mode means that after the text generation model completes the first query processing of multiple sub-texts to be queried and obtains multiple first sub-query results, the electronic device outputs the multiple first sub-query results (that is, the text generation model needs to output a complete answer, and the electronic device outputs the complete answer).

[0211] When the electronic device is a terminal, a plurality of first sub-query results can be displayed on a display screen using a streaming output method or a non-streaming output method. When the electronic device is a server, the server can transmit the plurality of first sub-query results to the terminal using a streaming output method or a non-streaming output method, so that the terminal can display the plurality of first sub-query results on a display screen. The display screen is the display screen of the terminal itself, and of course, the display screen can also be a display screen external to the terminal.

[0212] The above solution can flexibly select a streaming output mode or a non-streaming output mode according to the actual application scenario, and output the first sub-query result corresponding to each sub-text to be queried, thereby improving the flexibility of outputting multiple first sub-query results.

[0213] In the case where there are dependencies between multiple sub-texts to be queried, a streaming output method or a non-streaming output method can be adopted to output multiple first sub-query results based on the dependencies.

[0214] Exemplarily, the electronic device may be a terminal, and the terminal may display a user interface (UI) of the voice assistant or the generative search engine in response to a user's opening operation on the voice assistant or the generative search engine. Among them, the user can perform input operations on the UI interface, as shown in Figure 8. The acquisition module on the terminal can respond to the user's input operation to obtain the text to be queried, for example, the text to be queried can be "Introduce the Four Great Inventions of China", and then input the text to be queried into the construction module; the construction module can determine the query operation information based on the text to be queried, and determine multiple initial sub-texts to be queried based on the query operation information. Then, through the search service, the multiple initial sub-texts to be queried can be processed in parallel for the second query to obtain the second sub-query result corresponding to each initial sub-text to be queried; for each initial sub-text to be queried, the initial sub-text to be queried and the second sub-query result corresponding to the initial sub-text to be queried are combined to obtain the sub-text to be queried. For example, the number of the multiple sub-texts to be queried is 5, and the dependency relationship indicates that the 2nd to 5th sub-texts to be queried depend on the 1st sub-text to be queried. After the 5 sub-texts to be queried are input into the GPT, the 5 first sub-query results output by the GPT can be displayed on the display interface of the terminal display screen based on the dependency relationship. Among them, since the 2nd to 5th subtexts to be queried are dependent on the 1st subtext to be queried, the 1st first subquery result corresponding to the 1st subtext to be queried displayed on the display interface is arranged before the 1st first subquery results corresponding to the 2nd to 5th subtexts to be queried.

[0215] In the above scheme, when there is a dependency relationship between multiple sub-texts to be queried, a streaming output method or a non-streaming output method can be used to output multiple first sub-query results based on the dependency relationship, thereby ensuring the readability and coherence of the output multiple first sub-query results and improving the user experience.

[0216] An embodiment of the present application provides a text processing method, which includes obtaining a text to be queried; generating query operation information based on the text to be queried, wherein the query operation information represents a query plan when querying the text to be queried; determining multiple sub-texts to be queried based on the query operation information; performing a first query process on the multiple sub-texts to be queried using a text generation model, obtaining a first sub-query result corresponding to each sub-text to be queried, and outputting multiple first sub-query results, wherein the first query process for at least two of the multiple sub-texts to be queried is performed in parallel; thus, based on the query operation information generated by the text to be queried, multiple sub-texts to be queried are determined, and then when the text generation model is used to perform the first query process on the multiple sub-texts to be queried, the first query process is performed on at least two of the multiple sub-texts to be queried in parallel, thereby shortening the time it takes the text generation model to perform the first query process on the multiple sub-texts to be queried, thereby shortening the time it takes to generate the multiple first sub-query results, and improving the efficiency of generating the multiple first sub-query results. This method eliminates the need for the text generation model to directly process the text to be queried as in the related art, thereby solving the problem of long time and low efficiency in generating reply text using the text generation model in the related art.

[0217] Based on the foregoing embodiments, an embodiment of the present application provides a text generation method, which is applied to an electronic device. Exemplarily, the electronic device may be a device with a text processing function, such as a server or a terminal. As shown in FIG9 , the text generation method may be implemented through S701 to S712, and each step is described below.

[0218] It should be noted that, in the above embodiment, S301 can be implemented through S701 and S702, or through S701 and S703.

[0219] S701. Obtain information to be queried.

[0220] The format of the information to be queried includes but is not limited to at least one of text format, image format, and audio format.

[0221] In an embodiment of the present application, the information to be queried may be sent to the electronic device by other devices; of course, the information to be queried may also be obtained in response to a user's input operation; the information to be queried may also be generated by the electronic device according to an actual application scenario; in this way, at least one of the aforementioned methods may be used to obtain the information to be queried, thereby improving the flexibility of obtaining the information to be queried.

[0222] For example, the electronic device may be a terminal, and the user may perform input operations on a UI interface of the terminal's display screen, and the terminal may obtain the information to be queried in response to the user's input operations. Of course, the electronic device may also be a server, and the information to be queried may be obtained by the terminal and then sent to the server.

[0223] In the embodiment of the present application, the text to be queried can be determined based on the information to be queried. Specifically, it can be determined whether the information to be queried needs to be formatted according to the format of the information to be queried to determine the text to be queried.

[0224] It should be noted that S702 or S703 may be executed after S701.

[0225] S702: When the format of the information to be queried is text format, the information to be queried is used as text to be queried.

[0226] In an embodiment of the present application, the format of the information to be queried may be detected first. If the format of the information to be queried is a text format, the information to be queried may be used as the text to be queried so that the text to be queried can be processed subsequently.

[0227] S703: When the format of the information to be queried is non-text format, convert the format of the information to be queried to obtain the text to be queried.

[0228] In an embodiment of the present application, when the format of the information to be queried is at least one of other non-text formats such as image format, audio format, etc., the format of the information to be queried can be converted to obtain the text to be queried.

[0229] For example, when the format of the information to be queried is an image format, optical character recognition (OCR) can be performed on the information to be queried to obtain the text to be queried; when the format of the information to be queried is an audio format, speech-to-text conversion technology can be used to convert the information to be queried to obtain the text to be queried.

[0230] It should be noted that, in the above embodiment, S302 can be implemented through S704:

[0231] S704: Use the operation information generation model to process the query text to obtain query operation information.

[0232] The query operation information represents the query plan when querying the text to be queried.

[0233] In an embodiment of the present application, the query text can be input into the operation information generation model, which processes the query text and outputs query operation information. The operation information generation model is pre-trained.

[0234] For example, the text to be queried may be "Introduce the Four Great Inventions of China". By inputting the "text to be queried" into the operation information generation model, query operation information can be obtained. The query operation information is shown in FIG6B , for example, it may be "1. List the Four Great Inventions of China; 2. Introduce papermaking; 3. Introduce printing; 4. Introduce gunpowder; 5. Introduce the compass".

[0235] The operation information generation model can be obtained in the following ways:

[0236] Obtain sample text to be queried and sample query operation information corresponding to the sample text to be queried, where the sample query operation information represents a query plan when querying the sample text to be queried; train an initial operation information generation model based on the sample text to be queried and the sample query operation information to obtain an operation information generation model.

[0237] In an embodiment of the present application, a large number of question pairs can be obtained, each of which includes a question and an answer. The question can be used as a sample text to be queried, and in response to the user's editing operation, sample query operation information can be constructed based on the question and answer, or the query operation information can be constructed based only on the question. The sample query operation information can also be automatically constructed by the electronic device based on the question and answer, or automatically constructed by the electronic device based only on the question. The large number of question pairs can be input by the user, downloaded from the network in response to the user's acquisition instruction, or actively downloaded from the network by the electronic device.

[0238] For example, the question in the question pair could be "How to create a team", and the answer could be "Creating a team requires the following steps: 1. Clarify the team's goals and vision: The team needs to have a clear goal and vision, which helps team members understand what they are doing and provides them with motivation and direction. In addition, clear goals also help to establish common values ​​among team members. 2. Identify team members: Determine who has the appropriate skills and experience to contribute to the team. When selecting team members, take into account each member's personality and work style, and ensure that everyone has the opportunity to play to their strengths in the team as much as possible. 3. Establish open communication channels: Communication is key to the success of a team. Establishing effective communication channels ensures that team members are always connected and share information in a timely manner. Setting up a team chat group, mailing list, or using online collaboration tools (such as Slack or Microsoft) are good ways to establish effective communication. 4. Establish clear roles and responsibilities: Establishing clear roles and responsibilities can help team members understand their responsibilities and the responsibilities of other members. This helps reduce confusion and conflict and ensures that everyone focuses on the tasks within their job scope." Sample query operation information constructed based on questions and answers might include, for example, "1. What are the steps involved in establishing a team? 2. How do I clarify the team's goals and vision? 3. How do I identify team members? 4. How do I establish open communication channels? 5. How do I define clear roles and responsibilities?" In this sample query operation information, steps 2 through 5 are dependent on step 1.

[0239] In an embodiment of the present application, the initial operation information generation model can be a neural network model containing ultra-large-scale parameters, as shown in Figure 10. The architecture of the initial operation information generation model can be an "encoder-decoder architecture" or a "decoder architecture". Among them, the electronic device can input the sample text to be queried into the initial operation information generation model, and the initial operation information generation model can process the sample text to be queried to obtain the query operation information to be processed; it can also be filling the sample query operation information into a preset prompt template to obtain a prompt, and inputting the prompt into the initial operation information generation model, and the initial operation information generation model processes the prompt to obtain the query operation information to be processed. After obtaining the query operation information to be processed, a loss function can be used to compare the query operation information to be processed and the sample query operation information to obtain a comparison result. The model parameters of the initial operation information generation model are continuously updated according to the comparison result, and finally the operation information generation model is obtained.

[0240] It should be noted that, in the above embodiment, S303 can be implemented through S705 and S706, or through S705 and S707:

[0241] S705: Determine a plurality of initial subtexts to be searched from the query operation information.

[0242] In the embodiment of the present application, the query operation information may be split and processed to obtain a plurality of initial sub-texts to be queried.

[0243] Specifically, the query operation information can be split based on the target character to obtain multiple initial sub-texts to be queried; the target character can be a punctuation mark. Of course, the query operation information can also be split based on the context of the query operation information to obtain multiple initial sub-texts to be queried.

[0244] Exemplarily, punctuation marks may be "." and ";". As shown in FIG6B , the query operation information may be split according to the punctuation marks "." and ";" in the query operation information to obtain multiple initial sub-texts to be queried; among them, the first initial sub-text to be queried is "1. List the four great inventions of China", the second initial sub-text to be queried is "2. Introduce papermaking", the third initial sub-text to be queried is "3. Introduce printing", the fourth initial sub-text to be queried is "4. Introduce gunpowder", and the fifth initial sub-text to be queried is "5. Introduce the compass".

[0245] It should be noted that S706 or S707 may be executed after S705.

[0246] S706: Use the multiple initial subtexts to be queried as multiple subtexts to be queried.

[0247] The above solution uses multiple initial subtexts to be queried as multiple subtexts to be queried, which simplifies the process of obtaining multiple subtexts to be queried and improves the efficiency of obtaining multiple subtexts to be queried.

[0248] S707 : For each initial subtext to be queried, perform a second query process on the initial subtext to be queried through the search service to obtain a second subquery result, and combine the second subquery result with the initial subtext to be queried to obtain the subtext to be queried.

[0249] Among them, the search service is a module deployed on electronic devices that collects and organizes information.

[0250] In the embodiment of the present application, a search service may be used to perform second query processing on multiple initial subtexts to be queried in parallel to obtain a second subquery result corresponding to each initial subtext to be queried.

[0251] For example, as shown in FIG11 , the electronic device is a terminal, and the user can input in the UI interface of the terminal display screen. As shown in FIG12 , the terminal can obtain the information to be queried in response to the user's input operation, and determine the text to be queried based on the information to be queried, wherein the text to be queried can be “Introduce the Four Great Inventions of China”. Then, the text to be queried can be input into the operation information generation model. The operation information generation model processes the text to be queried to obtain query operation information, and splits the query operation information to obtain multiple initial sub-texts to be queried. The first initial sub-text to be queried (i.e., the first initial sub-query) is “List the Four Great Inventions of China”. The first initial sub-query is generated by the search service. The second sub-query result obtained by performing the second query processing on the sub-text to be queried may be, for example, "The four great inventions of China are the compass, papermaking, printing, and gunpowder". The first initial sub-text to be queried and the second sub-query result corresponding to the first initial sub-text to be queried are combined to obtain the first sub-text to be queried, that is, the first sub-query; the second initial sub-text to be queried (that is, the second initial sub-query) is "2. Introduce papermaking". The second sub-query result obtained by performing the second query processing on the second initial sub-text to be queried through the search service may be, for example, "Papermaking was invented in the Western Han Dynasty..." The second initial sub-text to be queried and the second initial sub-query are combined. The second sub-query results corresponding to the text are combined to obtain the second sub-text to be queried, that is, the second sub-query; the third initial sub-text to be queried (that is, the third initial sub-query) is "3. Introduce printing technology". The second sub-query result obtained by performing the second query processing on the third initial sub-text to be queried through the search service can be, for example, "Printing technology is one of the inventions of the working people in ancient China. Woodblock printing technology was invented in..." The third initial sub-text to be queried and the second sub-query results corresponding to the third initial sub-text to be queried are combined to obtain the third sub-text to be queried, that is, the third sub-query; the fourth initial sub-text to be queried (that is, the fourth initial sub-query) y) is "Introduce gunpowder." The search service performs a second query on the fourth initial query subtext to obtain a second subquery result, such as "Gunpowder, as the name suggests, can be made of sparks, flames, etc." The fourth initial query subtext and the second subquery result corresponding to the fourth initial query subtext are combined to obtain the fourth query subtext, i.e., the fourth subquery. The fifth initial query subtext (i.e., the fifth initial subquery) is "Introduce the compass." The search service performs a second query on the fifth initial query subtext to obtain a second subquery result, such as "The compass, called Sinan in ancient times, has the following main components..."", combine the fifth initial sub-text to be queried with the second sub-query result corresponding to the fifth initial sub-text to be queried to obtain the fifth sub-text to be queried, that is, the fifth sub-query.

[0252] Based on the above scheme, for each initial sub-text to be queried, the initial sub-text to be queried and the second sub-query result corresponding to the initial sub-text to be queried are combined to obtain the sub-text to be queried, thereby improving the completeness of the determined sub-text to be queried, and further improving the accuracy and completeness of the subsequent first sub-query result determined based on the sub-text to be queried.

[0253] Furthermore, the multiple sub-texts to be queried contain not only the meaning of the queried text itself, but also relevant information about the queried text and the aforementioned second sub-query result. When the text generation model processes the multiple sub-texts to be queried, for example, it can supplement the second sub-query result to obtain the first sub-query result. This shortens the time it takes for the text generation model to generate the multiple first sub-query results, improving their efficiency and accuracy. The second sub-query result can be the reply text corresponding to the initial queried sub-text.

[0254] S708 : Using the generative pre-training model GPT, perform first query processing on multiple sub-texts to be queried in parallel to obtain a first sub-query result corresponding to each sub-text to be queried.

[0255] Among them, text generation models include GPT.

[0256] In an embodiment of the present application, multiple sub-texts to be queried can be input into the GPT simultaneously or sequentially. The GPT can perform first query processing on the multiple sub-texts to be queried in parallel to obtain the first sub-query result corresponding to each sub-text to be queried. Wherein, the GPT performs the first query processing on the multiple sub-texts to be queried in parallel, which can be to start performing the first query processing on the multiple sub-texts to be queried at the same time; of course, the GPT performs the first query processing on the multiple sub-texts to be queried in parallel, or it can start processing the multiple sub-texts to be queried sequentially. For example, the GPT can start performing the first query processing on the N+1th sub-text to be queried while performing the first query processing on the Nth sub-text to be queried. When the GPT performs the first query processing on the last sub-text to be queried among the multiple sub-texts to be queried, the GPT's first query processing on the 1st sub-text to be queried has not yet ended.

[0257] Exemplarily, the number of multiple sub-texts to be queried can be 3, the first sub-text to be queried is "How big is the screen of mobile phone A", the second sub-text to be queried is "How big is the screen of mobile phone B", and the third sub-text to be queried can be "Whose screen is bigger, mobile phone A or mobile phone B?". The three sub-texts to be queried can be input into GPT at the same time, and the first sub-query result corresponding to the first sub-text to be queried can be, for example, "The screen size of mobile phone A is...", the first sub-query result corresponding to the second sub-text to be queried can be, for example, "The screen size of mobile phone B is...", and the first sub-query result corresponding to the third sub-text to be queried can be, for example, "The screen size of mobile phone A is smaller than the screen size of mobile phone B."

[0258] In the above scheme, GPT is used to perform first query processing on multiple sub-texts to be queried in parallel to obtain the first sub-query result corresponding to each sub-text to be queried, which shortens the time required for GPT to perform first query processing on multiple sub-texts to be queried, and further shortens the time taken by GPT to generate multiple first sub-query results, thereby improving the efficiency of GPT in generating multiple first sub-query results (i.e., reply texts).

[0259] S709: Determine whether there is a dependency relationship between the multiple sub-texts to be queried based on the query operation information.

[0260] In the embodiment of the present application, semantic analysis can be performed on the query operation information to determine whether there is a dependency relationship between multiple sub-texts to be queried. Of course, the determination of whether there is a dependency relationship between the sub-texts to be queried can also be based on the arrangement format of the target characters or steps in the query operation information. The target character can be a space.

[0261] For example, whether there is a dependency relationship between the sub-texts to be queried can be determined based on the arrangement format between the steps in the query operation information. For example, for the query operation information shown in FIG5B , after analyzing the query operation information, it can be seen that the first characters of the two steps in the query operation information are aligned. In this case, it can be determined that there is no dependency relationship between the two steps in the query operation information, that is, there is no dependency relationship between the sub-texts to be queried. For example, for the query operation information shown in FIG6B , after analyzing the query operation information, it can be seen that the first character of the first step is not aligned with the first characters of the other four steps. In this case, it can be determined that there is a dependency relationship between the sub-texts to be queried, and any step 2 to 4 depends on step 1. For example, for the query operation information shown in FIG7B , after analyzing the query operation information, it can be seen that the first characters of the first and second steps are aligned, but the first character of the third step is not aligned with the first characters of the first two steps. In this case, it is determined that there is a dependency relationship between the three sub-texts to be queried, and the third step depends on the first two steps.

[0262] S710 : When there is no dependency relationship between the multiple sub-texts to be queried, use GPT to perform a first query process on the multiple sub-texts to be queried in parallel to obtain a first sub-query result corresponding to each sub-text to be queried.

[0263] Among them, text generation models include GPT.

[0264] For example, the first subtext to be queried is "1. What to do if you snore while sleeping", and the second subtext to be queried is "2. Treatment methods for snoring while sleeping". There is no dependency relationship between the first subtext to be queried and the second subtext to be queried.

[0265] It should be noted that in S710, when there is no dependency relationship between multiple sub-texts to be queried, the process of using GPT to perform first query processing on multiple sub-texts to be queried in parallel to obtain the first sub-query result corresponding to each sub-text to be queried is the same as the process of using GPT to perform first query processing on multiple sub-texts to be queried in parallel to obtain the first sub-query result corresponding to each sub-text to be queried in S708. For details, please refer to the process of using GPT to perform first query processing on multiple sub-texts to be queried in parallel to obtain the first sub-query result corresponding to each sub-text to be queried in S708. The embodiments of the present application will not be repeated here.

[0266] S711 : When there is a dependency relationship between multiple sub-texts to be queried, use GPT to perform a first query process on the multiple sub-texts to be queried, and obtain a first sub-query result corresponding to each sub-text to be queried.

[0267] The first query processing of at least two of the multiple sub-texts to be queried is performed in parallel, the number of the at least two sub-texts to be queried is smaller than the number of the multiple sub-texts to be queried, and the text generation model includes GPT.

[0268] In an embodiment of the present application, when there is a dependency relationship between multiple sub-texts to be queried, at least two sub-texts to be queried that need to be subjected to the first query processing in parallel can be determined from the sub-texts to be queried, and the number of the at least two sub-texts to be queried is less than the number of the multiple sub-texts to be queried. Herein, the at least two sub-texts to be queried can be randomly extracted from the multiple sub-texts to be queried; or the at least two sub-texts to be queried can be determined from the multiple sub-texts to be queried based on the dependency relationship and / or the importance of the sub-texts to be queried. After obtaining the aforementioned at least two sub-texts to be queried, the at least two sub-texts to be queried can be input into the GPT based on the dependency relationship. Herein, if the N+1th sub-text to be queried depends on the Nth sub-text to be queried, the Nth sub-text to be queried can be input into the GPT first, and then the N+1th sub-text to be queried can be input into the GPT.

[0269] In a possible implementation, when there is a dependency relationship between multiple sub-texts to be queried, determining at least two sub-texts to be queried that require parallel first query processing from the sub-texts to be queried may be performed in the following manner:

[0270] In the case where a dependency relationship exists between the multiple sub-texts to be queried, at least two sub-texts to be queried are determined from the multiple sub-texts to be queried based on the dependency relationship.

[0271] In an embodiment of the present application, a query operation ranking for each of the multiple subtexts to be queried can be determined based on the dependency relationship, and at least two subtexts to be queried can be determined from the multiple subtexts to be queried based on the query operation ranking. The query operation ranking represents the order in which each subtext to be queried is searched when searching the multiple subtexts to be queried.

[0272] Specifically, when the query operation positions corresponding to multiple sub-texts to be queried have the same query operation position, the sub-texts to be queried corresponding to the same query operation position can be used as the sub-texts to be queried that need to be processed in parallel for the first query; when the query operation positions corresponding to multiple sub-texts to be queried do not have the same query operation position, at least two sub-texts to be queried that need to be processed in parallel can be randomly selected; of course, when the query operation positions corresponding to multiple sub-texts to be queried do not have the same query operation position, at least two sub-texts to be queried whose importance meets the importance condition can be determined from the multiple sub-texts to be queried based on the importance of the sub-texts to be queried, and they can be used as the sub-texts to be queried that need to be processed in parallel for the first query.

[0273] For example, the first subtext to be queried is "How big is the screen of mobile phone A?", the second subtext to be queried is "How big is the screen of mobile phone B?", and the third subtext to be queried can be "Which screen is bigger, mobile phone A or mobile phone B?". The dependency relationship indicates that the third subtext to be queried depends on the first and second subtexts to be queried. Therefore, it can be determined that the query operation rankings of the first and second subtexts to be queried are both "1," and the query operation ranking of the third subtext to be queried is 2. The first and second subtexts to be queried, both with query operation rankings of 1, can be used as subtexts to be queried that need to be processed in parallel. The first and second subtexts to be queried can be input into the GPT simultaneously. After the GPT outputs the first subquery result corresponding to the first subtext to be queried and the first subquery result corresponding to the second subtext to be queried, the third subtext to be queried is input into the GPT. In this way, the consistency and readability of the multiple first sub-query results output by GPT are guaranteed. The electronic device can output the multiple first sub-query results in the order in which GPT outputs the first sub-query results, thereby ensuring the readability of the output multiple first sub-query results and improving the user experience.

[0274] S712: Output multiple first sub-query results.

[0275] At least two of the multiple first sub-query results are output in parallel. The at least two first sub-query results may be output simultaneously or non-simultaneously.

[0276] In an embodiment of the present application, when there is no dependency relationship between multiple sub-texts to be queried, multiple first sub-query results can be output based on the order in which the GPT outputs the multiple first sub-query results.

[0277] Specifically, when there is no dependency relationship between multiple sub-texts to be queried, the electronic device can use a streaming output method or a non-streaming output method to output multiple first sub-query results based on the order in which the GPT outputs multiple first sub-query results.

[0278] In the case where there is no dependency relationship between multiple sub-texts to be queried, when using the streaming output method, for example, if GPT outputs the first character in the first first sub-query result at time t1, then the first character in the first first sub-query result is immediately output, and then the other characters in the first first sub-query result sequentially output by GPT will be output; when in the process of outputting the first first sub-query result, if GPT outputs the first character in the second first sub-query result, then the first character in the second first sub-query result is also immediately output, and then the other characters in the second first sub-query result sequentially output by GPT will be output. Among them, when the electronic device outputs multiple first sub-query results, the sorting order of the multiple first sub-query results is the same as the output order of GPT outputting multiple first sub-query results. Among them, the first first sub-query result and the second first sub-query result are output in parallel, but the start time of outputting the first first sub-query result and the start time of outputting the second first sub-query result are different; the start time of outputting the first first sub-query result is earlier than the start time of outputting the second first sub-query result.

[0279] Exemplarily, the electronic device is a terminal, the number of sub-texts to be queried is 2, the first sub-text to be queried is "1. What to do about snoring while sleeping", and the second sub-text to be queried is "2. Treatment methods for snoring while sleeping". There is no dependency relationship between the first sub-text to be queried and the second sub-text to be queried, and the streaming output method can be used to output 2 first sub-query results. For example, the first first sub-query result corresponding to the first sub-text to be queried can be "The main reasons for snoring while sleeping are as follows...", and the second first sub-query result corresponding to the second sub-text to be queried can be "Regarding the problem of snoring while sleeping, the following can be taken...". Among them, as shown in Figure 13, for example, if GPT first outputs the first character "针" in the second first sub-query result, then this "针" is immediately output to a display area (i.e., the first display area) on the display interface of the terminal's display screen, and then the other characters in the second first sub-query result sequentially output by GPT will be output to this first display area; among them, when GPT is in the process of outputting the second first sub-query result, if GPT outputs the first character "睡" in the first first sub-query result, then this "睡" is also immediately output to another display area on the display interface, that is, the second display area, and then the other characters in the first first sub-query result output by GPT will be output to the second display area. In this way, for the text to be queried, the user can see the synchronous generation of text in multiple paragraphs on the display interface, and finally can see the complete multiple first sub-query results (i.e., the reply text; each paragraph corresponds to 1 first sub-query result) output.

[0280] In the case where there is no dependency between the multiple sub-texts to be queried, when a non-streaming output method is used, for example, if GPT outputs the first word in the first first sub-query result at time t1, the electronic device does not output the word and needs to wait for GPT to fully output the multiple first sub-query results before outputting the complete multiple first sub-query results. When the electronic device outputs the multiple first sub-query results, the arrangement order of the multiple first sub-query results is the same as the output order of the multiple first sub-query results output by GPT. The multiple first sub-query results can be output simultaneously, that is, the start time of outputting the multiple first sub-query results is the same.

[0281] For example, the electronic device is a terminal. The first first sub-query result corresponding to the first sub-text to be queried may be "The main reasons for snoring during sleep are as follows...", and the second first sub-query result corresponding to the second sub-text to be queried may be "To address the problem of snoring during sleep, you can take the following measures...". For example, if the GPT first outputs the first character "sleep" in the first first sub-query result, it does not output "sleep". Instead, it waits until the GPT outputs the complete first first sub-query result and the complete second first sub-query result before outputting the complete first first sub-query result and the complete second first sub-query result to the display interface of the terminal's display screen. As shown in FIG14 , the complete first first sub-query result may be displayed in the first display area of ​​the display interface, and the complete second first sub-query result may be displayed in the second display area of ​​the display interface. Since the GPT outputs the first first sub-query result first, and then outputs the second first sub-query result during the process of outputting the first sub-query result, the first first sub-query result is displayed before the second first sub-query result on the display interface. As shown in Figure 14, the first and second first sub-query results can be displayed simultaneously. On the display interface, the user can see multiple paragraphs of text generated simultaneously, ultimately displaying the complete output of multiple first sub-query results. This eliminates the need to wait for the first first sub-query result to be fully displayed before displaying the second first sub-query result, shortening user waiting time and improving the user experience.

[0282] It should be noted that, when there is no dependency relationship between multiple sub-texts to be queried, when the electronic device is a server, the server can send multiple first sub-query results to the terminal using a streaming output method or a non-streaming output method, and the terminal can display the multiple first sub-query results on the display interface of the display screen; wherein, exemplarily, the terminal can display the multiple first sub-query results on the display interface of the display screen in the display method shown in Figure 13 or Figure 14.

[0283] In an embodiment of the present application, when there is a dependency relationship between multiple subtexts to be queried, a streaming output method or a non-streaming output method can be used to output multiple first subquery results based on the dependency relationship. At least two of the multiple first subquery results are output in parallel.

[0284] In the case where there is a dependency relationship between multiple sub-texts to be queried, when a streaming output method is used, for example, if GPT first outputs the first word in the first first sub-query result at time t1, then the first word in the first first sub-query result will be output immediately, and then the other words in the first first sub-query result outputted by GPT in sequence will be outputted; when in the process of outputting the first first sub-query result, if GPT outputs the first word in the second first sub-query result, then the first word in the second first sub-query result will be output immediately, and then the other words in the second first sub-query result outputted by GPT in sequence will be outputted. Among them, the second sub-text to be queried corresponding to the second first sub-query result depends on the first sub-text to be queried corresponding to the first first sub-query result. Among them, when the electronic device outputs multiple first sub-query results, the sorting order between the multiple first sub-query results is related to the query operation position of the multiple sub-texts to be queried. The first first subquery result and the second first subquery result are output in parallel, but the start time of outputting the first first subquery result is different from the start time of outputting the second first subquery result; the start time of outputting the first first subquery result is earlier than the start time of outputting the second first subquery result.

[0285] Exemplarily, the electronic device is a terminal, and there is a dependency relationship between multiple sub-texts to be queried. For example, the number of multiple sub-texts to be queried can be 5. The first sub-text to be queried is "1. List the four great inventions of China", the second sub-text to be queried is "2. Introduce papermaking", the third sub-text to be queried is "3. Introduce printing", the fourth sub-text to be queried is "4. Introduce gunpowder", and the fifth sub-text to be queried is "Introduce the compass". Among them, the dependency relationship indicates that the second to fifth sub-texts to be queried depend on the first sub-text to be queried, and a streaming output method can be used to output five first sub-query results. As shown in Figure 15, for example, GPT first outputs the first character "中" in the first first sub-query result corresponding to the first sub-text to be queried, and then immediately outputs this "中" to a display area (i.e., the first display area) on the display interface of the terminal's display screen. After that, the other characters in the first first sub-query result output by GPT will be sequentially output to this first display area. Later, when GPT outputs other first sub-query results, each character in the other first sub-query results output by GPT will also be immediately displayed and output to other display areas on the display interface. Since the second to fifth sub-texts to be queried depend on the first sub-text to be queried, the first first sub-query result is arranged before the first sub-query results corresponding to the second to fifth sub-texts to be queried. As shown in Figure 15, on the display interface, the user can see the synchronous generation of text in multiple paragraphs (for example, each display area can correspond to the text of a paragraph), and the generation of text in multiple paragraphs does not affect each other. Finally, the complete multiple first sub-query results can be seen. Among them, the start times of generating text in multiple paragraphs can be different.

[0286] When there is a dependency relationship between multiple sub-texts to be queried, when using a non-streaming output method, for example, if GPT first outputs the first character in the first first sub-query result at time t1, then this character is not output. It is necessary to wait until GPT completely outputs multiple first sub-query results, and then the electronic device outputs the complete multiple first sub-query results based on the dependency relationship. Among them, multiple first sub-query results can be output by the electronic device simultaneously, and the start times of outputting multiple first sub-query results are the same.

[0287] Exemplarily, the electronic device is a terminal. The first first sub-query result corresponding to the first sub-text to be queried can be "The four great inventions of China are papermaking, the compass, gunpowder, and..."; the second first sub-query result corresponding to the second sub-text to be queried can be "Papermaking is an important invention in ancient China, which made writing..."; the third first sub-query result corresponding to the third sub-text to be queried can be "The compass is another important invention in ancient China, which made..."; the fourth first sub-query result corresponding to the fourth sub-text to be queried can be "Gunpowder is a weapon invented by ancient Chinese alchemists for military purposes, and at the same time..."; the fourth first sub-query result corresponding to the fifth sub-text to be queried can be "Movable type printing is a technology for printing,...". Among them, for example, if GPT first outputs the first character "中" in the first first sub-query result, then this "中" is not output, but waits until GPT outputs the complete 5 first sub-query results, and then outputs the 5 first sub-query results to the display interface of the terminal's display screen; among them, as shown in Figure 16, the first first sub-query result can be displayed in the first display area of the display interface, the second first sub-query result can be displayed in the second display area of the display interface... the fifth first sub-query result can be displayed in the fifth display area; because the second to fifth sub-texts to be queried depend on the first sub-text to be queried, the first first sub-query result displayed on the display interface is ranked before the second to fifth first sub-query results. Among them, as shown in Figure 16, the 5 first sub-query results can be displayed simultaneously, and on the display interface, the user can see that the text of multiple paragraphs is generated simultaneously and synchronously (each first sub-query result corresponds to a paragraph), and finally the complete multiple first sub-query results output can be seen.

[0288] It should be noted that when there is a dependency relationship between multiple sub-texts to be queried, when the electronic device is a server, the server can adopt a streaming output method or a non-streaming output method, and send multiple first sub-query results to the terminal based on the dependency relationship. The terminal can display the multiple first sub-query results on the display interface of the display screen; among them, exemplarily, the terminal can display the multiple first sub-query results on the display interface of the display screen in the display manner shown in Figure 15 or Figure 16.

[0289] In the above solution, when there is a dependency relationship between multiple sub-texts to be queried, the dependency relationship between multiple sub-texts to be queried is considered, and multiple first sub-query results are output, which ensures the readability of the multiple first output results presented to the user, and avoids the situation that there is a dependency relationship between multiple sub-texts to be queried, but the paragraphs between the multiple first sub-query results presented to the user are chaotic, resulting in poor readability of the multiple first output results and reducing the user experience.

[0290] It should be noted that, for the description of the same steps and the same contents in the embodiment of the present application as in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.

[0291] A text processing method provided by an embodiment of the present application determines multiple sub-texts to be queried based on query operation information generated by a text to be queried, and then uses a text generation model to perform first query processing on the multiple sub-texts to be queried, and performs first query processing on at least two of the multiple sub-texts to be queried in parallel, thereby shortening the time it takes for the text generation model to perform first query processing on the multiple sub-texts to be queried, thereby shortening the time it takes to generate multiple first sub-query results, and improving the efficiency of generating multiple first sub-query results. It does not require the text generation model used in related technologies to directly process the text to be queried, and solves the problem of long time and low efficiency in generating reply text using a text generation model in related technologies.

[0292] The present invention provides a text processing method for an electronic device, such as a terminal. The text processing method provided in the present invention is described in detail below using the electronic device as a terminal. As shown in FIG17 , the text generation method can be implemented through S801 to S803 , each of which is described below.

[0293] S801: In response to a target operation, a query request for searching for a text to be queried is sent to a server.

[0294] The target operation may be an input operation, which includes at least one of text input, voice input, gesture input, and the like.

[0295] In an embodiment of the present application, the text to be queried can be obtained in response to the target operation, and a query request carrying the text to be queried can be generated and sent to the server.

[0296] The acquisition of the query text in response to the target operation can be achieved in the following ways:

[0297] In one feasible implementation, information to be queried can be obtained in response to a target operation; the format of the information to be queried includes, but is not limited to, at least one of a text format, an image format, and an audio format. When the information to be queried is in a text format, the information to be queried is used as the text to be queried; when the information to be queried is in a non-text format, the information to be queried is converted to obtain the text to be queried.

[0298] For example, a user can enter the content to be searched on the display interface of the terminal as shown in Figure 11. In response to the user's input operation, the terminal obtains the search text, generates a query request carrying the search text, and sends the query request to the server. The search text can be, for example, "Introduce the Four Great Inventions of China."

[0299] S802: Receive multiple first sub-query results sent by the server.

[0300] Among them, multiple first sub-query results are obtained by the server generating query operation information based on the text to be queried in response to the query request, and using a text generation model to perform first query processing on multiple sub-texts to be queried determined based on the query operation information. The query operation information represents the query plan when querying the text to be queried; the first query processing of at least two of the multiple sub-texts to be queried is performed in parallel.

[0301] In an embodiment of the present application, after receiving a query request, the server can generate query operation information based on the text to be queried in response to the query request, and determine multiple sub-texts to be queried based on the query operation information; use a text generation model to perform a first query processing on the multiple sub-texts to be queried, obtain a first sub-query result corresponding to each sub-text to be queried, and output multiple first sub-query results; the first query processing of at least two of the multiple sub-texts to be queried is performed in parallel.

[0302] It should be noted that the server "generates query operation information based on the text to be queried, determines multiple sub-texts to be queried based on the query operation information; uses a text generation model to perform a first query processing on the multiple sub-texts to be queried, and obtains a first sub-query result corresponding to each sub-text to be queried" can be specifically referred to the aforementioned embodiments S704~S711 or S302~S304, and the embodiments of this application will not be repeated here.

[0303] In an embodiment of the present application, regardless of whether there are dependencies between the multiple sub-texts to be queried, the server can use a streaming output method or a non-streaming output method to send multiple first sub-query results to the terminal. When there are dependencies between the multiple sub-texts to be queried, the server can use a streaming output method or a non-streaming output method to send multiple first sub-query results to the terminal based on the dependencies. At least two of the multiple first sub-query results are sent to the terminal in parallel by the server.

[0304] The at least two first sub-query results sent in parallel by the server may be: first sub-query results corresponding to the sub-text to be queried that are subjected to the first query processing in parallel.

[0305] It should be noted that the server sending the at least two first sub-query results in parallel may mean that the server sends the at least two first sub-query results simultaneously, or the server may send the at least two first sub-query results non-simultaneously. The server sending the at least two first sub-query results non-simultaneously may, for example, mean that the server sends the (N+1)th first sub-query result while sending the (N)th first sub-query result, i.e., the start time of sending the (N)th first sub-query result is different from the start time of sending the (N+1)th first sub-query result. N is a positive integer.

[0306] S803: Display multiple first sub-query results.

[0307] In an embodiment of the present application, a terminal may receive multiple first sub-query results sent by a server and output the multiple first sub-query results to a display screen; wherein the display screen may be a display screen of the terminal itself or a display screen connected to the terminal. At least two of the multiple first sub-query results may be displayed in parallel.

[0308] The terminal concurrently displays at least two of the plurality of first sub-query results, which may include: the terminal simultaneously displays the at least two first sub-query results; wherein the display of the at least two first sub-query results starts at the same time. In this manner, multiple paragraphs of text (each paragraph of text corresponding to a first sub-query result) can be seen on the terminal's display interface starting to be displayed word by word simultaneously.

[0309] Of course, the terminal can also display at least two of the multiple first sub-query results in parallel by: displaying the Nth first sub-query result while displaying the Nth first sub-query result; the at least two first sub-query results include the Nth first sub-query result and the N+1th first sub-query result; and the start time for displaying the Nth first sub-query result and the start time for displaying the N+1th first sub-query result are different. In this way, on the terminal's display interface, the text of a certain paragraph can be displayed word by word first. Before the text of that paragraph is completely displayed, the text of other paragraphs can also be displayed word by word to the user, and the user can see the text of multiple paragraphs being generated synchronously.

[0310] Based on the above solution, when the server uses the text generation model to perform first query processing on multiple sub-texts to be queried, the first query processing of at least two of the multiple sub-texts to be queried is performed in parallel, shortening the time to generate multiple first sub-query results. The multiple first sub-query results are sent to the terminal, and the at least two first sub-query results are displayed in parallel on the terminal's display interface. This shortens the time users have to wait to view multiple first sub-query results, improving the user experience.

[0311] It should be noted that, for the description of the same steps and the same contents in the embodiment of the present application as in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.

[0312] An embodiment of the present application provides a text processing method, comprising: sending a query request for querying a text to be queried to a server in response to a target operation; receiving multiple first sub-query results sent by the server; wherein the multiple first sub-query results are obtained by the server generating query operation information based on the text to be queried in response to the query request, and performing first query processing on multiple sub-texts to be queried determined based on the query operation information using a text generation model, wherein the query operation information represents a query plan for querying the text to be queried; performing first query processing on at least two of the multiple sub-texts to be queried in parallel; and displaying the multiple first sub-query results. In this way, when the server performs first query processing on the multiple sub-texts to be queried using the text generation model, the server performs first query processing on at least two of the multiple sub-texts to be queried in parallel, thereby shortening the time it takes the text generation model to perform first query processing on the multiple sub-texts to be queried, thereby shortening the time it takes to generate the multiple first sub-query results, and improving the efficiency of generating the multiple first sub-query results. This eliminates the need for the text generation model to directly process the text to be queried, as in the related art, and solves the problem of long time and low efficiency in generating response text using the text generation model in the related art.

[0313] Based on the above embodiments, embodiments of the present application provide a text processing system. The above text processing method can be applied in the system 9. As shown in FIG18 , the system 9 includes a server 91 and a terminal 92. The terminal 92 is connected to the server 91. The terminal 92 and the server 91 are configured to perform the following steps:

[0314] S901 : The terminal 92 sends a query request for searching for a text to be queried to a server in response to a target operation.

[0315] It should be noted that the implementation process of S901 is the same as the implementation process of S801 in the aforementioned embodiment. For details, please refer to the implementation process of S801 in the aforementioned embodiment, and the embodiment of this application will not be repeated here.

[0316] S902: The server 91 generates query operation information based on the query text in response to the query request, wherein the query operation information represents a query plan for querying the query text.

[0317] S903: The server 91 determines a plurality of subtexts to be searched based on the query operation information.

[0318] S904: The server 91 uses a text generation model to perform a first query process on the multiple sub-texts to be queried, and obtains a first sub-query result corresponding to each sub-text to be queried.

[0319] The first query processing of at least two sub-texts to be queried among the multiple sub-texts to be queried is performed in parallel.

[0320] It should be noted that S902 and S904 may specifically refer to S704 to S711 or S302 to S304 in the aforementioned embodiments, and will not be further elaborated in the embodiments of the present application.

[0321] S905 : The server 91 sends multiple first sub-query results to the terminal.

[0322] S906. The terminal 92 receives multiple first sub-query results sent by the server.

[0323] S907 . The terminal 92 displays multiple first sub-query results.

[0324] It should be noted that the implementation process of S907 is the same as the implementation process of S803 in the aforementioned embodiment. The specific implementation process of S907 can refer to the specific implementation process of S803, and the embodiment of this application will not be repeated here.

[0325] An embodiment of the present application provides a text processing system that, when using a text generation model to perform first query processing on multiple sub-texts to be queried, performs first query processing on at least two of the multiple sub-texts to be queried in parallel, thereby shortening the time it takes for the text generation model to perform first query processing on the multiple sub-texts to be queried, thereby shortening the time it takes to generate multiple first sub-query results, and improving the efficiency of generating multiple first sub-query results. It does not require the use of a text generation model in related technologies to directly process the query text, thereby solving the problem of long time and low efficiency in generating reply text using a text generation model in related technologies.

[0326] The following will describe in detail an embodiment of the text processing device of the present application in conjunction with Figure 19. It should be understood that the text processing device in the embodiment of the present application can execute the text processing method of the aforementioned embodiment, that is, the specific working processes of the various products below can refer to the corresponding processes in the aforementioned method embodiment.

[0327] FIG19 is a schematic structural diagram of a text processing device 10 provided in an embodiment of the present application. The text processing device 10 includes an acquisition unit 1011 , a processing unit 1012 , and a communication unit 1013 .

[0328] In one possible design, the text processing device 10 can be used to execute the steps or processes of the text processing method shown in Figures 4 and 9 above. The acquisition unit 1011 is used to acquire the text to be queried; the processing unit 1012 is used to generate query operation information based on the text to be queried, wherein the query operation information represents a query plan for querying the text to be queried; the processing unit 1012 is also used to determine multiple sub-texts to be queried based on the query operation information; the processing unit 1012 is also used to use a text generation model to perform a first query processing on the multiple sub-texts to be queried, obtaining a first sub-query result corresponding to each sub-text to be queried, wherein the first query processing of at least two of the multiple sub-texts to be queried is performed in parallel; and the communication unit 1013 is used to output the multiple first sub-query results.

[0329] Optionally, the processing unit 1012 is specifically configured to: process the query text using an operation information generation model to obtain query operation information.

[0330] Optionally, the processing unit 1012 is specifically used to: obtain the sample text to be queried and the sample query operation information corresponding to the sample text to be queried, the sample query operation information representing the query plan when querying the sample text to be queried; based on the sample text to be queried and the sample query operation information, train the initial operation information generation model to obtain the operation information generation model.

[0331] Optionally, the processing unit 1012 is specifically used to: determine multiple initial sub-texts to be queried from the query operation information; use the multiple initial sub-texts to be queried as multiple sub-texts to be queried; or, for each initial sub-text to be queried, perform a second query processing on the initial sub-text to be queried through a search service to obtain a second sub-query result, and combine the second sub-query result and the initial sub-text to be queried to obtain the sub-text to be queried.

[0332] Optionally, the processing unit 1012 is specifically configured to: employ a generative pre-trained model GPT to perform first query processing on a plurality of sub-texts to be queried in parallel, and obtain a first sub-query result corresponding to each sub-text to be queried, wherein the text generation model includes GPT.

[0333] Optionally, the processing unit 1012 is specifically used to: when there is no dependency relationship between multiple sub-texts to be queried, use GPT to perform first query processing on multiple sub-texts to be queried in parallel to obtain a first sub-query result corresponding to each sub-text to be queried, and the text generation model includes GPT.

[0334] Optionally, the processing unit 1012 is specifically used to: when there is a dependency relationship between multiple sub-texts to be queried, use GPT to perform first query processing on the multiple sub-texts to be queried, and obtain a first sub-query result corresponding to each sub-text to be queried, the first query processing of at least two of the multiple sub-texts to be queried is performed in parallel, the number of at least two sub-texts to be queried is less than the number of multiple sub-texts to be queried, and the text generation model includes GPT.

[0335] Optionally, the processing unit 1012 is further configured to: when a dependency relationship exists between the multiple sub-texts to be queried, determine at least two sub-texts to be queried from the multiple sub-texts to be queried based on the dependency relationship.

[0336] Optionally, the processing unit 1012 is further configured to determine whether a dependency relationship exists between the multiple sub-texts to be queried based on the query operation information.

[0337] In a possible implementation, the communication unit 1013 is specifically configured to: when a dependency relationship exists between multiple subtexts to be queried, output multiple first sub-query results based on the dependency relationship.

[0338] Optionally, the acquisition unit 1011 is specifically used to: acquire the information to be queried; when the format of the information to be queried is text format, use the information to be queried as the text to be queried; when the format of the information to be queried is non-text format, convert the format of the information to be queried to obtain the text to be queried.

[0339] In another possible design, the text processing device 10 can be used to execute the steps or processes executed by the terminal in the text processing method in Figures 17 and 18 above.

[0340] Specifically, the communication unit 1013 is used to send a query request for querying the text to be queried to the server in response to the target operation; the communication unit 1013 is used to receive multiple first sub-query results sent by the server; wherein the multiple first sub-query results are obtained by the server generating query operation information based on the text to be queried in response to the query request, and using a text generation model to perform a first query processing on multiple sub-texts to be queried determined based on the query operation information, and the query operation information represents the query plan when querying the text to be queried; the first query processing of at least two of the multiple sub-texts to be queried is performed in parallel; the processing unit 1012 is used to display the multiple first sub-query results.

[0341] Optionally, the device further includes an acquisition unit 1011, which is used to obtain the text to be queried in response to the target operation; and the processing unit 1012 is further used to generate a query request carrying the text to be queried.

[0342] Optionally, the query operation information is obtained after the server processes the query text using an operation information generation model.

[0343] Optionally, the operation information generation model is obtained by the server obtaining sample text to be queried and sample query operation information corresponding to the sample text to be queried, and training the initial operation information generation model based on the sample text to be queried and the sample query operation information. The sample query operation information represents the query plan when querying the sample text to be queried.

[0344] Optionally, at least two first sub-query results among the multiple first sub-query results are sent to the terminal in parallel by the server.

[0345] Optionally, at least two first sub-query results among the multiple first sub-query results are displayed in parallel.

[0346] Optionally, the multiple sub-texts to be queried are multiple initial sub-texts to be queried determined by the server from the query operation information; or, the multiple sub-texts to be queried are multiple initial sub-texts to be queried determined by the server from the query operation information, and for each initial sub-text to be queried, the server performs a second query processing on the initial sub-text to be queried through the search service to obtain a second sub-query result, and combines the second sub-query result and the initial sub-text to be queried.

[0347] Optionally, the multiple first sub-query results are obtained by the server using a generative pre-trained model GPT to perform first query processing on multiple sub-texts to be queried in parallel, and the text generation model includes GPT.

[0348] Optionally, the multiple first sub-query results are obtained by the server using GPT to perform first query processing on the multiple sub-texts to be queried in parallel when there is no dependency relationship between the multiple sub-texts to be queried, and the text generation model includes GPT.

[0349] Optionally, when there is a dependency relationship between multiple sub-texts to be queried, the multiple first sub-query results are obtained by the server using GPT to perform first query processing on the multiple sub-texts to be queried, the first query processing of at least two of the multiple sub-texts to be queried is performed in parallel, the number of at least two sub-texts to be queried is less than the number of the multiple sub-texts to be queried, and the text generation model includes GPT.

[0350] Optionally, when there is a dependency relationship between the multiple sub-texts to be queried, the at least two sub-texts to be queried are determined by the server from the multiple sub-texts to be queried based on the dependency relationship.

[0351] Optionally, when a dependency relationship exists between the multiple sub-texts to be queried, the multiple first sub-query results are output to the terminal by the server based on the dependency relationship.

[0352] It should be noted that the above-mentioned text processing device is embodied in the form of a functional unit. The term "unit" here can be implemented in the form of software and / or hardware, and is not specifically limited to this.

[0353] For example, a "unit" may be a software program, a hardware circuit, or a combination of the two that implements the above-described functions. The hardware circuit may include an application specific integrated circuit (ASIC), an electronic circuit, a processor (e.g., a shared processor, a dedicated processor, or a group processor, etc.) and memory for executing one or more software or firmware programs, combined logic circuits, and / or other suitable components that support the described functions.

[0354] Therefore, the units of each example described in the embodiments of this application can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0355] Figure 20 shows a schematic diagram of the structure of an electronic device provided by the present application. The dotted lines in Figure 20 indicate that the instructions or programs are optional; the electronic device 11 can be used to implement the text processing method described in the above method embodiment.

[0356] The electronic device 11 includes one or more processors 1101, which can support the text processing method in the method embodiment implemented by the electronic device 11. The processor 1101 can be a general-purpose processor or a special-purpose processor. For example, the processor 1101 can be a central processing unit (CPU), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, such as discrete gates, transistor logic devices, or discrete hardware components.

[0357] The processor 1101 can be used to control the electronic device 11, execute software programs, and process data of the software programs. The electronic device 11 can also include a communication unit 1105 to implement signal input (reception) and output (transmission).

[0358] For example, the electronic device 11 may be a chip, the communication unit 1105 may be an input and / or output circuit of the chip, or the communication unit 1105 may be a communication interface of the chip, and the chip may be a component of a terminal device or other electronic device.

[0359] For another example, the electronic device 11 may be a terminal device, and the communication unit 1105 may be a transceiver of the terminal device, or the communication unit 1105 may be a transceiver circuit of the terminal device.

[0360] The electronic device 11 may include one or more memories 1102 on which a program 1104 is stored. The program 1104 can be executed by the processor 1101 to generate instructions 1103, so that the processor 1101 executes the text processing method described in the above method embodiment according to the instructions 1103.

[0361] Optionally, data may also be stored in the memory 1102 .

[0362] Optionally, the processor 1101 may also read data stored in the memory 1102 . The data may be stored at the same storage address as the program 1104 , or may be stored at a different storage address from the program 1104 .

[0363] The processor 1101 and the memory 1102 may be provided separately or integrated together, for example, integrated on a system on chip (SOC) of a terminal device.

[0364] Exemplarily, the memory 1102 can be used to store the relevant program 1104 of the text processing method provided in the embodiment of the present application, and the processor 1101 can be used to call the relevant program 1104 of the text processing method stored in the memory 1102 when executing text processing, and execute the method of the embodiment of the present application; for example, determine to obtain the text to be queried; based on the text to be queried, generate query operation information, wherein the query operation information represents the query plan when querying the text to be queried; based on the query operation information, determine multiple sub-texts to be queried; use a text generation model to perform a first query processing on the multiple sub-texts to be queried, obtain a first sub-query result corresponding to each sub-text to be queried, and output multiple first sub-query results, and the first query processing of at least two of the multiple sub-texts to be queried is performed in parallel. Or execute the method of an embodiment of the present application; for example, in response to a target operation, send a query request for querying a text to be queried to a server; receive multiple first sub-query results sent by the server; wherein the multiple first sub-query results are obtained by the server generating query operation information based on the text to be queried in response to the query request, and using a text generation model to perform a first query processing on multiple sub-texts to be queried determined based on the query operation information, the query operation information represents a query plan when querying the text to be queried; the first query processing of at least two of the multiple sub-texts to be queried is performed in parallel; and the multiple first sub-query results are displayed.

[0365] The present application also provides a computer program product, which, when executed by the processor 1101, implements the text processing method of any method embodiment in the present application.

[0366] The computer program product may be stored in the memory 1102 , for example, a program 1104 . The program 1104 is converted into an executable target file that can be executed by the processor 1101 after undergoing preprocessing, compilation, assembly, and linking.

[0367] The present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a computer, implements the text processing method of any method embodiment of the present application. The computer program can be a high-level language program or an executable target program.

[0368] The computer-readable storage medium is, for example, memory 1102. Memory 1102 may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).

[0369] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and equipment and the technical effects produced can refer to the corresponding processes and technical effects in the aforementioned method embodiments, and will not be repeated here.

[0370] In the several embodiments provided in this application, the disclosed systems, devices and methods can be implemented in other ways. For example, some features of the method embodiments described above can be ignored or not executed. The device embodiments described above are merely schematic, and the division of units is only a logical function division. There may be other division methods in actual implementation, and multiple units or components may be combined or integrated into another system. In addition, the coupling between the units or the coupling between the components may be direct coupling or indirect coupling, and the above coupling includes electrical, mechanical or other forms of connection.

[0371] It should be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0372] Additionally, the terms "system" and "network" are often used interchangeably. The term "and / or" in this document simply describes a relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " in this document generally indicates an "or" relationship between the related objects.

[0373] In short, the above is only a preferred embodiment of the technical solution of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of this application should be included in the scope of protection of this application.

[0374] The above content is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A text processing method, characterized in that, Applied to a terminal or a server, the method includes: Obtain the text to be queried; Generate query operation information based on the text to be queried, where the query operation information represents the query plan when querying the text to be queried; Determine multiple sub-texts to be queried based on the query operation information; Use a text generation model to perform a first query process on the multiple sub-texts to be queried, obtain a first sub-query result corresponding to each sub-text to be queried, and output multiple first sub-query results. The first query processes of at least two of the multiple sub-texts to be queried are performed in parallel.

2. The method according to claim 1, wherein The generating query operation information based on the text to be queried includes: Process the text to be queried using an operation information generation model to obtain the query operation information.

3. The method according to claim 2, wherein The operation information generation model is obtained by the following method: Obtain a sample text to be queried and the corresponding sample query operation information of the sample text to be queried. The sample query operation information represents the query plan when querying the sample text to be queried; Train an initial operation information generation model based on the sample text to be queried and the sample query operation information to obtain the operation information generation model.

4. The method according to any one of claims 1-3, characterized in that, The determining multiple sub-texts to be queried based on the query operation information includes: Determine multiple initial sub-texts to be queried from the query operation information; Use the multiple initial sub-texts to be queried as the multiple sub-texts to be queried; or, For each of the initial sub-texts to be queried, perform a second query process on the initial sub-text to be queried through a search service to obtain a second sub-query result, and combine the second sub-query result and the initial sub-text to be queried to obtain a sub-text to be queried.

5. The method according to any one of claims 1-4, characterized in that, The using a text generation model to perform a first query process on the multiple sub-texts to be queried and obtain a first sub-query result corresponding to each sub-text to be queried includes: Use the Generative Pretrained Transformer (GPT) to perform a first query process on the multiple sub-texts to be queried in parallel to obtain a first sub-query result corresponding to each sub-text to be queried. The text generation model includes the GPT.

6. The method according to any one of claims 1-4, characterized in that, The using a text generation model to perform a first query process on the multiple sub-texts to be queried and obtain a first sub-query result corresponding to each sub-text to be queried includes: In the case where there is no dependency relationship between the multiple sub-texts to be queried, use the GPT to perform a first query process on the multiple sub-texts to be queried in parallel to obtain a first sub-query result corresponding to each sub-text to be queried. The text generation model includes the GPT.

7. The method according to any one of claims 1-4, characterized in that, The using a text generation model to perform a first query process on the multiple sub-texts to be queried and obtain a first sub-query result corresponding to each sub-text to be queried includes: In the case where there is a dependency relationship among the multiple sub-texts to be queried, use GPT to perform a first query process on the multiple sub-texts to be queried, and obtain a first sub-query result corresponding to each sub-text to be queried. The first query processes of at least two sub-texts to be queried among the multiple sub-texts to be queried are performed in parallel. The number of the at least two sub-texts to be queried is less than the number of the multiple sub-texts to be queried. The text generation model includes the GPT.

8. The method according to claim 7, wherein Before performing, in the case where there is a dependency relationship among the multiple sub-texts to be queried, using GPT to perform a first query process on the multiple sub-texts to be queried and obtain a first sub-query result corresponding to each sub-text to be queried, it includes: In the case where there is a dependency relationship among the multiple sub-texts to be queried, based on the dependency relationship, determine the at least two sub-texts to be queried from the multiple sub-texts to be queried.

9. The method according to claim 6 or 7, characterized in that, Before using the text generation model to perform a first query process on the multiple sub-texts to be queried and obtain a first sub-query result corresponding to each sub-text to be queried, it includes: Based on the query operation information, determine whether there is the dependency relationship among the multiple sub-texts to be queried.

10. The method according to claim 5 or 7, characterized in that, Outputting the multiple first sub-query results includes: In the case where there is a dependency relationship among the multiple sub-texts to be queried, based on the dependency relationship, output the multiple first sub-query results.

11. The method according to any one of claims 1-10, characterized in that, Obtaining the text to be queried includes: Obtain the query information; In the case where the format of the query information is a text format, use the query information as the text to be queried; In the case where the format of the query information is a non-text format, perform a format conversion on the query information to obtain the text to be queried.

12. The method according to any one of claims 1-7, characterized in that At least two of the multiple first sub-query results are output in parallel.

13. A text processing method, characterized in that, When applied to a terminal, the method includes: In response to a target operation, send a query request for querying the text to be queried to the server; Receive the multiple first sub-query results sent by the server; wherein, the multiple first sub-query results are obtained by the server in response to the query request, generating query operation information based on the text to be queried, and using the text generation model to perform a first query process on the multiple sub-texts to be queried determined based on the query operation information. The query operation information represents the query plan when querying the text to be queried; the first query processes of at least two sub-texts to be queried among the multiple sub-texts to be queried are performed in parallel; Display the multiple first sub-query results.

14. The method according to claim 13, wherein The query operation information is obtained by the server after processing the text to be queried using the operation information generation model.

15. The method according to claim 14, wherein The operation information generation model is obtained by the server acquiring a sample text to be queried and the sample query operation information corresponding to the sample text to be queried, and training the initial operation information generation model based on the sample text to be queried and the sample query operation information. The sample query operation information represents the query plan when querying the sample text to be queried.

16. The method according to claim 13, characterized in that, At least two of the multiple first sub-query results are sent by the server to the terminal in parallel.

17. The method according to claim 16, wherein The at least two of the multiple first sub-query results are displayed in parallel.

18. A text processing system, characterized in that, The system includes a server and a terminal, and the terminal is connected to the server, where: The terminal is configured to send a query request for querying the text to be queried to the server in response to a target operation; The server is configured to generate query operation information based on the text to be queried in response to the query request, where the query operation information characterizes a query plan when querying the text to be queried; determine multiple sub-texts to be queried based on the query operation information; perform a first query process on the multiple sub-texts to be queried by using a text generation model to obtain a first sub-query result corresponding to each sub-text to be queried, and the first query processes of at least two of the multiple sub-texts to be queried are performed in parallel; send the multiple first sub-query results to the terminal; The terminal is further configured to receive the multiple first sub-query results sent by the server and display the multiple first sub-query results.

19. A text processing device, characterized in that, The device includes: An acquisition unit configured to acquire the text to be queried; A processing unit configured to generate query operation information based on the text to be queried, where the query operation information characterizes a query plan when querying the text to be queried; The processing unit is further configured to determine multiple sub-texts to be queried based on the query operation information; The processing unit is further configured to perform a first query process on the multiple sub-texts to be queried by using a text generation model to obtain a first sub-query result corresponding to each sub-text to be queried, and the first query processes of at least two of the multiple sub-texts to be queried are performed in parallel; A communication unit configured to output the multiple first sub-query results.

20. An electronic device, characterized in that, including: One or more processors and a memory; The memory is coupled to the one or more processors, and the memory is configured to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to cause the electronic device to execute the text processing method according to any one of claims 1 to 12 or 13 to 17.

21. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor is caused to execute the text processing method according to any one of claims 1 to 12 or 13 to 17.

Citation Information

Patent Citations

  • Text processing method, device and equipment and computer readable storage medium

    CN120296112A

  • Subquery generation from a query

    CN110869923A

  • Data query method and device, computer equipment and medium

    CN113946600A

  • Data query method, electronic equipment and computer readable storage medium

    CN116541418A

  • Executing CASE Expressions Containing Subqueries

    US20130198164A1