Methods, systems, and media for generating cross-language target text based on prompt information

By receiving source language text and natural language prompt information input by users, and using the learning model to generate cross-language target text, the problem of lack of interpretability and fine-grained control in cross-language scenarios in the existing technology is solved, and more efficient , accurate text generation.

CN118468894BActive Publication Date: 2024-11-05SICHUAN LAN-BRIDGE INFORMATION TECHNOLOGY CO LTD +1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410930791.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-12
Publication Date
2024-11-05
Estimated Expiration
2044-07-12

AI Technical Summary

Technical Problem

Existing neural machine translation systems lack interpretability and controllability, cannot be applied to situations where precise processing of specific terms and entity translations or stylistic constraints on target texts, and lack fine-grained and complex text control capabilities in cross-language scenarios.

Method used

Provide a method of generating cross-language target text based on prompt information, receives user input source language text and natural language prompt information through the processor, and generates cross-language target text using a trained learning model, supporting multiple types of cross-language Language fine-grained control information, including vocabulary, phrases, syntax, etc.

Benefits of technology

It realizes more efficient and accurate cross-language text generation, meets users' multi-dimensional composite control needs, provides more convenient text control methods, and the generated target text is more in line with user requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118468894B_ABST
    Figure CN118468894B_ABST
Patent Text Reader

Abstract

The present application relates to the field of natural language processing technology. In order to meet the needs of users in cross-language scenarios to conveniently perform multi-dimensional and complex intervention on target language generation in natural language, a method, system and medium for generating cross-language target text based on prompt information are proposed. The method includes a processor receiving a source language text to be generated as a cross-language text input by a user and a given prompt information, wherein the prompt information supports expression in the form of natural language and contains multiple types of cross-language fine-grained control information; based on the received source language text and in combination with the prompt information, a cross-language target text is generated for display using a trained first learning model. The present application enables users to more conveniently propose more complex and fine-grained cross-language text control requirements, and to generate a more accurate and user-friendly cross-language target text for the source language text with higher efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of natural language processing, and in particular to a method, system and medium for generating a cross-language target text based on prompt information. Background Art

[0002] Traditional neural machine translation systems (NMT) have made significant progress in recent years, relying on end-to-end training of a large number of parallel corpora, and the translation effect is even close to the level of human translation to a certain extent. However, these models usually have black box characteristics, that is, the trained model is a black box that can only get output given input, and its internal reasoning process based on matrix operations cannot receive human intervention, which leads to its lack of interpretability and controllability, and it cannot be used in situations that require precise processing such as translation of specific terms and entities, or style constraints on the target text.

[0003] Research in recent years has attempted to incorporate human control into the model. For example, the controllable generative model in the prior art is achieved by integrating vocabulary constraints into the model's decoding process or through special post-processing steps. The style constraints on the target text rely on data synthesis or specific model design. In other words, the existing controllable generative models are obviously model-specific, that is, they rely on a specific model structure, and different control objectives correspond to different model structures. In addition, there is no fine-grained complex text control applied to cross-language scenarios in the prior art.

[0004] Therefore, the existing models lack compatibility with constraint types as well as compatibility and scalability with languages ​​and model architectures, and are unable to meet the needs of users in cross-language scenarios to conveniently perform multi-dimensional and complex intervention in target language generation using natural language with a unified model architecture. Summary of the invention

[0005] The present application is provided to solve the above defects in the prior art. A method, system and medium for generating a cross-language target text based on prompt information is needed, which can enable users to more conveniently propose cross-language text control requirements with a higher degree of complexity, and generate a cross-language target text for the source language text that is more accurate and more in line with the user's control requirements.

[0006] According to a first scheme of the present application, a method for generating a cross-language target text based on prompt information is provided, comprising: a processor receiving a source language text of a cross-language text to be generated input by a user; a processor receiving prompt information input by a user, wherein the prompt information supports expression in the form of natural language and contains multiple types of cross-language fine-grained control information; and the processor generates a cross-language target text for display using a trained first learning model based on the received source language text and in combination with the prompt information.

