Text processing method and device, medium, electronic equipment and program product

By identifying the intention of the pending text and automatically determining the target text processing model, the limitations of a single model and insufficient flexibility in switching between multiple models are solved, intelligent adaptation and asynchronous calls are realized, and user experience and model calling flexibility are improved.

CN119739768APending Publication Date: 2025-04-01BEIJING ELECTRONIC DIGITAL INTELLIGENCE TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411659567.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

Text processing systems based on a single model perform well on specific tasks, but their limitations lead to poor user experience and difficult to meet complex needs; systems that integrate multiple models require users to manually select switching models, which lack flexibility.

Method used

By identifying the intent of the pending text, the target text processing model corresponding to the intent is automatically determined, and the processing is scheduled according to the dependencies between the models to generate the final text processing result.

Benefits of technology

It realizes intelligent adaptation of text processing models based on user intentions, avoids manual selection and switching, improves user experience and model call flexibility, and can fully meet the complex needs of multiple intentions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119739768A_ABST
    Figure CN119739768A_ABST
Patent Text Reader

Abstract

The invention relates to a text processing method and device, a medium, electronic equipment and a program product. The method comprises the steps of performing text intention recognition on a to-be-processed text to obtain at least one target intention; for each target intention, determining a target text processing model corresponding to the target intention, and determining a related text of the target intention from the to-be-processed text; when a plurality of target intentions exist, determining a first dependency relationship among the plurality of target text processing models; based on the first dependency relationship, scheduling each target text processing model to perform text processing on related texts of the corresponding target intention to obtain a plurality of first text processing results; and generating a second text processing result of the to-be-processed text at least according to the plurality of first text processing results. In this way, the text processing model can be intelligently adapted according to the user intention, manual selection and switching are avoided, and more convenience and rapidness are achieved. And a plurality of adaptive target text processing models are asynchronously called, so that the calling flexibility of different models is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of natural language processing, and in particular, to a text processing method, device, medium, electronic device and program product. Background Art

[0002] With the development of artificial intelligence technology, text processing systems based on large models have been applied in many fields. However, text processing systems in related technologies still face some challenges in practical applications: 1) Text processing systems based on a single model perform well on specific tasks, but the limitations of a single model lead to poor user experience and make it difficult to fully meet the complex needs of users; 2) Text processing systems that integrate multiple models usually require users to manually select and switch models, resulting in insufficient flexibility when calling different models. Summary of the invention

[0003] The purpose of the present disclosure is to provide a text processing method, device, medium, electronic device and program product.

[0004] In order to achieve the above objectives, in a first aspect, the present disclosure provides a text processing method, comprising: Get the text to be processed; Performing text intent recognition on the text to be processed to obtain at least one target intent; For each of the target intents, according to the correspondence between the pre-constructed intents and the text processing models, a target text processing model corresponding to the target intent is determined, and the relevant text of the target intent is determined from the text to be processed; When there are multiple target intentions, determining a first dependency relationship between the multiple target text processing models; Based on the first dependency relationship, scheduling each of the target text processing models to perform text processing on the relevant text of the target intent corresponding thereto, to obtain a plurality of first text processing results; A second text processing result of the text to be processed is generated at least according to the multiple first text processing results.

[0005] Optionally, determining a first dependency relationship between the plurality of target text processing models comprises: Determining a second dependency relationship between the plurality of target intentions according to the context information of the text to be processed; According to the second dependency relationship, a first dependency relationship of the plurality of target text processing models is determined.

[0006] Optionally, determining the first dependency relationship of the plurality of target text processing models according to the second dependency relationship includes: If the first intention depends on the second intention, the input of the target text processing model corresponding to the first intention depends on the output of the target text processing model corresponding to the second intention, wherein the first intention and the second intention are any two of the target intentions.

[0007] Optionally, based on the first dependency relationship, each of the target text processing models is scheduled to perform text processing on the relevant text of the target intent corresponding thereto, to obtain a plurality of first text processing results, including: If the input of the first text processing model depends on the output of the second text processing model, the relevant text of the target intent corresponding to the first text processing model and the output of the second text processing model are both input into the first text processing model to obtain the first text processing result, wherein the first text processing model is any one of the target text processing models, and the second text processing model includes the target text processing model on which the input of the first text processing model depends.

[0008] Optionally, generating a second text processing result of the text to be processed at least according to the plurality of first text processing results includes: Get the prompt text; splicing the prompt text, the text to be processed and the plurality of first text processing results to obtain a first target text; The first target text is input into a pre-trained large model to obtain a second text processing result of the text to be processed, wherein the prompt text is used to guide the large model to at least integrate the multiple first text processing results.

