Translation model training method and device, equipment, storage medium and program product

CN122693684APending Publication Date: 2026-09-04TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510245632.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-03
Publication Date
2026-09-04

AI Technical Summary

Technical Problem

[0003]本公开针对现有的方式的缺点,提出一种翻译模型的训练方法、装置、设备、计算机可读存储介质及计算机程序产品,用于解决如何提高翻译模型的翻译准确度的问题

Benefits of technology

获取训练数据集,训练数据集包括带有训练标签的样本,每个样本为包括至少一种目标字符的文本,每个样本的训练标签包括该样本中的各个目标字符的标准翻译结果,其中,训练数据集包括训练集、验证集和样本增强集,样本增强集中每个样本的目标字符带有分类标签;基于训练数据集,对待训练的翻译模型进行多轮训练操作,得到满足训练结束条件的目标翻译模型;其中,多轮训练操作中每轮训练操作包括以下步骤:基于训练集,对待训练的翻译模型进行训练,得到训练后的翻译模型;基于验证集,对训练后的翻译模型的翻译性能进行测试,得到每种目标字符对应的错误翻译比例;基于每种目标字符对应的错误翻译比例和样本增强集的相应种类目标字符的样本,对训练集进行调整,得到调整后的训练集,将调整后的训练集作为下轮训练操作所基于的训练集,并将训练后的翻译模型作为下轮训练操作的待训练的翻译模型;如此,通过在翻译模型训练过程中加入实时评测,确定各种目标字符(例如各种游戏术语和各种特定字符)的错误翻译比例,即统计了各种游戏术语出现不遵循目标翻译的问题和各种特定字符出现与翻译模型输入的格式不匹配问题分别导致的错误翻译比例;基于每种目标字符对应的错误翻译比例和样本增强集的相应种类目标字符的样本,对训练集进行调整,得到调整后的训练集,即通过在训练集中增加包括该种目标字符的样本或减少包括该种目标字符的样本(增加或减少包括该种目标字符的样本在训练集中的出现比例),从而在相同的训练时间内实现针对性的训练增强,提高了翻译模型的翻译准确度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122693684A_ABST
    Figure CN122693684A_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure provide a translation model training method and device, equipment, a storage medium and a program product, relating to the field of artificial intelligence, and the application scenarios include but are not limited to model training scenarios. The method comprises: based on a training data set, performing a plurality of rounds of training operations on a translation model to be trained to obtain a target translation model that meets a training end condition; each round of training operation comprises: based on the training set, training the translation model to be trained to obtain a trained translation model; based on the validation set, testing the translation performance of the trained translation model to obtain an error translation ratio corresponding to each target character; based on the error translation ratio corresponding to each target character and the samples of the corresponding target characters of the sample enhancement set, adjusting the training set to obtain an adjusted training set, taking the adjusted training set as the training set of the next round of training operation, and taking the trained translation model as the translation model to be trained of the next round of training operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and more specifically, to a method, apparatus, device, storage medium, and program product for training a translation model. Background Technology

[0002] In current technologies, AI-based translation models are playing an increasingly important role in various translation tasks. Existing techniques employ character translation strategies that directly replace characters in a character table to translate text; these characters may include game terms. For example, for a character in text, the translation model calculates a translation from the character table as the corresponding character in the text. However, existing translation models often generate incorrect translations for characters in text, resulting in low translation accuracy. Summary of the Invention

[0003] This disclosure addresses the shortcomings of existing methods by proposing a training method, apparatus, device, computer-readable storage medium, and computer program product for a translation model, aiming to solve the problem of how to improve the translation accuracy of the translation model.

[0004] Firstly, this disclosure provides a method for training a translation model, including: Obtain the training dataset, which includes samples with training labels. Each sample is text containing at least one target character. The training label for each sample includes the standard translation results of each target character in the sample. The training dataset includes a training set, a validation set, and a sample augmentation set. In the sample augmentation set, each target character of each sample has a classification label. Based on the training dataset, the translation model to be trained is subjected to multiple rounds of training operations to obtain the target translation model that meets the training termination condition; Each round of training includes the following steps: Based on the training set, the translation model to be trained is trained to obtain the trained translation model; Based on the validation set, the translation performance of the trained translation model is tested to obtain the error translation ratio for each target character; Based on the error translation ratio corresponding to each target character and the corresponding target character samples in the sample augmentation set, the training set is adjusted to obtain the adjusted training set. The adjusted training set is used as the training set for the next round of training operations, and the trained translation model is used as the translation model to be trained in the next round of training operations.

[0005] In one embodiment, the training set is divided into N sample subsets, where N ≥ 2 and N is a positive integer. Each round of training operations includes N training operations, and each training operation is based on one sample subset from the N sample subsets. Each training operation includes the following steps: Based on the sample subset corresponding to the current training operation, the translation model to be trained is trained to obtain the trained translation model. The translation model to be trained corresponding to the first training operation is the trained translation model obtained from the previous training operation, and the translation model to be trained corresponding to the training operations other than the first training operation is the trained translation model obtained from the previous training operation. Based on the validation set, the translation performance of the trained translation model is tested to obtain the error translation ratio for each target character; Based on the error translation ratio corresponding to each target character and the samples of the corresponding target characters in the sample augmentation set, the sample subset corresponding to the next training operation is adjusted to obtain the training set on which the next training operation is based.

[0006] In one embodiment, the translation performance of the trained translation model is tested based on a validation set to obtain the error translation ratio for each target character, including: Each sample in the validation set is input into the trained translation model to obtain the predicted translation result for each sample; Based on the training labels and corresponding predicted translation results of each sample in the validation set, the mistranslation ratio of each target character is determined.

[0007] In one embodiment, the training set is adjusted based on the error translation ratio corresponding to each target character and the samples of the corresponding target characters in the sample augmentation set, resulting in an adjusted training set, including: Based on the error translation ratio from largest to smallest, determine at least one first target character that ranks first among all target characters; For each type of first target character, at least one sample containing that first target character is selected from the sample augmentation set and added to the training set to obtain the adjusted training set.

[0008] In one embodiment, the training set is adjusted based on the error translation ratio corresponding to each target character and the samples of the corresponding target characters in the sample augmentation set, resulting in an adjusted training set, including: Based on the error translation ratio from largest to smallest, determine at least one second target character that is ranked last among all target characters; For each second target character, based on the samples of the corresponding target characters in the sample augmentation set, at least one sample containing the second target character is removed from the training set to obtain the adjusted training set.

[0009] In one embodiment, for each first target character, selecting at least one sample containing that first target character from the sample augmentation set and adding it to the training set includes: The number of samples to be added is determined based on the total number of samples of the first target character in the sample augmentation set and the preset sample increase ratio; Based on the increase in the number of samples, a corresponding number of samples containing the first target character are added to the training set.

[0010] In one embodiment, the number of samples to be increased is determined based on the total number of samples of the first target character in the sample augmentation set and a preset sample increase ratio, including: Based on the translation error rate of the first target character, the preset sample increase rate is adjusted to obtain the adjusted sample increase rate. The number of samples to be added is determined based on the total number of samples of the first target character in the sample augmentation set and the adjusted sample increase ratio.

[0011] In one embodiment, if the number of samples corresponding to any first target character in the sample augmentation set is less than the number of samples added to the first target character, then the samples in the sample augmentation set that include the first target character are added to the training set, and based on the difference between the number of samples added to the first target character and the number of samples corresponding to the first target character, a corresponding number of samples that do not include the first target character are extracted from the sample augmentation set. For each extracted sample, based on the preset syntax rules, the first target character is inserted into each extracted sample to obtain the updated sample, and the updated sample is added to the training set.

[0012] In one embodiment, the training dataset is a game-related training dataset, and the target character is game data or a specific character.

[0013] Secondly, this disclosure provides a training apparatus for a translation model, comprising: The first processing module is used to obtain the training dataset, which includes samples with training labels. Each sample is text containing at least one target character. The training label of each sample includes the standard translation results of each target character in the sample. The training dataset includes a training set, a validation set, and a sample augmentation set. Each target character in the sample augmentation set has a classification label. The second processing module is used to perform multiple rounds of training operations on the translation model to be trained based on the training dataset, so as to obtain the target translation model that meets the training termination condition. Each round of training includes the following steps: Based on the training set, the translation model to be trained is trained to obtain the trained translation model; Based on the validation set, the translation performance of the trained translation model is tested to obtain the error translation ratio for each target character; Based on the error translation ratio corresponding to each target character and the corresponding target character samples in the sample augmentation set, the training set is adjusted to obtain the adjusted training set. The adjusted training set is used as the training set for the next round of training operations, and the trained translation model is used as the translation model to be trained in the next round of training operations.

[0014] Thirdly, this disclosure provides an electronic device, including: a processor, a memory, and a bus; A bus is used to connect the processor and memory; Memory, used to store operation instructions; A processor for executing the training method of the translation model of the first aspect of this disclosure by invoking operation instructions.