[0007] According to the second scheme of the present application, a system for generating a cross-language target text based on prompt information is provided, comprising an interface configured to obtain a source language text of a cross-language text to be generated input by a user and prompt information input by the user, wherein the prompt information supports expression in the form of natural language and contains multiple types of cross-language fine-grained control information. The system also includes a processor configured to perform various operations of the method for generating a cross-language target text based on prompt information according to various embodiments of the present application. The system also includes a display configured to display the generated cross-language target text.

[0008] According to a third aspect of the present application, a non-transitory computer-readable storage medium storing a program is provided, wherein the program enables a processor to perform various operations of the method for generating a cross-language target text based on prompt information according to various embodiments of the present application.

[0009] The methods, systems and media for generating cross-language target texts based on prompt information provided in various embodiments of the present application allow users to provide prompt information for controlling and constraining target language texts in the form of natural language, thereby providing users with a more convenient and natural text control method. In addition, the prompt information may not be limited to a single dimension or angle, but may, for example, include multiple types of cross-language fine-grained control information. Therefore, when the trained first learning model is combined with the prompt information given by the user to generate a target language text for the source language text, it can have higher efficiency, make the generated target language text more accurate, and better meet the multi-dimensional, complex and complicated control requirements proposed by the user.

[0010] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below.

[0011] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0013] Figure 1 A schematic flow chart of a method for generating a cross-language target text based on prompt information according to an embodiment of the present application is shown.

[0014] Figure 2 A schematic diagram showing a process of a user correcting prompt information according to an embodiment of the present application is shown.

[0015] Figure 3 A schematic diagram of the composition structure of a first learning model according to an embodiment of the present application is shown.

[0016] Figure 4 A schematic diagram showing a training method for a first learning model according to an embodiment of the present application is shown.

[0017] Figure 5 A schematic diagram showing some components of a system for generating a cross-language target text based on prompt information according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0018] In order to make the purpose, technical solution and advantages of the embodiment of the present application clearer, the technical solution of the embodiment of the present application will be clearly and completely described in conjunction with the drawings of the embodiment of the present application. Obviously, the described embodiment is a part of the embodiment of the present application, not all of the embodiments. Based on the described embodiment of the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0019] Unless otherwise defined, the technical terms or scientific terms used in this application shall have the common meanings understood by persons with ordinary skills in the field to which this application belongs. "Include" or "comprising" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, but do not exclude other elements or objects.

[0020] The words "first", "second" and similar words used in this application do not indicate any order, quantity or importance, but are only used to distinguish. Words such as "include" or "comprise" and similar words mean that the elements before the word include the elements listed after the word, and do not exclude the possibility of also covering other elements. The execution order of the various steps in the method described in this application in conjunction with the accompanying drawings is not intended to be limiting. As long as it does not affect the logical relationship between the various steps, several steps can be integrated into a single step, a single step can be decomposed into multiple steps, and the execution order of the various steps can be changed according to specific needs.

[0021] It should also be understood that the term "and / or" in this application is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this application generally indicates that the associated objects before and after are in an "or" relationship.

[0022] In order to keep the following description of the embodiments of the present application clear and concise, the present application omits detailed descriptions of known functions and known components.

[0023] Figure 1 A schematic flow chart of a method for generating a cross-language target text based on prompt information according to an embodiment of the present application is shown.

[0024] like Figure 1 As shown, in step 101, the processor may receive a source language text for generating a cross-language text input by a user. It should be noted that the "source language text" here may be a specific language text to be translated into other language texts, or a specific language text to be rewritten into other language texts with certain constraints, which may be a sentence or a paragraph, and the length of the text and the specific language of the source language and cross-language are not specifically limited in this application.

[0025] In step 102, the processor may further receive prompt information input by the user, wherein the prompt information supports expression in the form of natural language and includes multiple types of cross-language fine-grained control information.

[0026] In some embodiments, the user wants to provide some prompts for the generation of cross-language texts due to the accuracy and personalization requirements of the translation, or due to the control requirements for the cross-language rewriting of the text, and the method according to the embodiment of the present application can support the user to provide these prompt information in the natural language of the source language he is accustomed to. In this application, "fine-grained" is a relative concept, and does not limit the specific level, specification and content of the prompt information, but means that the user can not only give overall control requirements for cross-language text generation, but also put forward specific constraints and control requirements from finer granularity such as vocabulary, phrases, and syntax.