[0009] Optionally, generating a second text processing result of the text to be processed at least according to the plurality of first text processing results includes: Get the prompt text; splicing the prompt text, the text to be processed, the plurality of first text processing results and each of the related texts to obtain a second target text; The second target text is input into a pre-trained large model to obtain a second text processing result of the text to be processed, wherein the prompt text is used to guide the large model to at least integrate the multiple first text processing results.

[0010] Optionally, the method further comprises: When the target intent is one, the target text processing model corresponding to the target intent is scheduled to perform text processing on the relevant text of the target intent to obtain a second text processing result of the text to be processed.

[0011] In a second aspect, the present disclosure provides a text processing device, comprising: An acquisition module is used to obtain the text to be processed; A recognition module, used for performing text intent recognition on the text to be processed to obtain at least one target intent; A first determination module is used to determine, for each of the target intents, a target text processing model corresponding to the target intent according to a pre-constructed correspondence between the intent and the text processing model, and determine the relevant text of the target intent from the text to be processed; A second determination module, configured to determine a first dependency relationship between a plurality of target text processing models when there are multiple target intentions; A scheduling module, configured to schedule each of the target text processing models to perform text processing on the relevant texts of the target intent corresponding thereto based on the first dependency relationship, so as to obtain a plurality of first text processing results; A generating module is used to generate a second text processing result of the text to be processed at least according to the multiple first text processing results.

[0012] In a third aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the text processing method provided in the first aspect of the present disclosure.

[0013] In a fourth aspect, the present disclosure provides an electronic device, including: a memory having a computer program stored thereon; A processor is used to execute the computer program in the memory to implement the steps of the text processing method provided in the first aspect of the present disclosure.

[0014] In a fifth aspect, the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the text processing method provided in the first aspect of the present disclosure.

[0015] In the above technical solution, after identifying the user's intention, the target text processing models corresponding to each of the user's intentions can be automatically determined based on the correspondence between the pre-built intentions and the text processing models, so that the text processing model can be intelligently adapted according to the user's intentions, avoiding manual selection and switching, which is more convenient and quick. In addition, when the user has multiple intentions, based on the dependency relationship between multiple adapted target text processing models, each target text processing model is scheduled to perform text processing on the relevant text of the target intention corresponding to it. In this way, multiple adapted target text processing models can be called asynchronously, ensuring the flexibility of calling different models. In addition, through multi-intention recognition and collaborative multi-model processing, the problem of poor user experience caused by the limitations of a single model can be effectively solved, thereby fully meeting the user's complex multi-intention needs.

[0016] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the present disclosure but do not constitute a limitation of the present disclosure. In the accompanying drawings: Figure 1 It is a structural diagram of a text processing system according to an exemplary embodiment.

[0018] Figure 2 The figure is a flowchart of a text processing method according to an exemplary embodiment.

[0019] Figure 3 It is a schematic diagram showing a text processing process according to an exemplary embodiment.

[0020] Figure 4 The figure is a schematic diagram of a processing flow of an intention recognition module according to an exemplary embodiment.

[0021] Figure 5 It is a schematic diagram of a processing flow of a model matching module according to an exemplary embodiment.

[0022] Figure 6 The figure is a schematic diagram of a processing flow of a model calling module according to an exemplary embodiment.

[0023] Figure 7 The figure is a schematic diagram of a processing flow of a result sorting module according to an exemplary embodiment.

[0024] Figure 8 It is a block diagram of a text processing device according to an exemplary embodiment.

[0025] Fig. 9 It is a block diagram of an electronic device according to an exemplary embodiment.

[0026] Fig.10 is a block diagram of an electronic device according to another exemplary embodiment. DETAILED DESCRIPTION

[0027] The specific implementation of the present disclosure is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described herein is only used to illustrate and explain the present disclosure, and is not used to limit the present disclosure.

[0028] Figure 1 FIG. 1 is a schematic diagram showing a structure of a text processing system according to an exemplary embodiment. Figure 1 As shown, the text processing system may include an intention recognition module, a model matching module, a model scheduling module and a result sorting module connected in sequence.

[0029] like Figure 1 As shown, the intent recognition module can perform intent recognition on the text to be processed through a pre-trained intent recognition model to obtain at least one target intent, and analyze the context of the text to be processed (i.e., text analysis) to extract the relevant text of each target intent. When there are multiple target intents, the dependency relationship between the multiple target intents can also be obtained through text analysis. After that, the results are sorted and formatted for output, that is, the identified target intent and its related text, as well as the dependency relationship between the multiple target intents are converted into structured data (hereinafter referred to as intent data, such as Figure 4 ) and output to the model matching model.