[0015] Fourthly, this disclosure provides a computer-readable storage medium storing a computer program that is used to execute a training method for the translation model of the first aspect of this disclosure.

[0016] Fifthly, this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the training method for the translation model in the first aspect of this disclosure.

[0017] The technical solutions provided in this disclosure have at least the following beneficial effects: Obtain a training dataset, which includes samples with training labels. Each sample is text containing at least one target character, and the training label for each sample includes the standard translation results for each target character in that sample. The training dataset includes a training set, a validation set, and a sample augmentation set. Each target character in the sample augmentation set has a classification label. Based on the training dataset, perform multiple rounds of training on the translation model to be trained until a target translation model that meets the training termination condition is obtained. Each round of training includes the following steps: training the translation model to be trained on the training set to obtain a trained translation model; testing the translation performance of the trained translation model on the validation set to obtain the error translation ratio for each target character; adjusting the training set based on the error translation ratio for each target character and the corresponding target character samples in the sample augmentation set to obtain an adjusted training set. The adjusted training set serves as the basis for the next round of training, and the trained translation model is used as the translation model to be trained in the next round. Thus, by incorporating real-time evaluation during the translation model training process, the error translation ratios for various target characters (e.g., various game terms and specific characters) are determined. Specifically, the error translation ratios caused by game terms not following the target translation and specific characters not matching the format of the translation model input are statistically analyzed. Based on the error translation ratios for each target character and the corresponding types of target character samples in the sample enhancement set, the training set is adjusted to obtain the adjusted training set. This is achieved by increasing or decreasing the number of samples containing that target character in the training set (increasing or decreasing the proportion of samples containing that target character in the training set), thereby achieving targeted training enhancement within the same training time and improving the translation accuracy of the translation model. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this disclosure, the accompanying drawings used in the description of the embodiments of this disclosure will be briefly introduced below.

[0019] Figure 1 A schematic diagram of the architecture of a training system for a translation model provided in an embodiment of this disclosure; Figure 2 A flowchart illustrating a training method for a translation model provided in this embodiment of the present disclosure; Figure 3 A flowchart illustrating a training method for a translation model provided in this embodiment of the present disclosure; Figure 4 A flowchart illustrating a training method for a translation model provided in this embodiment of the present disclosure; Figure 5A schematic diagram of the training interface of the translation platform provided in this embodiment of the disclosure; Figure 6 A flowchart illustrating a training method for a translation model provided in this embodiment of the present disclosure; Figure 7 A flowchart illustrating a training method for a translation model provided in this embodiment of the present disclosure; Figure 8 A schematic diagram of the structure of a training device for a translation model provided in an embodiment of this disclosure; Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0020] The embodiments of this disclosure are described below with reference to the accompanying drawings. It should be understood that the embodiments described below with reference to the accompanying drawings are exemplary descriptions for explaining the technical solutions of the embodiments of this disclosure, and do not constitute a limitation on the technical solutions of the embodiments of this disclosure.

[0021] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the terms “comprising” and “including” as used in embodiments of this disclosure mean that the corresponding feature can be implemented as the presented feature, information, data, step, operation, element, and / or component, but do not exclude implementation as other features, information, data, step, operation, element, component, and / or combinations thereof supported by the art. It should be understood that when we say that an element is “connected” or “coupled” to another element, the one element can be directly connected or coupled to the other element, or it can mean that the one element and the other element are connected through an intermediate element. Furthermore, “connected” or “coupled” as used herein can include wireless connection or wireless coupling. The term “and / or” as used herein indicates at least one of the items defined by the term; for example, “A and / or B” indicates implementation as “A,” or implementation as “B,” or implementation as “A and B.”

[0022] It is understood that in the specific embodiments of this disclosure, data related to the training of translation models is involved. When the above embodiments of this disclosure are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0023] To make the objectives, technical solutions, and advantages of this disclosure clearer, the embodiments of this disclosure will be described in further detail below with reference to the accompanying drawings.

[0024] This disclosure provides a method for training a translation model, which relates to fields such as artificial intelligence.

[0025] To better understand and explain the solutions of the embodiments of this disclosure, some technical terms involved in the embodiments of this disclosure will be briefly explained below.

[0026] Meta-learning: Meta-learning refers to the process of continuously improving learning algorithms or their configurations across multiple learning stages, enabling models using these algorithms to learn better. Meta-learning teaches models how to learn better.

[0027] Terminology: In game text translation, terminology refers to words or phrases that are related to specific game content and have relatively fixed translation objectives. Terminology is usually compiled into a glossary for translators to consult and for translation models to learn.

[0028] Following: In game text translation, following means that the translation results of terms in the game text conform to the target translation given in the terminology table. The term following rate reflects the learning effect of the translation model on the target translation of the term.

[0029] Off-target translation problem: Translating the source language into the wrong target language; for example, the requirement is to translate the source language into English, but the result is Chinese or English mixed with characters from other languages.

[0030] In existing technologies, due to uneven distribution of training data and insufficient expressive power of translation models, translation models often fail to follow the target translation when dealing with characters (such as specific terms and common phrases) in translation tasks. The format of the translated text also often does not match the format of the input text. For example, the format of HTML (HyperText Markup Language) webpage tags, brackets, and line breaks output by the translation model does not match the format of the input text. Existing technologies struggle to address the consistency between character translation and context. Calculating context-appropriate character translations using a large language model after training would increase the training time of the large language model. Furthermore, existing technologies require character tables (such as terminology tables) to include all possible translations of all characters (such as terms) in all possible contexts, necessitating significant manpower for improvement.

[0031] Based on this, the present disclosure provides a method, apparatus, device, computer-readable storage medium, and program product for training a translation model, and the specific technical solutions will be described in detail below.

[0032] The solutions provided in this disclosure relate to artificial intelligence technology. The technical solutions of this disclosure will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this disclosure will now be described with reference to the accompanying drawings.

[0033] To better understand the solution provided in this disclosure, the solution will be described below in conjunction with a specific application scenario.

[0034] In one embodiment, Figure 1 The diagram shows an architecture diagram of a translation model training system applicable to embodiments of the present disclosure. It is understood that the translation model training method provided in embodiments of the present disclosure can be applied to, but is not limited to, applications such as... Figure 1 In the application scenarios shown.

[0035] In this example, as Figure 1 As shown, the architecture of the training system for the translation model in this example may include, but is not limited to, server 10, terminal 20, and database 30. Server 10, terminal 20, and database 30 can interact via network 40.

[0036] Server 10 acquires a training dataset, which includes samples with training labels. Each sample is text containing at least one target character, and the training label for each sample includes the standard translation results for each target character in that sample. The training dataset includes a training set, a validation set, and a sample augmentation set. Each target character in the sample augmentation set has a classification label. Server 10 performs multiple rounds of training on the translation model to be trained based on the training dataset to obtain a target translation model that meets the training termination condition. Each round of training includes the following steps: training the translation model to be trained based on the training set to obtain a trained translation model; testing the translation performance of the trained translation model based on the validation set to obtain the error translation ratio corresponding to each target character; adjusting the training set based on the error translation ratio corresponding to each target character and the corresponding target character samples in the sample augmentation set to obtain an adjusted training set, using the adjusted training set as the training set for the next round of training, and using the trained translation model as the translation model to be trained in the next round of training. Server 10 sends the error translation ratio corresponding to each target character to terminal 20 for display. Server 10 obtains the training dataset from database 30.

[0037] It is understood that the above is only one example, and this embodiment is not limited here.

[0038] Terminals include, but are not limited to, smartphones (such as Android phones, iOS phones, etc.), mobile phone emulators, tablets, laptops, digital broadcast receivers, MIDs (Mobile Internet Devices), PDAs (Personal Digital Assistants), smart voice interaction devices, smart home appliances, and in-vehicle terminals.

[0039] A server can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server or server cluster that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0040] The aforementioned networks may include, but are not limited to, wired networks and wireless networks. Wired networks include local area networks (LANs), metropolitan area networks (MANs), and wide area networks (WANs). Wireless networks include Bluetooth, Wi-Fi, and other networks that enable wireless communication. Specific details can be determined based on actual application scenario requirements and are not limited here.

[0041] See Figure 2 , Figure 2 This diagram illustrates a flowchart of a translation model training method provided by an embodiment of the present disclosure. This method can be executed by any electronic device, such as a server. As an optional implementation, the method can be executed by a server. For ease of description, the following description of some optional embodiments will use server execution as an example. Figure 2 As shown, the training method for the translation model provided in this embodiment includes the following steps: S201, Obtain the training dataset. The training dataset includes samples with training labels. Each sample is text containing at least one target character. The training label for each sample includes the standard translation results of each target character in the sample. The training dataset includes a training set, a validation set, and a sample augmentation set. The target character of each sample in the sample augmentation set has a classification label.

