A text translation method and system

CN122596076APending Publication Date: 2026-08-18TIANJIN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611015069.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-09
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

但该方法对上下文信息和复杂语言现象的建模能力有限,在翻译中难以兼顾语义与形态一致性,导致翻译的准确性较低

Benefits of technology

[0010]According to the embodiments of this application, because semantic translation processing is performed on the source language text to be translated to obtain an initial translation text for the target language; then, according to the grammatical constraints of the target language, the morphological constraint information corresponding to at least one text span in the text to be translated in the target language is determined; then, the translation text span corresponding to the text span in the initial translation text is determined, and the actual morphological information of the translation text span is compared with the morphological constraint information to obtain a comparison result; and in response to the comparison result indicating that the actual morphological information and the morphological constraint information do not match, according to the first preset prompt information, a large language model is used to perform difference analysis on the actual morphological information and the morphological constraint information and output the analysis result, and the translation text span is modified according to the analysis result to obtain the target translation text, the technical means at least partially overcome the technical problem that semantic and morphological consistency are difficult to balance in the translation process of related examples, thereby achieving the technical effect of ensuring the semantic accuracy of the translation while making the translation strictly conform to the grammatical and morphological norms of the target language, which helps to improve the accuracy and standardization of text translation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122596076A_ABST
    Figure CN122596076A_ABST
Patent Text Reader

Abstract

The application provides a text translation method and system, which is applied to the field of artificial intelligence technology, and in particular to the field of natural language processing technology. The method comprises: performing semantic translation processing on a text to be translated in a source language to obtain an initial translation text; determining morphological constraint information corresponding to at least one text span to be translated in the text to be translated in a target language according to a grammatical constraint rule of the target language; determining a translation text span corresponding to the text span to be translated in the initial translation text, and comparing actual morphological information of the translation text span with the morphological constraint information to obtain a comparison result; in response to the comparison result indicating that the actual morphological information and the morphological constraint information do not match, performing difference analysis on the actual morphological information and the morphological constraint information according to first preset prompt information by using a large language model and outputting an analysis result, and modifying the translation text span according to the analysis result to obtain a target translation text.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, particularly to the field of natural language processing technology, and more specifically, to a text translation method and system. Background Technology

[0002] With the widespread application of internet technology and the deepening of social informatization, cross-language information exchange is becoming increasingly important in various fields such as education, scientific research, and business. Especially in multilingual content service scenarios, the demand for high-quality, automated translation technology continues to rise. To meet these needs, machine translation technology has achieved rapid development.

[0003] The translation systems in the relevant examples mainly employ rule-based or statistical learning methods, achieving language conversion through manually constructed rules or probabilistic models. However, these methods have limited ability to model contextual information and complex linguistic phenomena, making it difficult to balance semantic and morphological consistency in translation, resulting in low translation accuracy. Summary of the Invention

[0004] In view of this, this application provides a text translation method and system.

[0005] One aspect of this application provides a text translation method, comprising: performing semantic translation processing on a text to be translated in a source language to obtain an initial translation text in a target language; determining, according to the grammatical constraint rules of the target language, morphological constraint information corresponding to at least one text span in the text to be translated in the target language; determining the translation text span corresponding to the text span in the initial translation text, and comparing the actual morphological information of the translation text span with the morphological constraint information to obtain a comparison result; and responding to the comparison result indicating a mismatch between the actual morphological information and the morphological constraint information, performing a difference analysis on the actual morphological information and the morphological constraint information using a large language model according to a first preset prompt, outputting the analysis result, and modifying the translation text span according to the analysis result to obtain the target translation text, wherein the first preset prompt is used to constrain the large language model to execute in the order of first outputting the analysis result and then performing the modification operation.

[0006] Another aspect of this application provides a text translation system, comprising: a semantic generation module for performing semantic translation processing on a text to be translated in a source language to obtain an initial translated text in a target language; a morphological information determination module for determining, according to the grammatical constraint rules of the target language, the morphological constraint information corresponding to at least one span of the text to be translated in the target language; a comparison module for determining the translated text span corresponding to the span of the text to be translated in the initial translated text, and comparing the actual morphological information of the translated text span with the morphological constraint information to obtain a comparison result; and a modification module for responding to a mismatch between the actual morphological information and the morphological constraint information indicated by the comparison result, performing a difference analysis on the actual morphological information and the morphological constraint information using a large language model according to a first preset prompt, outputting the analysis result, and modifying the translated text span according to the analysis result to obtain the target translated text, wherein the first preset prompt is used to constrain the large language model to execute in the order of first outputting the analysis result and then performing the modification operation.

[0007] Another aspect of this application provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to perform the method described above.

[0008] Another aspect of this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed, are used to implement the above-described method.

[0009] Another aspect of this application provides a computer program product including computer-executable instructions that, when executed, implement the method described above.

[0010] According to the embodiments of this application, because semantic translation processing is performed on the source language text to be translated to obtain an initial translation text for the target language; then, according to the grammatical constraints of the target language, the morphological constraint information corresponding to at least one text span in the text to be translated in the target language is determined; then, the translation text span corresponding to the text span in the initial translation text is determined, and the actual morphological information of the translation text span is compared with the morphological constraint information to obtain a comparison result; and in response to the comparison result indicating that the actual morphological information and the morphological constraint information do not match, according to the first preset prompt information, a large language model is used to perform difference analysis on the actual morphological information and the morphological constraint information and output the analysis result, and the translation text span is modified according to the analysis result to obtain the target translation text, the technical means at least partially overcome the technical problem that semantic and morphological consistency are difficult to balance in the translation process of related examples, thereby achieving the technical effect of ensuring the semantic accuracy of the translation while making the translation strictly conform to the grammatical and morphological norms of the target language, which helps to improve the accuracy and standardization of text translation. Attached Figure Description

[0011] The above and other objects, features and advantages of this application will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:

[0012] Figure 1 An exemplary system architecture for applying text translation methods according to embodiments of this application is shown.

[0013] Figure 2 A flowchart of a text translation method according to an embodiment of this application is shown.

[0014] Figure 3 A schematic diagram illustrating the determination of morphological constraint information according to an embodiment of this application is shown.

[0015] Figure 4 A schematic diagram illustrating a method for modifying the span of text to be modified according to an embodiment of this application is shown.

[0016] Figure 5 A block diagram of a text translation system according to an embodiment of this application is shown.

[0017] Figure 6 A schematic diagram illustrating text translation performed by a text translation system according to an embodiment of this application is shown. Detailed Implementation

[0018] The embodiments of this application will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of this application. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of this application for ease of explanation. However, it will be apparent that one or more embodiments may be implemented without these specific details. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concepts of this application.

[0019] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0020] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.

[0021] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).

[0022] In the embodiments of this application, the collection, updating, analysis, processing, use, transmission, provision, disclosure, and storage of data (e.g., including but not limited to user personal information) comply with relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. In particular, necessary measures have been taken to prevent unauthorized access to user personal information data and to safeguard user personal information security and network security.

[0023] In the embodiments of this application, the user's authorization or consent was obtained before obtaining or collecting the user's personal information.

[0024] With the widespread application of internet technology and the continuous advancement of globalization, cross-language information exchange has become increasingly important in various fields such as education, scientific research, and business. Especially in multilingual content service scenarios, the demand for high-quality, automated translation technology continues to grow. To meet these needs, machine translation technology has developed rapidly.

[0025] The translation systems in the relevant examples mainly employ rule-based or statistical learning methods, achieving language conversion through manual rule design or probabilistic models. While these methods have achieved certain results in specific scenarios, their ability to model contextual information and complex linguistic phenomena is limited, making it difficult to adapt to the real-world application needs of diverse language structures and complex morphological changes.

[0026] With the development of deep learning technology, researchers have begun to introduce neural network models, especially Large Language Models (LLMs), into machine translation tasks. However, most machine translation solutions based on LLMs in relevant examples adopt an end-to-end text generation approach, using a single model to complete semantic understanding and target language generation. However, when dealing with languages ​​with complex morphological changes or strict grammatical constraints, this end-to-end translation approach struggles to simultaneously ensure semantic accuracy and grammatical correctness in the same translation process. It is prone to producing translation results with lexical inconsistencies or grammatical errors, thus affecting the quality and usability of the translation.

