Text translation method and device based on large model, electronic equipment and storage medium

By correlating the text data in the vehicle computer system with its own control features and inputting the trained text translation model, the problem of inconsistent text translation style and semantic errors in the existing technology is solved, and a higher quality and consistent translation effect is achieved.

CN119783693APending Publication Date: 2025-04-08CHINA AUTOMOTIVE INNOVATION CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411852529.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

The existing big model-based translation method is difficult to ensure the unity of text styles, and semantic errors may occur, which makes it difficult for users to understand when using the vehicle computer system in overseas markets.

Method used

By associating the text data with the features of the control to which it belongs, a text to be translated containing control feature information is generated, and a trained text translation model is input to generate translated text that conforms to the context and control features.

Benefits of technology

Ensure that the translation style is consistent between control texts of the same type and hierarchy, avoid inconsistent styles or incoherent contexts, and improve translation quality and consistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119783693A_ABST
    Figure CN119783693A_ABST
Patent Text Reader

Abstract

The invention discloses a text translation method and device based on a large model, electronic equipment and a storage medium. The method comprises the steps that control feature information corresponding to text data is acquired; the control feature information comprises feature information of a control in the vehicle-mounted application to which the text data belongs; associating the text data with the control feature information corresponding to the text data, and constructing a to-be-translated text containing the control feature information; the to-be-translated text containing the control feature information is input into the trained text translation model, and the translated text is obtained. In the embodiment of the invention, the text data is associated with the features of the control to which the text data belongs, the to-be-translated text containing the control feature information is generated, and the trained text translation model is input; according to the method, translated texts conforming to context and control features are generated, it can be ensured that translation styles of texts of controls of the same type and level are kept consistent, and the situation that styles are not uniform or contexts are not coherent possibly occurring in traditional one-by-one translation is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of large language model technology-assisted translation technology, and in particular to a large model-based text translation method, device, electronic device and storage medium. Background Art

[0002] With the rapid development of domestic smart cars in the global market, especially in the popularization and application of car systems and application software, many car systems need to support multiple languages ​​to meet the needs of different regions and users. Most of the existing car systems have Chinese versions of button texts, prompt information, menu options and other application interface texts, and when exported to overseas markets, these texts usually need to be translated into the target language.

[0003] Currently, translation technology based on large models has made significant progress. Usually, text resources in the application are extracted, translated one by one, and the corresponding translation version is generated according to the target language. However, the text style translated by this translation method cannot be unified, and semantic errors may occur. Subsequent manual correction is required so that overseas users can correctly understand the button text, prompt information, menu options and other application interface texts in the car system. This is time-consuming, labor-intensive and inefficient. Summary of the invention

[0004] In order to solve the technical problem that the style of text translated by the existing method of translating one by one using a large model cannot be unified and semantic errors may occur, the present invention provides a text translation method, device, electronic device and storage medium based on a large model. By associating text data with the characteristics of the control to which the text data belongs, and generating a text to be translated containing the control feature information, a trained text translation model is input to generate a translation text that conforms to the context and control features. While translating the text one by one, it can ensure that the translation style is consistent between texts of the same type and level of controls, avoiding the inconsistent style or incoherent context that may occur in traditional one-by-one translation.

[0005] In a first aspect, an embodiment of the present application provides a text translation method based on a large model, the method comprising:

[0006] Get text data from in-vehicle applications;

[0007] Acquire control feature information corresponding to the text data; the control feature information includes feature information of the control in the in-vehicle application to which the text data belongs;

[0008] Associating the text data with the control feature information corresponding to the text data to construct a text to be translated containing the control feature information;

[0009] The text to be translated containing the control feature information is input into the trained text translation model to obtain the translated text.

[0010] In an optional embodiment, obtaining control feature information corresponding to text data includes:

[0011] Get the layout information corresponding to the text data;

[0012] According to the layout information, obtain the control type information and control size information corresponding to the text data;

[0013] According to the control type information, obtain the control level information corresponding to the text data;

[0014] Determine control feature information based on control type information, control size information, and control hierarchy information.

[0015] In an optional embodiment, obtaining control level information corresponding to the text data according to the control type information includes:

[0016] When the control type information indicates that the control to which the text data belongs includes a first-type control, a plurality of first-subtype controls are acquired; the first-type control includes a plurality of first-subtype controls;

[0017] Acquire a plurality of first language texts and a plurality of second language texts of a plurality of first sub-type controls; the plurality of second language texts are respectively obtained by translating the plurality of first language texts;