[0030] like Figure 1As shown, after receiving the intent data sent by the intent recognition module, the model matching module parses the intent data to obtain at least one target intent, and then selects the corresponding target text processing model for each target intent from the predefined model library. Finally, the model matching results are sorted for formatted output, that is, the target intent, related text and corresponding target text processing are output to the model scheduling module in the form of structured data. Wherein, when there are multiple target intents, the model matching module can also determine the dependency relationship between multiple target text processing models according to the dependency relationship between multiple target intents. Accordingly, when formatting the output, the model matching results and the model dependency relationship can be sorted at the same time for formatted output, that is, the target intent, related text, corresponding target text processing and the dependency relationship between multiple target text processing models are output to the model scheduling module in the form of structured data. Wherein, the predefined model library includes multiple text processing models, and one text processing model corresponds to one or more intents. For example, the predefined model library can include various types of text processing models such as translation models, semantic synthesis models, image generation models, text generation models, and text classification models.

[0031] like Figure 1 As shown, after receiving the structured data sent by the model matching module, the model scheduling module can control the target text processing model to perform text processing according to the structured data. Specifically, when the intent recognition module recognizes one target intent, the model scheduling module can directly call the target text processing model corresponding to the one target intent to directly obtain the final text processing result of the text to be processed, that is, the second text processing result, that is, input the relevant text of the target intent into the target text processing model corresponding to the target intent to obtain a first text processing result. At this time, the first text processing result can be directly used as the second text processing result of the text to be processed.

[0032] like Figure 1As shown, when the intent recognition module identifies multiple target intents, the model scheduling module can schedule each target text processing model to perform text processing on the relevant text of the corresponding target intent according to the dependency relationship between the multiple target text processing models in the structured data, and obtain multiple first text processing results. Among them, the model scheduling module can input the relevant text of the target intent as prompt information (i.e., prompt generation) into the target text processing model corresponding to the target intent for each target intent. In addition, if the input of the target text processing model corresponding to the target intent depends on the output of other target text processing models, the input of the target text processing model corresponding to the target intent also includes the output of other target text processing models on which it depends. After obtaining multiple first text processing results through each target text processing model, the model scheduling module can merge the results, that is, splice the multiple first text processing results to obtain the model merged result, and format the model merged result and output it to the result sorting module.

[0033] like Figure 1 As shown, after receiving the model merging result sent by the model scheduling module, the result sorting module can use the model merging result, the prompt text and the text to be processed as prompt information (i.e., Prompt generation), and then call the pre-trained large model, that is, input the prompt information into the large model, obtain the final text processing result of the text to be processed, that is, the second text processing result, and output the second text processing result.

[0034] Figure 2 FIG. 1 is a flowchart of a text processing method according to an exemplary embodiment. Figure 2 As shown, the text processing method may include the following S101~S106.

[0035] In S101, a text to be processed is obtained.

[0036] In the present disclosure, the text to be processed may include one intent or multiple intents.

[0037] In S102, text intent recognition is performed on the text to be processed to obtain at least one target intent.

[0038] In the present disclosure, the intent recognition result may include one target intent or multiple target intents. Figure 3 As shown, by performing text intent recognition on the text to be processed, three target intents can be obtained, namely intent a, intent b and intent c.

[0039] In addition, the text to be processed can be identified through the intention recognition module, specifically, Figure 4As shown, the text intent recognition can be performed on the text to be processed through a pre-trained intent recognition model to obtain one or more target intents.

[0040] In S103, for each target intent, a target text processing model corresponding to the target intent is determined according to the correspondence between the pre-constructed intent and the text processing model, and the relevant text of the target intent is determined from the text to be processed.

[0041] In the present disclosure, a correspondence between an intention and a text processing model may be established in advance (e.g. Figure 5 ), wherein a text processing model may correspond to one or more intents. In addition, a target text processing model corresponding to each target intent may be selected through a model matching module in the text processing system.

[0042] like Figure 5 As shown, model A corresponds to intent c, model B corresponds to intent a, model C corresponds to intent b, and model D corresponds to intent d and intent e.

[0043] For example, Figure 3 As shown in the figure, by performing text intent recognition on the processed text, three target intents, intent a, intent b, and intent c, are obtained. Figure 5 From the correspondence between the intent and the text processing model shown in the table, it can be seen that the target text processing model corresponding to intent a is model B, the target text processing model corresponding to intent b is model C, and the target text processing model corresponding to intent c is model A.

[0044] When processing text for different target intents, in order to improve the efficiency of text processing, only the text related to the current intent can be processed. Figure 4 As shown, the context of the text to be processed can be analyzed by the intent recognition module to extract the relevant text of each target intent and establish an association relationship between the target intent and its relevant text. Figure 4 As shown, the relevant text of intent a is text1, the relevant text of intent b is text2, and the relevant text of intent c is text3.