[0027] Furthermore, some translation methods that introduce intermediate representations often employ a serial processing structure. If there is a deviation in the intermediate result, it can be amplified in subsequent translation processes, causing error propagation and leading to a decline in overall translation performance.

[0028] Meanwhile, existing technologies lack effective decoupling of semantic generation and morphological constraints during the translation process, making it difficult to flexibly control according to the grammatical characteristics of different languages. This not only results in poor stability and adaptability of translation systems in multilingual and low-resource language scenarios, but also easily leads to problems such as word form errors or grammatical inconsistencies, which need further improvement.

[0029] Based on this, this application provides an intelligent translation method based on the decoupling of semantic generation and morphological control. By separating the semantic content and grammatical constraints during the translation process and fusing and correcting the generated results, the accuracy and stability of translation in complex grammatical and low-resource language scenarios are improved. Specifically, embodiments of this application provide a text translation method, including: performing semantic translation processing on a text to be translated in a source language to obtain an initial translation text in a target language; determining, according to the grammatical constraint rules of the target language, the morphological constraint information corresponding to at least one span of the text to be translated in the target language; determining the translation text span corresponding to the span of the text to be translated in the initial translation text, and comparing the actual morphological information of the translation text span with the morphological constraint information to obtain a comparison result; and responding to the comparison result indicating a mismatch between the actual morphological information and the morphological constraint information, performing a difference analysis on the actual morphological information and the morphological constraint information using a large language model according to a first preset prompt, outputting the analysis result, and modifying the translation text span according to the analysis result to obtain the target translation text, wherein the first preset prompt is used to constrain the large language model to execute in the order of first outputting the analysis result and then performing the modification operation.

[0030] Figure 1 An exemplary system architecture for applying text translation methods according to embodiments of this application is illustrated. It should be noted that... Figure 1 The examples shown are merely examples of system architectures that can be applied to the embodiments of this application, in order to help those skilled in the art understand the technical content of this application, but do not mean that the embodiments of this application cannot be used in other devices, systems, environments or scenarios.

[0031] like Figure 1 As shown, the system architecture of this embodiment may include a semantic generation module 110, a morphological control module 120, and an editing and fusion module 130. During text translation, the source language input text is simultaneously input into both the semantic generation module 110 and the morphological control module 120. The semantic generation module 110 performs semantic translation on the source language input text, outputting an initial semantic translation. Simultaneously, the morphological control module 120 extracts morphological constraints from the source language input text, outputting a set of structured grammatical constraints. Then, the source language input text, the initial semantic translation, and the set of structured grammatical constraints are simultaneously input into the editing and fusion module 130 for editing and fusion processing, ultimately outputting the target translation. The system architecture of this application breaks away from the traditional single-generation or serial translation structure, dividing the translation process into parallel semantic generation and morphological constraint extraction stages, and introducing a residual-based comparative fusion stage. The collaborative work of each stage effectively avoids the accumulation of errors caused by inaccurate intermediate results and achieves precise grammatical control without losing original high-quality vocabulary.

[0032] The following is combined with Figures 2-4 The text translation method described in this application is explained in detail.

[0033] Figure 2 A flowchart of a text translation method according to an embodiment of this application is shown.

[0034] like Figure 2 As shown, the text translation method of this embodiment includes operations S210~S240.

[0035] In operation S210, semantic translation processing is performed on the text to be translated in the source language to obtain the initial translated text in the target language.

[0036] The source language refers to the original language used in the text to be translated, such as English or Chinese. In translation tasks, the source language is the starting point of the input. Depending on the specific circumstances, the source language can be any natural language, such as Chinese or French, or it can be a programming language or a markup language. This application does not limit the specific type of source language.

[0037] The text to be translated refers to the original sentences or passages that exist in the source language and require translation. For example, the text to be translated could be a sentence in English, such as "The terrified cat sprinted across the wet lawn".

[0038] Furthermore, the text to be translated can be obtained from an open database, such as from a relevant website; the text to be translated can also be input by the user into the text translation system in real time; of course, the embodiments of this application do not limit the method of obtaining the original text, and can be adapted according to the actual situation.

[0039] Semantic translation processing refers to translation activities that prioritize conveying the core semantics of the source text. When generating a translation, it prioritizes ensuring the accuracy of word meanings, the naturalness of expression, and the consistency of style. It allows for imperfections in grammatical details such as noun case and verb agreement in the target language, as long as the word roots can accurately convey the core semantics of the source language sentence.

[0040] The target language refers to the language into which the text to be translated needs to be converted, such as Chinese, Russian, or German. In translation tasks, the target language is the target form of the output.

[0041] The initial translated text refers to the translated result obtained directly after semantic translation processing; it is an intermediate product of this stage. While the initial translated text is relatively accurate at the semantic level, it may contain morphological inconsistencies with the grammatical rules of the target language.

[0042] In some embodiments, semantic translation processing of the source language text can include implementations using models with different structures or parameter scales. For neural network implementations, either autoregressive large language models with hundreds of billions of parameters (such as generative models based on the Transformer decoder architecture) or lightweight encoder-decoder architecture translation models can be used. For non-neural network implementations, phrase-based statistical machine translation (PBMT) or rule-based machine translation (RBMT) engines combined with high-frequency dictionaries can be used to generate initial semantic translations containing core vocabulary. The key is to ensure that the system can generate initial translated texts while relaxing strict grammatical constraints.

[0043] For example, semantic translation processing of text to be translated in a source language includes using a large language model based on the Transformer architecture. Specifically, based on preset prompts, the large language model is used to perform semantic translation processing on the text to be translated to obtain an initial translated text. The preset prompts are used to instruct the large language model to prioritize semantic accuracy over morphological accuracy during the semantic translation process.

[0044] Preset prompts are instruction texts that are proactively injected into the model input before calling the large language model. These instruction texts are used to guide the behavior patterns and output preferences of the large language model.

[0045] Semantic accuracy refers to whether the translation accurately conveys the core meaning of the source language text, specifically reflected in the correct correspondence of word roots, the complete preservation of key information, and the accurate mapping of semantic relationships.

[0046] Morphological accuracy refers to whether the translation conforms to the mandatory grammatical requirements of the target language, such as the case of nouns (nominative and accusative), the tense and person of verbs, and the agreement of gender and number of adjectives.

[0047] For example, the preset prompt message could be something like, "Prioritize the accuracy, idiomaticity, and stylistic features of the vocabulary. We can tolerate grammatical flaws in the target language, such as the case of nouns or the agreement of verbs, as long as the root word accurately conveys the meaning of the source sentence."

[0048] For example, when the source language input is the English sentence "The terrified cat sprinted across the wetlawn" and the target language is Russian, the following prompt is injected into the large language model: "Please translate the following English sentence into Russian, prioritizing semantic accuracy and natural expression, without requiring complete correctness in noun case and verb agreement." After receiving this prompt, the large language model will, during the autoregressive decoding process, favor words with high semantic matching and idiomatic expression, rather than excessively forcing nouns to use the nominative case or verbs to agree in gender and number with the subject. The final generated initial translation text is a semantically accurate Russian sentence. The probability distribution model of its generation process is expressed as the following formula (1):

[0049] (1);

[0050] in, This indicates the initial translated text. Represents the conditional probability distribution of a large language model. This indicates the text to be translated. Formula (1) represents the preset prompt information and the initial translated text as a whole. From a large language model, given the text to be translated and preset prompt information The random variables obtained are used in the conditional probability distribution.

[0051] Under the guidance of relaxed morphological constraints, the core objective is to anchor a high-quality vocabulary distribution, providing a reliable semantic foundation for subsequent morphological refinement. This design avoids requiring large language models to simultaneously satisfy all complex morphological constraints (such as case, gender, and number) in a single generation, as the distraction of attention from multiple tasks often leads to model degradation, tending to use generalized, bland common vocabulary, resulting in the loss of deep semantic information. Without pre-generating initial translation text based on the guidance of relaxed morphological constraints, large language models are prone to severe semantic drift, sacrificing translation accuracy in order to forcibly meet grammatical requirements.