[0027] In addition, the prompt information provided by the user may not only include a single type of cross-language fine-grained control requirements, but may also provide multiple fine-grained cross-language control prompt information about text translation or rewriting, such as emotion, style, syntactic structure, etc., according to user needs. In this way, especially when the user has very clear text control requirements, multi-dimensional and multi-angle complex control information can be provided at one time to improve the efficiency of generating cross-language target texts. In other embodiments, due to the translation from the source language to the target language, the prompt information may also include some cross-language vocabulary, phrases or sentences.

[0028] Next, in step 103, the trained first learning model may be used to generate a cross-language target text for display based on the received source language text and in combination with the prompt information given by the user.

[0029] In some embodiments, the first learning model may adopt a network structure similar to an encoder-decoder, or any other applicable neural network architecture. This application does not make any specific limitations on this. As long as it can uniformly process the source language text and the prompt information given by the user that may contain multiple requirements after the training described in the embodiments of this application, and generate a cross-language target text that meets the text translation or rewriting requirements given by the user in the prompt information, it will be sufficient.

[0030] According to the method for generating a cross-language target text based on prompt information of an embodiment of the present application, by allowing the user to give prompt information for controlling the target language text in their accustomed natural language and in a more diverse manner, a more convenient and natural text control method is provided to the user. In addition, since the content in the prompt information may not be limited to a single control dimension or angle, but may include multiple types of cross-language fine-grained control information, when the trained first learning model is combined with the prompt information given by the user to generate a target language text for the source language text, a more accurate target language text that better meets the user's requirements can be generated in a more efficient manner.

[0031] In some embodiments, the user may wish to further modify or supplement the previously given prompt information. Figure 2 A schematic diagram showing a process of a user correcting prompt information according to an embodiment of the present application is shown.

[0032] like Figure 2 As shown, in step 201, when the user gives prompt information in the previous round, the prompt information of each previous round and the corresponding cross-language target text can be displayed in comparison. In this way, the user can be helped to clarify the prompt information that was given before, which serves as a basis for modifying and supplementing the prompt information. In other embodiments, in order to facilitate comparison and viewing, the user can always be provided with the display of the source language text.

[0033] Next, in step 202, a correction operation of the user on the prompt information of the specified round may be received, wherein the correction operation is performed based at least on the deviation between the cross-language target text of the specified round and the prompt information of the round.

[0034] Since the prompt information of the previous rounds and the cross-language target text generated accordingly are displayed in step 201, the user can not only analyze the possible errors in the target language text, but also conveniently check the degree to which the control requirements given by the user are met, whether there are mismatches in some fine-grained controls, etc.; or, it can also be evaluated whether the generated cross-language target text is the effect it really expects, etc., so as to efficiently supplement or iteratively optimize the prompt information.

[0035] In some embodiments, the prompt information of a specified round may be the last round of prompt information given by the user. For example, the user may first select the text control dimension or angle that he or she is more concerned about and has a higher priority, and give prompt information. When the given control dimension or angle is satisfied to a sufficient degree, the control requirements of other dimensions or angles with lower priority are gradually given. In other embodiments, the user may also use the prompt information of other rounds that are not the last round as the basis for supplementation and modification. In this way, for example, if the user has tried different prompt methods for a specific dimension in the previous round, he or she may select the most suitable prompt method in the new round, and make further modifications and supplements based on the round.

[0036] Finally, in step 203, based on the source language text and the corrected prompt information, the trained first learning model may be used again to generate an updated cross-language target text for display.

[0037] like Figure 2The illustrated embodiment enables the user to modify and supplement the prompt information in a progressive manner, and by providing each round of prompt information for the user to choose, the efficiency of the user selecting the prompt information that is closest to his / her control needs is further improved.

[0038] As mentioned above, the control information provided by the user may include multiple dimensions and multiple angles. In some embodiments, in addition to the cross-language fine-grained control information, the prompt information may also include translation prompt information in terms of dimensions, for example.

[0039] In addition, in order to enable users, especially new users of the system, to more conveniently and accurately propose the prompt information they need and can be responded to, in some embodiments, the user can also be provided with guidance for the prompt information, such as providing some typical examples of natural language forms of prompt information on the user interface, or listing all the types of prompt information that can be selected, so that the user can add the framework of the corresponding prompt information to the prompt information to be given by clicking, thereby enabling the user to very conveniently provide prompt information including at least one type of translation prompt information and / or at least one type of cross-language fine-grained control information for the generation of cross-language target text. That is to say, in an embodiment according to the present application, the user can only make a translation request for translating the source language text into the target language text, or only make a cross-language fine-grained control request for rewriting the source language text into the target language text, or can also provide the prompt information of the above two dimensions together.