[0042] Specifically, for example, the training set is used to train a translation model to be trained, the training set includes a plurality of samples with training labels, each sample with training labels among the plurality of samples with training labels is text including at least one target character, and the training label of each sample with training labels includes the standard translation result of each target character in the sample. The target characters are, for example, game data, specific characters, etc. The game data is, for example, game terms, the game terms are, for example, Cao Cao, Lü Bu, etc., and the specific characters are, for example, formats such as HTML web page tags, parentheses, line breaks, etc.

[0043] For example, the validation set is used to test the translation performance of the trained translation model, and the validation set includes a plurality of samples, each sample among the plurality of samples is text including at least one target character. For example, the sample augmentation set includes a plurality of samples, each sample among the plurality of samples is text including at least one target character, and the target character of each sample is provided with a classification label; for example, the classification label of the target character "Cao Cao" is Cao Cao, the classification label of the target character "Lü Bu" is Lü Bu, and the classification label of the target character "Li Bai" is Li Bai; for another example, the classification label of the target character "Cao Cao" is Three Kingdoms figure, the classification label of the target character "Lü Bu" is Three Kingdoms figure, and the classification label of the target character "Li Bai" is poet; for another example, the target character " " has a classification label of color, the target character " " has a classification label of b, and the classification label of the target character "" is size.

[0044] S202, based on the training data set, performing multi-round training operations on the translation model to be trained to obtain a target translation model meeting the training end condition; Wherein, each round of training operation in the multi-round training operations includes the following steps: Based on the training set, training the translation model to be trained to obtain a trained translation model; Based on the validation set, testing the translation performance of the trained translation model to obtain the wrong translation ratio corresponding to each type of target character; Based on the wrong translation ratio corresponding to each type of target character and the samples of corresponding type of target characters in the sample augmentation set, adjusting the training set to obtain an adjusted training set, taking the adjusted training set as the training set based on which the next round of training operation is performed, and taking the trained translation model as the translation model to be trained for the next round of training operation.

[0045] Specifically, the translation model to be trained is, for example, a large language model to be trained. For instance, based on the training dataset, the translation model to be trained is subjected to multiple rounds of training operations to obtain a target translation model that meets the training termination condition; wherein, the training termination condition is, for example, if the translation model to be trained completes multiple rounds of training operations, then the training of the translation model to be trained is terminated; another training termination condition is, for example, if the translation model to be trained completes multiple rounds of training operations and the value of the loss function of the translation model to be trained is less than or equal to a preset loss threshold, then the training of the translation model to be trained is terminated.

[0046] For example, the validation set includes 10,000 samples. The target character "Cao Cao" appears in 500 of the 10,000 samples. Among these 500 samples, 100 samples have translation errors for the target character "Cao Cao". The error translation ratio for the target character "Cao Cao" is 100 / 500 = 20%.

[0047] It should be noted that by incorporating real-time evaluation during the translation model training process, the error translation ratios of various target characters (such as various game terms and various specific characters) are determined. Specifically, the error translation ratios caused by various game terms not following the target translation and various specific characters not matching the format of the translation model input are statistically analyzed. Based on the error translation ratios corresponding to each target character and the corresponding types of target character samples in the sample enhancement set, the training set is adjusted to obtain the adjusted training set. This is achieved by increasing or decreasing the number of samples containing that type of target character in the training set (increasing or decreasing the proportion of samples containing that type of target character in the training set), thereby achieving targeted training enhancement within the same training time and improving the translation accuracy of the translation model.

[0048] In this embodiment, a training dataset is obtained, comprising samples with training labels. Each sample is text containing at least one target character, and the training label for each sample includes the standard translation results for each target character in that sample. The training dataset includes a training set, a validation set, and a sample augmentation set, where each target character in the sample augmentation set has a classification label. Based on the training dataset, the translation model to be trained is subjected to multiple rounds of training operations to obtain a target translation model that meets the training termination condition. Each round of training operations includes the following steps: training the translation model to be trained based on the training set to obtain a trained translation model; testing the translation performance of the trained translation model based on the validation set to obtain the error translation ratio corresponding to each target character; and adjusting the training set based on the error translation ratio corresponding to each target character and the samples of the corresponding target characters in the sample augmentation set to obtain an adjusted training set. The adjusted training set is used as the training set for the next round of training operations, and the trained translation model is used as the translation model to be trained in the next round of training operations. In this way, by adding real-time evaluation during the training process of the translation model, the error translation ratio of various target characters (such as various game terms and various specific characters) is determined. That is, the error translation ratio caused by various game terms not following the target translation and various specific characters not matching the format of the translation model input are statistically analyzed. Based on the error translation ratio corresponding to each target character and the corresponding type of target character samples in the sample enhancement set, the training set is adjusted to obtain the adjusted training set. That is, by increasing or decreasing the samples containing the target character in the training set (increasing or decreasing the occurrence ratio of samples containing the target character in the training set), targeted training enhancement is achieved within the same training time, thereby improving the translation accuracy of the translation model.

[0049] In one embodiment, the training set is divided into N sample subsets, where N ≥ 2 and N is a positive integer. Each round of training operations includes N training operations, and each training operation is based on one sample subset from the N sample subsets. Each training operation includes the following steps: Based on the sample subset corresponding to the current training operation, the translation model to be trained is trained to obtain the trained translation model. The translation model to be trained corresponding to the first training operation is the trained translation model obtained from the previous training operation, and the translation model to be trained corresponding to the training operations other than the first training operation is the trained translation model obtained from the previous training operation. Based on the validation set, the translation performance of the trained translation model is tested to obtain the error translation ratio for each target character; Based on the error translation ratio corresponding to each target character and the samples of the corresponding target characters in the sample augmentation set, the sample subset corresponding to the next training operation is adjusted to obtain the training set on which the next training operation is based.

[0050] Specifically, for example, N is 2, the training set is divided into 2 sample subsets, and each sample subset in the 2 sample subsets corresponds to 50 batches of samples; the multi-round training operation is 8 rounds of training operations, and each round of training operations includes 2 training operations. Each of the 2 training operations is based on one sample subset in the 2 sample subsets, and this sample subset corresponds to 50 batches of samples.

[0051] For example, a multi-round training operation consists of 8 rounds of training operations. Each round of training operations includes 2 training operations, and each of the 2 training operations is based on one of two sample subsets. The first round of training operations includes training operation 1 and training operation 2. Based on sample subset 1 corresponding to training operation 1, the translation model to be trained is trained to obtain the trained translation model. Based on the validation set, the translation performance of the trained translation model is tested to obtain the error translation ratio corresponding to each target character. Based on the error translation ratio corresponding to each target character and the samples of the corresponding target characters in the sample augmentation set, sample subset 2 corresponding to training operation 2 is adjusted to obtain the adjusted sample subset 2, which serves as the sample subset on which training operation 2 is based.

[0052] For example, the multi-round training operation consists of 8 rounds, with each round including 2 training operations. Each of the 2 training operations is based on one of two sample subsets. The third round of training includes training operation 1 and training operation 2. Based on sample subset 1 corresponding to training operation 1, the translation model to be trained is trained to obtain the trained translation model. The translation model to be trained corresponding to the first training operation (training operation 1) is the trained translation model obtained from the previous round of training (training operation 2). Based on the validation set, the translation performance of the trained translation model is tested to obtain the error translation ratio corresponding to each target character. Based on the error translation ratio corresponding to each target character and the samples of the corresponding target characters in the sample augmentation set, sample subset 2 corresponding to training operation 2 is adjusted to obtain the adjusted sample subset 2. The adjusted sample subset 2 is used as the sample subset on which training operation 2 is based. The translation model to be trained corresponding to the training operation (training operation 2) other than the first training operation is the trained translation model obtained from the previous training operation (training operation 1).

[0053] For example, the target characters include, for example, game data, specific characters, etc. The game data includes, for example, game terms, such as Cao Cao, Lü Bu, etc., and the specific characters include formats such as HTML web page tags, brackets, line breaks, etc.; wherein, the Chinese game terms and their corresponding English training labels are shown in Table 1, and the formats and their corresponding classification labels are shown in Table 2.

[0054] Table 1: Game terms and training labels of game terms

[0055] Wherein, the sample augmentation set includes a plurality of samples, each sample in the plurality of samples is a text including at least one target character, and the target character of each sample is provided with a classification label; for example, the classification label of the target character "Cao Cao" is Cao Cao, the classification label of the target character "Lü Bu" is Lü Bu, and the classification label of the target character "Li Bai" is Li Bai; for another example, the classification label of the target character "Cao Cao" is Three Kingdoms figure, the classification label of the target character "Lü Bu" is Three Kingdoms figure, and the classification label of the target character "Li Bai" is poet; the training label of a game term is the accurate translation of the game term.

[0056] Table 2: Formats and classification labels of formats