[0052] It is worth noting that the semantic translation processing steps in this embodiment use a general-purpose large language model, rather than a translation model fine-tuned for a specific language pair, thus possessing good cross-language generalization ability. In this way, it is possible to quickly generate an initial translation with natural semantics and idiomatic vocabulary without sacrificing semantic accuracy, while reserving sufficient processing space for subsequent morphological constraint extraction and conflict detection.

[0053] In operation S220, based on the grammatical constraints of the target language, the morphological constraint information corresponding to at least one span of the text to be translated in the target language is determined.

[0054] The grammatical constraints of a target language refer to the mandatory grammatical requirements stipulated by the target language at the lexical morphology level. Different languages ​​have different morphological rules for word classes such as nouns, verbs, and adjectives. For example, Russian requires nouns to use different case forms (nominative, accusative, dative, etc.) according to their syntactic role (subject, object, etc.) in a sentence; German requires nouns to distinguish case, gender, and number simultaneously; English requires verbs to conjugate according to the person and number of the subject (e.g., adding "-s" for the third-person singular). These rules collectively constitute the grammatical constraints of the target language.

[0055] For example, determining the grammatical constraint rules of the target language may include: pre-building a grammatical constraint rule library that wraps different languages, and then obtaining the grammatical constraint rules corresponding to the target language from the grammatical constraint rule library.

[0056] The text span to be translated refers to a lexical or phrase unit within the text to be translated. This text span can be a single word, such as the noun "cat" or the verb "run"; or it can be a phrase unit composed of multiple words, such as the noun phrase "the beautiful cat" or the prepositional phrase "on the table". It should be noted that the text span to be translated is the original unit extracted directly from the text to be translated, not the result of translation.

[0057] Morphological constraint information refers to the mandatory morphological changes required for a specific text span based on the grammatical constraints of the target language. It can be represented in the form of a set of structured tags. For example, if the source language noun phrase "the small mouse" is in the object position in a sentence, and the target language is Russian, its morphological constraint information may include "accusative, singular, feminine"; if the target language is German, it may include "accusative, singular, feminine, or neuter".

[0058] In some embodiments, determining the morphological constraint information corresponding to at least one span of the text to be translated in the target language according to the grammatical constraint rules of the target language may include: inputting the text to be translated and the target language identifier into a large language model; the large language model determining the grammatical constraint rules of the target language according to the target language identifier and dividing the text to be translated into at least one span; and then determining the morphological constraint information corresponding to the span of the text to be translated in the target language according to the grammatical constraint rules of the target language.

[0059] In other embodiments, to ensure that the large language model can stably output structured data, specific role and task prompts can be injected into the large language model. The core structure of the task prompts may include: "You are a linguistic planner for machine translation. Your task is to analyze the text to be translated and identify the specific grammatical constraints required to translate it into [target language]. Please identify source language keywords that require specific morphological inflection (such as verbs requiring specific tenses or nouns requiring specific cases). Do not translate sentences, only output constraints, in a strict format: source word → [constraint 1, constraint 2]".

[0060] Having obtained the initial translation text and the morphological constraint information corresponding to the span of each text to be translated, operation S230 is executed.

[0061] In operation S230, the translation text span corresponding to the span of the text to be translated in the initial translation text is determined, and the actual morphological information of the translation text span is compared with the morphological constraint information to obtain the comparison result.

[0062] The translation text span refers to the portion of the initial translation text that corresponds to the span of the source language text to be translated; that is, a continuous string of words or phrases that have a precise translational correspondence with the span of the text to be translated. For example, if the span of the text to be translated is "large caves" with constraints of [Genitive, Plural], the generated "больших пещер" will be accurately tracked in the initial Russian translation and locked as the translation text span.

[0063] Actual morphological information refers to the actual morphological features of a lexical unit as presented in the current translation, which are parsed from the translation span of the initial translated text. It is usually represented in the form of a set of morphological feature labels. For example, from the translation span "маленькая мышь" in the initial Russian translation, the actual morphological information parsed can include "nominative, singular, feminine".

[0064] In some embodiments, determining the translation text span corresponding to the span of the text to be translated in the initial translation text may include: using a cross-language alignment algorithm to retrieve and extract consecutive word or phrase fragments from the initial translation text that have an exact translation correspondence with the span of the text to be translated, thereby obtaining the translation text span.

[0065] Cross-language alignment algorithms are technical methods that establish lexical or phrase-level correspondences between source language text and target language translations. Their core objective is to identify which source language units translate into which target language units in parallel sentence pairs between the two languages, thereby constructing word-to-word or phrase-to-phrase mappings.

[0066] Before comparing the actual morphological information of the translated text span with the morphological constraint information, it is necessary to determine the actual morphological information of the translated text span. Specifically, a morphological parser can be used to extract the actual morphological attributes of the translated text span. For example, the actual morphological information of the current translated text span is parsed as [singular, feminine].

[0067] In operation S240, in response to the comparison result indicating that the actual morphological information and the morphological constraint information do not match, according to the first preset prompt information, the large language model is used to perform difference analysis on the actual morphological information and the morphological constraint information and output the analysis results. Based on the analysis results, the span of the translated text is modified to obtain the target translated text.

[0068] The first preset prompt message is used to constrain the large language model to execute in the order of first outputting the analysis results and then performing the modification operation.

[0069] A mismatch between actual morphological information and morphological constraint information indicates that at least one constraint in the actual morphology does not satisfy the morphological constraint information. For example, the actual morphological information for the span of the translated text is "nominative, singular, masculine," while the morphological constraint information requires "accusative, singular, masculine." Since the constraint label "accusative" does not belong to the set of actual morphological information, the comparison result is a mismatch.

[0070] The first preset prompt message is used to constrain the execution order of the large language model. The first preset prompt message could be: "You must analyze the differences and output the analysis results before performing the modification operation; skipping the analysis step and directly outputting the modification results is prohibited." The analysis results can be displayed and readable.

[0071] Based on the analysis results and morphological constraint information, the span of the translated text is modified to obtain the target translated text. This can include modifying the span of the translated text using the principle of minimum editing so that the span of the modified translated text satisfies the morphological constraint information.

[0072] According to an embodiment of this application, semantic translation processing is performed on the source language text to be translated to obtain an initial translation text for the target language; then, based on the grammatical constraint rules of the target language, the morphological constraint information corresponding to at least one text span in the text to be translated is determined in the target language; then, the translation text span corresponding to the text span in the initial translation text is determined, and the actual morphological information of the translation text span is compared with the morphological constraint information to obtain a comparison result; and in response to the comparison result indicating that the actual morphological information and the morphological constraint information do not match, according to a first pre- The system uses a large language model to perform differential analysis on actual morphological information and morphological constraint information, outputs the analysis results, and modifies the translation text based on the analysis results to obtain the target translation text. The first preset prompt information is used to constrain the large language model to execute the technical means of outputting the analysis results first and then performing the modification operation. Therefore, it at least partially overcomes the technical problem of the difficulty in balancing semantic and morphological consistency in the translation process in the relevant examples. This achieves the technical effect of ensuring the semantic accuracy of the translation while making the translation strictly conform to the grammatical and morphological norms of the target language, which helps to improve the accuracy and standardization of text translation.

[0073] In addition, the text translation method of this application decouples semantic generation from morphological control, which can improve the accuracy and stability of translation results under complex grammatical structures; at the same time, the parallel processing and editing fusion mechanism can reduce the risk of intermediate result errors propagating during the translation process.

[0074] According to embodiments of this application, determining the morphological constraint information corresponding to at least one text span in the text to be translated in the target language can be achieved through a rule engine, a lexical analyzer, or an agent based on a large language model.

[0075] A rule engine is a system component that executes decisions based on predefined rules. In morphological constraint determination tasks, a rule engine can contain a set of "condition-action" rules. The condition part matches the syntactic features of the text span to be translated (such as part of speech, dependency relations, and syntactic roles), and the action part outputs the corresponding target language morphological constraint labels. For example, a rule can be stated as: "If the text span to be translated is a noun and its syntactic role is a direct object (obj), and the target language is Russian, then output the morphological constraint information [accusative, singular]". For language pairs with clear grammatical rules and regular variations (such as noun case determination in English-to-Russian translation), rule engines can be used to achieve efficient and interpretable constraint extraction.