[0018] If the control type corresponding to the text data and the sub-control type corresponding to the first language text are the same, the first language text and the second language text are determined as the control level information corresponding to the text data.

[0019] In an optional embodiment, obtaining control level information corresponding to the text data according to the control type information further includes:

[0020] When the control type information indicates that the control to which the text data belongs includes a second type control, acquiring control attribute information;

[0021] If the control attribute information includes reference information, a plurality of third language texts and a plurality of fourth language texts corresponding to the reference information are obtained; the plurality of third language texts are respectively translated based on the plurality of fourth language texts;

[0022] A plurality of third language texts and a plurality of fourth language texts are determined as control level information of the text data.

[0023] In an optional embodiment, the text data is associated with the control feature information corresponding to the text data to construct a text to be translated containing the control feature information, including:

[0024] Obtain a data pair corresponding to the text data according to the text data and the control type information, control size information and control level information corresponding to the text data;

[0025] Get the prompt word template; the prompt word template includes translation scene information and prompt instructions;

[0026] Based on the data pair corresponding to the text data and the prompt word template, a text to be translated containing the control feature information is generated.

[0027] In an optional embodiment, the method further comprises the step of training to obtain a trained text translation model;

[0028] The trained text translation model includes:

[0029] Acquire a training data set; the training data set includes a plurality of training texts to be translated and actual translation texts corresponding to each training text to be translated; each training control feature information includes training control feature information;

[0030] Get the pre-trained large language model;

[0031] The training data set is input into the pre-trained large language model for text translation operation to obtain the trained text translation model.

[0032] In an optional embodiment, inputting the training data set into a pre-trained large language model to perform a text translation operation to obtain a trained text translation model includes:

[0033] Use the pre-trained large language model as the current large language model;

[0034] Determine a loss value based on the training text to be translated corresponding to the training translation text and the actual translation text;

[0035] When the loss value is greater than a preset threshold, back propagation is performed based on the loss value, the current large language model is updated to obtain an updated large language model, and the updated large language model is re-determined as the current large language model; repeating the steps of: performing a text translation operation on the training text to be translated based on the current large language model, and determining a training translation text corresponding to the training text to be translated;

[0036] When the loss value is less than or equal to a preset threshold, the current large language model is determined as a trained text translation model.

[0037] In a second aspect, an embodiment of the present application provides a text translation device based on a large model, the device comprising:

[0038] A first acquisition module, used to acquire text data of an in-vehicle application;

[0039] The second acquisition module is used to acquire the control feature information corresponding to the text data; the control feature information includes the feature information of the control in the vehicle-mounted application to which the text data belongs;

[0040] A construction module, used for associating text data with control feature information corresponding to the text data, and constructing a text to be translated containing the control feature information;

[0041] The third module is used to input the text to be translated containing the control feature information into the trained text translation model to obtain the translated text.

[0042] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, at least one program, a code set or an instruction set is loaded and executed by the processor to implement the large model-based text translation method of the first aspect.

[0043] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which at least one instruction or at least one program is stored, and the at least one instruction or at least one program is loaded and executed by a processor to implement the large model-based text translation method of the first aspect.

[0044] In a fifth aspect, an embodiment of the present application provides a computer program product or a computer program, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the large model-based text translation method of the first aspect.

[0045] The text translation method, device, electronic device and storage medium based on the big model provided in the embodiments of the present application have the following technical effects:

[0046] Acquire text data of an in-vehicle application; acquire control feature information corresponding to the text data; the control feature information includes feature information of a control in the in-vehicle application to which the text data belongs; associate the text data with the control feature information corresponding to the text data to construct a text to be translated containing the control feature information; input the text to be translated containing the control feature information into a trained text translation model to acquire a translated text. In an embodiment of the present application, by associating the text data with the features of the control to which the text data belongs, and generating a text to be translated containing the control feature information, the text is input into a trained text translation model to generate a translated text that conforms to the context and control features. By introducing the control feature information, the text translation model can understand the context of the text data, its relationship with other text data in the control to which it belongs, and its relationship with other controls. While translating the text line by line, it can ensure that the translated texts of controls of the same type and level maintain a consistent translation style, thereby avoiding the inconsistent style or incoherent context that may occur in traditional line-by-line translation. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0048] Figure 1 is a schematic diagram of an application environment provided by an embodiment of the present application;

[0049] Figure 2 This is a flowchart of a text translation method based on a large model provided in an embodiment of the present application. Figure 1 ;

[0050] Figure 3 This is a flowchart of a text translation method based on a large model provided in an embodiment of the present application. Figure 2 ;

