Translation method and device, computer device and storage medium thereof
By determining the grammar and language training samples in the translation model and fine-tuning the target neural network, the problem of large translation errors in the intermediate language mode is solved, achieving higher translation accuracy and efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INDUSTRIAL AND COMMERCIAL BANK OF CHINA
- Filing Date
- 2023-02-14
- Publication Date
- 2026-05-15
AI Technical Summary
Translation models based on the 'intermediate language' model suffer from poor accuracy due to the increased error between the target language and the language being translated caused by the introduction of a third language.
By determining grammar training samples and language training samples, a basic translation model is trained, and the target neural network that affects translation accuracy is fine-tuned to obtain the target translation model, ensuring the accuracy and efficiency of the training process.
This improves the accuracy and efficiency of translation tasks, ensuring that the translation model can successfully complete the target translation task and improve the accuracy of the translation results.
Smart Images

Figure CN116187353B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a translation method, apparatus, computer device and its storage medium. Background Technology
[0002] With the continuous development of society, people often encounter situations that require language translation in their daily lives and work; therefore, in order to meet people's needs for language translation, translation models based on the "intermediate language" model have emerged.
[0003] Among them, the translation model based on the "intermediate language" mode is specifically used in the process of translating the language to be translated into the target language by selecting another language as an intermediate language, thereby translating the language to be translated into the intermediate language, and then translating the intermediate language into the target language. For example, when translating Chinese into French, English can be selected as the intermediate language. Therefore, when translating Chinese, it can first be translated into English, and then English into French.
[0004] However, the "intermediate language" translation model requires the introduction of a third language (i.e., an intermediate language) to translate the language to be translated into the target language, which increases the error between the language to be translated and the target language. Therefore, the translation results obtained by using a translation model based on the "intermediate language" model are less accurate. Summary of the Invention
[0005] Therefore, it is necessary to provide a translation method, apparatus, computer equipment, and storage medium that can improve translation accuracy in response to the above-mentioned technical problems.
[0006] Firstly, this application provides a translation method. The method includes:
[0007] Get the content to be translated;
[0008] The content to be translated is input into the target language model, and the translation result corresponding to the content to be translated is generated by the target language model. The target language model is trained based on the grammar training samples and language training samples determined by the target translation task.
[0009] In one embodiment, the content to be translated is input into the target language model, the content to be translated is vectorized, and the translation vector of the content to be translated is determined.
[0010] Based on the vector to be translated, the translation result corresponding to the content to be translated is generated by the target language model.
[0011] In one embodiment, grammar training samples and language training samples are determined based on the target translation task; wherein, the target translation task includes: source language, target language, and translation accuracy;
[0012] The basic translation model is obtained by training the translation model based on the grammatical training samples.
[0013] Identify the target neural network in the basic translation model that affects translation accuracy;
[0014] Based on language training samples, the target neural network in the basic translation model is fine-tuned to obtain the target translation model. The target language model is used to perform translation tasks from the source language to the target language.
[0015] In one embodiment, determining grammar training samples based on the target translation task includes:
[0016] The grammar training task is determined based on the translation accuracy required for the target translation task.
[0017] Based on the source language, target language, and grammar training task in the target translation task, determine the grammar training samples.
[0018] In one embodiment, language training samples are determined based on the target translation task, including:
[0019] Based on the source language and target language in the target translation task, determine the language training samples.
[0020] In one embodiment, the grammar training task includes at least one of a cloze test task, a sentence prediction task, and a multilingual comparison task.
[0021] In one embodiment, determining the target neural network in the base translation model that affects translation accuracy includes:
[0022] Determine if there is a corresponding historical translation task for the target translation task; wherein, the source language and target language in the historical translation task are the same as those in the target translation task;
[0023] If so, then based on the network fine-tuning records corresponding to historical translation tasks, determine the target neural network in the basic translation model that affects the accuracy of language translation.
[0024] In one embodiment, the method further includes:
[0025] If not, then determine the degree of influence of each candidate neural network in the basic language model on the translation accuracy of the target translation task;
[0026] Based on the degree of influence, the target neural network is determined from each candidate neural network.
[0027] Secondly, this application also provides a translation device. The device includes:
[0028] The acquisition module is used to acquire the content to be translated;
[0029] The input module is used to input the content to be translated into the target language model and obtain the translation result corresponding to the content to be translated generated by the target language model. The target language model is trained based on the grammar training samples and language training samples determined by the target translation task.
[0030] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the translation method as described in any of the embodiments of the first aspect above.
[0031] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the translation method as described in any of the embodiments of the first aspect above.
[0032] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the translation method as described in any of the embodiments of the first aspect above.
[0033] According to the technical solution of this application, by determining the grammar training samples and language training samples, the smooth progress of subsequent processes is ensured, providing training samples for subsequent training and guaranteeing the training effect. Based on the grammar training samples, the translation model to be trained can be grammatically trained, improving the translation accuracy of subsequent target translation tasks. Furthermore, it ensures that the basic translation model can be fine-tuned based on the language training samples, further improving the translation accuracy of subsequent target translation tasks. By determining the target neural network that affects translation accuracy, it ensures that the basic translation model can be smoothly fine-tuned subsequently. It also ensures that only the target neural network is trained during fine-tuning of the basic translation model, improving the training efficiency of fine-tuning and guaranteeing its training effect. This enables the target translation model to successfully complete the target translation task and ensures the accuracy of the target translation model in performing the target translation task. Attached Figure Description
[0034] Figure 1 An application environment diagram of a translation method provided in this application embodiment;
[0035] Figure 2 A flowchart illustrating a translation method provided in this application embodiment;
[0036] Figure 3A flowchart illustrating the steps for determining a vector to be translated, as provided in this application embodiment;
[0037] Figure 4 A flowchart illustrating a translation method provided in this application embodiment;
[0038] Figure 5 A flowchart illustrating the steps for determining grammar training samples provided in this application embodiment;
[0039] Figure 6 A flowchart illustrating the steps for determining a target neural network, as provided in this application embodiment;
[0040] Figure 7 A flowchart illustrating another translation method provided in this application embodiment;
[0041] Figure 8 A structural block diagram of the first translation device provided in the embodiments of this application;
[0042] Figure 9 A structural block diagram of the second translation device provided in the embodiments of this application;
[0043] Figure 10 A structural block diagram of the third translation device provided in the embodiments of this application;
[0044] Figure 11 A structural block diagram of the fourth translation device provided in the embodiments of this application;
[0045] Figure 12 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0046] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0047] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application. In the description of this application, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0048] With the continuous development of society, people often encounter situations that require language translation in their daily lives and work; therefore, in order to meet people's needs for language translation, translation models based on the "intermediate language" model have emerged.
[0049] Among them, the translation model based on the "intermediate language" mode is specifically used in the process of translating the language to be translated into the target language by selecting another language as an intermediate language, thereby translating the language to be translated into the intermediate language, and then translating the intermediate language into the target language. For example, when translating Chinese into French, English can be selected as the intermediate language. Therefore, when translating Chinese, it can first be translated into English, and then English into French.
[0050] However, the "intermediate language" translation model requires the introduction of a third language (i.e., an intermediate language) to translate the language to be translated into the target language, which increases the error between the language to be translated and the target language. Therefore, the translation results obtained by using a translation model based on the "intermediate language" model are less accurate.
[0051] The translation method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, in one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows. Figure 1As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database stores data acquired through the translation method. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements a translation method.
[0052] This application discloses a translation method, apparatus, computer device, and storage medium thereof. The operator's computer device determines grammar training samples and language training samples based on the target translation task; obtains a basic translation model based on the grammar training samples; determines the target neural network of the basic translation model; and fine-tunes the target neural network of the basic translation model based on the language training samples to obtain the target translation model.
[0053] In one embodiment, such as Figure 2 As shown, Figure 2 This application provides a flowchart of a translation method according to an embodiment of the present application. Figure 1 The translation method performed by the computer device in the middle may include the following steps:
[0054] Step 201: Obtain the content to be translated.
[0055] It should be noted that the content to be translated refers to the relevant content that needs to be translated by the target language model, and the content to be translated can include, but is not limited to: articles, short sentences, words, etc.
[0056] To further clarify, the content to be translated may consist of multiple languages.
[0057] Step 202: Input the content to be translated into the target language model to obtain the translation result generated by the target language model corresponding to the content to be translated.
[0058] The target language model is trained based on the grammar training samples and language training samples determined by the target translation task.
[0059] According to the translation method of this application, the translation operation is realized by inputting the content to be translated into the target language model, so that the target translation model can successfully complete the translation work.
[0060] It should be noted that vector transformation is performed on the content to be translated to determine the vector to be translated; optionally, such as... Figure 3 As shown, Figure 3This application provides a flowchart of steps for determining a vector to be translated. Specifically, determining the vector to be translated may include the following steps:
[0061] Step 301: Input the content to be translated into the target language model, perform vector transformation on the content to be translated, and determine the translation vector of the content to be translated.
[0062] It should be noted that when vector conversion of the content to be translated is required, it can be performed based on a pre-defined character-vector mapping table.
[0063] In one embodiment of this application, when vector conversion of the content to be translated is required, each character in the content to be translated is represented by a specific vector according to the character-vector lookup table, thereby obtaining the vector to be translated corresponding to the content to be translated.
[0064] Step 302: Based on the vector to be translated, obtain the translation result generated by the target language model corresponding to the content to be translated.
[0065] Specifically, when it is necessary to determine the translation result corresponding to the content to be translated, the vector to be translated can be input into the target language model to obtain the translation result corresponding to the content to be translated generated by the target language model.
[0066] According to the translation method of this application, by performing vector transformation on the content to be translated, it is ensured that the target language model can successfully generate translation results corresponding to the content to be translated, thus ensuring the accuracy of the translation results.
[0067] It should be noted that a target language model can be trained based on grammar training samples and language training samples determined by the target translation task, such as... Figure 4 As shown, Figure 4 A flowchart illustrating the steps of training a target language model, as provided in this application embodiment.
[0068] Specifically, training a target language model may include the following steps:
[0069] Step 401: Based on the target translation task, determine the grammar training samples and language training samples; wherein, the target translation task includes: source language, target language, and translation accuracy.
[0070] It should be noted that the source language refers to the language that needs to be translated in the target translation task, the target language refers to the language that the source language needs to be translated into in the target translation task, and the translation accuracy refers to the degree to which the source language can contain translation errors in the target language.
[0071] For example, the target translation task could be: to translate English into Arabic, with the requirement that the translation accuracy be such that there is no more than one incorrect word per thousand words; where "English" is the source language of the target translation task, "Arabic" is the target language of the target translation task, and "no more than one incorrect word per thousand words" is the translation accuracy of the target translation task.
[0072] It should be noted that grammar training samples can be used to train the translation model to ensure that the model possesses grammatical knowledge of the target language and improves the accuracy of translation into the target language. Therefore, when it is necessary to determine grammar training samples, the training task for training grammatical knowledge of the target language can be determined, and then the training samples to be used can be determined based on the training task. These training samples are the grammar training samples.
[0073] The training task of training target language grammar knowledge refers to the training task that enables the model to possess target language grammar knowledge. It can be understood as enabling the model to possess target language grammar knowledge through the training task of training target language grammar knowledge.
[0074] In one embodiment of this application, when it is necessary to determine grammar training samples, the target language of the target translation task can be determined according to the target translation task, and a training task for training grammar knowledge of the target language can be determined. Since the training samples corresponding to different training tasks are also different, the training sample corresponding to the grammar knowledge training task can be determined based on the grammar knowledge training task, and the training sample is the grammar training sample.
[0075] To further clarify, the grammar training samples can include grammar training samples translated from multiple languages into the target language, as well as grammar training samples translated from a single language into the target language. Specifically, when the source language of the target translation task is determined to be multiple languages based on the target translation task, it is necessary to determine grammar training samples translated from multiple languages into the target language; when the source language of the target translation task is determined to be a single language based on the target translation task, it is necessary to determine grammar training samples translated from a single language into the target language.
[0076] To further explain, language training samples can be used to fine-tune the model for the target language, ensuring that the trained model can more accurately translate the source language into the target language, thereby improving the accuracy of the translation into the target language. Therefore, when it is necessary to determine language training samples, the training samples for translating from the source language into the target language can be determined based on the source language and the target language in the target translation task. These training samples are the language training samples.
[0077] For example, when the source language is Chinese and the target language is English, the language training sample is: converting the Chinese "早上好" to the English "Good moring"; when the source language is Chinese and the target language is German, the language training sample is: converting the Chinese "早上好" to the German "Guten morgen".
[0078] Step 402: Based on the grammar training samples, perform grammar training on the to-be-trained translation model to obtain a basic translation model.
[0079] It should be noted that to ensure that the source language in the target translation task can be accurately translated into the target language subsequently, it is necessary to perform grammar training on the to-be-trained translation model to ensure that the trained basic translation model has the grammar knowledge of the target language and improve the accuracy of translating the source language into the target language.
[0080] For example, the grammar training samples can be: Chinese: [MASK]早上, English: [MASK]moring, German: [MASK]morgen, and Spanish: [MASK]dias. Among them, the word after [MASK] is the content that the to-be-trained translation model needs to learn. Specifically, when performing grammar training on the to-be-trained translation model according to this grammar training sample, let the to-be-trained translation model predict the word after [MASK] according to the context at the [MASK] position in the original text. Furthermore, judge whether the single word output by the to-be-trained translation model is correct.
[0081] Furthermore, the intensity of grammar training for the to-be-trained translation model can be determined according to the translation accuracy in the target translation task. For example, when it is determined that the translation accuracy in the target translation task is relatively high, more grammar training samples need to be determined. Thus, perform grammar training on the to-be-trained translation model according to more grammar training samples; when it is determined that the translation accuracy in the target translation task is relatively low, fewer grammar training samples can be determined. Thus, perform grammar training on the to-be-trained translation model according to fewer grammar training samples.
[0082] Step 403: Determine the target neural network in the basic translation model that affects translation accuracy.
[0083] It should be noted that since the basic translation model has already undergone grammatical training, the grammar-related neural networks within it do not require further training. Training the grammar-related neural networks separately would not affect the translation accuracy of the basic model and would waste resources, thus reducing training efficiency. Therefore, to prevent resource waste and improve training efficiency, the target neural networks affecting translation accuracy within the basic model can be pre-defined, ensuring that subsequent fine-tuning training focuses solely on these target networks.
[0084] To further explain, when it is necessary to determine the target neural network, the historical translation task corresponding to the target translation task can be determined based on the source language and target language of the target translation task, wherein the source language and target language of the historical translation task are the same as those of the target translation task; based on the historical neural network that affects the translation accuracy in the model of the historical translation task, the target neural network that affects the translation accuracy in the basic translation model can be determined.
[0085] In one embodiment of this application, when it is necessary to determine the target neural network, the historical translation task is determined according to the source language and target language of the target translation task; the historical neural network of the historical translation task is determined according to the network fine-tuning record of the historical translation task; it is determined whether there is a neural network in the target neural network that is the same as the historical neural network; if so, the neural network that is the same as the historical neural network is the target neural network.
[0086] To further explain, when it is necessary to determine the target neural network, it is also possible to determine the degree of influence of each neural network in the basic language model on the translation accuracy of the target translation task, and determine the target neural network based on the degree of influence.
[0087] In one embodiment of this application, when it is necessary to determine the target neural network, an influence threshold is predetermined, the influence of each neural network in the basic language model on the translation accuracy of the target translation task is determined, and the relationship between the influence of each neural network and the influence threshold is determined. If the influence of a certain neural network is greater than or equal to the influence threshold, then the neural network is the target neural network.
[0088] Step 404: Based on the language training samples, fine-tune the target neural network in the basic translation model to obtain the target translation model.
[0089] The target language model is used to perform translation tasks from the source language to the target language.
[0090] In one embodiment of this application, when it is necessary to fine-tune the target neural network in the basic translation model, the parameters of other neural networks in the basic translation model besides the target neural network can be fixed in advance. Then, the basic translation model with fixed parameters is trained according to the language training samples. The above process is to fine-tune the target neural network in the basic translation model.
[0091] According to the translation method of this application, by determining grammar training samples and language training samples, the smooth progress of subsequent processes is ensured, providing training samples for subsequent training and guaranteeing the training effect. Based on the grammar training samples, the translation model to be trained can be grammatically trained, improving the translation accuracy of subsequent target translation tasks. Furthermore, it ensures that the basic translation model can be fine-tuned based on the language training samples, further improving the translation accuracy of subsequent target translation tasks. By determining the target neural network that affects translation accuracy, it ensures that subsequent fine-tuning training of the basic translation model can be carried out smoothly. It also ensures that only the target neural network is trained during fine-tuning training of the basic translation model, improving the training efficiency of fine-tuning training and guaranteeing the training effect of fine-tuning training. This enables the target translation model to successfully complete the target translation task and ensures the accuracy of the target translation model in performing the target translation task.
[0092] It should be noted that grammar training samples can be determined through grammar training tasks; optionally, such as Figure 5 As shown, Figure 5 This application provides a flowchart of steps for determining grammar training samples. Specifically, determining grammar training samples may include the following steps:
[0093] Step 501: Determine the grammar training task based on the translation accuracy in the target translation task.
[0094] Specifically, the translation model to be trained can be trained according to the grammar training task to ensure that the translation model to be trained can have grammatical knowledge of the target speech. Furthermore, the grammar training task includes at least one of the following: cloze test task, sentence prediction task, and multilingual comparison task. Moreover, the grammar training task can include many kinds of tasks, which will not be elaborated here.
[0095] It should be noted that the cloze test task refers to removing some words from the original text in the target language and having the model predict the removed words based on the context of the original text. Specifically, the difference between the words predicted by the model and the original removed words is used as the optimization objective to ensure that the model trained through the cloze test task can accurately predict the removed words.
[0096] For further explanation, the up-and-down sentence prediction task refers to giving a number of sentences and asking the model to determine whether there is a relationship between these two sentences as an up-and-down sentence; for example, if the two sentences are: "Good morning" and "Hello", it can be determined that the two sentences are in an up-and-down sentence relationship; if the two sentences are: "Good morning" and "45 yuan", it can be determined that the two sentences are not in an up-and-down sentence relationship.
[0097] For further explanation, the multilingual comparison task refers to giving a number of sentences in different languages and asking the model to determine whether these two sentences have the same semantics; for example, if the two sentences are "Good morning" and "Good evening", it is determined that the two sentences do not have the same semantics; if the three sentences are "Good moring", "Guten morgen" and "Buenosdias", it is determined that the two sentences have the same semantics.
[0098] It should be noted that the translation accuracy is used to represent the situation where a certain number of original language words are allowed to have incorrect words in the target translation task. Among them, the higher the translation accuracy, the fewer incorrect words are allowed for a fixed number of original language words; the lower the translation accuracy, the more incorrect words are allowed for a fixed number of original language words.
[0099] As an implementation method, when it is necessary to determine the grammar training task, if the translation accuracy is higher, it means that more grammar training tasks are required to ensure that the training translation model is grammatically trained according to more grammar training tasks, so that the translation accuracy of the target translation model is higher and fewer errors occur when translating the original language words; if the translation accuracy is lower, it means that fewer grammar training tasks are required to ensure that the training translation model is grammatically trained according to fewer grammar training tasks, and the translation accuracy of the target translation model meets the translation accuracy requirements, and more errors occur when translating the original language words.
[0100] It should be noted that when determining the grammar training task, it can be judged according to the work experience of the staff, so as to select the most suitable grammar training task for the target translation task.
[0101] For further explanation, when determining the grammar training task, the training effect of each grammar training task on the target translation task can be determined in advance, so as to select the most suitable grammar training task for the target translation task according to the training effect corresponding to each grammar training task.
[0102] Step 502, determine the grammar training samples according to the original language, target language and grammar training task in the target translation task.
[0103] It should be noted that in order to ensure that the translation model to be trained can be successfully trained according to the grammar training task, it is necessary to determine the grammar training samples corresponding to the grammar training task. Since different grammar training tasks correspond to different grammar training samples, when there are multiple grammar training tasks, it is necessary to determine the grammar training samples corresponding to each grammar training task separately.
[0104] To further explain, when it is necessary to determine the grammar training samples, the source language text and the target language text are screened and extracted according to the concept of the grammar training task, so as to obtain the grammar training samples corresponding to the grammar training task.
[0105] As one approach, if the source language is pre-set to be Chinese, the target language to be English, and the grammar training task to be a cloze test, then when it is necessary to determine the grammar training samples, since the cloze test task refers to predicting missing words based on the context, the Chinese and English short passages can be determined separately, and some words in the Chinese and English short passages can be deleted. The result obtained is the grammar training sample corresponding to the cloze test task.
[0106] As one approach, if the source language is pre-defined as Chinese, the target language as English, and the grammar training task is sentence prediction, then when determining the grammar training samples, since the sentence prediction task requires determining whether two sentences are in a sentence-upper-sentence relationship, it is necessary to determine multiple Chinese sentence texts and multiple English sentence texts separately, and then combine the multiple Chinese sentence texts and multiple English sentence texts in pairs. Among the several pairs of combined sentences, there are both sentences in a sentence-upper-sentence relationship and sentences that are not in a sentence-upper-sentence relationship. The two combined sentences are the grammar training samples.
[0107] As one approach, if the source language is pre-defined as Chinese, the target language as English, and the grammar training task is a multilingual comparison task, then when determining the grammar training samples, since the multilingual comparison task requires determining whether multiple sentences express the same meaning, it is necessary to determine multiple Chinese sentence texts and multiple English sentence texts separately, and then randomly combine the multiple Chinese sentence texts and multiple English sentence texts. The result of the random combination is the grammar training sample.
[0108] According to the translation method of this application, by determining the grammar training task, it is ensured that the grammar training samples can be determined according to the grammar training task, and that the grammar training samples can conform to the type of grammar training task. This enables the grammar knowledge of the translation model to be trained to be improved based on the grammar training samples, ensuring that the translation model to be trained can be successfully trained in grammar, and improving the translation accuracy of the subsequent target translation task.
[0109] It should be noted that language training samples can be determined based on the source language and the target language. Optionally. Specifically, determining language training samples may include the following: determining language training samples according to the source language and the target language in the target translation task.
[0110] It should be noted that when determining language training samples, source language sentences and target language sentences with the same meaning, as well as source language words and target language words with the same meaning can be used. Among them, source language sentences and target language sentences with the same meaning, and source language words and target language words with the same meaning can both be used as language training samples.
[0111] Furthermore, the source language in the target translation task can be multiple languages. For example, if the target translation task is to translate multiple languages into English, then these multiple languages are all source languages, and English is the target language. Therefore, when determining language training samples, sentences of multiple source languages with the same meaning and target language sentences, as well as words of multiple source languages with the same meaning and target language words can be determined. Among them, sentences of multiple source languages with the same meaning and target language sentences, as well as words of multiple source languages with the same meaning and target language words can both be used as language training samples.
[0112] For example, when the source language is Chinese and the target language is English, and the language training samples are sentences, the language training samples can be: "早上好" and "Good moring"; when the source language is Chinese and the target language is English, and the language training samples are words, the language training samples can be: "早上" and "Moring".
[0113] According to the translation method of the present application, by obtaining language training samples, it is ensured that subsequent fine-tuning training of the basic translation model can be carried out, further improving the accuracy of subsequent execution of the target translation task, ensuring that the target language model obtained by fine-tuning training can more accurately translate the source language into the target language.
[0114] It should be noted that the target neural network can be determined through historical translation tasks. Optionally, as Figure 6 shown, Figure 6 is a flowchart of the steps for determining the target neural network provided by an embodiment of the present application. Specifically, determining the target neural network may include the following:
[0115] Step 601, determine grammar training samples and language training samples according to the target translation task; where the target translation task includes: source language, target language, and translation accuracy.
[0116] Step 602, perform grammar training on the to-be-trained translation model based on the grammar training samples to obtain a basic translation model.
[0117] Step 603: Determine if there is a corresponding historical translation task for the target translation task; wherein the source language and target language in the historical translation task are the same as those in the target translation task. If yes, proceed to step 604; otherwise, proceed to step 605.
[0118] It should be noted that by identifying historical translation tasks, we can ensure that, in the subsequent execution of historical translation tasks, we can determine the historical neural network that affects the accuracy of translation, and then, based on the historical neural network, determine the target neural network in the basic translation model.
[0119] In one embodiment of this application, when it is necessary to determine whether there is a corresponding historical translation task for the target translation task, the historical records of the staff in the computer history can be used to determine whether there is a translation task with the same source language and target language as the target translation task. If there is, the translation task is determined to be a historical translation task.
[0120] In another embodiment of this application, when multiple translation tasks with the same source language and target language as the target translation task are identified based on the computer history records of the staff, it is determined whether the translation accuracy of each translation task is related to the translation accuracy of the target translation task. This allows for the identification of the translation task whose translation accuracy is closest to that of the target translation task among all translation tasks, and this translation task is the target translation task.
[0121] Step 604: Based on the network fine-tuning records corresponding to historical translation tasks, determine the target neural network in the basic translation model that affects the accuracy of language translation.
[0122] It should be noted that the network fine-tuning record contains historical neural networks that affected translation accuracy during the execution of historical translation tasks. Therefore, when it is necessary to determine the target neural network, the historical neural networks that affected translation accuracy can be identified based on the network fine-tuning record, and then the target neural network can be determined based on the historical neural networks.
[0123] In one embodiment of this application, when it is necessary to determine the target neural network, the historical neural network that affects the accuracy of the model translation can be determined based on the network fine-tuning records corresponding to the historical translation tasks. The network that is the same as the historical neural network can be determined from the basic translation model, and this network is the target neural network.
[0124] Step 605: Determine the degree of influence of each candidate neural network in the basic language model on the translation accuracy of the target translation task; based on the determination of the degree of influence, determine the target neural network from each candidate neural network.
[0125] It should be noted that when determining the impact of a candidate neural network on the translation accuracy of a target translation task, the parameters of all other neural networks in the base language model, except for the candidate neural network, can be fixed to ensure that these other neural networks do not change during fine-tuning training. After fixing the parameters of all other neural networks in the base language model, fine-tuning training is performed on the base language model based on language training samples. The accuracy of the trained base language model when performing the translation task is then assessed. If a change occurs, the amount of change in accuracy of the trained base language model is determined, and this amount of change in accuracy is the result of determining the degree of impact.
[0126] To further explain, when it is necessary to determine the target neural network, the influence of each candidate neural network can be determined one by one according to the above method to determine the result, and then the target neural network can be determined from each candidate neural network based on the influence degree.
[0127] In one embodiment of this application, an influence threshold is predetermined. When it is necessary to determine the target neural network, the influence determination result of each candidate neural network is determined one by one. The relationship between the influence determination result of each candidate neural network and the influence threshold is judged. If the influence determination result of the candidate neural network is greater than or equal to the influence threshold, the candidate neural network is determined to be the target neural network. If the influence determination result of the candidate neural network is less than the influence threshold, the candidate neural network is determined not to be the target neural network.
[0128] Step 606: Based on language training samples, fine-tune the target neural network in the basic translation model to obtain the target translation model. The target language model is used to perform the translation task from the source language to the target language.
[0129] According to the translation method of this application, by determining whether there are historical translation records, it is ensured that when historical translation records exist, the target neural network can be determined based on the network fine-tuning records in the historical translation records, thus ensuring the smooth determination of the target neural network and ensuring that the basic translation model can be fine-tuned and trained smoothly in the future; when there are no historical translation records, the result can be determined by determining the degree of influence, thus determining the magnitude of the influence of each candidate neural network on the translation accuracy of the target translation task, thereby ensuring the accuracy of the target neural network determination.
[0130] In one embodiment of this application, such as Figure 7 As shown, Figure 7 A flowchart of another translation method provided in this application embodiment, when a target translation task needs to be performed:
[0131] Step 701: Determine the grammar training task based on the translation accuracy in the target translation task.
[0132] It should be noted that the grammar training tasks include at least one of the following: cloze test, sentence prediction, and multilingual comparison.
[0133] Step 702: Determine the grammar training samples based on the source language, target language, and grammar training task in the target translation task.
[0134] Step 703: Determine the language training samples based on the source language and target language in the target translation task.
[0135] Step 704: Perform grammatical training on the translation model to be trained based on the grammatical training samples to obtain the basic translation model.
[0136] Step 705: Determine if there is a corresponding historical translation task for the target translation task; wherein, the source language and target language in the historical translation task are the same as those in the target translation task. If yes, proceed to step 706; otherwise, proceed to step 707.
[0137] Step 706: Based on the network fine-tuning records corresponding to historical translation tasks, determine the target neural network in the basic translation model that affects the accuracy of language translation.
[0138] Step 707: Determine the degree of influence of each candidate neural network in the basic language model on the translation accuracy of the target translation task; based on the determination result of the degree of influence, determine the target neural network from each candidate neural network.
[0139] Step 708: Based on language training samples, fine-tune the target neural network in the basic translation model to obtain the target translation model. The target language model is used to perform the translation task from the source language to the target language.
[0140] According to the translation method of this application, by determining grammar training samples and language training samples, the smooth progress of subsequent processes is ensured, providing training samples for subsequent training and guaranteeing the training effect. Based on the grammar training samples, the translation model to be trained can be grammatically trained, improving the translation accuracy of subsequent target translation tasks. Furthermore, it ensures that the basic translation model can be fine-tuned based on the language training samples, further improving the translation accuracy of subsequent target translation tasks. By determining the target neural network that affects translation accuracy, it ensures that subsequent fine-tuning training of the basic translation model can be carried out smoothly. It also ensures that only the target neural network is trained during fine-tuning training of the basic translation model, improving the training efficiency of fine-tuning training and guaranteeing the training effect of fine-tuning training. This enables the target translation model to successfully complete the target translation task and ensures the accuracy of the target translation model in performing the target translation task.
[0141] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0142] Based on the same inventive concept, this application also provides a translation apparatus for implementing the translation method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more translation apparatus embodiments provided below can be found in the limitations of the translation method described above, and will not be repeated here.
[0143] In one embodiment, such as Figure 8 As shown, Figure 8 This is a structural block diagram of a first translation device provided in an embodiment of this application. The device includes: an acquisition module 10 and an input module 20, wherein:
[0144] Module 10 is used to acquire the content to be translated.
[0145] The input module 20 is used to input the content to be translated into the target language model and obtain the translation result generated by the target language model corresponding to the content to be translated. The target language model is trained based on the grammar training samples and language training samples determined by the target translation task.
[0146] It should be noted that the content to be translated is input into the target language model, and the content to be translated is vectorized to determine the translation vector of the content to be translated; based on the translation vector, the translation result corresponding to the content to be translated is generated by the target language model.
[0147] In one embodiment, such as Figure 9 As shown, Figure 9 This is a structural block diagram of a second translation device provided in an embodiment of this application. The device further includes: a first determining model 30, a training model 40, a second determining module 50, and a fine-tuning model 60, wherein:
[0148] The first model 30 is used to determine the grammar training samples and language training samples according to the target translation task; wherein, the target translation task includes: source language, target language and translation accuracy.
[0149] Training model 40 is used to perform grammatical training on the translation model to be trained based on the grammatical training samples, so as to obtain the basic translation model.
[0150] The second determining module 50 is used to determine the target neural network in the basic translation model that affects the accuracy of translation.
[0151] Model 60 is used to fine-tune the target neural network in the basic translation model based on language training samples to obtain the target translation model. The target language model is used to perform the translation task from the source language to the target language.
[0152] According to the translation device of this application, by determining grammar training samples and language training samples, the smooth progress of subsequent processes is ensured, providing training samples for subsequent training and guaranteeing the training effect. It enables grammatical training of the translation model to be trained based on the grammar training samples, improving the translation accuracy of subsequent target translation tasks. Furthermore, it ensures that the basic translation model can be fine-tuned based on the language training samples, further improving the translation accuracy of subsequent target translation tasks. By determining the target neural network that affects translation accuracy, it ensures that subsequent fine-tuning training of the basic translation model can be carried out smoothly. It also ensures that only the target neural network is trained during fine-tuning training of the basic translation model, improving the training efficiency of fine-tuning training and guaranteeing the training effect of fine-tuning training. This enables the target translation model to successfully complete the target translation task and ensures the accuracy of the target translation model in performing the target translation task.
[0153] In one embodiment, such as Figure 10 As shown, Figure 10 This is a structural block diagram of a third translation device provided in an embodiment of this application. The translation device includes a first determining model 30 comprising: a first determining unit 31 and a second determining unit 32, wherein:
[0154] The first determining unit 31 is used to determine the grammar training task based on the translation accuracy in the target translation task.
[0155] It should be noted that the grammar training tasks include at least one of the following: cloze test, sentence prediction, and multilingual comparison.
[0156] The second determining unit 32 is used to determine the grammar training samples based on the source language, target language, and grammar training task in the target translation task.
[0157] To further explain, the language training samples are determined based on the source language and target language in the target translation task.
[0158] According to the translation device of this application, by determining the grammar training task, it ensures that subsequent grammar training samples can be determined based on the grammar training task, and that the grammar training samples conform to the type of grammar training task. This allows the grammar knowledge of the translation model to be trained to be improved based on the grammar training samples, ensuring smooth grammar training of the translation model to be trained and improving the translation accuracy of subsequent target translation tasks. Furthermore, by obtaining language training samples, it ensures that the basic translation model can be fine-tuned and trained, further improving the accuracy of subsequent target translation tasks. This ensures that the target language model obtained through fine-tuning training can more accurately translate the source language into the target language.
[0159] In one embodiment, such as Figure 11 As shown, Figure 11 This is a structural block diagram of a fourth translation device provided in an embodiment of this application. The translation device includes a second determining module 50 comprising: a third determining unit 51, a fourth determining unit 52, and a fifth determining unit 53, wherein:
[0160] The third determining unit 51 is used to determine whether there is a corresponding historical translation task for the target translation task; wherein the source language and target language in the historical translation task are the same as those in the target translation task.
[0161] The fourth determining unit 52 is used to determine the target neural network that affects the accuracy of language translation in the basic translation model based on the network fine-tuning records corresponding to the historical translation tasks if the condition is met.
[0162] The fifth determining unit 53 is used to determine the degree of influence of each candidate neural network in the basic language model on the translation accuracy of the target translation task if no; and to determine the target neural network from each candidate neural network based on the degree of influence determination result.
[0163] According to the translation device of this application, by determining whether there are historical translation records, it is possible to determine the target neural network based on the network fine-tuning records in the historical translation records when historical translation records exist, thus ensuring the smooth determination of the target neural network and the smooth fine-tuning training of the basic translation model in the future; when there are no historical translation records, it is possible to determine the result by determining the degree of influence, thereby determining the magnitude of the influence of each candidate neural network on the translation accuracy of the target translation task, thus ensuring the accuracy of the determination of the target neural network.
[0164] Each module in the aforementioned translation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0165] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 12 As shown. The computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a translation method. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad located on the computer device's casing, or an external keyboard, touchpad, or mouse.
[0166] Those skilled in the art will understand that Figure 12 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0167] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0168] Get the content to be translated;
[0169] The content to be translated is input into the target language model, and the translation result corresponding to the content to be translated is generated by the target language model. The target language model is trained based on the grammar training samples and language training samples determined by the target translation task.
[0170] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0171] The content to be translated is input into the target language model, and vector transformation is performed on the content to be translated to determine the translation vector of the content to be translated.
[0172] Based on the vector to be translated, the translation result corresponding to the content to be translated is generated by the target language model.
[0173] Based on the target translation task, grammar training samples and language training samples are determined; the target translation task includes: source language, target language, and translation accuracy;
[0174] The basic translation model is obtained by training the translation model based on the grammatical training samples.
[0175] Identify the target neural network in the basic translation model that affects translation accuracy;
[0176] Based on language training samples, the target neural network in the basic translation model is fine-tuned to obtain the target translation model. The target language model is used to perform translation tasks from the source language to the target language.
[0177] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0178] The grammar training task is determined based on the translation accuracy required for the target translation task.
[0179] Based on the source language, target language, and grammar training task in the target translation task, determine the grammar training samples.
[0180] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0181] Based on the source language and target language in the target translation task, determine the language training samples.
[0182] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0183] Grammar training tasks include at least one of the following: cloze test, sentence prediction, and multilingual comparison.
[0184] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0185] Determine if there is a corresponding historical translation task for the target translation task; wherein, the source language and target language in the historical translation task are the same as those in the target translation task;
[0186] If so, then based on the network fine-tuning records corresponding to historical translation tasks, determine the target neural network in the basic translation model that affects the accuracy of language translation.
[0187] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0188] If not, then determine the degree of influence of each candidate neural network in the basic language model on the translation accuracy of the target translation task;
[0189] Based on the degree of influence, the target neural network is determined from each candidate neural network.
[0190] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0191] Get the content to be translated;
[0192] The content to be translated is input into the target language model, and the translation result corresponding to the content to be translated is generated by the target language model. The target language model is trained based on the grammar training samples and language training samples determined by the target translation task.
[0193] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0194] The content to be translated is input into the target language model, and vector transformation is performed on the content to be translated to determine the translation vector of the content to be translated.
[0195] Based on the vector to be translated, the translation result corresponding to the content to be translated is generated by the target language model.
[0196] Based on the target translation task, grammar training samples and language training samples are determined; the target translation task includes: source language, target language, and translation accuracy;
[0197] The basic translation model is obtained by training the translation model based on the grammatical training samples.
[0198] Identify the target neural network in the basic translation model that affects translation accuracy;
[0199] Based on language training samples, the target neural network in the basic translation model is fine-tuned to obtain the target translation model. The target language model is used to perform translation tasks from the source language to the target language.
[0200] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0201] The grammar training task is determined based on the translation accuracy required for the target translation task.
[0202] Based on the source language, target language, and grammar training task in the target translation task, determine the grammar training samples.
[0203] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0204] Based on the source language and target language in the target translation task, determine the language training samples.
[0205] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0206] Grammar training tasks include at least one of the following: cloze test, sentence prediction, and multilingual comparison.
[0207] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0208] Determine if there is a corresponding historical translation task for the target translation task; wherein, the source language and target language in the historical translation task are the same as those in the target translation task;
[0209] If so, then based on the network fine-tuning records corresponding to historical translation tasks, determine the target neural network in the basic translation model that affects the accuracy of language translation.
[0210] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0211] If not, then determine the degree of influence of each candidate neural network in the basic language model on the translation accuracy of the target translation task;
[0212] Based on the degree of influence, the target neural network is determined from each candidate neural network.
[0213] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0214] Get the content to be translated;
[0215] The content to be translated is input into the target language model, and the translation result corresponding to the content to be translated is generated by the target language model. The target language model is trained based on the grammar training samples and language training samples determined by the target translation task.
[0216] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0217] The content to be translated is input into the target language model, and vector transformation is performed on the content to be translated to determine the translation vector of the content to be translated.
[0218] Based on the vector to be translated, the translation result corresponding to the content to be translated is generated by the target language model.
[0219] Based on the target translation task, grammar training samples and language training samples are determined; the target translation task includes: source language, target language, and translation accuracy;
[0220] The basic translation model is obtained by training the translation model based on the grammatical training samples.
[0221] Identify the target neural network in the basic translation model that affects translation accuracy;
[0222] Based on language training samples, the target neural network in the basic translation model is fine-tuned to obtain the target translation model. The target language model is used to perform translation tasks from the source language to the target language.
[0223] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0224] The grammar training task is determined based on the translation accuracy required for the target translation task.
[0225] Based on the source language, target language, and grammar training task in the target translation task, determine the grammar training samples.
[0226] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0227] Based on the source language and target language in the target translation task, determine the language training samples.
[0228] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0229] Grammar training tasks include at least one of the following: cloze test, sentence prediction, and multilingual comparison.
[0230] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0231] Determine if there is a corresponding historical translation task for the target translation task; wherein, the source language and target language in the historical translation task are the same as those in the target translation task;
[0232] If so, then based on the network fine-tuning records corresponding to historical translation tasks, determine the target neural network in the basic translation model that affects the accuracy of language translation.
[0233] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0234] If not, then determine the degree of influence of each candidate neural network in the basic language model on the translation accuracy of the target translation task;
[0235] Based on the degree of influence, the target neural network is determined from each candidate neural network.
[0236] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0237] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0238] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0239] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A translation method, characterized in that, The method includes: Get the content to be translated; The content to be translated is input into the target language model to obtain the translation result generated by the target language model corresponding to the content to be translated. The target language model is trained based on the grammar training samples and language training samples determined by the target translation task. The target language model is trained based on the grammar training samples and language training samples determined by the target translation task, including: Based on the target translation task, grammar training samples and language training samples are determined; wherein, the target translation task includes: source language, target language, and translation accuracy; the translation accuracy is the degree to which translation errors are allowed in the target language when translating from the source language. Based on the grammar training samples, the translation model to be trained is grammatically trained to obtain a basic translation model; Identify the target neural network in the basic translation model that affects translation accuracy; Based on the language training samples, the target neural network in the basic translation model is fine-tuned to obtain the target translation model, which is used to perform the translation task from the source language to the target language. Based on the target translation task, determine the grammar training samples, including: Based on the translation accuracy in the target translation task, determine the grammar training task; Based on the source language, the target language, and the grammar training task in the target translation task, the grammar training sample is determined, wherein the grammar training task includes at least one of a cloze test task, a sentence prediction task, and a multilingual comparison task.
2. The method according to claim 1, characterized in that, The step of inputting the content to be translated into the target language model and obtaining the translation result generated by the target language model corresponding to the content to be translated includes: The content to be translated is input into the target language model, and vector transformation is performed on the content to be translated to determine the translation vector of the content to be translated. Based on the vector to be translated, the translation result corresponding to the content to be translated, generated by the target language model, is obtained.
3. The method according to claim 1, characterized in that, Based on the target translation task, determine the language training samples, including: Based on the source language and the target language in the target translation task, determine the language training samples.
4. The method according to claim 1, characterized in that, The determination of the target neural network affecting translation accuracy in the basic translation model includes: Determine whether the target translation task has a corresponding historical translation task; wherein, the historical translation task has the same source language and target language as the target translation task; If so, then based on the network fine-tuning records corresponding to the historical translation tasks, the target neural network that affects the accuracy of language translation in the basic translation model is determined.
5. The method according to claim 4, characterized in that, The method further includes: If not, then determine the degree of influence of each candidate neural network in the basic language model on the translation accuracy of the target translation task; Based on the results of the influence determination, the target neural network is determined from the candidate neural networks.
6. A translation device, characterized in that, The device includes: The acquisition module is used to acquire the content to be translated; The input module is used to input the content to be translated into the target language model and obtain the translation result generated by the target language model corresponding to the content to be translated. The target language model is trained based on the grammar training samples and language training samples determined by the target translation task. The first model is used to determine grammar training samples and language training samples based on the target translation task; wherein, the target translation task includes: source language, target language, and translation accuracy; wherein, the translation accuracy is the degree to which translation errors are allowed in the source language when translating to the target language; The training model is used to perform grammatical training on the translation model to be trained based on the grammatical training samples, so as to obtain a basic translation model. The second determining module is used to determine the target neural network in the basic translation model that affects translation accuracy. A fine-tuning model is used to fine-tune the target neural network in the base translation model based on the language training samples to obtain a target translation model. The target language model is used to perform the translation task from the source language to the target language. The first determining unit is used to determine the grammar training task based on the translation accuracy in the target translation task; The second determining unit is used to determine the grammar training sample based on the source language, the target language, and the grammar training task in the target translation task, wherein the grammar training task includes at least one of a cloze test task, a sentence prediction task, and a multilingual comparison task.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.
8. 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 to 5.
9. 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 to 5.