[0040] In some embodiments, both translation prompts and cross-language fine-grained control may have multiple angles that are allowed to coexist. Specifically, the types of the translation prompt information may include, for example, a target phrase class, a target phrase class, and a target word order class; the types of the cross-language fine-grained control information may include a target text length class, a target text sentiment class, a target text lexical class, a target text syntactic range class, and a target text syntactic template class.

[0041] As mentioned above, the user may not give all the prompt information at once. Therefore, when receiving the user's correction operation on the prompt information of the specified round, the correction operation is also performed based on the specified round prompt information to supplement at least part of the translation prompt information or the cross-language fine-grained control information that is not included. In some embodiments, the user can, for example, in the order of the priority of the control requirements from high to low, only put forward new prompts for one type of translation prompt information or cross-language fine-grained control information at a time, so that the user can more clearly know the matching degree between the generated cross-language target text and its control requirements.

[0042] Figure 3 A schematic diagram of the composition structure of a first learning model according to an embodiment of the present application is shown.

[0043] like Figure 3 As shown, the first learning model 300 may include a first encoding unit 301, a second encoding unit 302 and a decoding unit 303, and a natural language prompt template 304. Based on the received source language text combined with the prompt information, generating a cross-language target text for display using the trained first learning model 300 may specifically include the following steps.

[0044] First, the prompt information expressed by the user in natural language is integrated into a first continuous text using the natural language prompt template 304 .

[0045] As mentioned above, according to the embodiments of the present application, it is possible to support user input of richer and wider control dimensions and angles than the traditional constraint types in the prior art, and the prompt information given by the user can be a natural language text of any form and content. Subsequently, through the natural language prompt template 304, after pre-processing such as semantic analysis, information extraction and screening, multiple prompt information are matched to the corresponding placeholders in the natural language prompt template 304, so that the natural language prompt information given by the user is integrated into the first continuous text ,in, Prompt the user for the information contained in Translation prompt information from different angles or cross-language fine-grained control information, and the first continuous text P The format can be recognized and directly applied by subsequent components in the first learning model 300 .

[0046] Then, based on the first continuous text P , using the first encoding unit 301 P Encode to get the hint vector ,in, o 1 is right p 1 is encoded and the resulting hint vector is o The first component of o 2 is right p 2 is the second component of the hint vector o obtained by encoding, and so on. Correspondingly, o t0 Yes p t0 The hint vector obtained by encoding o No. Components, etc., are not listed here one by one.

[0047] In addition, for example, the source language text input by the user can be used in parallel , wherein the second encoding unit 302 is used to X Encode to get the source language text vector .in, is the length of the source language text sequence, x 1, x 2, ..., x t1 Source language text X t1 characters in h 1, h 2, ..., h t1 To use the second encoding unit 302 X After encoding, respectively x 1, x 2, ..., x t1 The corresponding source language text vector h of each component.

[0048] Next, the prompt vector o and the source language text vector h The decoder 303 is sent to generate a cross-language target text. For display, t is the length of the cross-language target text sequence, y 1, y 2, ..., y t is the cross-language target text sequence t characters. It is worth noting that t and t1 It is not necessarily the same value. In particular, when the user prompt information includes cross-language fine-grained control information such as the target text length, the length of the generated cross-language target text may vary compared to the source language text.

[0049] In some embodiments, the first encoding unit 301 and the second encoding unit 302 can be implemented by using any flexible and adaptable neural network structure, and the decoding unit 303 can be implemented by using an autoregressive method based on the source language text vector. h , and combined with the hint vector o To generate a vector that matches the prompt o Cross-language target text for control requirements in Y .

[0050] In other embodiments, the first encoding unit 301 and the second encoding unit 302 may not be set as separate components, but may be implemented as a unified encoding unit. In this case, the source language text and prompt information input by the user can be input into the unified encoding unit for unified encoding. This application does not limit this.