[0045] In one implementation, the intent recognition module may extract entities related to the target intent, that is, related text, from the text to be processed by using Named Entity Recognition (NER) technology.

[0046] In S104, when there are multiple target intentions, a first dependency relationship between the multiple target text processing models is determined.

[0047] In the present disclosure, the target text processing model M1 depends on the target text processing model M2, which can be understood as the input of the target text processing model M1 depends on the target text processing model M2. At this time, the output of the target text processing model M2 can be used as the input of the target text processing model M1.

[0048] In addition, the first dependency relationship (model relationship for short) between multiple target text processing models can be determined through the model matching module, and the first dependency relationship can be sent to the model scheduling module.

[0049] In S105, based on the first dependency relationship, each target text processing model is scheduled to perform text processing on the text related to the corresponding target intent, so as to obtain a plurality of first text processing results.

[0050] In the present disclosure, a model scheduling module can be used to schedule multiple target text processing models based on the first dependency relationship between the multiple target text processing models. Figure 6 As shown, after receiving the first dependency relationship (i.e., model relationship) between multiple target text processing models sent by the model matching module, the model scheduling module can perform model relationship analysis, and for each target intent, call the target text processing model corresponding to the target intent from the predefined model library. Specifically, the relevant text of the target intent can be input as prompt information (i.e., generate a Prompt) into the target text processing model corresponding to the target intent to obtain the processing result of the relevant text of the target intent, i.e., the first text processing result.

[0051] In addition, if the input of the target text processing model corresponding to the target intent depends on the output of other target text processing models, then the input of the target text processing model corresponding to the target intent also includes the output of other target text processing models on which it depends. Specifically, if the input of the first text processing model depends on the output of the second text processing model, then the relevant text of the target intent corresponding to the first text processing model and the output of the second text processing model are both input into the first text processing model to obtain the first text processing result, wherein the first text processing model is any target text processing model, and the second text processing model includes the target text processing model on which the input of the first text processing model depends.

[0052] For example, Figure 6 As shown, the input of model C depends on the output of model B, so the input of model C not only includes the corresponding related text, but also includes the output of model B.

[0053] In S106, a second text processing result of the text to be processed is generated at least according to the plurality of first text processing results.

[0054] like Figure 3 As shown, after obtaining multiple text processing results by scheduling the target text processing model, the results can be merged and the merged results can be output.

[0055] like Figure 6 As shown, after the model scheduling module obtains multiple first text processing results through each target text processing model, it can merge the results, that is, splice the multiple first text processing results to obtain a model merging result, and then the model merging result can be formatted and output to the result sorting module, so that the result sorting module can sort the results to obtain the second text processing result of the text to be processed. Alternatively, the model merging result is directly used as the second text processing result of the text to be processed.

[0056] In the above technical solution, after identifying the user's intention, the target text processing models corresponding to each of the user's intentions can be automatically determined based on the correspondence between the pre-built intentions and the text processing models, so that the text processing model can be intelligently adapted according to the user's intentions, avoiding manual selection and switching, which is more convenient and quick. In addition, when the user has multiple intentions, based on the dependency relationship between multiple adapted target text processing models, each target text processing model is scheduled to perform text processing on the relevant text of the target intention corresponding to it. In this way, multiple adapted target text processing models can be called asynchronously, ensuring the flexibility of calling different models. In addition, through multi-intention recognition and collaborative multi-model processing, the problem of poor user experience caused by the limitations of a single model can be effectively solved, thereby fully meeting the user's complex multi-intention needs.

[0057] The following is a detailed description of the specific implementation of determining the first dependency relationship between the multiple target text processing models in S104. Specifically, it can be achieved through the following steps (1) and (2): Step (1): Determine the second dependency relationship between multiple target intents based on the context information of the text to be processed.

[0058] In the present disclosure, intent a depends on intent b, which can be understood as the need to respond to intent a based on the response result of intent b.

[0059] For example, if the text to be processed is "Translate a piece of English text into French and read it aloud", the target intents obtained through text intent recognition include "translation" and "speech synthesis", among which "speech synthesis" depends on "translation", that is, speech synthesis needs to be performed based on the translation result.

[0060] like Figure 4As shown, the intent recognition module can determine the second dependency relationship between multiple target intents based on the context information of the text to be processed to establish an intent relationship, and then send the intent relationship to the model matching module.

[0061] Step (2): Determine the first dependency relationship of multiple target text processing models based on the second dependency relationship between multiple target intents.