[0051] Figure 4 It is a flowchart of a method for obtaining control level information corresponding to text data according to control type information provided by an embodiment of the present application;

[0052] Figure 5 It is a flowchart of a method for training and obtaining a trained text translation model provided in an embodiment of the present application;

[0053] Figure 6 It is a structural schematic diagram of a text translation device based on a large model provided in an embodiment of the present application;

[0054] Figure 7This is a hardware structure block diagram of a server for a large model-based text translation method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0055] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0056] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0057] See also Figure 1 , Figure 1 It is a schematic diagram of an application environment provided in an embodiment of the present application, including a vehicle-mounted system 101 and a server 102 .

[0058] In a possible embodiment, the in-vehicle system 101 is a computing platform installed on a vehicle, and the in-vehicle system 101 includes an in-vehicle application and a communication module.

[0059] In one possible embodiment, an in-vehicle application refers to a software application installed and running on the in-vehicle system 101. The functions of the in-vehicle application usually include navigation (such as maps, route planning), multimedia playback (such as music, video) and voice assistant (such as voice command recognition). The in-vehicle application interface usually displays text information, which may be a label or title on the interface, such as "Navigation", "Music", "Settings", or text on a button, such as "Start Navigation", "Play", "Pause", or prompt information, such as "No network connection", "Device paired". The above text information needs to be translated into different languages ​​when used to meet global usage needs.

[0060] In the embodiment of the present application, the development and operation of the in-vehicle application are based on the Android operating system (Android), and are constructed using the development tools, framework and application programming interface (Application Programming Interface, API) provided by Android.

[0061] In the embodiment of the present application, the vehicle application is the direct initiator and receiver of the text translation request and result of the present application, and runs on a vehicle system such as the Android Automotive OS (AAOS). The communication module is responsible for realizing the network connection between the vehicle system 101 and the external server 102 (such as 4G / 5G / Wi-Fi, etc.). The vehicle application sends a translation request to the server 102 through the communication module, receives the translation result returned by the server 102 and displays it to the user.

[0062] In a possible embodiment, after receiving a text translation request sent by the in-vehicle system 101, the server 102 obtains text data of the in-vehicle application; obtains control feature information corresponding to the text data; the control feature information includes feature information of the control in the in-vehicle application to which the text data belongs; associates the text data with the control feature information corresponding to the text data to construct a text to be translated containing the control feature information; inputs the text to be translated containing the control feature information into a trained text translation model to obtain a translated text. In an embodiment of the present application, by associating the text data with the features of the control to which the text data belongs, and generating a text to be translated containing the control feature information, the text is input into a trained text translation model to generate a translated text that conforms to the context and control features. By introducing the control feature information, the text translation model can understand the context of the text data, its relationship with other text data in the control to which it belongs, and its relationship with other controls. While translating the text one by one, it can ensure that the translation style is consistent between controls of the same type and level, thereby avoiding the inconsistent style or inconsistent context that may occur in traditional one-by-one translation.

[0063] The following describes a specific embodiment of a text translation method based on a large model of the present application. Figure 2 This is a flowchart of a text translation method based on a large model provided in an embodiment of the present application. Figure 1 , this specification provides method operation steps such as embodiments or flow charts, but may include more or fewer operation steps based on routine or non-creative work. The order of steps listed in the embodiments is only one way of executing the steps among many orders, and does not represent the only order of execution. When the actual system or server product is executed, it can be executed in the order of the method shown in the embodiments or the drawings or in parallel (for example, in a parallel processor or multi-threaded processing environment). Specifically, Figure 2As shown, the method is applied to the server and may include:

[0064] S201: Acquire text data of an in-vehicle application.

[0065] S202: Acquire control feature information corresponding to the text data; the control feature information includes feature information of the control in the in-vehicle application to which the text data belongs.

[0066] S203: Associating the text data with the control feature information corresponding to the text data to construct a text to be translated containing the control feature information.

[0067] S204: Input the text to be translated containing the control feature information into the trained text translation model to obtain the translated text.

[0068] Figure 3 This is a flowchart of a text translation method based on a large model provided in an embodiment of the present application. Figure 2 , the method may include:

[0069] S301: Acquire text data of an in-vehicle application.

[0070] In a possible embodiment, the text data is a collection of all text information displayed to the user in the vehicle-mounted application. Such text information generally includes interface labels, button texts, prompt messages, etc., and involves visual content of the vehicle-mounted application interface.