[0051] In the process of training the first learning model, in order to enable the first learning model to have the ability to give matching, high-quality target language text according to user prompt information after training, the first learning model can be trained based on both source language text-cross-language target text training sentence pairs and training prompt sets.

[0052] From the dimension of control information, the prompt information in the training prompt set includes at least translation prompt information and cross-language fine-grained control information. The translation prompt information can be constructed by obtaining word alignment information in the sentence pair, and the cross-language fine-grained control information can be constructed by extracting linguistic features of the cross-language target text.

[0053] Specifically, the types of translation prompt information may include at least target word group type, target phrase type and target word order type. For example, the word alignment information of the source language text to the target language text can be obtained through the existing statistical translation method, and various types of translation prompt information can be constructed based on the alignment information.

[0054] As an example only, the translation prompt information of the target phrase class can specify that a specific phrase in the source language is translated into a specific phrase in the target language in the source language text-cross-language target text training sentence pair, such as specifying that "World Trade Organization" is translated into "World Trade Organization". For another example, the translation prompt information of the target phrase class can specify specific phrase restrictions in the target language translation, such as the translation should start with "at the United Nations conference", or the translation should include the specific term "United Nations conference", etc. For another example, the translation prompt information of the target word order class can specify specific word order restrictions that should be presented when translating source language phrases, such as the source language phrase "the United Nations conference" should be translated after the phrase "that was held on November 12th", etc., which are not listed here one by one.

[0055] The types of cross-language fine-grained control information may include at least target text length class, target text sentiment class, target text lexical class, target text syntactic range class and target text syntactic template class. The linguistic features of the target language text can be obtained through existing language parsing tools, such as Stanza, and various types of cross-language fine-grained control prompt information can be constructed.

[0056] As an example only, the target text length prompt information is intended to control the length of the generated cross-language target text. For example, a text with a length of 6 can be specified: "Global warming is a significant issue". For another example, the target text sentiment prompt information can be used to specify the sentiment tendency of the generated cross-language target text. For example, when the source language is English, the source language text "This product is very serviceable." can be rewritten into a positive version of the cross-language target text corresponding to "This product is excellent and has an excellent user experience" or a negative version of the cross-language target text corresponding to "Although this product is useful, it has some shortcomings". For another example, the target text lexical prompt information can require the generated cross-language target text to strictly follow a given lexical (such as part of speech) sequence. For example, for the source language text "He ran over quickly", if the given lexical prompt information is adjective-adverb-verb, then the generated target language text may be corresponding to "He ran quickly". For another example, the target text syntactic range type prompt information can be used to impose specific syntactic structure restrictions on the generated cross-language target text, for example, it can be required that the 5th to 11th words of the generated cross-language text constitute a verb phrase. For another example, the target text syntactic template type prompt information can be used to restrict the generated cross-language target text to follow a specific syntactic template, for example, the target text is generated according to the "(ROOT (S (VP (S ))))" template, and so on.

[0057] Figure 4 A schematic diagram showing a training method for a first learning model according to an embodiment of the present application is shown.

[0058] When the first learning model is trained based on the source language text-cross-language target text training sentence pairs and the training prompt set, the training model can be trained according to Figure 4 The steps 401 to 403 are performed as shown.

[0059] First, in step 401, it can be determined whether to provide prompt information for the current training sentence pair based on the first distribution function.

[0060] In some embodiments, the first distribution function may be, for example, a Bernoulli distribution. By setting the parameters of the Bernoulli distribution, the probability of providing prompt information for the training sentence pair may be controlled as needed, so that the trained first learning model can not only accurately generate a cross-language target text that meets user needs when there is user prompt information, but also directly output a cross-language target text with accurate translation without losing translation performance when there is no user prompt information. The first distribution function may also select other distribution functions, and this application does not limit this.

[0061] Then, in step 402, when it is determined that prompt information is to be provided for the current training sentence pair, sampling is performed in the training prompt set based on the second distribution function to obtain a sampled prompt information set. The second distribution function may be, for example, any applicable uniform distribution function, so as to ensure uniform sampling in the training prompt set as much as possible.

[0062] Next, in step 403, the first learning model may be trained by using each source language text-cross-language target text training sentence pair in combination with a sampled prompt information set corresponding to the training sentence pair.