[0062] In the present disclosure, the dependency relationship between target text processing models inherits the dependency relationship between corresponding target intents. Specifically, if a first intent depends on a second intent, the input of the target text processing model corresponding to the first intent depends on the output of the target text processing model corresponding to the second intent, wherein the first intent and the second intent are any two target intents.

[0063] like Figure 5 As shown, the model matching module can determine the first dependency relationship of multiple target text processing models according to the second dependency relationship between multiple target intents. Specifically, after receiving the intent relationship from the intent recognition module, the model matching module can perform intent relationship analysis and build a model relationship according to the intent relationship, that is, determine the first dependency relationship of multiple target text processing models according to the second dependency relationship between multiple target intents, and format the model relationship and output it to the model scheduling module.

[0064] For example, Figure 4 As shown, intent b depends on intent a, intent c has no dependencies on other intents, and, as Figure 5 As shown, model A corresponds to intention c, model B corresponds to intention a, and model C corresponds to intention b. Therefore, we can get Figure 6 The model dependency relationship shown, that is, model C depends on model B, and model A is independent of model B and model C. At this time, model A and model B can run in parallel, and model C will run after model B is completed.

[0065] The following is a detailed description of the specific implementation of generating the second text processing result of the to-be-processed text at least based on the multiple first text processing results in the above S106. Specifically, it can be implemented through multiple implementations. In one implementation, the multiple first text processing results can be merged, for example, the multiple first text processing results are spliced ​​to obtain a model merging result, and then the model merging result is directly used as the second text processing result of the to-be-processed text.

[0066] In another embodiment, a second text processing result of the text to be processed may be generated by following steps [1] and [2] at least based on multiple first text processing results.

[0067] Step [1]: Get the prompt text.

[0068] Step [2]: Generate a second text processing result of the text to be processed based on at least the prompt text, the text to be processed and multiple first text processing results through a pre-trained large model.

[0069] In the present disclosure, the prompt text may include the description information of the result sorting task of the large model, and the prompt text is a text description that guides the large model to understand and execute the result sorting task, and is used to guide the large model to at least integrate multiple first text processing results. In addition to the overall task requirements, the prompt text also includes the task requirements and output result examples of the tasks corresponding to each target intention.

[0070] For example, the target intent includes "translation" and "speech synthesis". In this case, the prompt text is as follows: "Merge the processing results of the tasks. The merged results should be smooth and easy to read. The merged results should meet the requirements of the following tasks: Translation tasks: - Task requirements: The translation must be faithful to the original text and accurately convey the information and intention of the original text - Result example: Enjoy life, starting with a cup of good coffee.

[0071] Start your day with a great cup of coffee. Speech synthesis tasks: - Task requirements: The speech should be clear, natural, fluent and attractive; the speech synthesis should maintain the rhythm and rhythm of the original text - Example result: Open the audio file and hear a warm and inspiring Chinese female voice clearly say the sentence "Quality life starts from the heart." (The voice is spoken at a natural speed and with an ascending tone, giving a positive feeling)." In addition, the result sorting module can generate a second text processing result of the text to be processed based on at least the prompt text, the text to be processed and the plurality of first text processing results through a pre-trained large model. Figure 7 As shown, after receiving the model merging result sent by the model scheduling module, the result collating module can use at least the prompt text, the text to be processed and the model merging result (i.e., multiple first text processing results) as the prompt information of the large model (i.e., generate a Prompt), and then call the large model to sort the results, obtain the sorting result, i.e., the second text processing result of the text to be processed, and output the sorting result.

[0072] In this implementation, by calling a large model to organize the model merging results, a coherent correlation result can be formed, thereby avoiding the problem of output content fragmentation caused by calling multiple models.

[0073] Specifically, the second text processing result of the text to be processed can be generated in a variety of ways through a pre-trained large model based at least on the prompt text, the text to be processed, and the multiple first text processing results. In one embodiment, the prompt text, the text to be processed, and the multiple first text processing results can be spliced ​​to obtain a first target text; then, the first target text is input into the pre-trained large model to obtain a second text processing result of the text to be processed.

[0074] In another embodiment, in order to further improve the quality of the second text processing result, the input of the above-mentioned large model may include not only the prompt text, the text to be processed, and the multiple first text processing results, but also the related texts of each target intention. Specifically, the prompt text, the text to be processed, the multiple first text processing results, and each related text may be concatenated to obtain the second target text; then, the second target text is input into the pre-trained large model to obtain the second text processing result of the text to be processed.

[0075] In a possible implementation, the text processing method may further include the following steps: When there is only one target intent, the target text processing model corresponding to the target intent is scheduled to perform text processing on the relevant text of the target intent to obtain a second text processing result of the text to be processed.