[0071] In the embodiment of the present application, the text data in the vehicle application is stored in the resource system of Android. In the development of the Android system, the string resource files in the res / values, res / values-zh, res / values-zh-rCN and other directories store all the text data in the application interface, and are usually stored in the eXtensibleMarkup Language (XML) format, with <string>(string) Label.

[0072] Among them, the string resource files in the res / values ​​directory store string resources for the default language (usually Chinese), the string resource files in the res / values-zh directory store string resources related to simplified Chinese, and the string resource files in the res / values-zh-rCN directory store Chinese string resources for specific regions.

[0073] Specifically, the Chinese string resource file stores all the text information based on Chinese in the vehicle application. If all the Chinese text data needs to be translated into English, all the Chinese string resource files are searched in the above string resource files. For example, if you need to translate "navigation", you can get the Chinese string resource files based on<string name="navigation"> navigation< / string> Text data stored in the Chinese string resource file in the form of.

[0074] In a possible embodiment, the step of obtaining text data of the vehicle-mounted application includes: first, parsing the XML file and scanning the file line by line to locate <string>Tags, obtained by reading the file content <string>The text data in the tag is then extracted and the text data that needs to be translated is filtered out, for example, only the text data that is not empty and is not marked as not requiring translation (such as translatable="false") is extracted. In the above manner, all the text data that needs to be translated can be obtained from the resource file of the vehicle-mounted application, preparing for the subsequent translation work.

[0075] S302: Acquire control feature information corresponding to the text data.

[0076] In a possible embodiment, a control is a basic component unit in an application interface, which is used to display content or implement interactive functions. In the Android system, controls are usually defined by XML files and operated in the application code through Java / Kotlin. Controls include display controls, such as Text View (displaying text) and Image View (displaying pictures), interactive controls, such as Button, Edit Text (input box), Checkbox, and container controls, such as Linear Layout and Relative Layout (organizing and managing the layout of other controls).

[0077] In a possible embodiment, the control characteristic information includes characteristic information of a control in the in-vehicle application to which the text data belongs. Specifically, the control characteristic information represents the type, size, style, and hierarchical relationship of the control to which the text data belongs.

[0078] In a possible embodiment, obtaining control feature information corresponding to text data includes:

[0079] S312: Obtain layout information corresponding to the text data.

[0080] S322: Acquire control type information and control size information corresponding to the text data according to the layout information.

[0081] S332: Acquire control level information corresponding to the text data according to the control type information.

[0082] S342: Determine control feature information according to control type information, control size information, and control level information.

[0083] In a possible embodiment, the control feature information includes control type information, control size information, and control level information.

[0084] Among them, the control type information represents the category and function of the control, such as whether it is a display control for displaying text, or an interactive control for triggering operations or inputting data. Different control types have different translation styles. For example, for the Chinese text "Return", a display control such as Text View needs to translate "Return" into "Back" to represent the direction or static state, and an interactive control such as Button needs to translate "Return" into "Go Back" to represent the return action. It can also be translated into "Return" to represent the operation of returning from the current screen to the previous screen.

[0085] Optionally, the control size information represents the display size and layout proportion of the control in the interface. For example, the control width is 50dp and the control height is 20dp.

[0086] Optionally, the control level information includes the ownership and reference relationship between controls, and also includes Chinese text data and English (or other language forms) text data before and after translation of text data of controls at the same level.

[0087] Control type information, control size information, and control hierarchy information together provide accurate contextual support for translation, ensuring that the translation results conform to control functions, size restrictions, and interface logic, and have complete semantics.

[0088] S303: Associating the text data with the control feature information corresponding to the text data to construct a text to be translated containing the control feature information.

[0089] In a possible embodiment, associating the text to be translated with the control feature information corresponding to the text to be translated to construct the text to be translated containing the control feature information includes:

[0090] S313: Acquire a data pair corresponding to the text to be translated according to the text to be translated and the control type information, control size information and control level information corresponding to the text to be translated.

[0091] S323: Obtain a prompt word template.

[0092] In a possible embodiment, the prompt word template includes translation scene information and prompt instructions. In the embodiment of the present application, the translation scene information may be a vehicle-mounted application translation scene, and the prompt instruction is a Chinese template including instructions.

[0093] S333: Generate the text to be translated containing the feature information based on the data pair corresponding to the text to be translated and the prompt word template.

[0094] For example, the text data is Chinese text "level 1", the control type information corresponding to the text data is the TextView text display control, the control size information corresponding to the text data is the control width is 50dp, the control height is 50dp, the control level information corresponding to the text data is the same level "level 2" translated as "level2" and "level 3" translated as "level3", and the data pair corresponding to the text data is {"zh":"level 1","en":"level1","type":"Text View","area":{"weight":"50dp","height":"50dp"},"same_layer":["level 2":"level2","level 3":"level3"]}.