[0076] A lemmatist is a tool that analyzes the morphological structure of words and extracts grammatical features. In morphological constraint determination tasks, lemmatists can be used to identify the inherent morphological features (such as tense, person, and case) across the text to be translated. These features can be directly projected onto the morphological constraints of the target language. For example, an English lemmatist identifies the verb "chased" as having the morphological features of "past tense, third person singular." When the target language is German, this feature can be directly mapped to the German verb conjugation constraint of "past tense, third person singular." For inherent morphological features in the source language, such as verb tense and noun attributes, lemmatists can extract these features and directly project them onto the morphological constraints of the target language.

[0077] A large language model-based agent refers to an AI proxy that uses a large language model as its core inference engine and is guided by specific prompts to perform morphological constraint analysis tasks. This agent does not rely on a predefined rule base but instead utilizes the cross-lingual grammatical knowledge learned by the large language model during pre-training. It directly takes the span of the text to be translated and the target language identifier as input and outputs structured morphological constraint information. For scenarios with complex morphological changes, lack of explicit rules, or the need to handle long-distance dependencies, the system can use a large language model-based agent for end-to-end morphological constraint extraction.

[0078] It should be noted that the actual morphological information of the above-mentioned translation text span can be extracted in the same way as the morphological constraint information.

[0079] The following example uses a method for determining morphological constraint information based on a large language model, combined with... Figure 3 Explain the process of determining morphological constraint information.

[0080] Figure 3 A schematic diagram illustrating the determination of morphological constraint information according to an embodiment of this application is shown.

[0081] like Figure 3 As shown, the process of determining morphological constraint information in this embodiment includes: performing syntactic dependency analysis on the text to be translated 310 to determine the syntactic dependencies between multiple text spans in the text to be translated 310, and obtaining a dependency syntax tree 320, wherein the nodes in the dependency syntax tree 320 represent the text spans to be translated, and the edges represent the syntactic dependencies between the text spans to be translated; according to the general dependency syntax 330, mapping the syntactic dependencies corresponding to each edge in the dependency syntax tree 320 to the corresponding standard labels 340, and replacing the syntactic dependencies in the dependency syntax tree 320 with the standard labels 340 to obtain a standard dependency syntax tree 350; and determining the morphological constraint information 370 of the text spans to be translated corresponding to each node according to the standard labels of each node in the standard dependency syntax tree 350 and the grammatical constraint rules 360 of the target language.

[0082] Syntactic dependency analysis is a natural language processing technique that constructs a directed topological structure with the predicate verb as the root node by analyzing the dominance and subordination relationships between words in a sentence. This method can characterize the grammatical dependencies between words and distinguish between core sentence components and modifying, subordinate components. For example, performing syntactic dependency analysis on the English sentence "The beautiful cat chased the small mouse" will identify "chased" as the root node and establish two dependency arcs: "chased→cat" (subject-verb) and "chased→mouse" (verb-object).

[0083] A dependency syntactic tree is a tree-like structure output by syntactic dependency analysis. Nodes represent the span of the text to be translated (i.e., vocabulary or phrase units), and edges represent the syntactic dependencies between nodes.

[0084] Universal Dependencies (UD) is a unified syntactic annotation system for cross-language communication. It defines a standardized set of dependency relation tags, including common syntactic dependency types such as nsubj (subject-verb), obj (verb-object), obl (adverbial / adverbial), amod (adjective modifier), and det (determiner). Based on unified annotation rules and relation definitions, the UD framework can achieve alignment, comparison, and cross-language mapping of syntactic structures from different languages, enabling comparison and mapping of syntactic structures from different languages ​​within the same system.

[0085] Standard tags are standard dependency relation tags defined by the Universal Dependency Syntax Framework (UDS). They are used to replace language-specific dependency tags output by various parsers, thereby achieving cross-language consistency in syntactic expression. For example, the annotations output by different parsers for subject-verb relations will be uniformly mapped to the nsubj standard tags under the UD framework.

[0086] The standard dependency syntax tree is a standardized tree structure obtained by replacing all syntactic dependencies in the native dependency syntax tree with standard labels from the general dependency syntax tree. The nodes in this standard dependency syntax tree still represent the span of the text to be translated, but the labels on each edge have been converted to a language-neutral standard form, which facilitates subsequent cross-language morphological rule matching.

[0087] According to embodiments of this application, the determination of morphological constraint information for the span of the text to be translated corresponding to each node, based on the standard labels of each node in the standard dependency syntax tree and the grammatical constraint rules of the target language, can be implemented using a large language model. For example: using a large language model, the standard labels of each node in the standard dependency syntax tree and the target language are transformed into conditional vectors, injected into a feedforward neural network, and the morphological rule subspace corresponding to the target language is activated; the text vector of the span of the text to be translated is matched with the morphological rule subspace using a nonlinear inner product to determine the morphological constraint features corresponding to the span of the text to be translated; the morphological constraint features are input into a decoder, and the scores of each word corresponding to the morphological constraint features are output; the scores of words not in the whitelist for the target language are modified to negative infinity, and the modified scores of each word are normalized to obtain the probability of each word; based on the probability of each word, the morphological constraint information is output.

[0088] In other embodiments, the process of determining morphological constraint information based on a large language model may include: inputting the text to be translated and the target language identifier into the large language model, along with task prompts (such as "Please analyze the syntactic structure of the input text, and according to the grammatical rules of the target language, output the morphological constraint labels corresponding to each dependency node in JSON (JavaScript Object Notation) format, including case, number, gender, tense, etc. Only output structured labels, do not output other explanatory content"). After receiving the above input, the large language model achieves accurate extraction of morphological constraint information through the following process: from text to vector, and then from vector to structured grammatical rules. Specifically, the method based on the large language model includes the following steps:

[0089] Phase 1: Text vectorization and construction of implicit dependency trees.

[0090] First, the text to be translated is transformed into a high-dimensional sequence of word embedding vectors. In the hidden layer of the large language model, a multi-head self-attention mechanism is used to calculate the attention weight distribution among the word vectors in the sentence. This attention weight distribution dynamically captures the true syntactic dependencies (such as subject-verb, verb-object, and prepositional phrase relations) between words in the vector space. For example, for the input words "cat" and "sprinted," the attention mechanism assigns them higher association weights, thus naturally constructing the dependency syntactic tree topology of the text to be translated in the model's latent space.

[0091] Phase 2: Cross-linguistic feature projection based on general dependency grammar.

[0092] Cross-language mapping uses a general dependency grammar framework as its underlying mathematical schema to achieve isomorphic mapping between languages. Specifically, the large language model first identifies the UD roles of each node in the implicit dependency syntax tree (e.g., identifying that the noun "lawn" is governed by the preposition "across" indicating physical crossing, with its dependency relationship being obl indirect object). Subsequently, combined with the target language identifier (e.g., "Russian"), it is injected as a conditional vector into the feedforward neural network, activating the target language-specific morphological rule subspace. The syntactic feature vector of the text to be translated is then matched with this subspace using a nonlinear inner product, thereby triggering specific morphological constraint features (e.g., activating the morphological node representing "Accusative Case" after matching).

[0093] The third stage: controlled autoregressive decoding and structured information generation.

[0094] After completing the feature mapping in the latent space, the decoder transforms the latent vectors carrying morphological constraint information into a probability distribution of natural language. At this stage, a mandatory constraint mechanism based on "vocabulary masking" and "logits penalty" is introduced: a pre-constructed set of legal morphological labels for the target language (such as nominative, plural, etc.) is used as a whitelist. When the model generates each token autoregressively, an interception is performed before the Softmax probability calculation layer, forcing the scores of all words not in the whitelist to be set to negative infinity. This physical-level probability zeroing operation masks the sampling probability of conventional open-ended natural language translation, forcing the model to decode only from predefined morphological labels and JSON structure symbols. Finally, a stable, machine-readable, hallucination-free set of structured morphological skeletons, i.e., morphological constraint information, is output.

[0095] For example, consider the text to be translated, “The terrified cat sprinted across the wetlawn.” (target language is Russian). After the above mapping process, the key-value pair format morphological constraint information can be output as: {“cat”: [“Nominative”, “Singular”], “sprinted”: [“Past Tense”, “PerfectiveAspect”], “lawn”: [“Accusative”]}.

[0096] According to embodiments of this application, the determination of morphological constraint information can also be achieved based on structured rule methods or by prediction through neural network models.