[0063] In some embodiments, in order to cover the prompt information of various dimensions and angles as evenly as possible, when it is determined that prompt information is to be provided for the current training sentence pair, the type of prompt information to be sampled is first determined from the type of each translation prompt information and the type of cross-language fine-grained control information based on the second distribution function, and then, in the subsets of the training prompt set corresponding to each type of prompt information to be sampled, sampling is performed according to the third distribution function corresponding to each type, and the union of the prompt information sampled from each subset is used as the sampled prompt information set. Among them, the third distribution function corresponding to each type can be, for example, any applicable uniform distribution function, and can be the same or different from each other, and this application does not make specific restrictions on this.

[0064] In some embodiments, when the first learning model is trained using each source language text-cross-language target text training sentence pair in combination with the sampling prompt information set corresponding to the corresponding training sentence pair, the first encoding unit, the second encoding unit and the decoding unit are jointly optimized, and the training goal is to minimize the negative log-likelihood of cross-language target text generation.

[0065] Specifically, for example, the decoder can be based on To model the conditional probability of the target end, that is, let the target text generation state be the previous The generated words, ,but , and use methods such as gradient descent and greedy search or beam search to find the Step selection makes The largest y t As the current output, repeatedly generate y t Until the preset length is reached or the output termination symbol is encountered. During the training optimization process, the negative log-likelihood function generated by the cross-lingual target text is minimized. is the target, where θ represents the parameter space including the first encoding part, the second encoding part and the decoding part, for y t The derivative of represents the probability function with θ as parameter space.

[0066] It is worth noting that according to Figure 4 When the method shown trains the first learning model, as shown in step 401, prompt information is not always provided for the training sentence pairs. Therefore, in the training process, the ability to accurately generate a cross-language target text with accurate translation is actually learned without relying on user prompt information. Therefore, according to an embodiment of the present application, the processor can only receive the source language text of the cross-language text to be generated input by the user, and the processor can generate a cross-language target text for display using the trained first learning model based only on the received source language text without relying on prompt information given by the user.

[0067] According to an embodiment of the present application, a system for generating a cross-language target text based on prompt information is also provided. Figure 5 A schematic diagram showing some components of a system for generating a cross-language target text based on prompt information according to an embodiment of the present application is shown.

[0068] like Figure 5 As shown, the system 500 at least includes an interface 501, a processor 502, and a display 503. The interface 501 can be configured to obtain a source language text of a cross-language text to be generated input by a user and prompt information input by the user, wherein the prompt information supports expression in the form of natural language and includes multiple types of cross-language fine-grained control information.

[0069] In some embodiments, the interface 501 may include a network adapter, a cable connector, a serial connector, a USB connector, a parallel connector, a high-speed data transmission adapter (such as optical fiber, USB 3.0, Thunderbolt interface, etc.), a wireless network adapter (such as a WiFi adapter), a telecommunications (3G, 4G / LTE, etc.) adapter, etc., and this application does not limit this. The system 500 can transmit the source language text of the cross-language text to be generated and the prompt information input by the user to other parts such as the processor 502 and the display 503 through the interface 501. In some embodiments, the interface 501 can also receive, for example, a trained first learning model from a learning network training device (not shown), which is not listed one by one in this application.

[0070] In some embodiments, the processor 502 may be configured to perform various operations of the method for generating a cross-language target text based on prompt information described in various embodiments of the present application. In some embodiments, the processor 502 may be a processing device including one or more general-purpose processing devices, such as a microprocessor, a central processing unit (CPU), a graphics processing unit (GPU), etc. More specifically, the processor may be a complex instruction set computing (CISC) microprocessor, a reduced instruction set computing (RISC) microprocessor, a very long instruction word (VLIW) microprocessor, a processor running other instruction sets, or a processor running a combination of instruction sets. The processor may also be one or more special-purpose processing devices, such as an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a digital signal processor (DSP), a system on a chip (SoC), etc.

[0071] In some embodiments, the display 503 can be configured to at least display the generated cross-language target text. In other embodiments, the display 503 can also be configured to display the source language text, and, when the user gives prompt information in the previous round, display the prompt information of each previous round and the corresponding cross-language target text and other information that needs to be displayed, which will not be repeated here.