[0076] In a possible implementation, the above text processing system can be applied to the joint processing of text and image generation.

[0077] For example, the text to be processed is "I want to know about current sports events and make a picture of the events". The intent recognition module can identify the two intents of "news" and "image generation", and extract the relevant texts of the two intents, that is, the relevant text of the intent "news" is "I want to know about current sports events", and the relevant text of the intent "image generation" is "make a picture of the events". At the same time, according to the connection between the contexts, the dependency between the intents is marked, that is, the intent "news" depends on the intent "image generation"; then, the model matching module can be used to match the text generation model for the intent "news" and the image generation model for the intent "image generation", and according to the dependency between the intents, the dependency between the two models is determined, that is, the image generation model depends on the text generation model; next, the relevant text of the intent "news" as "I want to know about current sports events" can be input into the text generation model to generate the latest sports event news summary, and then the sports event news summary and the relevant text of "image generation" as "make a picture of the events" are input into the image generation model to obtain the event picture; finally, the large model is called to organize the sports event news summary and the event picture to obtain high-quality and coherent graphic content for users to view.

[0078] In a possible implementation, the above text processing system can be applied to cross-language translation and speech synthesis.

[0079] For example, the text to be processed is "translate a paragraph of English text S into French and read it aloud". The intention recognition module can identify two intentions of "translation" and "speech synthesis", and extract the relevant texts of the two intentions, that is, the relevant text of the intention "translation" is "translate a paragraph of English text S into French", and the relevant text of the intention "speech synthesis" is "read aloud". At the same time, according to the connection between the contexts, the dependency between the intentions is marked, that is, the intention "speech synthesis" depends on the intention "translation"; then, the model matching module can be used to match the translation model for the intention "translation" and the speech synthesis model for the intention "speech synthesis", and according to the dependency between the intentions, the dependency between the two models is determined, that is, the speech synthesis model depends on the translation model; next, the relevant text of the intention "translation" as "translate a paragraph of English text S into French" can be input into the translation model, and the French text corresponding to the English text S can be input into the translation model, and then the French text and the relevant text of "speech synthesis" as "read aloud" can be input into the translation model to obtain synthesized audio; finally, the large model is called to organize the French text and the synthesized audio to obtain high-quality and coherent French audio, and finally the French audio is output for the user to play.

[0080] Figure 8 FIG. 1 is a block diagram of a text processing device according to an exemplary embodiment. Figure 8As shown, the text processing device 200 includes: An acquisition module 201 is used to acquire the text to be processed; The recognition module 202 is used to perform text intent recognition on the text to be processed to obtain at least one target intent; The first determination module 203 is used to determine, for each of the target intents, a target text processing model corresponding to the target intent according to a pre-constructed correspondence between the intent and the text processing model, and determine the relevant text of the target intent from the text to be processed; A second determination module 204 is used to determine a first dependency relationship between the plurality of target text processing models when there are multiple target intentions; A scheduling module 205 is used to schedule each of the target text processing models to perform text processing on the relevant texts of the target intent corresponding thereto based on the first dependency relationship, so as to obtain a plurality of first text processing results; The generating module 206 is configured to generate a second text processing result of the text to be processed at least according to the plurality of first text processing results.

[0081] In the above technical solution, after identifying the user's intention, the target text processing models corresponding to each of the user's intentions can be automatically determined based on the correspondence between the pre-built intentions and the text processing models, so that the text processing model can be intelligently adapted according to the user's intentions, avoiding manual selection and switching, which is more convenient and quick. In addition, when the user has multiple intentions, based on the dependency relationship between multiple adapted target text processing models, each target text processing model is scheduled to perform text processing on the relevant text of the target intention corresponding to it. In this way, multiple adapted target text processing models can be called asynchronously, ensuring the flexibility of calling different models. In addition, through multi-intention recognition and collaborative multi-model processing, the problem of poor user experience caused by the limitations of a single model can be effectively solved, thereby fully meeting the user's complex multi-intention needs.

[0082] Optionally, the second determining module 204 includes: A first determination submodule, configured to determine a second dependency relationship between a plurality of target intentions according to context information of the text to be processed; The second determination submodule is used to determine the first dependency relationship of the plurality of target text processing models according to the second dependency relationship.

[0083] Optionally, the second determination submodule is used to determine that if the first intention depends on the second intention, the input of the target text processing model corresponding to the first intention depends on the output of the target text processing model corresponding to the second intention, wherein the first intention and the second intention are any two of the target intentions.