[0057] Wherein, the sample augmentation set includes a plurality of samples, each sample in the plurality of samples is a text including at least one target character, and the target character of each sample is provided with a classification label; for example, the classification label of the target character "<color=#16cc29>" is color, the classification label of the target character " " is b, and the classification label of the target character "" is size.

[0058] For example, before the multi-round training operation, the target characters of each sample in the training set are classified to obtain a sample augmentation set.

[0059] For example, as Figure 3 shown, classifying target characters in a training set to obtain a sample augmentation set comprises the following steps: S301, acquiring a training set.

[0060] Specifically, the training data set includes samples with training labels, each sample is a text including at least one target character, and the training label of each sample includes the standard translation result of each target character in the sample. The target characters include, for example, game data, specific characters, etc. The game data includes, for example, game terms, such as Cao Cao, Lü Bu, etc., and the specific characters include formats such as HTML web page tags, brackets, line breaks, etc.

[0061] S302, determine whether the total number of game term types in the training set is greater than the first threshold, and determine whether the total number of format types is greater than the second threshold; if the total number of game term types is greater than the first threshold, and / or the total number of format types is greater than the second threshold, then proceed to S303 for processing; if the total number of game term types is less than or equal to the first threshold, and the total number of format types is less than or equal to the second threshold, then proceed to S304 for processing.

[0062] Specifically, the first threshold is, for example, 5,000 types, and the second threshold is, for example, 100 types.

[0063] S303, through clustering algorithms, similar game terms are grouped into the same category of game terms, and / or similar formats are grouped into the same category of formats, so that the total number of game term categories is less than or equal to the first threshold, and the total number of format categories is less than or equal to the second threshold.

[0064] Specifically, for example, the number of game terminology and format categories can be limited. In common task scenarios, the number of game terms in game text translation is generally around several thousand, but there may be special cases, such as an exceptionally large number of game terms. By calculating the similarity of game texts and using a bottom-up clustering algorithm, similar game terms are grouped into the same category, and similar formats are grouped into the same category, thereby reducing the total number of game terminology categories to below 5000 and the number of format categories to below 100. For example, as shown in Table 1, figures from the Three Kingdoms period, such as Cao Cao and Lü Bu, are grouped into the same category. For example, as shown in Table 2, various... They are grouped into the same color class.

[0065] S304, based on the types and formats of game terms, traverse all samples in the training set to determine the classification label and / or format classification label of the game terms for each sample in all samples.

[0066] Specifically, for example, based on the types of game terms and formats, all samples in the training set are traversed. If the text to be translated corresponding to a certain sample includes a certain game term or a certain format belonging to a certain category, then the game term or the format is classified into that category.

[0067] It should be noted that there can be a many-to-many relationship between categories and samples; one category can correspond to multiple samples, and one sample can correspond to multiple categories.

[0068] S305, based on the training set and the classification labels and / or formatted classification labels of the game terms for each sample in the training set, obtain the sample augmentation set.

[0069] Specifically, the sample augmentation set includes multiple samples, each of which is text containing at least one target character, and the target character of each sample is labeled with a classification tag.

[0070] It should be noted that by incorporating real-time evaluation, i.e., cross-validation, during the translation model training process, the error translation ratio of various target characters is determined. Based on the error translation ratio corresponding to each target character and the samples of the corresponding target characters in the sample enhancement set, the sample subset in the training set is adjusted to obtain the adjusted sample subset. That is, the proportion of samples containing that type of target character in the sample subset is increased or decreased. In this way, targeted training enhancement is achieved within the same training time, thereby improving the translation accuracy of the translation model.

[0071] In one embodiment, the translation performance of the trained translation model is tested based on a validation set to obtain the error translation ratio for each target character, including steps A1-A2: Step A1: Input each sample in the validation set into the trained translation model to obtain the predicted translation result for each sample.

[0072] Specifically, for example, the validation set includes 10,000 samples, and the translation model, such as a large language model, inputs each of the 10,000 samples into the trained large language model to obtain the predicted translation result for each sample.

[0073] Step A2: Based on the training labels and corresponding predicted translation results of each sample in the validation set, determine the mistranslation ratio of each target character.

[0074] Specifically, for example, the validation set includes 10,000 samples. A certain game term "Cao Cao" appears in 500 of the 10,000 samples. Among these 500 samples, 100 samples contain translation errors for the game term "Cao Cao". For example, "Cao Cao" is translated into incorrect English. The error translation ratio for the game term "Cao Cao" is 100 / 500 = 20%.

[0075] For example, the validation set includes 10,000 samples. A certain format "b" appears in 400 of the 10,000 samples. Among these 400 samples, 100 samples have translation errors for this format "b". Translation errors for this format "b" include, for example, the translation model outputs an incorrect format, or the translation model does not output a format, etc. The error translation ratio corresponding to this format "b" is 100 / 400=25%.

[0076] It should be noted that by incorporating real-time evaluation during the translation model training process, the error translation ratios of various target characters (such as various game terms and various specific characters) are determined. Specifically, the error translation ratios caused by game terms not following the target translation and specific characters not matching the format input to the translation model are statistically analyzed. Based on the error translation ratios corresponding to each target character and the corresponding types of target character samples in the sample enhancement set, the training set is adjusted to obtain an adjusted training set. This is achieved by adding or removing samples containing that type of target character from the training set, thereby achieving targeted training enhancement within the same training time and improving the translation accuracy of the translation model. In the method provided in this embodiment, meta-learning refers to adjusting the training set based on the verification effect of the translation model during training (the error translation ratio of each target character). The underlying meta-learning idea of ​​targeted training has broad applicability and provides an effective translation enhancement solution for solving translation off-target problems and long sentence omission translation problems.

[0077] In one embodiment, the training set is adjusted based on the error translation ratio corresponding to each target character and the samples of the corresponding target characters in the sample augmentation set to obtain the adjusted training set, including steps B1-B2: Step B1: Sort the target characters by error translation ratio from largest to smallest, and determine at least one first target character that ranks first among the various target characters.

[0078] Specifically, the target characters include various game terms and formats. For example, for various game terms, sorted by error translation ratio from largest to smallest, the top 20% of game terms with the highest error translation ratio are identified as categories to be enhanced, and each game term in these 20% categories is the first target character; for various formats, sorted by error translation ratio from largest to smallest, the top 20% of formats with the highest error translation ratio are identified as categories to be enhanced, and each format in these 20% categories is the first target character.

[0079] Step B2: For each type of first target character, select at least one sample containing that type of first target character from the sample augmentation set and add it to the training set to obtain the adjusted training set.

[0080] Specifically, for example, based on the total number of samples of a first target character in the sample augmentation set and a preset sample increase ratio, the number of samples to be added is determined; based on the number of samples to be added, the corresponding number of samples including the first target character are added to the training set.

[0081] For example, the sample increase ratio is the training augmentation magnitude parameter, and the sample increase ratio is 1%; the sample augmentation set includes 10,000 samples, and the total number of samples in the sample augmentation set that include a first target character is 500 (for example, the first target character "Cao Cao" appears in 500 samples). Based on the total number of samples of this first target character in the sample augmentation set of 500 and the sample increase ratio of 1%, the sample increase quantity is determined to be 500 × 1% = 5; 5 samples containing this first target character are randomly selected from the sample augmentation set without replacement, and these 5 samples containing this first target character are added to the training set.

[0082] It should be noted that during the training of the translation model, periodic validation set evaluations were conducted simultaneously. The proportion of incorrect translations caused by various game terms not following the target translation and various specific characters (in various formats) not matching the format input to the translation model were statistically analyzed. For game terms with more problems not following the target translation and formats with more problems matching the format input to the translation model, the frequency of samples including these game terms and these formats was increased in subsequent translation model training, thereby conducting targeted training enhancement and improving the translation accuracy of the translation model.

[0083] In one embodiment, the training set is adjusted based on the error translation ratio corresponding to each target character and the samples of the corresponding target characters in the sample augmentation set, resulting in an adjusted training set, including: The training set is adjusted based on the error translation ratio for each target character, the default importance for each target character, and the samples of the corresponding target characters in the sample augmentation set, resulting in the adjusted training set.

[0084] Specifically, for example, sorting by error translation ratio from largest to smallest to obtain the ranking of each target character; determining the comprehensive ranking of each target character based on the ranking of each target character, the preset ranking weight, the default importance of each target character, and the preset default importance weight; determining at least one first target character with the highest comprehensive ranking among all target characters; for each first target character, selecting at least one sample containing that first target character from the sample augmentation set and adding it to the training set to obtain the adjusted training set.

[0085] In one embodiment, the training set is adjusted based on the error translation ratio corresponding to each target character and the samples of the corresponding target characters in the sample augmentation set to obtain an adjusted training set, including steps C1-C2: Step C1: Determine at least one second target character that is ranked last among all target characters, according to the error translation ratio from largest to smallest.