[0097] Rule-based methods can be used, for example, traditional syntactic analysis tools such as Stanford CoreNLP can be used to extract the dependency tree of the source sentence, and specific relations (such as nouns governed by a certain preposition) can be directly mapped to case constraints (such as accusative case) of the target language through pre-hard-coded regular expressions and conditional mapping tables.

[0098] This is implemented using neural networks, such as Bidirectional Encoder Representations from Transformers (BERT), Bidirectional Long Short-Term Memory (Bi-LSTM), or Graph Neural Network (GNN) sequence labeling models finely tuned with specific morphologically labeled datasets. The model directly inputs source language features, and at the output, it uses a Softmax classification layer to directly predict and output the classification probability of the morphological label (such as singular / plural, tense, etc.) for each node.

[0099] According to embodiments of this application, the method further includes: determining a key text span from multiple text spans to be translated in the text to be translated based on the grammatical constraints of the target language, wherein the key text span is the text span to be translated that requires morphological changes during the translation into the target language; determining the translation text span corresponding to the text span to be translated in the initial translation text includes: determining the translation text span corresponding to the key text span in the initial translation text; determining the morphological constraint information of the text span to be translated includes: determining the morphological constraint information of the key text span.

[0100] For example, when translating the English sentence "The terrified catsprinted across the wet lawn" into Russian, the noun "cat" needs to change from the nominative case to the case corresponding to its syntactic role (e.g., nominative for the subject, accusative for the object), the verb "sprinted" needs to change from the base form to the past tense and change gender and number according to the subject's gender, and the noun "lawn" in the prepositional phrase needs to change to the accusative or prepositive case according to the requirements of the preposition "across." These words can be considered key text spans. However, the article "the" has no corresponding form in Russian, and the preposition "across" itself does not require morphological changes; therefore, these words are not considered key text spans.

[0101] According to the embodiments of this application, firstly, based on the grammatical constraints of the target language, key spans requiring morphological changes (such as verbs requiring conjugation and nouns requiring case changes) are selected from all spans of the text to be translated, while components that do not require morphological changes are excluded. Subsequently, only these key spans are used to determine their corresponding translation text spans in the initial translation text. This avoids unnecessary calculations for text segments without morphological change requirements in subsequent comparison and modification steps, thereby significantly reducing the system's processing overhead and improving overall translation efficiency. At the same time, since content words and function words that do not need attention are excluded, the accuracy and robustness of morphological constraint extraction are further enhanced, avoiding noise or misjudgment introduced by over-analysis of non-key spans.

[0102] The following explains how to compare the actual morphological information of the translated text span with the morphological constraint information.

[0103] According to embodiments of this application, unlike semantic comparisons that rely on continuous vector cosine similarity and floating-point thresholds, the morphological grammar rules (such as nominative / accusative, singular / plural) in this application belong to orthogonal discrete category features. Therefore, the comparison of the actual morphological information and morphological constraint information of the translated text span employs deterministic Boolean logic operations. Specifically, comparing the actual morphological information and morphological constraint information of the translated text span includes: representing the actual morphological information and morphological constraint information as sets of morphological feature labels respectively; performing a set comparison operation between the actual morphological feature label set corresponding to the actual morphological information and the morphological constraint feature label set corresponding to the morphological constraint information; determining that the comparison result is a match between the actual morphological information and the morphological constraint information if the morphological constraint feature label set is a subset of the actual morphological feature label set; and determining that the comparison result is a mismatch between the actual morphological information and the morphological constraint information if the morphological constraint feature label set is not a subset of the actual morphological feature label set.

[0104] A morphological feature tag set is a structured way of representing the morphological information of words or phrases in a set form. Each tag represents an independent grammatical feature dimension, such as case (nominative, accusative), number (singular, plural), gender (masculine, feminine, neuter), tense (past, present), and person (first, second, third person). For example, when the Russian noun "кот" (cat) is used as the subject in a sentence, its morphological feature tag set can be represented as {nominative, singular, masculine}; the past tense form of the verb "гнал" (to drive away) can be represented as {past, masculine, singular}. The morphological feature tag set does not care about the order of the tags, but only the membership relationship of the tags; therefore, {nominative, singular, masculine} and {singular, masculine, nominative} represent the same morphological information.

[0105] The actual morphological feature label set refers to the label set composed of the actual morphological features of the translated text span as presented in the original translated text, which are parsed from the translated text span of the original translated text.

[0106] The morphological constraint feature tag set refers to the set of tags formed by the mandatory morphological requirements determined for the span of a certain text to be translated, based on the grammatical constraints of the target language.

[0107] Set comparison operations compare whether there is an inclusion relationship or equality relationship between two sets. For example, comparing the set of actual morphological feature labels with the set of morphological constraint feature labels to see if there is an inclusion relationship or equality relationship. The core objective is to verify whether the morphology of the text to be translated meets the grammatical constraints of the target language.

[0108] According to an embodiment of this application, the method further includes: adding a first marker to the translation text spans in the initial translation text where the comparison result is a mismatch; and adding a second marker to the translation text spans in the initial translation text where the comparison result is a match.

[0109] For example, a first marker is added to the translation text spans in the initial translation text where the alignment result is a mismatch; a second marker is added to the translation text spans in the initial translation text where the alignment result is a match. This can include: adding a second marker if and only if there is an absolute mismatch between the actual morphological feature label set and the morphological constraint feature label set in the discrete dimension (i.e., ...). When a "hard syntax conflict" occurs, the indicator function outputs a boolean value of True, indicating a "hard syntax conflict," and a conflict mask is generated. (i.e., the first label); if all discrete features of the actual morphological feature label set perfectly match the morphological constraint feature label set, then (i.e., the first marker).

[0110] After marking the initial translated text, the span of the translated text with the first mark is determined as the span of the text to be modified; the span of the text to be modified is modified according to the morphological constraint information corresponding to the span of the text to be modified.

[0111] According to embodiments of this application, a first marker is added to mismatched translation spans, indicating them as targets requiring correction; a second marker is added to matched translation spans, indicating them as correct parts that can be directly retained. After marking, subsequent morphological correction operations are performed only on the text spans to be modified carrying the first marker, while spans carrying the second marker are directly retained and participate in the final translation assembly. This avoids indiscriminate repetitive processing of all spans during the correction stage, reducing the computational overhead of the correction operation. Simultaneously, the black-box text rewriting is completely transformed into a deterministic and controlled algorithmic judgment.

[0112] The following combination Figure 4 Explain the method for modifying the span of the text.

[0113] After identifying the text to be modified using the first marker, the text is modified based on the principle of minimal editing.

[0114] Figure 4 A schematic diagram illustrating a method for modifying the span of text to be modified according to an embodiment of this application is shown.

[0115] like Figure 4 As shown, the method for modifying the translation text span in this embodiment includes performing morphological analysis on the translation text span 410, splitting the translation text span 410 into a root sequence 420 and an affix sequence 430; modifying the affix sequence 430 according to the difference between the morphological constraint information and the actual morphological information to obtain a modified affix sequence 440; and then determining the modified translation text span 450 based on the modified affix sequence 440 and the root sequence 420.

[0116] It should be noted that modifying affix sequences can include at least one of the following operations: addition, deletion, or replacement.

[0117] Based on the difference between morphological constraint information and actual morphological information, before modifying the affix sequence, the following steps are also taken: applying edit distance protection restrictions to the root sequence in memory, forcing the root sequence to be set to read-only state, and disallowing any modification.

[0118] Edit distance protection limits set the root sequence to read-only in memory, forcing the edit distance to only apply to the affix sequence, thereby protecting the semantic integrity of the root sequence when it is modified.

[0119] According to embodiments of this application, the text to be modified is divided into [root part] and [affix part]. In subsequent modification stages, boundary constraints are applied to the root part, strictly limiting the editing distance of the generation operation to a reasonable range of morphological conjugation (i.e., only local editing operations such as adding, deleting, and replacing affixes are allowed, while modifying, replacing, or deleting the root is not allowed). This prevents the possibility of replacing the original high-quality vocabulary with other synonyms at the underlying algorithm level, ensuring that the correction operation always revolves around the original root for semantic anchoring, and only performs local morphological adjustments on the affixes. Thus, while maintaining the core semantics, the grammatical morphological correction required by the target language is accurately achieved.