[0095] Based on the data pair corresponding to the text to be translated and the prompt word template, the text to be translated containing the feature information is generated as "I want to translate the English version of a car application. Now there is a control called Text View. Its height attribute is 50dp, its weight attribute is 50dp, and its text is 'level 1'. The text on the control of the same level, 'level 2', is translated into 'level 2', and 'level 3' is translated into 'level 3'. Please provide me with a translation."

[0096] S304: Input the text to be translated containing the control feature information into the trained text translation model to obtain the translated text.

[0097] In an embodiment of the present application, the trained text translation model is used to translate Chinese text data one by one, and the generated translation text is stored in res / values-en (storing English-related string resources) to complete the automatic translation of the overseas version of the application.

[0098] Figure 4 This is a flow chart of obtaining control level information corresponding to text data according to control type information provided by an embodiment of the present application. The method may include:

[0099] S401: Determine whether the control type information is a first type control or a second type control. If it is a first type control, execute S402; if it is a second type control, execute S406.

[0100] In the embodiment of the present application, the first type of control is an Android native control, which is a control predefined in the Android SDK, such as the TextView, Button, etc. mentioned above, and the developer can directly use these controls in the layout file. The second type of control is a control created by the developer according to specific needs, inheriting the Android native control or View class, modifying its appearance, behavior, or adding specific functions.

[0101] S402: Acquire multiple first sub-type controls.

[0102] In a possible embodiment, the first type of control includes multiple first sub-type controls, and the native controls may specifically include different sub-types such as the above-mentioned TextView, Button, etc.

[0103] S403: Acquire a plurality of first language texts and a plurality of second language texts of a plurality of first sub-type controls.

[0104] The plurality of second language texts are respectively translated based on the plurality of first language texts. For example, the first language texts are a plurality of Chinese text data of the first sub-type control, and the second language texts are a plurality of corresponding English text data.

[0105] S404: Determine whether the sub-control types corresponding to the text data and the first language text are the same. If so, execute S405; if not, continue with S404.

[0106] S405: Determine the first language text and the second language text as control level information corresponding to the text data.

[0107] In a possible embodiment, for Android native controls, controls belonging to the same sub-control type are regarded as controls at the same level, and Chinese text data and corresponding English text data of the controls at the same level are regarded as control level information of the text data.

[0108] For example, control A includes first language text A1 and corresponding second language text a1, control B includes first language text B1, B2, B3 and corresponding second language text b1, b2, b3. If control A and control B belong to the same sub-control type, then B1, B2, B3, b1, b2, b3 are all used as control hierarchy information of A1.

[0109] S406: Obtain control attribute information.

[0110] S407: Determine whether the control attribute information includes reference information, if so, execute S408, if not, continue with S407.

[0111] S408: Acquire multiple third language texts and multiple fourth language texts corresponding to the reference information.

[0112] Similarly, the plurality of third language texts are translated based on the plurality of fourth language texts respectively.

[0113] S409: Determine the plurality of third language texts and the plurality of fourth language texts as control level information of the text data.

[0114] In a possible embodiment, a custom control may contain references of type @string, which point to string resources defined in strings.xml. For example, the android:text attribute of the custom control Custom Button references the @string / start string, so the Custom Button control displays the text defined in strings.xml. All attributes containing @string references (such as @string / submit, @string / cancel) are classified as the same level for processing.

[0115] The above grouping method can optimize the translation process, ensuring that different types of controls can be clearly distinguished during processing and appropriate translations are provided based on their type and context.

[0116] Before inputting the text to be translated containing the control feature information into the trained text translation model to obtain the translated text, it is necessary to train the trained text translation model. Figure 5 : is a flowchart of a method for training a trained text translation model provided in an embodiment of the present application. The method may include:

[0117] S501: Obtain a training data set.

[0118] In a possible embodiment, the training data set includes a plurality of training texts to be translated and actual translation texts corresponding to each training text to be translated; and each training control feature information includes training control feature information.

[0119] For example, the training text to be translated is: "I want to translate the English version of a car application. Now there is a control called Text View. Its height attribute is 50dp, weight attribute is 50dp, and its text is 'level 1'. The text on the control of the same level 'level 2' is translated as 'level 2', and 'level 3' is translated as 'level 3'. Please provide me a translation", and the actual translated text is: "level 1".