[0072] In some embodiments, the display 503 may include a liquid crystal display (LCD), a light emitting diode display (LED), a plasma display, or any other type of display, and present a graphical user interface (GUI) on the display for user input and image / data display, etc., which will not be described in detail here.

[0073] According to an embodiment of the present application, a non-transitory computer-readable storage medium is also provided, on which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, various operations of the method for generating a cross-language target text based on prompt information described in various embodiments of the present application are implemented.

[0074] In some embodiments, the above-mentioned non-transitory computer-readable medium can be a read-only memory (ROM), random access memory (RAM), phase change random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), electrically erasable programmable read-only memory (EEPROM), other types of random access memory (RAM), flash disk or other forms of flash memory, cache, register, static memory, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, cassette tape or other magnetic storage device, or any other possible non-transitory medium used to store information or instructions that can be accessed by a computer device.

[0075] The method, system and medium for generating cross-language target text based on prompt information according to the embodiment of the present application have better user-friendly interaction, allowing users to put forward text control demands in the form of natural language, and are not limited to putting forward all demands at one time. It can also progressively iterate or supplement control demands of multiple dimensions and multiple angles through observation and analysis of the comparison and presentation of the generation status of previous prompts and corresponding target texts. And according to the first learning model of the embodiment of the present application, in the case where, for example, the wording and sentence structure of natural language are ever-changing and may contain different numbers and types of control demands, the model can also automatically parse and convert into a format that can be processed by the network, and robustly identify user intentions and accurately complete text control. The model can be applied to any sequence-to-sequence learning network, and realize multi-task processing such as translation and text rewriting under a unified network architecture, and has strong versatility, universality and scalability.

[0076] By comparing with the translation model in the prior art, the first learning model according to the embodiment of the present application performs better in terms of target text generation quality and control success rate on the fine-grained cross-language text control task. Table 1 shows the comparison results of the first learning model according to the embodiment of the present application with the existing open source large model (Llama-2-7B-Chat) and the commercial large model (ChatGPT) in terms of target text generation quality and control success rate indicators on the fine-grained cross-language text control task.

[0077] Table 1

[0078]

[0079] It can be roughly seen from Table 1 that in terms of each indicator of model generation quality, control generation quality and control success rate, the first learning model according to the embodiment of the present application is better than Llama-2-7B-Chat and ChatGPT.

[0080] In addition, although exemplary embodiments have been described herein, the scope includes any and all embodiments based on the present application with equivalent elements, modifications, omissions, combinations (e.g., various embodiments intersecting schemes), adaptations or changes. The elements in the claims will be interpreted broadly based on the language adopted in the claims, and are not limited to the examples described in this specification or during the execution of the application, and the examples will be interpreted as non-exclusive. Therefore, this specification and examples are intended to be considered as examples only, and the true scope and spirit are indicated by the claims and the full scope of their equivalents.

[0081] The above description is intended to be illustrative rather than restrictive. For example, the above examples (or one or more schemes thereof) may be used in combination with each other. For example, a person of ordinary skill in the art may use other embodiments when reading the above description. In addition, in the above-mentioned specific embodiments, various features may be grouped together to simplify the present application. This should not be interpreted as an intention that a disclosed feature that is not required to be protected is necessary for any claim. On the contrary, the subject matter of the present application may be less than all the features of a particular disclosed embodiment. Thus, the claims are incorporated herein as examples or embodiments in the specific embodiments, wherein each claim is independently a separate embodiment, and it is considered that these embodiments may be combined with each other in various combinations or arrangements. The scope of the present application should be determined with reference to the claims and the full scope of equivalent forms granted by these claims.

[0082] The above embodiments are only exemplary embodiments of the present application and are not intended to limit the present application. The protection scope of the present application is defined by the claims. Those skilled in the art may make various modifications or equivalent substitutions to the present application within the essence and protection scope of the present application, and such modifications or equivalent substitutions shall also be deemed to fall within the protection scope of the present application.

Claims