[0120] In some embodiments, based on the difference between morphological constraint information and actual morphological information, performing at least one of the operations of adding, deleting, or replacing affixes may include: performing a difference operation on the morphological constraint feature label set corresponding to the morphological constraint information and the actual morphological feature label set corresponding to the actual morphological information to obtain a difference set; encoding the difference set as a grammatical residual offset, and using a preset morphological word form transformation paradigm to map the grammatical residual offset into a character-level editing operation for the affix sequence; and performing at least one of the operations of adding, deleting, or replacing affixes based on the character-level editing operation.

[0121] According to embodiments of this application, the difference operation includes calculating the difference between the two directions respectively:

[0122] Missing feature set (Labels that need to be added or replaced);

[0123] Redundant feature set (Tags to be deleted);

[0124] in, Represents a set of morphological constraint feature labels. This represents the set of labels representing actual morphological features.

[0125] According to embodiments of this application, encoding the difference set into a syntax residual offset may include: merging and encoding the missing feature set and the redundant feature set into a vector representation, called the syntax residual offset. .Should Essentially, it's a vectorized encoding of editing instructions, used to drive subsequent character-level operations. For example, if the set of morphological constraint feature labels... =[complex, negative], the set of actual morphological feature labels =[singular, feminine], then [plural], [Singular]; then, according to [plural], [Singular] Derivation of transformation type: It is necessary to transform "singular" into "complex" and encode the transformation into a vector to obtain the syntax residual offset.

[0126] According to an embodiment of this application, mapping grammatical residual offsets to character-level editing operations for affix sequences using a preset morphological lexical transformation paradigm includes: determining a target paradigm for affix sequences from the preset morphological lexical transformation paradigm based on the identifiers of the target language and the feature information of the affix sequences; and mapping grammatical residual offsets to character-level editing operations for affix sequences according to the rules of the target paradigm.

[0127] The feature information of an affix sequence refers to the feature representation obtained by encoding the affix sequence across the translated text. This can include the length and position of the affix (prefix / suffix / infix), the current character sequence, and the grammatical features it carries. This feature information helps large language models understand the structure and state of the current affix.

[0128] The pre-built morphological morphological morphological morphological paradigm refers to a pre-constructed library of morphological morphological rules for various languages, including regular morphological patterns (such as the Russian adjective declension suffix table and the German adjective strong morphological suffix table) and irregular morphological entries (such as the English "go→went"). This paradigm is encoded as a set of rules that can be queried by a large language model, and each rule defines a mapping relationship from a specific source state to a target state.

[0129] The target paradigm refers to a specific paradigm rule that is retrieved and selected from pre-defined morphological inflection paradigms based on the target language markers and affix sequence features, and is applicable to the current translation text span. For example, for the Russian adjective "красивая" (beautiful nominative feminine singular), the target paradigm might be "adjective feminine singular declension rule: when changing from nominative to accusative, the suffix '-ая' is replaced with '-ую'."

[0130] Character-level modification operations refer to editing instructions for specific characters in an affix sequence, such as "insert the character 'у' at position 3", "delete the character '-т' at positions 5-6", and "replace the character 'а' at position 2 with 'о'". Based on the information carried by the syntax residual offset, character-level editing operations include the following types:

[0131] Add affix operation: when When there are new positive features that need to be added (such as changing from "incomplete" to "complete"), and there are no mutually exclusive conflicts, the operation is mapped to the locked root word. morphological marker character sequences are inserted at specific boundaries (such as prefix positions). For example, if the verb in the initial translated text is "мчался" (imperfective form), and constraint c... k If a "complete form" is required, the operation determined by the residual offset is to add the prefix "по-" before the fixed root word, thus becoming "помчался";

[0132] Deleting affixes: When When the text contains redundant features that do not conform to the target constraints, the operation is mapped to a character truncation instruction, which directly removes the redundant suffix or prefix characters across the translated text.

[0133] Replace affixes operation: when and When mutually exclusive states belong to the same dimension (such as singular and plural being mutually exclusive), a fixed-point substitution operation is performed. In this case, due to the root word... When locked, the probability distribution of the generative model during autoregressive decoding is forced to focus on the word ending region. Kernel sampling is used to generate affixes corresponding to the target features, replacing the original incorrect affixes. For example, if the relative pronoun in the initial translated text is "которая" (singular), and the constraint requires "plural," then the residual operation only replaces its suffix, changing it to "которые".

[0134] It should be noted that the local editing strategy in the embodiments of this application can also be replaced by other implementation methods such as sequence rearrangement and constraint decoding. As long as the lexical and grammatical structure of the target language can be modified while maintaining semantic consistency, the technical effect of this application can be achieved.

[0135] Reordering: If the detected structural conflict manifests as a sentence order error (e.g., the target language requires adjectives to be placed after the verb, while the initial translation text has them placed before the verb), the word order within the target span can be directly adjusted to repair the structure through vector swapping or index shifting algorithms.

[0136] Constrained Beam Search Decoding: In this implementation, the set of morphological constraints is directly compiled into the forced-inclusion or forced-exclusion vocabulary rules of the beam search algorithm. During secondary decoding correction of local segments, logistic probability penalties are used to forcibly block the generation path of erroneous word forms (such as singular suffixes), thereby outputting the correct word form that conforms to the constraints.

[0137] The text translation method of this application, while strictly maintaining core semantic consistency, only targets and corrects conflicting morphological and syntactic features (such as word inflection and local word order), thereby significantly improving the grammatical compliance and readability of the translation without disrupting the distribution of high-quality vocabulary. Furthermore, the text translation method of this application does not rely on additional labeled data, is applicable to multiple language pairs and low-resource language scenarios, and has good versatility and application prospects.

[0138] The above has explained the text translation methods; the following will combine... Figure 5 The text translation system is described.

[0139] Figure 5 A block diagram of a text translation system according to an embodiment of this application is shown.

[0140] like Figure 5 As shown, the text translation system of this embodiment includes a semantic generation module 110, a morphological information determination module 520, a comparison module 530, and a modification module 540.

[0141] The semantic generation module 110 is used to perform semantic translation processing on the text to be translated in the source language to obtain the initial translated text in the target language.

[0142] The morphological information determination module 520 is used to determine the morphological constraint information corresponding to at least one span of the text to be translated in the target language, based on the grammatical constraint rules of the target language. This morphological information determination module 520 is related to... Figure 1 The shape control module 120 shown has a similar function.

[0143] The comparison module 530 is used to determine the translation text span corresponding to the span of the text to be translated in the initial translation text, and compares the actual morphological information of the translation text span with the morphological constraint information to obtain the comparison result. The comparison result can be represented as a Boolean collision mask M. conflict Each dimension indicates whether a certain grammatical feature (such as "number", "case", "aspect") is conflicted (1 indicates conflict, 0 indicates agreement).

[0144] Modification module 540 is used to respond to the mismatch between the actual morphological information and the morphological constraint information indicated by the comparison result, and to perform difference analysis on the actual morphological information and the morphological constraint information using a large language model according to the first preset prompt information and output the analysis result, and modify the span of the translated text according to the analysis result to obtain the target translated text. The first preset prompt information is used to constrain the large language model to execute in the order of outputting the analysis result first and then performing the modification operation.

[0145] It should be noted that the comparison module 530 and the modification module 540 together constitute... Figure 1 The functions of the editing and fusion module 130 shown.

[0146] In some embodiments, the editing fusion module can be implemented by a large language model, whose prompts may include: You are a morphological editor. You will receive a source sentence, a semantic draft, and a set of morphological constraints. Your task is to rewrite the draft to meet the constraints. The following logical loop must be strictly followed: 1. Minimal editing constraints: Unless the underlying grammar completely collapses, the source vocabulary (root words) in the draft must be locked and preserved. 2. Targeted correction: Only suffixes, prefixes, or word forms are modified to match the required case, gender, and number. 3. Reasoning logic: First, enter the explicit thought chain (Analysis) to precisely list the conflicting differences between the current form of the draft and the constraints; then, generate the final sentence based on these differences.

[0147] By employing this prompt instruction, targeted corrections are made only to localized areas with morphological conflicts, rather than regenerating the entire translation. This avoids new errors or semantic drift introduced by regeneration in traditional systems, ensuring that high-quality word choices (root words) in the initial semantic translation are fully preserved.