[0120] In a possible embodiment, similar to obtaining the text to be translated, obtaining the training text to be translated includes:

[0121] S511: Acquire a data pair corresponding to the training text data according to the training text data and the control type information, control size information and control level information corresponding to the training text data.

[0122] S521: Obtain a prompt word template. The prompt word template includes translation scene information and prompt instructions.

[0123] S531: Generate a training text to be translated containing feature information based on the data pair of the training text data and the prompt word template.

[0124] S502: Obtain a pre-trained large language model.

[0125] A Large Language Model (LLM) is an artificial intelligence model trained with a large amount of text data, designed to understand and generate natural language. It is developed based on deep learning technology, especially the Transformer architecture, which can process large amounts of text data and perform well in various natural language processing tasks. Pre-training is a key training process for large language models. Pre-training enables large language models to learn general language knowledge on a large amount of unlabeled data, and master grammatical structure, vocabulary usage, syntactic relations, etc. By processing a large amount of text, the large language model can grasp the nuances of the language and thus have a certain language comprehension ability. The pre-trained large language model can be used as a basic model and adapted to different specific tasks through fine-tuning.

[0126] In a possible embodiment, the pre-trained large language model may include models such as a bidirectional encoder representation transformer (Bidirectional Encoder Representations from Transformers BERT) based on a Transformer architecture, a generative pre-trained transformer (GPT), a text-to-text transfer transformer (T5), a sequence-to-sequence (Seq2Seq), a neural machine translation model of a neural machine translator (NMT), and other large language models.

[0127] S503: Input the training data set into the pre-trained large language model to perform text translation operations to obtain a trained text translation model.

[0128] In a possible embodiment, model training includes supervised and unsupervised model training, and a supervised method for obtaining trained text translation model training further includes:

[0129] S513: Use the pre-trained large language model as the current large language model.

[0130] S523: Determine a loss value based on the training text to be translated corresponding to the training translation text and the actual translation text.

[0131] S533: Determine whether the loss value is greater than a preset threshold. If so, execute S543; if not, execute S563.

[0132] S543: Perform back propagation based on the loss value, update the current large language model to obtain an updated large language model, and redefine the updated large language model as the current large language model.

[0133] S553: ​​Based on the current large language model, perform a text translation operation on the training text to be translated, determine a training translation text corresponding to the training text to be translated, and execute S523.

[0134] S563: Determine the current large language model as a trained text translation model.

[0135] The present application also provides a text translation device based on a large model. Figure 6 is a structural diagram of a text translation device based on a large model provided in an embodiment of the present application, such as Figure 6 As shown, the device 600 includes:

[0136] A first acquisition module 601 is used to acquire text data of an in-vehicle application;

[0137] The second acquisition module 602 is used to acquire the control feature information corresponding to the text data; the control feature information includes the feature information of the control in the vehicle-mounted application to which the text data belongs;

[0138] A construction module 603 is used to associate the text data with the control feature information corresponding to the text data to construct a text to be translated containing the control feature information;

[0139] The third acquisition module 604 is used to input the text to be translated containing the control feature information into the trained text translation model to obtain the translated text.

[0140] In an optional implementation, it also includes:

[0141] A training module, which is used to train and obtain a trained text translation model;

[0142] The training module is used to obtain a training data set; the training data set includes multiple training texts to be translated and actual translation texts corresponding to each training text to be translated; each training control feature information includes training control feature information; obtain a pre-trained large language model; input the training data set into the pre-trained large language model to perform text translation operations, and obtain a trained text translation model.

[0143] In an optional implementation, it also includes:

[0144] A first determination module is used to use the pre-trained large language model as the current large language model;

[0145] A second determination module is used to determine a loss value based on the training text to be translated corresponding to the training translation text and the actual translation text;

[0146] The third determination module is configured to, when the loss value is greater than a preset threshold, perform back propagation based on the loss value, update the current large language model to obtain an updated large language model, and redetermine the updated large language model as the current large language model; repeat the steps of: performing a text translation operation on the training text to be translated based on the current large language model, and determining a training translation text corresponding to the training text to be translated;

[0147] The fourth determination module is used to determine the current large language model as a trained text translation model when the loss value is less than or equal to a preset threshold.

[0148] In an optional implementation, it also includes:

[0149] A fourth acquisition module, used to acquire layout information corresponding to the text data;

[0150] A fifth acquisition module, used for acquiring control type information and control size information corresponding to the text data according to the layout information;

[0151] A sixth acquisition module, used for acquiring control level information corresponding to the text data according to the control type information;