1. A method for generating a cross-language target text based on prompt information, characterized in that: include: The processor receives a source language text for generating a cross-language text input by a user; The processor receives prompt information input by the user, wherein the prompt information supports expression in the form of natural language and includes multiple types of cross-language fine-grained control information, wherein the types of the cross-language fine-grained control information include target text length class, target text sentiment class, target text lexical class, target text syntactic range class and target text syntactic template class; The processor generates a cross-language target text for display by using the trained first learning model based on the received source language text and in combination with the prompt information; The first learning model is trained based on source language text-cross-language target text training sentence pairs and a training prompt set containing translation prompt information and cross-language fine-grained control information, specifically including: Determine whether to provide prompt information for the current training sentence pair based on the first distribution function; when it is determined that prompt information is to be provided for the current training sentence pair, determine the type of prompt information to be sampled from the types of various translation prompt information and the types of cross-language fine-grained control information based on the second distribution function; in the subsets of the training prompt set corresponding to each type of prompt information to be sampled, sample according to the third distribution function corresponding to each type, and use the union of the prompt information sampled from each subset as the sampled prompt information set for the current training sentence pair; train the first learning model using each source language text-cross-language target text training sentence pair in combination with the sampled prompt information set corresponding to the training sentence pair.

2. The method according to claim 1, characterized in that The method further comprises, In the case where the user has given prompt information in the previous round, the prompt information of each previous round and the corresponding cross-language target text are displayed in comparison; receiving a user's correction operation on the prompt information of a specified round, wherein the correction operation is performed based at least on a deviation between the cross-language target text of the specified round and the prompt information of the round; Based on the source language text combined with the corrected prompt information, the trained first learning model is again used to generate an updated cross-language target text for display.

3. The method according to claim 1 or 2, characterized in that: The prompt information also includes translation prompt information, and the method further includes: Providing guidance for the prompt information to the user, so that the user can provide prompt information including at least one type of translation prompt information and / or at least one type of cross-language fine-grained control information for the generation of the cross-language target text; wherein, The types of translation prompt information include target word group type, target phrase type and target word order type.

4. The method according to claim 3, characterized in that The method further comprises, In case of receiving a user's correction operation on the prompt information of a specified round, the correction operation is further performed based on the supplementation of the specified round prompt information to at least part of the translation prompt information or the cross-language fine-grained control information by types not included.

5. The method according to claim 1 or 2, characterized in that: The first learning model includes a first encoding unit, a second encoding unit and a decoding unit. Based on the received source language text combined with the prompt information, the trained first learning model is used to generate a cross-language target text for display, which specifically includes: Using a natural language prompt template, integrating the prompt information into a first continuous text; Based on the first continuous text, use the first encoding unit to encode to obtain a prompt vector; based on the source language text, use the second encoding unit to encode to obtain a source language text vector; The prompt vector and the source language text vector are sent to the decoding unit together to generate a cross-language target text for display.

6. The method according to claim 1, characterized in that The translation hint information is constructed by acquiring word alignment information in the sentence pair; and the cross-language fine-grained control information is constructed by extracting linguistic features of the cross-language target text.

7. The method according to claim 5, characterized in that The method further includes: when training the first learning model using each source language text-cross-language target text training sentence pair in combination with the sampled prompt information set, jointly optimizing the first encoding part, the second encoding part, and the decoding part, and taking minimizing the negative log-likelihood of cross-language target text generation as a training goal.

8. The method according to claim 7, characterized in that The method further comprises: The processor only receives the source language text of the cross-language text to be generated input by the user; the processor generates the cross-language target text for display using the trained first learning model based only on the received source language text without relying on prompt information given by the user.

9. A system for generating a cross-language target text based on prompt information, characterized in that: include: The interface is configured to: obtain a source language text of a cross-language text to be generated and prompt information input by a user, wherein the prompt information supports expression in a natural language form and includes multiple types of cross-language fine-grained control information; A processor, configured to: execute the method for generating a cross-language target text based on prompt information according to any one of claims 1 to 7; and a display configured to: display the generated cross-language target text.

10. A non-transitory computer-readable storage medium, characterized in that: Computer executable instructions are stored thereon, and when the computer executable instructions are executed by a processor, the method for generating a cross-language target text based on prompt information according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Data processing method and device and electronic equipment

    CN111104807A

  • Method and system for generating cross-language abstract for long text of source language and medium

    CN116187324A

  • Human-in-loop neural machine translation method and system and readable storage medium

    CN117195922A

  • Modularized semantic machine translation method and device and storage medium

    CN117371461A

  • Cross-language vulnerability detection system based on hierarchical source code representation learning method

    CN118332559A