[0148] According to an embodiment of this application, the semantic generation module includes a semantic translation submodule.

[0149] The semantic translation submodule is used to perform semantic translation processing on the text to be translated using a large language model based on the second preset prompt information to obtain the initial translated text. The second preset prompt information is used to instruct the large language model to set the priority of semantic accuracy to higher than morphological accuracy during the semantic translation process.

[0150] According to an embodiment of this application, the morphological information determination module includes: a syntactic dependency analysis submodule, a mapping substitution submodule, and a determination submodule.

[0151] The syntactic dependency analysis submodule is used to perform syntactic dependency analysis on the text to be translated, determine the syntactic dependencies between multiple text spans in the text to be translated, and obtain a dependency syntax tree, where nodes in the dependency syntax tree represent text spans to be translated, and edges represent syntactic dependencies between text spans to be translated.

[0152] The mapping and replacement submodule is used to map the syntactic dependencies corresponding to each edge in the dependency syntax tree to the corresponding standard labels according to the general dependency syntax, and replace the syntactic dependencies in the dependency syntax tree with the standard labels to obtain the standard dependency syntax tree.

[0153] The determination submodule is used to determine the morphological constraint information of the span of the text to be translated corresponding to each node, based on the standard labels of each node in the standard dependency syntax tree and the grammatical constraint rules of the target language.

[0154] According to an embodiment of this application, the determination submodule is further configured to utilize a large language model to convert the standard labels of each node in the standard dependency syntax tree and the target language into conditional vectors, inject them into a feedforward neural network, and activate the morphological rule subspace corresponding to the target language; perform nonlinear inner product matching between the text vector of the span of the text to be translated and the morphological rule subspace to obtain the morphological constraint features corresponding to the span of the text to be translated; input the morphological constraint features into the decoder and output the scores of each word corresponding to the morphological constraint features; modify the scores of words that are not in the whitelist for the target language to negative infinity, and normalize the modified scores of each word to obtain the probability of each word; and output the morphological constraint information based on the probability of each word.

[0155] According to an embodiment of this application, the above-described text translation system further includes: a first determining module.

[0156] The first determining module is used to determine the key text span from multiple text spans to be translated in the target language according to the grammatical constraints of the target language. The key text span is the text span to be translated that needs to undergo morphological changes during the translation into the target language.

[0157] According to an embodiment of this application, the comparison module is further used to determine the translation text span corresponding to the key text span in the initial translation text.

[0158] According to an embodiment of this application, the comparison module includes: a representation submodule, a comparison submodule, a first result determination submodule, and a second result determination submodule.

[0159] The representation submodule is used to represent the actual morphological information and morphological constraint information as sets of morphological feature labels respectively.

[0160] The comparison submodule is used to perform a set comparison operation between the set of actual morphological feature labels corresponding to the actual morphological information and the set of morphological constraint feature labels corresponding to the morphological constraint information.

[0161] The first result determination submodule is used to determine the comparison result as a match between the actual morphological information and the morphological constraint information in response to the fact that the morphological constraint feature label set is a subset of the actual morphological feature label set.

[0162] The second result determination submodule is used to determine the comparison result as a mismatch between the actual morphological information and the morphological constraint information in response to the fact that the set of morphological constraint feature labels is not a subset of the set of actual morphological feature labels.

[0163] According to embodiments of this application, the above-described text translation system further includes: a first adding module, a second adding module, a second determining module, and a span modification module.

[0164] The first addition module is used to add a first marker to the span of translated text that does not match the comparison result in the initial translated text.

[0165] The second addition module is used to add a second marker to the span of the translated text that matches the comparison result in the initial translated text.

[0166] The second determination module is used to determine the translation text span marked with the first tag as the text span to be modified.

[0167] The span modification module is used to modify the span of the text to be modified based on the morphological constraint information corresponding to the span of the text to be modified.

[0168] According to an embodiment of this application, the modification module includes: a morphological analysis submodule and a modification submodule.

[0169] The morphological analysis submodule is used to perform morphological analysis on the span of the translated text, breaking it down into root sequence and affix sequence.

[0170] The modification submodule is used to lock the root sequence in memory as a read-only state, and perform at least one of the following operations on the affix sequence: addition, deletion, or replacement, based on the difference between the morphological constraint information and the actual morphological information.

[0171] According to an embodiment of this application, the modification submodule includes: a difference operation unit, a mapping unit, and a modification unit.

[0172] The difference operation unit is used to perform a difference operation on the set of morphological constraint feature labels corresponding to the morphological constraint information and the set of actual morphological feature labels corresponding to the actual morphological information to obtain the difference operation result; and to encode the difference operation result to obtain the syntax residual offset.

[0173] The mapping unit is used to map the grammatical residual offset to a character-level editing operation for the affix sequence using a preset morphological word form change paradigm. The character-level editing operation includes at least one of the following operations: an addition operation, a deletion operation, and a replacement operation.

[0174] The modification unit is used to modify the affix sequence based on character-level editing operations.

[0175] According to an embodiment of this application, the mapping unit includes: a determining subunit and a mapping subunit.

[0176] The sub-unit is determined based on the characteristic information of the target language's markers and affix sequences to identify the target paradigm for the affix sequence from a pre-defined morphological inflection paradigm.

[0177] The mapping subunit is used to map the syntax residual offsets to character-level editing operations on the affix sequence according to the rules of the target paradigm.

[0178] The following combination Figure 6 The process of text translation by the text translation system in this application is illustrated by way of example.

[0179] Figure 6 A schematic diagram illustrating text translation performed by a text translation system according to an embodiment of this application is shown.

[0180] like Figure 6As shown, the process of text translation by the text translation system includes three stages. Specifically: The text translation system receives the text X to be translated in the English language, such as "...steady as large caves on Earth that often maintain a fairly constant temperature..."; the target language for translation is: Russian, and it enters Stage 1: Heterogeneous dual-stream parallel encoding. In Stage 1, it includes a semantic generation step and a morphological constraint extraction step.

[0181] In the semantic generation step, the semantic generation module receives the text X to be translated. Under the condition of relaxing strict syntactic constraints, it gives priority to ensuring the accuracy of word selection and generates the initial translation text , such as "...не такое стабильное, как у больших пещер на Земле, которая часто поддерживает довольно постоянную температуру...". The initial translation text in this example exposes the following problems: In this initial translation text, the semantic generation module selects words (such as "стабильное") very accurately, but when dealing with the attributive clause, the relative pronoun "которая" and the verb "поддерживает" wrongly agree with the singular feminine noun "Earth (Земле)" nearby, while in fact they should syntactically point to the plural noun "caves (пещер)". Traditional serial translation methods are very likely to have error propagation here.

[0182] The morphological constraint extraction step is synchronized with the semantic generation step. The morphological control module performs syntactic dependency tree analysis on the text X to be translated and accurately identifies that the true preposition of "that often maintain" is "large caves", thereby extracting the morphological skeleton for this span (i.e., the morphological constraint information of the span to be translated). For example, the morphological skeleton extracted for the text X to be translated includes the following constraints: [Constraint 1: The relative pronoun needs to be plural (Plural)]; [Constraint 2: The verb needs to be in the third person plural (3rd Person Plural), consistent with caves].

[0183] After that, it enters Stage 2: Comparative auditing and conflict detection. In Stage 2, the editing fusion module receives the initial translation text and the morphological skeleton, and performs an alignment operation to obtain the conflict mask of the initial translation text , where 0 in the conflict mask indicates retention and 1 indicates editing. For example, comparing the morphological skeleton with the initial translation text The span “которая часто поддерживает” is compared. It is detected that the initial translated text uses the singular feminine form, which conflicts with the constraint specifying “plural”. Therefore, a conflict mask is generated at that location. = 1.

[0184] Next, we move to Phase 3: Residual-based Constraint Editing and Fusion. For translation text spans with a conflict mask of 1, the correctly generated word roots are locked, and only morphological residual transformations are applied to them for word insertion or deletion. For example, the relative pronoun: которая (singular) → которые (plural); the verb: поддерживает (third-person singular) → поддерживают (third-person plural). For the remaining spans with a conflict mask of 0 (such as the word “стабильное”), they are directly retained without any modification.