[0084] Optionally, the scheduling module 205 is used to input the relevant text of the target intent corresponding to the first text processing model and the output of the second text processing model into the first text processing model if the input of the first text processing model depends on the output of the second text processing model, so as to obtain the first text processing result, wherein the first text processing model is any of the target text processing models, and the second text processing model includes the target text processing model on which the input of the first text processing model depends.

[0085] Optionally, the generating module 206 includes: Get submodule, used to get prompt text; A first splicing submodule, used for splicing the prompt text, the text to be processed and the plurality of first text processing results to obtain a first target text; The first input submodule is used to input the first target text into a pre-trained large model to obtain a second text processing result of the text to be processed, wherein the prompt text is used to guide the large model to at least integrate the multiple first text processing results.

[0086] Optionally, the generating module 206 includes: Get submodule, used to get prompt text; A second splicing submodule is used to splice the prompt text, the text to be processed, the multiple first text processing results and each of the related texts to obtain a second target text; The second input submodule is used to input the second target text into a pre-trained large model to obtain a second text processing result of the text to be processed, wherein the prompt text is used to guide the large model to at least integrate the multiple first text processing results.

[0087] Optionally, the scheduling module 205 is also used to schedule the target text processing model corresponding to the target intent to perform text processing on the relevant text of the target intent when the target intent is one, so as to obtain a second text processing result of the text to be processed.

[0088] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0089] In addition, the present disclosure provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the above-mentioned text processing method provided by the present disclosure are implemented.

[0090] In addition, the present disclosure provides a computer program product, including a computer program, which implements the steps of the above-mentioned text processing method provided by the present disclosure when the computer program is executed by a processor.

[0091] Fig. 9 FIG. 7 is a block diagram of an electronic device 700 according to an exemplary embodiment. Fig. 9 As shown, the electronic device 700 may include: a processor 701 , a memory 702 . The electronic device 700 may also include one or more of a multimedia component 703 , an input / output (I / O) interface 704 , and a communication component 705 .