[0086] Specifically, various target characters include, for example, various game terms and various formats. For example, for various game terms, after sorting the game terms in descending order of error translation proportion, 20% of the types with lower error translation proportion among the various game terms are determined as enhanced types, and each game term in this 20% of game term types is a second target character; for various formats, after sorting the formats in descending order of error translation proportion, 20% of the types with lower error translation proportion among the various formats are determined as enhanced types, and each format in this 20% of format types is a second target character.

[0087] Step C2, for each second target character, based on the samples of the corresponding type of target character in the sample augmentation set, delete at least one sample including the second target character from the training set to obtain an adjusted training set.

[0088] Specifically, for example, the number of reduced samples is determined based on the total number of samples of one second target character in the sample augmentation set and a preset sample reduction proportion; based on the number of reduced samples, a corresponding number of samples including the second target character are reduced from the training set.

[0089] For example, the sample reduction proportion is a training augmentation amplitude parameter, and the sample reduction proportion is 1%; the sample augmentation set includes 10000 samples, and the total number of samples of one second target character in the sample augmentation set is 400 (for example, the second target character "Lü Bu" appears in 400 samples), based on the total number of 400 samples of this type of second target character in the sample augmentation set and the 1% sample reduction proportion, the number of reduced samples is determined as = 400×1%=4; based on the number of reduced samples 4, 4 samples including the second target character are reduced from the training set.

[0090] It should be noted that during the training process of the translation model, periodic verification set evaluation is performed synchronously, and the error translation proportion caused respectively by the problem that various game terms do not follow the target translation and the problem that various specific characters (various formats) do not match the format input to the translation model is counted; for game terms with fewer problems of not following the target translation and formats with fewer problems of not matching the format input to the translation model, the occurrence frequency of samples including such game terms and samples of such formats is correspondingly reduced in the subsequent training process of the translation model, thereby stabilizing the total training volume while performing targeted training augmentation, and improving the translation accuracy of the translation model.

[0091] In one embodiment, for each first target character, selecting at least one sample including the type of first target character from the sample augmentation set to add to the training set comprises steps D1-D2: Step D1, determining the number of increased samples based on the total number of samples of this type of first target character in the sample augmentation set and a preset sample increase proportion.

[0092] Specifically, for example, the sample increase ratio is the training enhancement magnitude parameter, and the sample increase ratio is 1%; the sample enhancement set includes 10,000 samples, and the total number of samples of a first target character in the sample enhancement set is 500 (for example, the first target character "Cao Cao" appears in 500 samples). Based on the total number of samples of this first target character in the sample enhancement set of 500 and the sample increase ratio of 1%, the sample increase quantity is determined to be 500 × 1% = 5.

[0093] Step D2: Based on the increase in the number of samples, add the corresponding number of samples containing the first target character to the training set.

[0094] Specifically, for example, if the number of samples corresponding to a first target character is increased to 5, 5 samples containing that first target character are randomly selected without replacement from the sample augmentation set, and the 5 samples containing that first target character are added to the training set.

[0095] It should be noted that during the training of the translation model, periodic validation set evaluations were conducted simultaneously. The proportion of incorrect translations caused by various game terms not following the target translation and various specific characters (in various formats) not matching the format input to the translation model were statistically analyzed. For game terms with more problems not following the target translation and formats with more problems matching the format input to the translation model, the frequency of samples including these game terms and these formats was increased in subsequent translation model training, thereby conducting targeted training enhancement and improving the translation accuracy of the translation model.

[0096] In one embodiment, for each second target character, based on samples of the corresponding type of target character in the sample augmentation set, at least one sample containing the second target character is removed from the training set, including: The number of samples to be reduced is determined based on the total number of samples of a second target character in the sample augmentation set and the preset sample reduction ratio; Based on the number of samples reduced, a corresponding number of samples containing the second target character are reduced from the training set.

[0097] Specifically, for example, the sample reduction ratio is the training augmentation magnitude parameter, and the sample reduction ratio is 1%; the sample augmentation set includes 10,000 samples, and the total number of samples in the sample augmentation set that include a second target character is 600 (for example, the second target character "color" appears in 600 samples). Based on the total number of samples of this second target character in the sample augmentation set of 600 and the sample reduction ratio of 1%, the sample reduction quantity is determined to be 600 × 1% = 6; based on the sample reduction quantity of 6, 6 samples containing the second target character are reduced from the training set.

[0098] In one embodiment, the number of samples to be increased is determined based on the total number of samples of the first target character in the sample augmentation set and a preset sample increase ratio, including steps E1-E2: Step E1: Based on the translation error ratio of the first target character, adjust the preset sample increase ratio to obtain the adjusted sample increase ratio.

[0099] Specifically, the target characters include various game terms and formats. For example, for various game terms, sorted by error translation ratio from largest to smallest, the top 20% of game terms with the highest error translation ratio are identified as categories to be enhanced. Each game term in these 20% categories is a first target character. If the translation error ratio of this first target character is greater than a preset third threshold, the preset sample increase ratio is adjusted from 1% to 2%, resulting in an adjusted sample increase ratio of 2%. Similarly, for various formats, sorted by error translation ratio from largest to smallest, the top 20% of formats with the highest error translation ratio are identified as categories to be enhanced. Each format in these 20% categories is a first target character. If the translation error ratio of this first target character is greater than a preset third threshold, the preset sample increase ratio is adjusted from 1% to 2%, resulting in an adjusted sample increase ratio of 2%.

[0100] Step E2: Based on the total number of samples of the first target character in the sample augmentation set and the adjusted sample increase ratio, determine the number of samples to be added.

[0101] Specifically, for example, the sample increase ratio is the training enhancement magnitude parameter, the sample increase ratio is 1%, and the adjusted sample increase ratio is 2%; the sample enhancement set includes 10,000 samples, and the total number of samples of a first target character in the sample enhancement set is 500 (for example, the first target character "Cao Cao" appears in 500 samples). Based on the total number of samples of this first target character in the sample enhancement set of 500 and the adjusted sample increase ratio of 2%, the sample increase quantity is determined to be 500 × 2% = 10.

[0102] It should be noted that the sample increase ratio is adjusted based on the translation error ratio of a certain target character. The higher the translation error ratio of this target character, the larger the sample increase ratio (training enhancement amplitude parameter). This results in a corresponding increase in the frequency of samples including this target character during the subsequent training of the translation model, enabling targeted training enhancement and improving the translation accuracy of the translation model.

[0103] In one embodiment, determining the sample reduction amount based on the total number of samples of a second target character in the sample augmentation set and a preset sample reduction ratio includes: Adjusting a preset sample reduction ratio based on the translation error ratio of the second target character to obtain an adjusted sample reduction ratio; Determining the sample reduction quantity based on the total number of samples of the second target character in the sample enhancement set and the adjusted sample reduction ratio.

[0104] Specifically, various target characters include, for example, various game terms and various formats. For example, for various game terms, after sorting the error translation ratios in descending order, 20% of the types of game terms with the lowest error translation ratios are determined as enhanced types, and each game term in this 20% of types is a second target character; if the translation error ratio of the second target character is less than a preset fourth threshold, the preset sample reduction ratio is adjusted from 1% to 2%, and the adjusted sample reduction ratio of 2% is obtained. For various formats, after sorting the error translation ratios in descending order, 20% of the types of formats with the lowest error translation ratios are determined as enhanced types, and each format in this 20% of types is a second target character; if the translation error ratio of the second target character is less than a preset fourth threshold, the preset sample reduction ratio is adjusted from 1% to 2%, and the adjusted sample reduction ratio of 2% is obtained.

[0105] For example, the sample reduction ratio is a training enhancement amplitude parameter, the original sample reduction ratio is 1%, and the adjusted sample reduction ratio is 2%; the sample enhancement set includes 10000 samples, the total number of samples of one type of second target character in the sample enhancement set is 400 (for example, the second target character "Lü Bu" appears in 400 samples), and the sample reduction quantity is determined as 400×2%=8 based on the total number of 400 samples of the second target character in the sample enhancement set and the adjusted sample reduction ratio of 2%.

[0106] It should be noted that adjusting the sample reduction ratio based on the translation error ratio of a target character follows the rule that the smaller the translation error ratio of the target character is, the larger the sample reduction ratio (training enhancement amplitude parameter) will be. In the subsequent training process of the translation model, the occurrence frequency of samples including such game terms and samples in such formats is correspondingly reduced, thereby stabilizing the total training volume while performing targeted training enhancement, and improving the translation accuracy of the translation model.

[0107] In one embodiment, if the number of samples corresponding to any first target character in the sample enhancement set is less than the sample increase quantity corresponding to the first target character, adding all samples including the first target character in the sample enhancement set to the training set, and extracting a corresponding number of samples that do not include the first target character from the sample enhancement set based on the difference between the sample increase quantity corresponding to the first target character and the number of samples corresponding to the first target character; For each extracted sample, based on the preset syntax rules, the first target character is inserted into each extracted sample to obtain the updated sample, and the updated sample is added to the training set.