[0185] Finally, the system outputs the target translation text Y, such as "...не такое стабильное, как у больших пещер на Земле, которые часто поддерживают довольно постояннуютемпературу...".

[0186] As the examples above demonstrate, without the decoupling mechanism proposed in this application, directly requiring a large model to fix its grammar often results in semantic drift, arbitrarily replacing originally accurate words. The architecture of this application isolates the enforcement process of structural grammar through deterministic 0 / 1 conflict masks, performing minimal residual intervention only at locations where morphological violations of explicit dependency constraints perfectly preserve the high-fidelity lexical foundation established in the first stage.

[0187] The text translation system described in this application can be deployed on a server or cloud computing environment. Multiple translation requests can be simultaneously received through an interface, and the translation processing can be completed collaboratively by various modules, supporting practical application needs in high-concurrency and multilingual scenarios.

[0188] Deployment methods include, but are not limited to, the following deployments.

[0189] Server Deployment: The system is deployed on a local server cluster and receives translation requests through an Application Programming Interface (API) to achieve modular processing.

[0190] Cloud deployment: The system is deployed in a cloud computing environment, which can dynamically allocate computing resources according to the request volume, thereby improving processing efficiency and scalability.

[0191] Module collaboration: Each module interacts with other modules through standard interfaces to ensure the integrity and stability of the semantic generation, morphological control and editing integration process.

[0192] It should be noted that the text translation system part in the embodiments of this application corresponds to the text translation method part in the embodiments of this application. The specific description of the text translation system part is referred to in the text translation method part, and will not be repeated here.

[0193] The embodiments of this application have been described above. However, these embodiments are merely illustrative and not intended to limit the scope of this application. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. This application does not depart from its scope, and those skilled in the art can make various substitutions and modifications, all of which should fall within the scope of this application.

Claims

1. A text translation method, characterized in that, The method includes: Semantic translation processing is performed on the text to be translated in the source language to obtain the initial translated text in the target language; Based on the grammatical constraints of the target language, determine the morphological constraint information of at least one text span in the text to be translated in the target language. Determine the translation text span corresponding to the span of the text to be translated in the initial translation text, and compare the actual morphological information of the translation text span with the morphological constraint information to obtain the comparison result; and In response to the comparison result indicating that the actual morphological information does not match the morphological constraint information, according to the first preset prompt information, the large language model is used to perform difference analysis on the actual morphological information and the morphological constraint information and output the analysis result. The translation text span is modified according to the analysis result to obtain the target translation text. The first preset prompt information is used to constrain the large language model to execute in the order of first outputting the analysis result and then performing the modification operation.

2. The method according to claim 1, characterized in that, The semantic translation processing of the text to be translated in the source language to obtain the initial translated text in the target language includes: According to the second preset prompt information, the large language model is used to perform semantic translation processing on the text to be translated to obtain the initial translated text. The second preset prompt information is used to instruct the large language model to set the priority of semantic accuracy to higher than morphological accuracy during the semantic translation process.

3. The method according to claim 1 or 2, characterized in that, The step of determining the morphological constraint information corresponding to at least one text span in the text to be translated in the target language according to the grammatical constraint rules of the target language includes: Syntactic dependency analysis is performed on the text to be translated to determine the syntactic dependencies between multiple text spans in the text to be translated, and a dependency syntax tree is obtained, wherein the nodes in the dependency syntax tree represent the text spans to be translated, and the edges represent the syntactic dependencies between the text spans to be translated; According to the general dependency syntax, the syntactic dependencies corresponding to each edge in the dependency syntax tree are mapped to the corresponding standard labels, and the syntactic dependencies in the dependency syntax tree are replaced with the standard labels to obtain the standard dependency syntax tree; Based on the standard labels of each node in the standard dependency syntax tree and the grammatical constraint rules of the target language, the morphological constraint information of the span of the text to be translated corresponding to each node is determined.

4. The method according to claim 3, characterized in that, The step of determining the morphological constraint information of the text span to be translated corresponding to each node based on the standard labels of each node in the standard dependency syntax tree and the grammatical constraint rules of the target language includes: Using a large language model, the standard labels of each node in the standard dependency syntax tree and the target language are transformed into conditional vectors, which are then injected into a feedforward neural network to activate the morphological rule subspace corresponding to the target language. The text vector of the span of the text to be translated is matched with the morphological rule subspace by performing nonlinear inner product matching to obtain the morphological constraint features corresponding to the span of the text to be translated. The morphological constraint features are input into the decoder, and the scores of each word corresponding to the morphological constraint features are output. The scores of words that are not in the whitelist for the target language are modified to negative infinity, and the modified scores of each word are normalized to obtain the probability of each word. Based on the probability of each word, the morphological constraint information is output.

5. The method according to claim 3, characterized in that, Also includes: According to the grammatical constraints of the target language, a key text span is determined from multiple text spans to be translated in the text to be translated, wherein the key text span is the text span to be translated that needs to undergo morphological changes during the translation into the target language; Determining the translation text span corresponding to the span of the text to be translated in the initial translation text includes: Determine the translation text span corresponding to the key text span in the initial translation text.

6. The method according to claim 1, characterized in that, Comparing the actual morphological information of the translated text span with the morphological constraint information includes: The actual morphological information and the morphological constraint information are respectively represented as sets of morphological feature labels; Perform a set comparison operation between the set of actual shape feature labels corresponding to the actual shape information and the set of shape constraint feature labels corresponding to the shape constraint information. In response to the fact that the set of morphological constraint feature labels is a subset of the set of actual morphological feature labels, the comparison result is determined to be a match between the actual morphological information and the morphological constraint information. In response to the fact that the set of morphological constraint feature labels is not a subset of the set of actual morphological feature labels, the comparison result is determined to be that the actual morphological information does not match the morphological constraint information.

7. The method according to claim 6, characterized in that, Also includes: For the spans of translated text in the initial translated text where the comparison result shows a mismatch, a first marker is added; For the span of the translated text that matches the comparison result in the initial translated text, add a second tag; The span of the translated text with the first mark is determined as the text span to be modified; The span of the text to be modified is modified according to the morphological constraint information corresponding to the span of the text to be modified.

8. The method according to claim 1, characterized in that, Modifying the span of the translated text based on the morphological constraint information includes: The translated text span is subjected to morphological analysis, and the translated text span is divided into root sequence and affix sequence; The root sequence is locked in memory as a read-only state, and at least one of the following operations—addition, deletion, and replacement—is performed on the affix sequence based on the difference between the morphological constraint information and the actual morphological information.

9. The method according to claim 8, characterized in that, The operation of adding, deleting, or replacing affixes based on the difference between the morphological constraint information and the actual morphological information includes: The set of morphological constraint feature labels corresponding to the morphological constraint information is subjected to a difference operation with the set of actual morphological feature labels corresponding to the actual morphological information to obtain the difference operation result; and the difference operation result is encoded to obtain the syntax residual offset. Based on the identifiers of the target language and the feature information of the affix sequence, a target paradigm for the affix sequence is determined from a preset morphological word form change paradigm; According to the rules of the target paradigm, the grammatical residual offset is mapped to a character-level editing operation with respect to the affix sequence, wherein the character-level editing operation includes at least one of the following operations: an addition operation, a deletion operation, and a replacement operation. The affix sequence is modified according to the character-level editing operation.

10. A text translation system, characterized in that, The system includes: The semantic generation module is used to perform semantic translation processing on the text to be translated in the source language to obtain the initial translated text in the target language. The morphological information determination module is used to determine the morphological constraint information of at least one text span in the text to be translated in the target language according to the grammatical constraint rules of the target language. The comparison module is used to determine the translation text span corresponding to the span of the text to be translated in the initial translation text, and to compare the actual morphological information of the translation text span with the morphological constraint information to obtain the comparison result; and The modification module is used to respond to the comparison result indicating that the actual morphological information and the morphological constraint information do not match, and to perform difference analysis on the actual morphological information and the morphological constraint information using a large language model according to a first preset prompt, and output the analysis result, and modify the span of the translated text according to the analysis result to obtain the target translated text. The first preset prompt is used to constrain the large language model to execute in the order of outputting the analysis result first and then performing the modification operation.