[0092] The processor 701 is used to control the overall operation of the electronic device 700 to complete all or part of the steps in the above-mentioned text processing method. The memory 702 is used to store various types of data to support the operation of the electronic device 700. For example, these data may include instructions for any application or method used to operate on the electronic device 700, and application-related data, such as contact data, sent and received messages, pictures, audio, video, etc. The memory 702 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, referred to as EPROM), programmable read-only memory (Programmable Read-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic memory, flash memory, magnetic disk or optical disk. The multimedia component 703 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may be further stored in the memory 702 or sent through the communication component 705. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 704 provides an interface between the processor 701 and other interface modules, and the above-mentioned other interface modules may be a keyboard, a mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 705 is used for wired or wireless communication between the electronic device 700 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G or 4G, or a combination of one or more of them, so the corresponding communication component 705 may include: Wi-Fi module, Bluetooth module, NFC module.

[0093] In an exemplary embodiment, the electronic device 700 can be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned text processing method.

[0094] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, and when the program instructions are executed by a processor, the steps of the above-mentioned text processing method are implemented. For example, the computer-readable storage medium can be the above-mentioned memory 702 including program instructions, and the above-mentioned program instructions can be executed by the processor 701 of the electronic device 700 to complete the above-mentioned text processing method.

[0095] In another exemplary embodiment, a computer program product is further provided. The computer program product includes a computer program that can be executed by a processor. When the computer program is executed by the processor, the steps of the above-mentioned text processing method are implemented.

[0096] Fig.10 1 is a block diagram of an electronic device 1900 according to another exemplary embodiment. For example, the electronic device 1900 may be provided as a server. Fig.10 The electronic device 1900 includes a processor 1922, which may be one or more, and a memory 1932 for storing a computer program executable by the processor 1922. The computer program stored in the memory 1932 may include one or more modules each corresponding to a set of instructions. In addition, the processor 1922 may be configured to execute the computer program to perform the above-mentioned text processing method.

[0097] In addition, the electronic device 1900 may further include a power supply component 1926 and a communication component 1950, wherein the power supply component 1926 may be configured to perform power management of the electronic device 1900, and the communication component 1950 may be configured to implement communication of the electronic device 1900, for example, wired or wireless communication. In addition, the electronic device 1900 may further include an input / output (I / O) interface 1958. The electronic device 1900 may operate based on an operating system stored in the memory 1932, such as Windows Server™, Mac OS X™, Unix™, Linux™, etc.

[0098] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, and when the program instructions are executed by a processor, the steps of the above-mentioned text processing method are implemented. For example, the computer-readable storage medium can be the above-mentioned memory 1932 including program instructions, and the above-mentioned program instructions can be executed by the processor 1922 of the electronic device 1900 to complete the above-mentioned text processing method.

[0099] In another exemplary embodiment, a computer program product is further provided. The computer program product includes a computer program that can be executed by a processor. When the computer program is executed by the processor, the steps of the above-mentioned text processing method are implemented.

[0100] The preferred embodiments of the present disclosure are described in detail above in conjunction with the accompanying drawings; however, the present disclosure is not limited to the specific details in the above embodiments. Within the technical concept of the present disclosure, a variety of simple modifications can be made to the technical solution of the present disclosure, and these simple modifications all fall within the protection scope of the present disclosure.

[0101] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present disclosure will not further describe various possible combinations.

[0102] In addition, various embodiments of the present disclosure may be arbitrarily combined, and as long as they do not violate the concept of the present disclosure, they should also be regarded as the contents disclosed by the present disclosure.

Claims

1. A text processing method, characterized in that: include: Get the text to be processed; Performing text intent recognition on the text to be processed to obtain at least one target intent; For each of the target intents, according to the correspondence between the pre-constructed intents and the text processing models, a target text processing model corresponding to the target intent is determined, and the relevant text of the target intent is determined from the text to be processed; When there are multiple target intentions, determining a first dependency relationship between the multiple target text processing models; Based on the first dependency relationship, scheduling each of the target text processing models to perform text processing on the relevant text of the target intent corresponding thereto, to obtain a plurality of first text processing results; A second text processing result of the text to be processed is generated at least according to the multiple first text processing results.

2. The method according to claim 1, characterized in that The determining of a first dependency relationship between the plurality of target text processing models comprises: Determining a second dependency relationship between the plurality of target intentions according to the context information of the text to be processed; According to the second dependency relationship, a first dependency relationship of the plurality of target text processing models is determined.

3. The method according to claim 2, characterized in that Determining the first dependency relationship of the plurality of target text processing models according to the second dependency relationship includes: If the first intention depends on the second intention, the input of the target text processing model corresponding to the first intention depends on the output of the target text processing model corresponding to the second intention, wherein the first intention and the second intention are any two of the target intentions.

4. The method according to claim 1, characterized in that: Based on the first dependency relationship, each of the target text processing models is scheduled to perform text processing on the relevant text of the target intent corresponding thereto, to obtain a plurality of first text processing results, including: If the input of the first text processing model depends on the output of the second text processing model, the relevant text of the target intent corresponding to the first text processing model and the output of the second text processing model are both input into the first text processing model to obtain the first text processing result, wherein the first text processing model is any one of the target text processing models, and the second text processing model includes the target text processing model on which the input of the first text processing model depends.

5. The method according to claim 1, characterized in that The step of generating a second text processing result of the text to be processed at least according to the plurality of first text processing results comprises: Get the prompt text; splicing the prompt text, the text to be processed and the plurality of first text processing results to obtain a first target text; The first target text is input into a pre-trained large model to obtain a second text processing result of the text to be processed, wherein the prompt text is used to guide the large model to at least integrate the multiple first text processing results.

6. The method according to claim 1, characterized in that The step of generating a second text processing result of the text to be processed at least according to the plurality of first text processing results comprises: Get the prompt text; splicing the prompt text, the text to be processed, the plurality of first text processing results and each of the related texts to obtain a second target text; The second target text is input into a pre-trained large model to obtain a second text processing result of the text to be processed, wherein the prompt text is used to guide the large model to at least integrate the multiple first text processing results.

7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: When the target intent is one, the target text processing model corresponding to the target intent is scheduled to perform text processing on the relevant text of the target intent to obtain a second text processing result of the text to be processed.

8. A text processing device, characterized in that: include: An acquisition module is used to obtain the text to be processed; A recognition module, used for performing text intent recognition on the text to be processed to obtain at least one target intent; A first determination module is used to determine, for each of the target intents, a target text processing model corresponding to the target intent according to a pre-constructed correspondence between the intent and the text processing model, and determine the relevant text of the target intent from the text to be processed; A second determination module, configured to determine a first dependency relationship between a plurality of target text processing models when there are multiple target intentions; A scheduling module, configured to schedule each of the target text processing models to perform text processing on the relevant texts of the target intent corresponding thereto based on the first dependency relationship, so as to obtain a plurality of first text processing results; A generating module is used to generate a second text processing result of the text to be processed at least according to the multiple first text processing results.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 7 are implemented.

10. An electronic device, characterized in that: include: a memory having a computer program stored thereon; A processor, configured to execute the computer program in the memory to implement the steps of the method according to any one of claims 1 to 7.

11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Question answering method and device, electronic equipment and storage medium

    CN112131364A

  • Multi-model cooperation method based on large-scale language model

    CN116976306A

  • Information processing method and device, electronic equipment and storage medium

    CN117313746A