[0108] Specifically, the target characters are such as game data, specific characters, etc., and the specific characters are such as HTML web page tags. If the number of samples corresponding to a certain type of HTML web page tag in the sample augmentation set is less than the number of samples added to that type of HTML web page tag, then the samples in the sample augmentation set that include that type of HTML web page tag are added to the training set. Based on the difference 2 between the number of samples added to that type of HTML web page tag (6) and the number of samples corresponding to that type of HTML web page tag (4), two samples that do not include that type of HTML web page tag are extracted from the sample augmentation set. For each of the two extracted samples that do not include that type of HTML web page tag, based on the preset syntax rules, the two samples that do not include that type of HTML web page tag are inserted into each extracted sample to obtain the updated sample, and the updated sample is added to the training set.

[0109] It should be noted that, for example, due to the large variety and relatively small total number of HTML web page tags, the number of samples corresponding to some types of HTML web page tags is often very small, making it difficult to conduct effective targeted training. Therefore, if the number of samples corresponding to a certain type of HTML web page tag is particularly small, a batch of samples including other types (excluding samples of that type of HTML web page tag) can be selected, and that type of HTML web page tag can be inserted into this batch of samples to achieve the purpose of data augmentation.

[0110] In one embodiment, the training dataset is a game-related training dataset, and the target character is game data or a specific character.

[0111] Specifically, target characters include game data and specific characters. Game data includes game terms, game terms include Cao Cao and Lü Bu, and specific characters include HTML web page tags, parentheses, line breaks, and other formats. Game terms are shown in Table 1, and specific characters are shown in Table 2.

[0112] Applying the embodiments of this disclosure has at least the following beneficial effects: By incorporating real-time evaluation during the translation model training process, the error translation ratios for various target characters (such as various game terms and specific characters) are determined. Specifically, the error translation ratios caused by game terms not following the target translation and specific characters not matching the format of the translation model input are statistically analyzed. Based on the error translation ratios for each target character and the corresponding target character samples in the sample enhancement set, the training set is adjusted to obtain an adjusted training set. This is achieved by increasing or decreasing the number of samples containing that target character in the training set (increasing or decreasing the proportion of samples containing that target character in the training set), thereby achieving targeted training enhancement within the same training time and improving the translation accuracy of the translation model.

[0113] To better understand the methods provided in the embodiments of this disclosure, the solutions of the embodiments of this disclosure will be further explained below with reference to specific application scenarios.

[0114] In a specific application scenario, for a translation model translation task, see [link to relevant documentation]. Figure 4 This illustrates the processing flow of a translation model training method, such as... Figure 4 As shown, the processing flow of the translation model training method provided in this embodiment includes the following steps: S401, the person in charge of the translation task determines the translation enhancement options through the Youyi platform.

[0115] Specifically, the game translation platform is a server; for example, a platform for translating game text from Chinese to English. Figure 5 As shown, the person in charge of the translation task can determine whether to activate the training enhancement program (translation enhancement option) and the corresponding training enhancement magnitude parameters through the training interface of the Youyi platform.

[0116] It should be noted that determining the translation enhancement options, i.e. activating the training enhancement scheme, involves selecting the corresponding training enhancement magnitude parameters.

[0117] S402, the translation platform obtains the training dataset submitted by the person in charge of the translation task, and performs multiple rounds of training operations on the translation model to be trained based on the training dataset to obtain the target translation model that meets the training termination conditions.

[0118] Specifically, the training dataset includes a training set, a validation set, and a sample augmentation set, where each sample in the sample augmentation set carries a classification label for the target character.

[0119] S403, the translation platform obtains training loss, translation accuracy logs, etc. during the training process of the translation model to be trained.

[0120] Specifically, the training loss during the training process of the translation model to be trained is, for example, the value of the loss function of the translation model to be trained. The translation accuracy log includes the translation accuracy corresponding to each target character, where the translation accuracy corresponding to each target character is 100% minus the proportion of incorrect translations corresponding to each target character.

[0121] In one embodiment, for example, Figure 5As shown, the training interface of the translation platform includes options such as truncation length, learning rate, number of training epochs, learning rate adjuster, calculation type, batch size, gradient accumulation, maximum gradient norm, validation set ratio, cross-validation steps, whether to enable translation enhancement options, training enhancement magnitude parameters, LoRA parameter settings, parameter configuration management, parameter preview, start training, interrupt, refresh and resume, training dataset upload, log download, name of the newly created model weight file, and training time progress. Among these, truncation length: inputs the maximum text data length for the translation model; text exceeding this length will be truncated to this length before being input into the translation model. Type, for example, a truncation length of 1536; Learning rate: the update length for each model gradient update, used to adjust the training speed of the translation model, for example, the initial learning rate of the AdamW optimizer is le-4; Number of training epochs: the total number of training epochs, for example, 8.0; Learning rate regulator: indicates how the learning rate changes with the number of training steps, for example, a cosine learning rate regulator will cause the learning rate to decrease along the cosine curve as the number of training steps increases; Computation type: refers to the data type used in model training and inference, for example, computation type is fp16, fp16 refers to 16-bit float. Point (floating-point) number; Batch size: The amount of data input to the translation model at each step of training. For example, a batch size of 4 means that the amount of data input to the translation model at one time is 4 data points (4 samples); Gradient accumulation: How many training steps are required to perform a gradient update. For example, a gradient accumulation of 8 means that a gradient update is performed after 8 training steps; Maximum gradient norm: Before the model's gradient is updated, the maximum norm of the gradient vector is restricted to be less than or equal to a certain value. For example, the maximum gradient norm is 1.0, meaning gradient vectors with a norm greater than 1, will have their norm reduced to 1; Validation set ratio: the percentage of the training dataset in the validation set; Cross-validation steps: setting the number of steps between validations, e.g., 50 steps, with one step constituting one batch; Enable translation enhancement options: enabling translation enhancement and selecting the corresponding training enhancement magnitude parameter; Training enhancement magnitude parameter: e.g., 1% training enhancement magnitude parameter; LoRA parameter settings: parameter settings related to the LoRA training method, a highly efficient method for training models; Parameter configuration management: used to manage saved parameter templates; Preview parameters: preview all parameters in the training interface, such as truncation length, learning rate, training... The system includes parameters such as training rounds, learning rate adjuster, computation type, batch size, gradient accumulation, maximum gradient norm, validation set ratio, cross-validation steps, whether to enable translation enhancement options, and training enhancement magnitude parameters; Start Training: Initiates training of the translation model; Interrupt: Interrupts model training; Refresh and Resume: Refreshes the current running status of the translation platform when the connection is unstable and recovers from possible operational problems; Training Dataset Upload: The translation platform obtains the training dataset submitted by the person responsible for the translation task; Log Download: Downloads relevant logs from the model training; Name of New Model Weight File: After the model training is completed, a new and saved model weight file is created, containing the model parameters; Training Time Progress: The model training time progress.

[0122] In a specific application scenario, such as the training scenario of a translation model, see [link to relevant documentation]. Figure 6 This illustrates the processing flow of a translation model training method, such as... Figure 6 As shown, the processing flow of the translation model training method provided in this embodiment includes the following steps: S601, the server obtains the training set and validation set, classifies the target characters in the training set to obtain the sample augmentation set, and constructs the training dataset from the training set, validation set and sample augmentation set.

[0123] Specifically, for example, the training dataset includes samples with training labels, each sample being text containing at least one target character, and the training label for each sample including the standard translation results of each target character in the sample. The training dataset includes a training set, a validation set, and a sample augmentation set, where each target character in the sample augmentation set has a classification label.

[0124] S602, the server performs multiple rounds of training operations on the translation model to be trained based on the training dataset to obtain the target translation model that meets the training termination condition; wherein, the training set is divided into N sample subsets, N≥2, N is a positive integer, each round of training operation includes N training operations, and each training operation is based on one sample subset of the N sample subsets.

[0125] Specifically, for example, such as Figure 7 As shown, each training operation includes steps S701-S703: S701, the server trains the translation model to be trained based on the sample subset corresponding to the current training operation, and obtains the trained translation model. The translation model to be trained corresponding to the first training operation is the trained translation model obtained from the previous training operation, and the translation models to be trained corresponding to training operations other than the first training operation are the trained translation models obtained from the previous training operation.

[0126] S702, the server tests the translation performance of the trained translation model based on the validation set, and obtains the error translation ratio for each target character.

[0127] Specifically, for example, each sample in the validation set is input into the trained translation model to obtain the predicted translation result for each sample; based on the training label and the corresponding predicted translation result for each sample in the validation set, the error translation ratio for each target character is determined.