[0152] The fifth determining module is used to determine the control feature information according to the control type information, the control size information and the control level information.

[0153] In an optional implementation, it also includes:

[0154] A seventh acquisition module, configured to acquire a plurality of first sub-type controls when the control type information indicates that the control to which the text data belongs includes a first type control; the first type control includes a plurality of first sub-type controls;

[0155] An eighth acquisition module, used to acquire a plurality of first language texts and a plurality of second language texts of a plurality of first sub-type controls; the plurality of second language texts are respectively obtained by translating the plurality of first language texts;

[0156] The sixth determination module is used to determine the first language text and the second language text as the control level information corresponding to the text data if the control type corresponding to the to-be-translated text and the control type corresponding to the first language text are the same.

[0157] In an optional implementation, it also includes:

[0158] A ninth acquisition module, configured to acquire control attribute information when the control type information indicates that the control to which the text data belongs includes a second type of control;

[0159] a tenth acquisition module, for acquiring, if the control attribute information includes reference information, a plurality of third language texts and a plurality of fourth language texts corresponding to the reference information; the plurality of third language texts are respectively obtained by translating based on the plurality of fourth language texts;

[0160] The seventh determining module is used to determine the plurality of third language texts and the plurality of fourth language texts as the control level information of the text data.

[0161] In an optional implementation, it also includes:

[0162] An eleventh acquisition module is used to acquire a data pair corresponding to the text to be translated according to the text to be translated and the control type information, control size information and control level information corresponding to the text to be translated;

[0163] A twelfth acquisition module is used to acquire a prompt word template; the prompt word template includes translation scene information and prompt instructions;

[0164] The generation and acquisition module is used to generate the text to be translated containing the control feature information based on the data pair corresponding to the text to be translated and the prompt word template.

[0165] The device and method embodiments in the embodiments of this application are based on the same application concept.

[0166] The method embodiments provided in the embodiments of the present application can be executed in a computer terminal, a server or a similar computing device. Taking running on a server as an example, Figure 7 1 is a hardware structure block diagram of a server of a text translation method based on a large model provided in an embodiment of the present application. Figure 7 As shown, the server 700 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 710 (the processor 710 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 730 for storing data, and one or more storage media 720 (such as one or more mass storage devices) for storing application programs 723 or data 722. Among them, the memory 730 and the storage medium 720 can be short-term storage or permanent storage. The program stored in the storage medium 720 may include one or more modules, each of which may include a series of instruction operations on the server. Furthermore, the central processing unit 710 can be configured to communicate with the storage medium 720 and execute a series of instruction operations in the storage medium 720 on the server 700. The server 700 may also include one or more power supplies 760, one or more wired or wireless network interfaces 750, one or more input and output interfaces 740, and / or one or more operating systems 721, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0167] The input / output interface 740 may be used to receive or send data via a network. The specific example of the network may include a wireless network provided by a communication provider of the server 700. In one example, the input / output interface 740 includes a network adapter (Network Interface Controller, NIC), which may be connected to other network devices via a base station so as to communicate with the Internet. In one example, the input / output interface 740 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0168] It can be understood by those skilled in the art that Figure 7 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 7 More or fewer components as shown, or with Figure 7 Different configurations are shown.

[0169] An embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set, or an instruction set, and the at least one instruction, at least one program, a code set, or an instruction set is loaded and executed by the processor to implement the above-mentioned large model-based text translation method.

[0170] An embodiment of the present application also provides a computer-readable storage medium, which can be set in a server to store at least one instruction, at least one program, a code set or an instruction set related to a text translation method based on a big model in an implementation method embodiment. The at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the above-mentioned text translation method based on a big model.

[0171] Optionally, in this embodiment, the storage medium may be located in at least one of the multiple network servers of the computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.

[0172] It can be seen from the embodiments of the large model-based text translation method, device, electronic device or storage medium provided by the present application that, in the embodiments of the present application, text data of the vehicle-mounted application is obtained; control feature information corresponding to the text data is obtained; the control feature information includes feature information of the control in the vehicle-mounted application to which the text data belongs; the text data is associated with the control feature information corresponding to the text data to construct a text to be translated containing the control feature information; the text to be translated containing the control feature information is input into the trained text translation model to obtain the translated text. In the embodiments of the present application, by associating the text data with the features of the control to which the text data belongs, and generating a text to be translated containing the control feature information, the text is input into the trained text translation model to generate a translated text that conforms to the context and control features. By introducing the control feature information, the text translation model can understand the context of the text data, its relationship with other text data in the control to which it belongs, and its relationship with other controls. While translating the text one by one, it can ensure that the translation style is consistent between controls of the same type and level, avoiding the inconsistent style or incoherent context that may occur in traditional one-by-one translation.