[0128] For example, in a validation set of 10,000 samples, the game term "Cao Cao" appears in 500 of those samples. Of these 500 samples, 100 contain translation errors for "Cao Cao," such as translating "Cao Cao" into incorrect English. The error rate for this game term "Cao Cao" is 100 / 500 = 20%. Similarly, in another validation set of 10,000 samples, a format "b" appears in 400 of those samples. Of these 400 samples, 100 contain translation errors for this format "b," such as the translation model outputting an incorrect format or not outputting a format at all. The error rate for this format "b" is 100 / 400 = 25%.

[0129] S703, the server adjusts the sample subset corresponding to the next training operation based on the error translation ratio of each target character and the samples of the corresponding target characters in the sample augmentation set, to obtain the training set on which the next training operation is based.

[0130] Specifically, various target characters include various game terms and formats. For example, for various game terms, sorted by error translation ratio from largest to smallest, the top 20% of game terms with the highest error translation ratio are identified as categories to be enhanced, and each game term in these 20% categories is designated as the first target character. For various formats, sorted by error translation ratio from largest to smallest, the top 20% of formats with the highest error translation ratio are identified as categories to be enhanced, and each format in these 20% categories is designated as the first target character. Based on the total number of samples of a first target character in the sample enhancement set and a preset sample increase ratio, the number of samples to be added is determined. Based on the number of samples to be added, the corresponding number of samples including the first target character are added to the sample subset corresponding to the next training operation.

[0131] For example, for various game terms, sorted by error translation ratio from largest to smallest, the bottom 20% of game terms with the lowest error translation ratio are identified as enhanced types, and each game term in these 20% types is designated as the second target character; for various formats, sorted by error translation ratio from largest to smallest, the bottom 20% of formats with the lowest error translation ratio are identified as enhanced types, and each format in these 20% types is designated as the second target character; based on the total number of samples of a second target character in the sample enhancement set and a preset sample reduction ratio, the number of samples to be reduced is determined; based on the number of samples to be reduced, a corresponding number of samples including the second target character are reduced from the sample subset corresponding to the next training operation.

[0132] S603, the server outputs the training logs of the translation model to be trained.

[0133] Specifically, the training log includes a translation accuracy log, which contains the translation accuracy for each target character. The translation accuracy for each target character is calculated as 100% minus the percentage of incorrect translations for that target character.

[0134] Applying the embodiments of this disclosure has at least the following beneficial effects: By incorporating real-time evaluation during the translation model training process, the error translation ratios for various target characters (e.g., various game terms and specific characters) are determined. Specifically, the error translation ratios caused by game terms not conforming to the target translation and specific characters not matching the input format of the translation model are statistically analyzed. Based on the error translation ratios for each target character and the corresponding target character samples in the sample augmentation set, the training set is adjusted to obtain an adjusted training set. This is achieved by either increasing or decreasing the number of samples containing that target character in the training set (increasing or decreasing the number of samples containing that target character in the training set). This approach (increasing the current ratio) allows for targeted training enhancement within the same training time, improving the translation accuracy of the translation model. It addresses issues such as translation models not adhering to the target translation for various game terms and mismatches between specific characters and the input format. It avoids problems like inconsistencies between game terminology translation and context, the need for additional model computation, and high requirements for terminology lists. It achieves automation and effective platform packaging, requiring no additional manual input and is easy to use. The underlying meta-learning concept of targeted training has broad applicability, providing an effective translation enhancement solution for addressing translation off-target issues and omissions in long sentence translation.

[0135] This disclosure also provides a training device for a translation model, the structural schematic diagram of which is shown below. Figure 8 As shown, the training device 80 for the translation model includes a first processing module 801 and a second processing module 802.

[0136] The first processing module 801 is used to obtain a training dataset. The training dataset includes samples with training labels. Each sample is text containing at least one target character. The training label of each sample includes the standard translation results of each target character in the sample. The training dataset includes a training set, a validation set, and a sample augmentation set. Each target character in the sample augmentation set has a classification label. The second processing module 802 is used to perform multiple rounds of training operations on the translation model to be trained based on the training dataset, so as to obtain the target translation model that meets the training termination condition. Each round of training includes the following steps: Based on the training set, the translation model to be trained is trained to obtain the trained translation model; Based on the validation set, the translation performance of the trained translation model is tested to obtain the error translation ratio for each target character; Based on the error translation ratio corresponding to each target character and the corresponding target character samples in the sample augmentation set, the training set is adjusted to obtain the adjusted training set. The adjusted training set is used as the training set for the next round of training operations, and the trained translation model is used as the translation model to be trained in the next round of training operations.

[0137] In one embodiment, the training set is divided into N sample subsets, where N ≥ 2 and N is a positive integer. Each round of training operations includes N training operations, and each training operation is based on one sample subset from the N sample subsets. Each training operation includes the following steps: Based on the sample subset corresponding to the current training operation, the translation model to be trained is trained to obtain the trained translation model. The translation model to be trained corresponding to the first training operation is the trained translation model obtained from the previous training operation, and the translation model to be trained corresponding to the training operations other than the first training operation is the trained translation model obtained from the previous training operation. Based on the validation set, the translation performance of the trained translation model is tested to obtain the error translation ratio for each target character; Based on the error translation ratio corresponding to each target character and the samples of the corresponding target characters in the sample augmentation set, the sample subset corresponding to the next training operation is adjusted to obtain the training set on which the next training operation is based.

[0138] In one embodiment, the second processing module 802 is specifically used for: Each sample in the validation set is input into the trained translation model to obtain the predicted translation result for each sample; Based on the training labels and corresponding predicted translation results of each sample in the validation set, the mistranslation ratio of each target character is determined.

[0139] In one embodiment, the second processing module 802 is specifically used for: Based on the error translation ratio from largest to smallest, determine at least one first target character that appears first among all target characters; For each type of first target character, at least one sample containing that first target character is selected from the sample augmentation set and added to the training set to obtain the adjusted training set.

[0140] In one embodiment, the second processing module 802 is specifically used for: Based on the error translation ratio from largest to smallest, determine at least one second target character that is ranked last among all target characters; For each second target character, based on the samples of the corresponding target characters in the sample augmentation set, at least one sample containing the second target character is removed from the training set to obtain the adjusted training set.

[0141] In one embodiment, the second processing module 802 is specifically used for: The number of samples to be added is determined based on the total number of samples of the first target character in the sample augmentation set and the preset sample increase ratio; Based on the increase in the number of samples, a corresponding number of samples containing the first target character are added to the training set.

[0142] In one embodiment, the second processing module 802 is specifically used for: Based on the translation error rate of the first target character, the preset sample increase rate is adjusted to obtain the adjusted sample increase rate. The number of samples to be added is determined based on the total number of samples of the first target character in the sample augmentation set and the adjusted sample increase ratio.

[0143] In one embodiment, the second processing module 802 is specifically used for: If the number of samples corresponding to any first target character in the sample augmentation set is less than the number of samples added to that first target character, then the samples in the sample augmentation set that include that first target character will be added to the training set, and based on the difference between the number of samples added to that first target character and the number of samples corresponding to that first target character, a corresponding number of samples that do not include that first target character will be extracted from the sample augmentation set. For each extracted sample, based on the preset syntax rules, the first target character is inserted into each extracted sample to obtain the updated sample, and the updated sample is added to the training set.

[0144] In one embodiment, the training dataset is a game-related training dataset, and the target character is game data or a specific character.

[0145] Applying the embodiments of this disclosure has at least the following beneficial effects: Obtain a training dataset, which includes samples with training labels. Each sample is text containing at least one target character, and the training label for each sample includes the standard translation results for each target character in that sample. The training dataset includes a training set, a validation set, and a sample augmentation set. Each target character in the sample augmentation set has a classification label. Based on the training dataset, perform multiple rounds of training on the translation model to be trained until a target translation model that meets the training termination condition is obtained. Each round of training includes the following steps: training the translation model to be trained on the training set to obtain a trained translation model; testing the translation performance of the trained translation model on the validation set to obtain the error translation ratio for each target character; adjusting the training set based on the error translation ratio for each target character and the corresponding target character samples in the sample augmentation set to obtain an adjusted training set. The adjusted training set serves as the basis for the next round of training, and the trained translation model is used as the translation model to be trained in the next round. Thus, by incorporating real-time evaluation during the translation model training process, the error translation ratios for various target characters (e.g., various game terms and specific characters) are determined. Specifically, the error translation ratios caused by game terms not following the target translation and specific characters not matching the format of the translation model input are statistically analyzed. Based on the error translation ratios for each target character and the corresponding types of target character samples in the sample enhancement set, the training set is adjusted to obtain the adjusted training set. This is achieved by increasing or decreasing the number of samples containing that target character in the training set (increasing or decreasing the proportion of samples containing that target character in the training set), thereby achieving targeted training enhancement within the same training time and improving the translation accuracy of the translation model.

[0146] This disclosure also provides an electronic device, the structural schematic diagram of which is shown below. Figure 9 As shown, Figure 9 The illustrated electronic device 4000 includes a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, for example, via a bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004, which can be used for data interaction between the electronic device and other electronic devices, such as sending and / or receiving data. It should be noted that in practical applications, the transceiver 4004 is not limited to one type, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of this disclosure.

[0147] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with this disclosure. Processor 4001 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.

[0148] Bus 4002 may include a pathway for transmitting information between the aforementioned components. Bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 4002 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 9 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0149] The memory 4003 may be ROM (Read Only Memory) or other types of static storage devices capable of storing static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices capable of storing information and instructions, or EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium capable of carrying or storing computer programs and capable of being read by a computer, without limitation herein.

[0150] The memory 4003 is used to store computer programs that execute embodiments of the present disclosure, and is controlled by the processor 4001 to execute them. The processor 4001 is used to execute the computer programs stored in the memory 4003 to implement the steps shown in the foregoing method embodiments.

[0151] Electronic devices include, but are not limited to, servers.

[0152] Applying the embodiments of this disclosure has at least the following beneficial effects: Obtain a training dataset, which includes samples with training labels. Each sample is text containing at least one target character, and the training label for each sample includes the standard translation results for each target character in that sample. The training dataset includes a training set, a validation set, and a sample augmentation set. Each target character in the sample augmentation set has a classification label. Based on the training dataset, perform multiple rounds of training on the translation model to be trained until a target translation model that meets the training termination condition is obtained. Each round of training includes the following steps: training the translation model to be trained on the training set to obtain a trained translation model; testing the translation performance of the trained translation model on the validation set to obtain the error translation ratio for each target character; adjusting the training set based on the error translation ratio for each target character and the corresponding target character samples in the sample augmentation set to obtain an adjusted training set. The adjusted training set serves as the basis for the next round of training, and the trained translation model is used as the translation model to be trained in the next round. Thus, by incorporating real-time evaluation during the translation model training process, the error translation ratios for various target characters (e.g., various game terms and specific characters) are determined. Specifically, the error translation ratios caused by game terms not following the target translation and specific characters not matching the format of the translation model input are statistically analyzed. Based on the error translation ratios for each target character and the corresponding types of target character samples in the sample enhancement set, the training set is adjusted to obtain the adjusted training set. This is achieved by increasing or decreasing the number of samples containing that target character in the training set (increasing or decreasing the proportion of samples containing that target character in the training set), thereby achieving targeted training enhancement within the same training time and improving the translation accuracy of the translation model.

[0153] This disclosure provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the steps and corresponding content of the aforementioned method embodiments.

[0154] This disclosure also provides a computer program product, including a computer program that, when executed by a processor, can implement the steps and corresponding content of the aforementioned method embodiments.

[0155] It should be understood that although arrows indicate various operation steps in the flowcharts of the embodiments of this disclosure, the order in which these steps are implemented is not limited to the order indicated by the arrows. Unless explicitly stated herein, in some implementation scenarios of the embodiments of this disclosure, the implementation steps in each flowchart can be executed in other orders as required. Furthermore, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on the actual implementation scenario. Some or all of these sub-steps or stages can be executed at the same time, and each sub-step or stage can also be executed at different times. In scenarios where execution times differ, the execution order of these sub-steps or stages can be flexibly configured as required, and the embodiments of this disclosure do not limit this.

[0156] The above description is only an optional implementation method for some implementation scenarios of this disclosure. It should be noted that for those skilled in the art, other similar implementation methods based on the technical concept of this disclosure without departing from the technical concept of this disclosure also fall within the protection scope of the embodiments of this disclosure.

Claims

1. A method for training a translation model, characterized in that, include: Obtain a training dataset, which includes samples with training labels. Each sample is text containing at least one target character. The training label of each sample includes the standard translation results of each target character in the sample. The training dataset includes a training set, a validation set, and a sample augmentation set. Each target character in the sample augmentation set has a classification label. Based on the training dataset, the translation model to be trained is subjected to multiple rounds of training operations to obtain the target translation model that meets the training termination condition; Each round of training includes the following steps: Based on the training set, the translation model to be trained is trained to obtain the trained translation model; Based on the validation set, the translation performance of the trained translation model is tested to obtain the error translation ratio for each target character; Based on the error translation ratio corresponding to each target character and the samples of the corresponding target characters in the sample enhancement set, the training set is adjusted to obtain an adjusted training set. The adjusted training set is used as the training set for the next round of training operations, and the trained translation model is used as the translation model to be trained in the next round of training operations.

2. The method according to claim 1, characterized in that, The training set is divided into N sample subsets, where N ≥ 2 and N is a positive integer. Each round of training operations includes N training operations, and each training operation is based on one sample subset from the N sample subsets. Each training operation includes the following steps: Based on the sample subset corresponding to the current training operation, the translation model to be trained is trained to obtain the trained translation model. The translation model to be trained corresponding to the first training operation is the trained translation model obtained from the previous training operation, and the translation model to be trained corresponding to the training operations other than the first training operation is the trained translation model obtained from the previous training operation. Based on the validation set, the translation performance of the trained translation model is tested to obtain the error translation ratio for each target character. Based on the error translation ratio corresponding to each target character and the samples of the corresponding target characters in the sample augmentation set, the sample subset corresponding to the next training operation is adjusted to obtain the training set on which the next training operation is based.

3. The method according to claim 1, characterized in that, The translation performance of the trained translation model is tested based on the validation set to obtain the error translation ratio for each target character, including: Each sample in the validation set is input into the trained translation model to obtain the predicted translation result for each sample; Based on the training labels and corresponding predicted translation results of each sample in the validation set, the error translation ratio of each target character is determined.

4. The method according to claim 1, characterized in that, Based on the error translation ratio corresponding to each target character and the samples of the corresponding target characters in the sample augmentation set, the training set is adjusted to obtain an adjusted training set, including: Based on the error translation ratio from largest to smallest, determine at least one first target character that ranks first among all target characters; For each first target character, at least one sample containing that first target character is selected from the sample enhancement set and added to the training set to obtain the adjusted training set.

5. The method according to claim 1, characterized in that, Based on the error translation ratio corresponding to each target character and the samples of the corresponding target characters in the sample augmentation set, the training set is adjusted to obtain an adjusted training set, including: Based on the error translation ratio from largest to smallest, determine at least one second target character that is ranked last among all target characters; For each second target character, based on the samples of the corresponding type of target character in the sample enhancement set, at least one sample containing the second target character is deleted from the training set to obtain an adjusted training set.

6. The method according to claim 4, characterized in that, For each first target character, selecting at least one sample containing that first target character from the sample enhancement set and adding it to the training set includes: Based on the total number of samples of the first target character in the sample enhancement set and the preset sample increase ratio, the number of samples to be increased is determined; Based on the increase in the number of samples, a corresponding number of samples including the first target character are added to the training set.

7. The method according to claim 6, characterized in that, The determination of the sample increase quantity based on the total number of samples of the first target character in the sample enhancement set and a preset sample increase ratio includes: Based on the translation error ratio of the first target character, the preset sample increase ratio is adjusted to obtain the adjusted sample increase ratio. The number of samples to be increased is determined based on the total number of samples of the first target character in the sample enhancement set and the adjusted sample increase ratio.

8. The method according to claim 4, characterized in that, Also includes: If the number of samples corresponding to any first target character in the sample augmentation set is less than the number of samples added to that first target character, then the samples in the sample augmentation set that include that first target character are added to the training set, and based on the difference between the number of samples added to that first target character and the number of samples corresponding to that first target character, a corresponding number of samples that do not include that first target character are extracted from the sample augmentation set. For each extracted sample, based on preset syntax rules, the first target character is inserted into each extracted sample to obtain an updated sample, and the updated sample is added to the training set.

9. The method according to claim 1, characterized in that, The training dataset is a game-related training dataset, and the target character is game data or a specific character.

10. A training device for a translation model, characterized in that, include: The first processing module is used to obtain a training dataset, which includes samples with training labels. Each sample is text containing at least one target character. The training label of each sample includes the standard translation results of each target character in the sample. The training dataset includes a training set, a validation set, and a sample augmentation set. Each target character in the sample augmentation set has a classification label. The second processing module is used to perform multiple rounds of training operations on the translation model to be trained based on the training dataset, so as to obtain a target translation model that meets the training termination condition. Each round of training includes the following steps: Based on the training set, the translation model to be trained is trained to obtain the trained translation model; Based on the validation set, the translation performance of the trained translation model is tested to obtain the error translation ratio for each target character; Based on the error translation ratio corresponding to each target character and the samples of the corresponding target characters in the sample enhancement set, the training set is adjusted to obtain an adjusted training set. The adjusted training set is used as the training set for the next round of training operations, and the trained translation model is used as the translation model to be trained in the next round of training operations.

11. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method according to any one of claims 1-9.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-9.

13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-9.