[0173] It should be noted that the above-mentioned sequence of the embodiments of the present application is for description only and does not represent the advantages and disadvantages of the embodiments. The above-mentioned specific embodiments of this specification are described. Other embodiments are within the scope of the attached claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0174] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0175] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0176] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.< / string> < / string>

Claims

1. A text translation method based on a large model, characterized in that: include: Get text data from in-vehicle applications; Acquire control feature information corresponding to the text data; the control feature information includes feature information of a control in the in-vehicle application to which the text data belongs; Associating the text data with the control feature information corresponding to the text data to construct a text to be translated containing the control feature information; The text to be translated containing the control feature information is input into a trained text translation model to obtain a translated text.

2. A text translation method based on a large model according to claim 1, characterized in that: The obtaining of control feature information corresponding to the text data includes: Obtaining layout information corresponding to the text data; According to the layout information, acquiring control type information and control size information corresponding to the text data; According to the control type information, acquiring control level information corresponding to the text data; The control feature information is determined according to the control type information, the control size information and the control level information.

3. A text translation method based on a large model according to claim 2, characterized in that: The acquiring, according to the control type information, control level information corresponding to the text data includes: In the case where the control type information indicates that the control to which the text data belongs includes a first-type control, acquiring a plurality of first-subtype controls; the first-type controls include the plurality of first-subtype controls; Acquire a plurality of first language texts and a plurality of second language texts of the plurality of first sub-type controls; the plurality of second language texts are respectively obtained by translating the plurality of first language texts; If the control type corresponding to the text data and the sub-control type corresponding to the first language text are the same, the first language text and the second language text are determined as the control level information corresponding to the text data.

4. A text translation method based on a large model according to claim 3, characterized in that: The acquiring, according to the control type information, control level information corresponding to the text data further includes: When the control type information indicates that the control to which the text data belongs includes a second type control, acquiring control attribute information; If the control attribute information includes reference information, obtaining a plurality of third language texts and a plurality of fourth language texts corresponding to the reference information; the plurality of third language texts are respectively translated based on the plurality of fourth language texts; The plurality of third language texts and the plurality of fourth language texts are determined as control level information of the text data.

5. The text translation method based on a large model according to claim 1, characterized in that: The step of associating the text data with the control feature information corresponding to the text data to construct a text to be translated containing the control feature information includes: Acquire a data pair corresponding to the text data according to the text data and the control type information, the control size information, and the control level information corresponding to the text data; Obtaining a prompt word template; the prompt word template includes translation scene information and prompt instructions; Based on the data pair corresponding to the text data and the prompt word template, the text to be translated containing the control feature information is generated.

6. A text translation method based on a large model according to claim 1, characterized in that: The method also includes the step of training to obtain the trained text translation model; The training to obtain the trained text translation model includes: Acquire a training data set; the training data set includes a plurality of training texts to be translated and actual translation texts corresponding to each of the training texts to be translated; each training control feature information includes training control feature information; Get the pre-trained large language model; The training data set is input into the pre-trained large language model to perform a text translation operation to obtain the trained text translation model.

7. A text translation method based on a large model according to claim 6, characterized in that: The step of inputting the training data set into the pre-trained large language model to perform a text translation operation and obtaining the trained text translation model comprises: Using the pre-trained large language model as the current large language model; Determine a loss value based on the training text to be translated corresponding to the training translation text and the actual translation text; When the loss value is greater than a preset threshold, back propagation is performed based on the loss value, the current large language model is updated to obtain an updated large language model, and the updated large language model is re-determined as the current large language model; repeating the steps of: performing a text translation operation on the training text to be translated based on the current large language model, and determining a training translation text corresponding to the training text to be translated; When the loss value is less than or equal to the preset threshold, the current large language model is determined as the trained text translation model.

8. A text translation device based on a large model, characterized in that: The device comprises: A first acquisition module, used to acquire text data of an in-vehicle application; A second acquisition module is used to acquire control feature information corresponding to the text data; the control feature information includes feature information of a control in the vehicle-mounted application to which the text data belongs; A construction module, used for associating the text data with the control feature information corresponding to the text data to construct a text to be translated containing the control feature information; The third module is used to input the text to be translated containing the control feature information into the trained text translation model to obtain the translated text.

9. An electronic device, characterized in that: The electronic device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the large model-based text translation method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the large model-based text translation method as described in any one of claims 1-7.