Cboth translation method, device and equipment, medium and program product
By using the method of receiving translation requirements, generating prompt word templates and entering target translation models in the smart cockpit technology of electric vehicles, the problem that the translated text may exceed the display range is solved, and a better functional page display effect is achieved.
Patent Information
- Application Number
- CN202411904150.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-12-20
AI Technical Summary
In the smart cockpit technology of electric vehicles, the translated text may exceed the display range of the original text, resulting in incomplete display of the function page information and poor display effect.
By receiving translation requirements, the response module determines prior knowledge from the preset copy library, generates a prompt word template, and enters it into the target translation model to obtain copy translation results that adapt to the displayed information. Users can view and adjust translation results in real time through the visual preview interface to ensure that the display effect is adapted to the target display.
It effectively alleviates the problem of mismatch between copy translation and display effects, reduces the possibility that the translated text exceeds the original text display range, improves the display effect of the function page, and reduces the cumbersome operations in the development process of the function page.
Smart Images

Figure CN119721059A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a text translation method, device, equipment, medium and program product. Background Art
[0002] With the continuous development of electric vehicle smart cockpit technology, the number of function pages provided by vehicle cockpits is increasing. With the globalization of the automobile market, the language adaptability of each function page has become a major problem in cockpit function development.
[0003] In order to ensure that the text of the interactive function page can adapt to the languages of different countries, the text needs to be translated into the corresponding language and displayed. Due to the different languages of different countries, the length of the language text obtained when the same text is translated into different languages of different countries may be different, and the size of the display screen that displays the language text for the same device is usually the same. Therefore, if the translated language text is directly displayed on the display screen, the translated language text may exceed the display range of the original text, resulting in incomplete display of the function page information and poor display effect. Summary of the invention
[0004] The present invention provides a text translation method, device, equipment, medium and program product to solve the problem in the related art that the translated text may exceed the display range of the original text, resulting in incomplete display of function page information and poor display effect.
[0005] In a first aspect, an embodiment of the present application provides a method for translating a text, comprising:
[0006] receiving a translation requirement, the translation requirement including a first text, a target translation language, a text type, and first display information of the first text on a target display screen;
[0007] In response to the translation requirement, determining the prior knowledge corresponding to the first copy from a preset copy library to obtain a prompt word template, wherein the prompt word template includes the prior knowledge and the translation requirement, and the prior knowledge includes at least a second copy, and the second copy is a copy in the preset copy library that matches the first copy;
[0008] Inputting the prompt word template into the target translation model to obtain a text translation result in the target translation language corresponding to the first text, wherein the text translation result is adapted to the first display information and the text type;
[0009] Displaying a visual preview interface according to the text translation result and the first display information, where the visual preview interface is used to show the display effect of the text translation result on the target display screen;
[0010] When an adjustment instruction of the user to the visual preview interface is detected, the text translation result is updated in response to the adjustment instruction, and / or the display position of the text translation result on the target display screen is updated to obtain the target text translation content corresponding to the first text, and the display effect of the target text translation content is adapted to the target display screen.
[0011] Optionally, the preset copy library includes one or more copy information, the copy information includes the copy and the display content of the copy, the display content includes: the copy translation result in one or more languages corresponding to the copy and the second display information; the prior knowledge also includes the display content of the second copy, and the one or more languages include the target translation language;
[0012] Determine the prior knowledge corresponding to the first copy from the preset copy library to obtain a prompt word template, including:
[0013] Determine at least one target copy information related to the first copy from a preset copy library, the target copy information including the second copy and the display content of the second copy, the target copy information being copy information that matches the first copy and the first display information and has a confidence level greater than or equal to a preset confidence level;
[0014] A prompt word template is determined according to the first text, the target translation language, the text type, the first display information, and at least one target text information.
[0015] Optionally, determining at least one target copy information related to the first copy from a preset copy library includes:
[0016] Performing vector matching on the first copy and multiple copy information in a preset copy library to determine multiple matched candidate copy information;
[0017] Performing vector matching on the plurality of candidate copywriting information and the first copywriting to determine a plurality of pending copywriting information matching the first copywriting;
[0018] At least one target copy information is determined from the plurality of pending copy information according to the confidence levels of the plurality of pending copy information.
[0019] Optionally, the method further comprises:
[0020] Obtaining an initial large language model, where the initial large language model is at least used for copy translation;
[0021] Acquire a data set, where the data set at least includes one or more paragraphs of text data related to the smart device and a keyword for each paragraph of text data;
[0022] Determine multiple data sets according to the data set, the multiple data sets include a training set and a validation set;
[0023] Select the target fine-tuning method and training set to adjust the initial large language model;
[0024] In the process of adjusting the initial large language model, the validation set is used to monitor and optimize the model performance to obtain the optimal model configuration;
[0025] The target translation model is obtained by using the model optimization configuration as the configuration of the initial large language model.
[0026] Optionally, the multiple data sets also include a test set, and the target translation model is obtained by using the model optimization configuration as the configuration of the initial large language model, including:
[0027] The test set is used to test the initial large language model using the model optimization configuration to evaluate the performance of the initial large language model using the model optimization configuration;
[0028] When the performance meets the requirements, the initial large language model with model optimization configuration will be used as the target translation model.
[0029] Optionally, the translation requirement includes multiple target translation languages, and the adjustment instruction includes an editing instruction. When an adjustment instruction triggered by a user on the visual preview interface is detected, the text translation result is updated in response to the adjustment instruction, including:
[0030] detecting that an editing instruction for a text translation result in a first target translation language among the text translation results in multiple target translation languages is triggered by a user, the editing instruction instructing to edit a first word in the text translation result in the first target translation language;
[0031] In response to the editing instruction, the first word is modified, and the second word in the text translation results of other target translation languages in the text translation results of the multiple target translation languages is modified synchronously, wherein the second word is the content in the text translation results of the other target translation languages corresponding to the first word.
[0032] Optionally, the visual preview interface includes the first text and text translation results in one or more target translation languages corresponding to the first text displayed in parallel.
[0033] Optionally, the translation requirement includes multiple target translation languages, and the method further includes:
[0034] Display multiple text translation results in different target translation languages in preview mode;
[0035] Output a text selection prompt, where the text selection prompt is used to prompt the user to select a text translation result from multiple text translation results for display;
[0036] Receive text selection instructions;
[0037] The step of displaying a visual preview interface according to the text translation result and the first display information of the first text on the target display screen includes:
[0038] In response to the text selection instruction, the text translation result selected by the text selection instruction is displayed on the visual preview interface according to the text translation result and the first display information.
[0039] Optionally, the method further comprises:
[0040] When an adjustment instruction triggered by the user on the visual preview interface is detected, the target text translation content corresponding to the first text is stored in a preset text library, and the target text translation content includes an updated text translation result corresponding to the first text and / or an updated display position of the text translation result corresponding to the first text on the target display screen;
[0041] In the case where no adjustment instruction is detected, the text translation result corresponding to the first text and / or the display position of the text translation result corresponding to the first text on the target display screen are stored in a preset text library.
[0042] Optionally, receive translation requests, including:
[0043] Displaying a visual demand interface, the visual demand interface includes a copy template, the copy template includes multiple key fields, any key field includes one or more options, each option corresponds to a demand content, and the multiple key fields include at least a copy type selection field, a copy content field, a display area field, a device model field, and a system version field;
[0044] The text content field is used to select or input a predefined first text in a first language; the display area field is used to indicate the screen and specific location where the first text needs to be displayed, and the display area field includes a maximum number of rows and a column width, which are used to indicate the maximum space that the first text can occupy in the display area; the device model field is used to indicate the device model to which the first text is applicable; and the system version field is used to indicate the system version used by the device to which the text is applicable;
[0045] Determine the translation requirements based on the requirements corresponding to the options selected by the user on the copy template.
[0046] Optionally, the method further comprises:
[0047] Displaying a visual search interface, wherein the visual search interface includes one or more search keywords, wherein the one or more search keywords include one or more of the following: document type, device model, system version;
[0048] According to the search keyword set by the user in the visual search interface, target copy information corresponding to the set search keyword is determined from a preset copy library; the preset copy library includes at least a first copy;
[0049] The target copy information is displayed, where the target copy information at least includes the target copy, the copy translation result corresponding to each target copy, and the display information corresponding to the target copy.
[0050] In a second aspect, an embodiment of the present application provides a text translation device, including:
[0051] A receiving module, configured to receive a translation requirement, wherein the translation requirement includes a first text, a target translation language, a text type, and first display information of the first text on a target display screen;
[0052] A response module, configured to determine, in response to a translation requirement, prior knowledge corresponding to the first copy from a preset copy library to obtain a prompt word template, wherein the prompt word template includes prior knowledge and the translation requirement, and the prior knowledge includes at least a second copy, and the second copy is a copy in the preset copy library that matches the first copy;
[0053] An input module, used for inputting the prompt word template into the target translation model to obtain a text translation result in the target translation language corresponding to the first text, wherein the text translation result is adapted to the first display information and the text type;
[0054] A display module, used to display a visual preview interface according to the text translation result and the first display information, wherein the visual preview interface is used to show the display effect of the text translation result on the target display screen;
[0055] The response module is also used to update the text translation result and / or update the display position of the text translation result on the target display screen in response to the adjustment instruction when the user's adjustment instruction for the visual preview interface is detected, so as to obtain the target text translation content corresponding to the first text, and the display effect of the target text translation content is adapted to the target display screen.
[0056] In a third aspect, an embodiment of the present application provides an intelligent device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned text translation method when executing the computer program.
[0057] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned text translation method are implemented.
[0058] In a fifth aspect, the present application provides a computer program product, the computer program product includes a computer program, and when the computer program is executed by a processor, the steps of implementing the above-mentioned text translation method are implemented.
[0059] In one solution provided by the above-mentioned text translation method, device, equipment, medium and program product, a translation requirement is received, the translation requirement includes a first text, a target translation language, a text type and first display information of the first text on a target display screen; in response to the translation requirement, prior knowledge corresponding to the first text is determined from a preset text library to obtain a prompt word template, the prompt word template includes prior knowledge and translation requirements, the prior knowledge includes at least a second text, and the second text is a text in the preset text library that matches the first text; the prompt word template is input into a target translation model to obtain a text translation result in the target translation language corresponding to the first text, and the text translation result is adapted to the first display information and the text type; according to the text translation result and the first display information, a visual preview interface is displayed, and the visual preview interface is used to show the display effect of the text translation result on the target display screen; in the case of detecting a user's adjustment instruction for the visual preview interface, in response to the adjustment instruction, the text translation result is updated, and / or the display position of the text translation result on the target display screen is updated, and the target text translation content corresponding to the first text is obtained, and the display effect of the target text translation content is adapted to the target display screen. In this embodiment, the display effect of the text translation result can be automatically adjusted through prior knowledge, text type and display information, and the user can view and adjust the translation result in real time through a visual preview interface to ensure that the final display effect meets user needs. The intelligent text translation and display effect adjustment and adaptation mechanism is adopted to effectively alleviate the incompatibility between text translation and display effect, reduce the possibility of the translated text exceeding the original text display range, reduce the situation of incomplete page information display, and improve the display effect of the function page. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0061] Figure 1 is a structural schematic diagram of a text translation system in one embodiment of the present invention;
[0062] Figure 2 It is a schematic diagram of a process of a text translation method in one embodiment of the present invention;
[0063] Figure 3 yes Figure 2 A schematic diagram of an implementation process of step S10;
[0064] Figure 4 yes Figure 2 A schematic diagram of an implementation process of step S20;
[0065] Figure 5 yes Figure 2 Another implementation flow diagram of step S40;
[0066] Figure 6 yes Figure 2 Another implementation flow diagram of step S50;
[0067] Figure 7 is a schematic diagram of a visual preview interface in one embodiment of the present invention;
[0068] Figure 8 It is a schematic diagram of an implementation process of a text translation method in one embodiment of the present invention;
[0069] Fig. 9 It is another schematic diagram of the implementation process of the copywriting translation method in one embodiment of the present invention;
[0070] Fig.10 yes Figure 1 A schematic diagram of the structure of a Chinese translation device;
[0071] Fig.11 It is a structural diagram of a smart device in one embodiment of the present invention. DETAILED DESCRIPTION
[0072] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0073] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or their collections. It should also be understood that the term "and / or" used in the present specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.
[0074] In addition, in the description of the present specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0075] References to "one embodiment" or "some embodiments" etc. described in the present specification mean that one or more embodiments of the present invention include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0076] It should be understood that the order of execution of the steps in the following embodiments does not imply a precedence of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0077] In order to illustrate the technical solution of the present invention, specific embodiments are provided below for illustration.
[0078] It should be understood that in order to ensure that the text of the interactive function page can adapt to the languages of different countries, the text needs to be translated into the corresponding language and displayed. However, due to the different lengths of different voice texts, directly displaying the translated text in the interactive function page may exceed the display range of the original text, resulting in incomplete display of the function page information and poor display effect. In addition, in response to this problem, relevant manufacturers generally adjust the text display of the function page during the product development stage, such as pre-generating translated texts in different languages and filling the translated text into the text area of the function page. However, in this process, due to the different lengths of different voice texts and the different terminal screen sizes, the translated text will still exceed the display range of the original text. R&D personnel need to adjust the text translation again and modify the page display scheme. This process may need to be repeated until all texts in different languages can adapt to the function pages of each screen. The whole process is cumbersome, resulting in a large waste of human resources and low efficiency.
[0079] In view of the above problems, the text translation method provided by the embodiment of the present invention can be applied in Figure 1In the text translation system shown, the text translation system includes a terminal device and a text translation apparatus, wherein the terminal device communicates with the text translation apparatus via a network. In other embodiments, the text translation system may include a text translation apparatus, and the text translation apparatus may include a control device and a display interface, and the control device communicates with the display screen via a cable.
[0080] In the case of a text translation task requirement with a functional page, a user can input relevant information and send a translation request through a terminal device (or a display screen of a text translation device), and the translation request includes a translation requirement including a first text, a target translation language, a text type, and a first display information of the first text on a target display screen. The text translation device (or control device) receives the translation request, and in response to the translation request, in response to the translation requirement, determines the prior knowledge corresponding to the first text from a preset text library to obtain a prompt word template; wherein the prompt word template includes prior knowledge and translation requirements, and the prior knowledge includes at least a second text, and the second text is a text matching the first text in the preset text library. The text translation device (or control device) inputs the prompt word template into the target translation model to obtain a text translation result of the target translation language corresponding to the first text, and the text translation result is adapted to the first display information and the text type; according to the text translation result and the first display information, a visual preview interface is displayed, wherein the visual preview interface is used to display the display effect of the text translation result on the target display screen. When the user's adjustment instruction for the visual preview interface is detected, the text translation device (or control device) responds to the adjustment instruction, updates the text translation result, and / or updates the display position of the text translation result on the target display screen, and obtains the target text translation content corresponding to the first text. The display effect of the target text translation content is adapted to the target display screen.
[0081] In this embodiment, the display effect of the text translation result can be automatically adjusted through prior knowledge, text type and display information, and through the visual preview interface, the user can view and adjust the translation result in real time to ensure that the final display effect meets the user's needs. The intelligent text translation and display effect adjustment and adaptation mechanism is adopted to effectively alleviate the incompatibility between text translation and display effect, reduce the possibility of the translated text exceeding the original text display range, reduce the situation of incomplete page information display, and improve the display effect of the function page. In addition, this solution does not need to translate and modify the page display scheme multiple times, which can reduce the cumbersome operations in the function page development process, reduce the waste of human resources, and improve the efficiency of function page development.
[0082] The terminal device includes, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, and portable wearable devices. The text translation device can be a server, which can be implemented as an independent server or a server cluster composed of multiple servers. In other embodiments, the text translation device can also be an intelligent device. For example, the intelligent device can be various personal computers, laptop computers, smart phones, tablet computers, etc.
[0083] The smart device in this embodiment may also be a vehicle. The vehicle includes a smart cockpit system, and the text translation method provided in the embodiment of the present application may also be implemented by the smart cockpit system. The smart cockpit system may be implemented by an independent server or a server cluster consisting of multiple servers.
[0084] Among them, the smart cockpit system can be a complete system consisting of a central control platform, a full LCD instrument, a central control display, an entertainment system, a smart speaker, a car networking module, a streaming media rearview mirror, a telematics system, etc. The smart cockpit system can be centered on the cockpit area controller, realize the functions of the above-mentioned smart cockpit system on a unified software and hardware platform, and integrate the system of intelligent interaction, intelligent scenes, and personalized services. The smart cockpit system can form the basis for human-vehicle interaction and the interconnection between the car and the outside world. The usage scenarios of the smart cockpit system can generally cover all scenarios in which users use the vehicle. Specifically, the scenarios in which users use the vehicle can include the time scenarios before the user uses the vehicle, the time scenarios during the user's use of the vehicle, and the time scenarios after the user uses the vehicle. The scenarios in which users use the vehicle can also include the spatial scenes of the driver, the co-pilot, the rear passengers, and the relevant people or objects outside the car. Compared with the past command interaction, the human-computer interaction of the smart cockpit system can combine the usage scenarios of the vehicle and the user, based on image recognition, voice recognition, environmental perception, etc., to achieve an intelligent effect that is more in line with user needs. In other words, the smart cockpit system refers to the vehicle electronic systems equipped with intelligent and networked on-board equipment and services, such as on-board infotainment systems, instrument panels, head-up displays (HUD), streaming media rearview mirrors, voice interaction systems, and other vehicle electronic systems.
[0085] In one embodiment, if Figure 2 As shown, a copywriting translation method is provided, which can be Figure 1 The method can be applied to the text translation device in Figure 1 The text translation device in the example is used to illustrate, including the following steps:
[0086] S10: receiving a translation requirement, where the translation requirement includes a first text, a target translation language, a text type, and first display information of the first text on a target display screen.
[0087] In the case of a text translation task requirement with a functional page, a user can input relevant information through a terminal device (or a display interface of a text translation apparatus) and send a translation request, wherein the translation request includes a translation requirement including a first text, a target translation language, a text type, and first display information of the first text on a target display screen.
[0088] Among them, the copy types of the first copy include menus, warnings, prompts, information instructions and other types. The target display screen can be the central control screen or dashboard screen of the vehicle. The first display information represents relevant information that restricts the display area, display space, and display method of the first copy. The first display information includes the display position (used to indicate the screen and specific position where the first copy needs to be displayed), the maximum number of rows and column widths (indicating the maximum space that the first copy can occupy in the display area), and whether the copy can be omitted (whether certain information can be omitted without affecting understanding to adapt to space limitations). The translation requirements can also include the device model of the device to which the first copy is applicable and the system version used by the device to which the first copy is applicable.
[0089] S20: In response to the translation requirement, prior knowledge corresponding to the first text is determined from a preset text library to obtain a prompt word template.
[0090] After receiving the translation request, the text translation device responds to the translation request and the translation requirement, and determines the prior knowledge corresponding to the first text from the preset text library to obtain a prompt word template. The prompt word template includes the prior knowledge and the translation requirement, and the prior knowledge includes at least the second text, which is a text in the preset text library that matches the first text.
[0091] S30: Inputting the prompt word template into the target translation model to obtain a text translation result in the target translation language corresponding to the first text.
[0092] The text translation device inputs the prompt word template into the target translation model to obtain a text translation result of the target translation language corresponding to the first text, wherein the text translation result is adapted to the first display information and the text type. The target translation model is a pre-trained large language model. The target translation model can be obtained by fine-tuning the large language model based on relevant data of the smart device (such as a vehicle).
[0093] The text translation device inputs the prompt word template including prior knowledge and translation requirements into the target translation model, and the target translation model converts the first text into a translation text of the target translation language according to the prior knowledge and translation requirements, that is, obtains the text translation result of the target translation language corresponding to the first text.
[0094] The first text is a Chinese text, the target translation languages include English and German, and the multiple translation texts in different target translation languages include at least one translation text corresponding to English and at least one translation text corresponding to German.
[0095] S40: Displaying a visual preview interface according to the text translation result and the first display information.
[0096] The text translation device displays a visual preview interface according to the text translation result and the first display information, wherein the visual preview interface is used to display the display effect of the text translation result on the target display screen.
[0097] The text translation device generates a visual preview interface adapted to the target display screen according to the text type of the first text, the target display screen and the text translation result, and the visual preview interface displays the text translation result at the display position of the first text. The translation request may include multiple target display screens, and the visual preview interface is used to display the display effects of the text translation results on different target display screens.
[0098] The user can input adjustment instructions through the visual preview interface. The adjustment instructions are used to instruct the modification of the text translation results, such as adjusting the text content, font size, layout and other information when there are translation errors, inaccuracies or too long translations; the adjustment instructions can also be used to instruct the modification of the display position of the text translation results on the target display screen, so as to personalize the display effect of the text translation results on the target display screen and ensure that the text display meets actual needs and user preferences. The visual preview interface intuitively displays the display effect of the text translation results on the page, allowing users to quickly find problems and make adjustments, greatly shortening the feedback cycle of the optimization process.
[0099] S50: When an adjustment instruction of the user on the visual preview interface is detected, in response to the adjustment instruction, the text translation result is updated, and / or the display position of the text translation result on the target display screen is updated to obtain the target text translation content corresponding to the first text.
[0100] When the user's adjustment instruction for the visual preview interface is detected, the text translation device responds to the adjustment instruction, updates the text translation result, and / or updates the display position of the text translation result on the target display screen, and obtains the target text translation content corresponding to the first text. The display effect of the target text translation content is adapted to the target display screen.
[0101] In this embodiment, the display effect of the text translation result can be automatically adjusted through prior knowledge, text type and display information, and through the visual preview interface, the user can view and adjust the translation result in real time to ensure that the final display effect meets the user's needs. The intelligent text translation and display effect adjustment and adaptation mechanism is adopted to effectively alleviate the incompatibility between text translation and display effect, reduce the possibility of the translated text exceeding the original text display range, reduce the situation of incomplete page information display, and improve the display effect of the function page. In addition, this solution does not need to translate and modify the page display scheme multiple times, which can reduce the cumbersome operations in the function page development process, reduce the waste of human resources, and improve the efficiency of function page development.
[0102] In one embodiment, before step S30, that is, before inputting the prompt word template into the target translation model, it is necessary to first obtain the target translation model. The target translation model is trained by:
[0103] S01: Obtain an initial large language model.
[0104] S02: Get the data set.
[0105] First, the text translation device can obtain an initial large language model. The initial large language model is at least used for text translation. At the same time, the text translation device obtains a data set, which includes multiple data samples, each of which includes at least one or more text data related to the smart device and keywords for each text data.
[0106] For example, the text translation device obtains data related to a smart device (such as a vehicle) and obtains multiple initial data of the smart device; performs keyword extraction on each initial data, and combines the initial data and its keywords into JSON format data as a key-value pair data; traverses multiple initial data to obtain multiple key-value pair data; performs data cleaning on multiple key-value pair data, such as removing duplicates, processing missing values, unifying the format of specific data (such as dates, numbers, etc.), removing or correcting outliers, etc., to ensure that the key-value pair data meets the format requirements of model training, obtain multiple data samples, and form a data set.
[0107] S03: Determine multiple data sets according to the data set, where the multiple data sets include a training set and a validation set.
[0108] The text translation device determines multiple data sets according to the data set, and the multiple data sets include a training set and a verification set. For example, multiple data samples in the data set are directly divided into a training set, a verification set (and a test set) according to a certain quantity ratio.
[0109] S04: Select the target fine-tuning method and training set to adjust the initial large language model.
[0110] The text translation device selects a target fine-tuning method and a training set to adjust the initial large language model.
[0111] Among them, the text translation device determines a target fine-tuning method that meets the performance of its hardware, such as a low-rank adaptation (LoRA) fine-tuning method, a model quantization and low-rank adaptation (QLoRA) fine-tuning method, a full model fine-tuning method, etc., and uses the target fine-tuning method to fine-tune the initial large language model using the training set.
[0112] S05: In the process of adjusting the initial large language model, the validation set is used to monitor and optimize the model performance to obtain the model optimization configuration.
[0113] In the process of adjusting the initial large language model, the text translation device uses the validation set to monitor and optimize the model performance, determine the optimal configuration parameters of the model, and obtain the model optimization configuration.
[0114] S06: Using the model optimization configuration as the configuration of the initial large language model to obtain a target translation model.
[0115] Then, the text translation device obtains the target translation model using the model optimization configuration as the configuration of the initial large language model.
[0116] In this embodiment, an initial large language model is obtained, and the initial large language model is at least used for text translation; a data set is obtained, and the data set at least includes one or more text data related to the smart device and keywords of each text data; multiple data sets are determined according to the data set, and the multiple data sets include a training set and a verification set; a target fine-tuning method and a training set are selected to adjust the initial large language model; in the process of adjusting the initial large language model, the verification set is used to monitor and optimize the model performance to obtain the model optimization configuration; the target translation model is obtained by using the model optimization configuration as the configuration of the initial large language model. The large language model is fine-tuned and trained by using the relevant data of the smart device, so as to improve the processing ability of the pre-trained large language model for the smart device data and improve the accuracy of the output text translation results.
[0117] In one embodiment, the plurality of data sets further include a test set; in step S06, the target translation model is obtained by using the model optimization configuration as the configuration of the initial large language model, which specifically includes the following steps:
[0118] S061: Use the test set to test the initial large language model with model optimization configuration to evaluate the performance of the initial large language model with model optimization configuration.
[0119] The text translation device tests the initial large language model with the model optimization configuration using the test set to evaluate the performance of the initial large language model with the model optimization configuration. If the performance of the initial large language model does not meet the requirements, the training set, the validation set and the test set are continued to be used to fine-tune, validate and test the model until the performance of the initial large language model meets the requirements.
[0120] S062: When the performance meets the requirements, the initial large language model with model optimization configuration will be used as the target translation model.
[0121] When the performance meets the requirements, the text translation device will use the initial large language model with model optimization configuration as the target translation model.
[0122] In this embodiment, after obtaining the target translation model by using the model optimization configuration as the configuration of the initial large language model, the initial large language model using the model optimization configuration is tested using a test set to evaluate the performance of the initial large language model using the model optimization configuration; if the performance meets the requirements, the initial large language model using the model optimization configuration is used as the target translation model. The performance of the initial large language model using the model optimization configuration is tested using a test set, and the initial large language model whose performance meets the requirements is output as an improved target translation model, thereby improving the data processing capability of the target translation model.
[0123] In one embodiment, if Figure 3 As shown, in step S10, a translation requirement is received, which specifically includes the following steps:
[0124] S11: Displaying a visual demand interface, which includes a text template. The text template includes multiple key fields. Any key field includes one or more options, and each option corresponds to a demand content.
[0125] The text translation device displays a visual demand interface through its own display screen or the display screen of the terminal device. The visual demand interface includes a text template, which includes multiple key fields. Any key field includes one or more options, and each option corresponds to a demand content. The user can select or enter different key fields according to their own needs according to the prompts of the text template.
[0126] Among them, multiple key fields include at least a text type selection field, a text content field, a display area field, a device model field, and a system version field. The text content field is used to select or enter a first text in a predefined first language (such as Chinese). The display area field includes a display position, which is used to indicate the screen and specific position where the first text needs to be displayed. The display area field also includes the maximum number of rows and column widths, which are used to indicate the maximum space that the first text can occupy in the display area. The device model field is used to indicate the device model (such as a vehicle model) to which the first text applies. The system version field is used to indicate the system version used by the device to which the first text applies.
[0127] S12: Determine the translation requirement according to the requirement content corresponding to the option selected by the user on the copy template.
[0128] The copy translation device determines the translation requirements according to the requirements corresponding to the options selected by the user on the copy template. That is, the copy translation device obtains different fields, such as the copy type selection field, the copy content field, the display area field, the device model field, and the system version field, according to the requirements corresponding to the options selected by the user on the copy template, splices these fields and generates translation requirements. The copy template can prompt the user to enter different data fields, such as the first copy of the specified page, the target translation language, and the display information. Input prompts and information input are performed through a concise and clear display visualization demand interface, so that users can easily fill in relevant information and send translation requests. In other embodiments, the copy translation device can also use form controls to collect the above-mentioned various field information, implement form verification to ensure that all required fields are correctly filled in, and for certain specific fields (such as the maximum number of rows, column width, etc.), the data format can also be verified.
[0129] In this embodiment, a visual demand interface is displayed, which includes a copy template. The copy template includes multiple key fields. Any key field includes one or more options. Each option corresponds to a demand content. The multiple key fields include at least a copy type selection field, a copy content field, a display area field, a device model field, and a system version field. The translation demand is determined based on the demand content corresponding to the option selected by the user on the copy template. A visual demand interface can be provided to the user. Information on copy translation demand is collected through the copy template to obtain translation demand with unified structural information. This is simple, intuitive, and easy to operate.
[0130] In one embodiment, the preset document library includes one or more document information, the document information includes the document and the display content of the document, the display content includes the translation result of the document in one or more languages corresponding to the document and the second display information; the prior knowledge also includes the display content of the second document; the one or more languages include the target translation language. Figure 4 As shown, in step S20, the prior knowledge corresponding to the first text is determined from the preset text library to obtain a prompt word template, which specifically includes the following steps:
[0131] S21: determining at least one target copy information related to the first copy from a preset copy library;
[0132] In this embodiment, the preset copy library includes one or more copy information, the copy information includes the copy and the display content of the copy, the display content includes the copy translation result and the second display information in one or more languages corresponding to the copy; the one or more languages include the target translation language. Among them, the prior knowledge includes the second copy and the display content of the second copy (including the first display information and the copy type). Among them, the display content can also include the copy type, and the second display information includes information such as the display position, the maximum number of rows and column widths, and whether the copy can be omitted. The copy information includes copy in different languages and the display content of each copy.
[0133] The process of obtaining the preset copy library is as follows: obtaining multiple copy information in the first language (such as Chinese) of all pages on the smart device, the copy information includes the copy and the display content of the copy, the display content includes the copy translation result and the second display information in one or more languages corresponding to the copy; multiple first copy data in different languages (including the first copy and display information); formatting and standardizing multiple copy information to ensure the consistency of the data set, encoding multiple copy information in accordance with the lightweight data format JSON (Java Script Object Notation) to obtain encoding vectors of multiple copy information, and then binding the copy information with its encoding vector and storing it in a specified database to obtain the preset copy library. Among them, a non-relational No SQL (No Structured Query Language) database or a relational database (using JSON field type) system can be selected to store and manage these JSON data.
[0134] The copy translation device determines at least one target copy information related to the first copy from a preset copy library, the target copy information including the second copy and the display content of the second copy, wherein the target copy information is copy information that matches the first copy and the first display information and has a confidence level greater than or equal to a preset confidence level.
[0135] That is, the first copy and the display content of the first copy are matched with multiple copy information in a preset copy library, and the copy information that matches the first copy and the first display information and has a confidence level greater than or equal to a preset confidence level is used as the target copy information to obtain at least one target copy information.
[0136] Among them, the similarity between the first copy and the display content of the first copy and multiple copy information can be determined, and the copy information with a similarity greater than a first threshold can be determined to obtain multiple candidate copy information, and the confidence of the multiple candidate copy information can be determined, and the candidate copy information with a confidence greater than or equal to a preset confidence can be used as the target copy information to obtain at least one target copy information.
[0137] S22: Determine a prompt word template according to the first text, the target translation language, the text type, the first display information, and at least one target text information.
[0138] The text translation device determines a prompt word template according to the first text, the target translation language, the text type, the first display information, and at least one target text information. The prompt word template is obtained by taking the at least one target text information as prior knowledge and taking the first text, the target translation language, the text type, and the first display information as translation requirements.
[0139] In this embodiment, at least one target copy information related to the first copy is determined from a preset copy library, the target copy information includes the second copy and the display content of the second copy, and the target copy information is the copy information that matches the first copy and the first display information and has a confidence level greater than or equal to a preset confidence level; a prompt word template is determined based on the first copy, the target translation language, the copy type, the first display information, and at least one target copy information. By comprehensively considering factors such as the copy itself, the copy type, and the display information, the target copy information related to the first copy can be efficiently and accurately identified and matched, and at least one target copy information with the best match can be selected, and finally a prompt word template is formed, thereby improving the accuracy and diversity of the input information, improving the accuracy of the copy translation results, saving the time of manual translation and manual matching, and improving work efficiency.
[0140] In one embodiment, step S21, i.e. determining at least one target copy information related to the first copy from a preset copy library, specifically includes the following steps:
[0141] S211: performing vector matching on the first text and multiple text information in a preset text library to determine multiple matched candidate text information.
[0142] The text translation device performs vector matching on the first text and multiple text information in a preset text library to determine multiple matched candidate text information.
[0143] Specifically, the preset copy library includes multiple copy information and encoding vectors of each copy information; the copy translation device uses a first vectorization model to vectorize the first copy and the display content of the first copy to obtain a first encoding vector of the first copy; the first encoding vector of the first copy and the encoding vectors of each copy information are calculated to obtain the similarity of each copy information; the copy information is sorted in descending order according to the similarity, and the n copy information with the highest similarity ranking are selected as the multiple candidate copy information that are matched.
[0144] S212: performing vector matching on the plurality of candidate copy information and the first copy to determine a plurality of pending copy information matching the first copy.
[0145] The text translation device performs secondary vector matching on a plurality of candidate text information and a first text to determine a plurality of pending text information matching the first text.
[0146] Specifically, the copy translation device uses a second vectorization model to vectorize the first copy and the display content of the first copy to a second encoding vector of the display text, thereby obtaining a second encoding vector of the first copy; performs similarity calculation on the first encoding vector of the second copy and the encoding vector of each candidate copy information to obtain the similarity of each candidate copy information; sorts each candidate copy information in descending order according to the similarity, and selects k candidate copy information with the highest similarity as the matched multiple pending copy information.
[0147] The first vectorization model and the second vectorization model are vectorization models of different types. For example, the first vectorization model may be an embedded vectorization model, and the second vectorization model may be a hash vectorization model.
[0148] S213: Determine at least one target copy information from the plurality of pending copy information according to the confidence levels of the plurality of pending copy information.
[0149] The text translation device determines the confidence of multiple pending text information according to multiple candidate text data, and uses the pending text information with a confidence greater than a preset confidence among the multiple pending text information as the target text information, thereby obtaining at least one target text information.
[0150] In this embodiment, vector matching is performed on the first copy and multiple copy information in the preset copy library to determine multiple candidate copy information that are matched; vector matching is performed on multiple candidate copy information and the first copy to determine multiple pending copy information that matches the first copy; and at least one target copy information is determined from the multiple pending copy information according to the confidence of the multiple pending copy information. Through two vector matchings, the interference of irrelevant data can be reduced, possible noise and mismatch items can be effectively filtered, and the data relevance can be enhanced by layer-by-layer screening and confidence filtering, thereby improving the reliability and accuracy of the matching results.
[0151] In one embodiment, the translation requirements include multiple target translation languages. Figure 5 As shown, in step S40, that is, displaying a visual preview interface according to the text translation result and the first display information of the first text on the target display screen, specifically includes the following steps:
[0152] S41: Displaying multiple text translation results in different target translation languages in a preview manner.
[0153] After obtaining the text translation result in the target translation language corresponding to the first text, the text translation device displays multiple text translation results in different target translation languages in a preview manner.
[0154] S42: Outputting a text selection prompt, where the text selection prompt is used to prompt the user to select a text translation result from multiple text translation results for display.
[0155] The text translation device outputs a text selection prompt, wherein the text selection prompt is used to prompt the user to select a text translation result from multiple text translation results to adapt the display of the target display screen.
[0156] For example, the copy translation device sends multiple copy translation results in different target translation languages to a terminal device or a display screen of the copy translation device, displays the multiple copy translation results in different target translation languages in preview mode through the display screen, and outputs a text selection prompt through the display screen to prompt the user to select a copy translation result from the multiple copy translation results to adapt the display of the target display screen.
[0157] S43: Receive a text selection instruction.
[0158] S44: In response to the text selection instruction, according to the text translation result and the first display information, the text translation result selected by the text selection instruction is displayed on the visual preview interface.
[0159] The text translation device receives a text selection instruction, and in response to the text selection instruction, displays the text translation result selected by the text selection instruction on a visual preview interface according to the text translation result selected in the text selection instruction and the first display information.
[0160] In this embodiment, multiple text translation results in different target translation languages are displayed in preview mode; a text selection prompt is output, and the text selection prompt is used to prompt the user to select a text translation result from multiple text translation results for display; a text selection instruction is received, and in response to the text selection instruction, the text translation result selected by the text selection instruction is displayed on the visual preview interface according to the text translation result and the first display information. The first text is converted into multiple text translation results in different target translation languages for the user to choose, so that the user can independently choose the translation version that best meets the expectations, and the multi-language support and multi-version selection of the translated text can adapt to different language environments and user needs.
[0161] In one embodiment, the translation requirements include multiple target translation languages, and the adjustment instructions include editing instructions. Figure 6 As shown, in step S50, that is, when an adjustment instruction triggered by the user on the visual preview interface is detected, the text translation result is updated in response to the adjustment instruction, which specifically includes the following steps:
[0162] S51: Detecting that an editing instruction for a text translation result in a first target translation language among text translation results in multiple target translation languages is triggered by a user.
[0163] In this embodiment, the first target translation language is a target translation language selected from a plurality of target translation languages for display on the target display screen. The translation requirements include a plurality of target translation languages, and the adjustment instructions include editing instructions. The visual preview interface includes the first text displayed in parallel and the text translation results of one or more target translation languages corresponding to the first text.
[0164] The text translation device can also display a visual preview interface based on the text translation results of multiple target translation languages and the first display information. That is, the visual preview interface is used to display the display effect of the text translation results of the first target translation language on the target display screen, as well as the text translation results of multiple target translation languages.
[0165] Among them, the visual preview interface includes a display effect area and an editable area. The editable area is used to display the first copy, and the copy translation results of one or more target translation languages corresponding to the first copy. The user can edit the vocabulary of the first copy and the copy translation results of multiple target translation languages in the editable area. The display effect area is used to display the display effect of the copy translation results of the first target translation language on the target display screen; wherein the translation requirements may include multiple target display screens, and the display effect area is used to display the display effect of the copy translation results of the first target translation language on different target display screens at different locations.
[0166] For example, the first copy is a copy in Chinese. The translation requirements may include a first target display screen (such as the central control screen of the vehicle) and a second target display screen (such as the dashboard of the vehicle); the multiple target translation languages in the translation requirements include English and German, among which the first target translation language may be English. Figure 7 As shown, the display effect area of the visual preview interface displays the display effect of the English translation result of the first text on the first target display screen, and displays the display effect of the English translation result of the first text on the second target display screen; the editable area of the visual preview interface displays the first text in Chinese, the English translation result of the first text, and the German translation result of the first text in parallel. The user can edit the vocabulary in the English translation result of the first text in the editable area according to the display effect of the English translation result in the display effect area on different target display screens, such as deleting, modifying, and inserting one or more vocabulary.
[0167] The text translation device detects the editing instruction (i.e., editing operation) of the user in the editable area to detect the editing instruction triggered by the user for the text translation result of the first target translation language among the text translation results of the multiple target translation languages. The editing instruction instructs to edit the first word in the text translation result of the first target translation language.
[0168] S52: In response to the editing instruction, modify the first vocabulary, and simultaneously modify the second vocabulary in the text translation results in other target translation languages among the text translation results in the plurality of target translation languages.
[0169] The text translation device responds to the editing instruction, modifies the first vocabulary, and simultaneously modifies the second vocabulary in the text translation results of other target translation languages in the text translation results of multiple target translation languages, wherein the second vocabulary is the content corresponding to the first vocabulary in the text translation results of other target translation languages.
[0170] The display effect area and the editable area are interrelated; if the user edits the editable area, the text translation device will respond to the user's adjustment of the translation text and synchronously adjust and update the text translation results of the first text or the target translation language in the first display adjustment area, and the text translation device will synchronously adjust and update the text translation results of other target translation languages, as well as the text translation results in the display effect area. The user's modification of the text translation results can be propagated to all relevant areas in real time, which is convenient for verifying the degree of match between the translation content and the original text semantics, ensuring the accuracy and coherence of the translation results, and eliminating the tedious operation of manual synchronization, greatly improving the adjustment efficiency.
[0171] In this embodiment, an editing instruction for the text translation result of the first target translation language among the text translation results of multiple target translation languages is detected, and the editing instruction indicates to edit the first word in the text translation result of the first target translation language; in response to the editing instruction, the first word is modified, and the second word in the text translation results of other target translation languages among the text translation results of multiple target translation languages is modified synchronously, and the second word is the content corresponding to the first word in the text translation results of other target translation languages. This solution provides real-time preview and adjustment functions, and improves the operation efficiency through the integration of real-time preview and interactive adjustment, and significantly improves the display effect, adaptation ability and interaction efficiency of the text translation results.
[0172] In one embodiment, after step S40, that is, after displaying the visual preview interface according to the text translation result and the first display information, the method further includes the following steps:
[0173] S501: When an adjustment instruction triggered by a user on a visual preview interface is detected, a target text translation content corresponding to a first text is stored in a preset text library.
[0174] After displaying the visual preview interface according to the text translation result and the first display information, the text translation device stores the target text translation content corresponding to the first text in the preset text library when detecting the adjustment instruction triggered by the user on the visual preview interface. The target text translation content includes the updated text translation result corresponding to the first text and / or the updated display position of the text translation result corresponding to the first text on the target display screen.
[0175] That is, when the adjustment instruction triggered by the user on the visual preview interface is detected, the text translation device responds to the adjustment instruction, updates the text translation result, and / or updates the display position of the text translation result on the target display screen, and obtains the target text translation content corresponding to the first text. Afterwards, if the user's storage instruction is received, the first text, the updated text translation result corresponding to the first text, and / or the updated display position of the text translation result corresponding to the first text on the target display screen (which may be the updated display position) are merged to obtain a text information, and the text information is vectorized to obtain the encoding vector of the text information, and then the text information and the encoding vector of the text information are stored in the preset text library for subsequent call.
[0176] S502: When no adjustment instruction is detected, the text translation result corresponding to the first text and / or the display position of the text translation result corresponding to the first text on the target display screen are stored in a preset text library.
[0177] If no adjustment instruction is detected, it means that the user does not need to adjust the text translation result. If a storage instruction is received from the user, the first text, the text translation result of the first text corresponding to the target translation language, and / or the display position of the text translation result corresponding to the first text on the target display screen are merged to obtain a text information, and the text information is vectorized to obtain the encoding vector of the text information, and then the text information and the encoding vector of the text information are stored in a preset text library for subsequent calls.
[0178] The text translation device marks each text information with a unique text identification code, and stores the text information, the text identification code of the text information and the encoding vector in a preset text library for easy subsequent calling.
[0179] In this embodiment, when an adjustment instruction triggered by the user on the visual preview interface is detected, the target text translation content corresponding to the first text is stored in a preset text library, and the target text translation content includes the updated text translation result corresponding to the first text, and / or the updated display position of the text translation result corresponding to the first text on the target display screen; when no adjustment instruction is detected, the text translation result corresponding to the first text, and / or the display position of the text translation result corresponding to the first text on the target display screen is stored in the preset text library. This solution achieves persistent storage and consistency management of the translation content by storing the first text, the text translation result, and its updated display position on the target display screen in the preset text library, significantly improving the reliability and expansion capabilities of the system, and is suitable for complex scenarios of multilingual content production and management.
[0180] Among them, in the process of the above-mentioned copywriting information to the preset copywriting library, all data can be uniformly converted into binary byte data in a binary serialization manner and stored in the preset copywriting library. At the same time, in the process of storing the above-mentioned copywriting information in the preset copywriting library, a compiler can also be used to convert each copywriting information into a serialized code, and store it in the code warehouse, and provide a calling interface for the copywriting information, so that the subsequent copywriting translation device can publish the copywriting information when receiving the user's publishing request, that is, copywriting publishing.
[0181] In one embodiment, Figure 8 As shown, the copy translation device displays a visual demand interface, which includes a copy template. The user selects and / or inputs key fields in the copy template to determine the translation request of the copy; the copy translation device determines the prior knowledge corresponding to the first copy from the preset copy library in response to the translation demand to obtain a prompt word template, inputs the prompt word template to call the target translation model for copy translation, and obtains the copy translation result of the target translation language corresponding to the first copy; then, according to the copy translation result and the first display information, a visual preview interface is displayed to preview and adjust the copy translation result, and the adjusted first copy and the copy translation result (and / or the display position of the copy translation result on the target display screen) are converted into serialized code and stored; finally, the copy information is published when a publishing request from the user is received.
[0182] In a specific embodiment, Fig. 9 As shown, the copy translation device pre-acquires an initial large language model and a data set related to the smart device (such as a data set of vehicle-related data), and based on the data set, adopts a target fine-tuning method to fine-tune the initial large language model to obtain and store the target translation model; the copy translation device pre-acquires multiple copies of different pages in the smart device, the translation results and display information of each copy, obtains multiple copy information and summarizes them into a copy information data set, vectorizes multiple copy information in the copy information data set, obtains encoding vectors of multiple copy information, and stores the multiple copy information and its encoding vectors in a preset copy library.
[0183] In practical applications, such as Fig. 9As shown, the text translation device displays a visual demand interface, which includes a text template. The user selects and / or inputs key fields in the text template to determine the text translation request; the text translation device vectorizes the first text, the text type and its display information in the translation request to obtain the encoding vector of the first text, and performs similarity matching on the encoding vector of the first text with the encoding vectors of multiple text information in the preset text library, and performs confidence filtering on the matched text information to obtain a target text information related to the first text. The target text information and the translation request are combined into a prompt word template, and the prompt word template is input into the target translation model for text translation to obtain the text translation result of the target translation language corresponding to the first text. Then, the copy translation device displays a visual preview interface based on the copy translation result and the first display information to preview and adjust the copy translation result, and converts all data of the adjusted first copy, copy translation result (and / or the display position of the copy translation result on the target display screen) into binary byte data in a binary serialization manner, and stores it in the copy information data set for vectorization and storage in a preset copy library.
[0184] In one embodiment, the text translation device also provides the user with text retrieval and filtering verification functions. The method also includes the following steps:
[0185] S60: Displaying a visual search interface, which includes one or more search keywords.
[0186] The text translation device displays a visual search interface through its own display screen or the display screen of the terminal device. The visual search interface includes one or more search keywords, and the one or more search keywords include one or more of the following: text keywords, text type, device model (such as vehicle model), system version, and text identification code.
[0187] S70: According to the search keyword set by the user in the visual search interface, target copy information corresponding to the set search keyword is determined from a preset copy library.
[0188] The text translation device determines target text information corresponding to the set search keyword from a plurality of text information in a preset text library according to the search keyword set by the user in the visual search interface, wherein the preset text library includes at least the first text.
[0189] S80: Displaying target copy information, where the target copy information at least includes the target copy, the copy translation result corresponding to each target copy, and display information corresponding to the target copy.
[0190] The text translation device displays the target text information, which at least includes the target text, the text translation result corresponding to each target text, and the display information corresponding to the target text. The target text information may also include the text type, device model (such as vehicle model), system version, and text identification code. The text translation device provides the user with text retrieval and filtering verification functions, so that the user can quickly find a specific text for verification according to the text type, target vehicle model, system version, and other conditions.
[0191] In this embodiment, a visual search interface is displayed, and the visual search interface includes one or more search keywords, and the one or more search keywords include one or more of the following: document type, device model, system version; according to the search keyword set by the user in the visual search interface, the target document information corresponding to the set search keyword is determined from the preset document library; the preset document library includes at least the first document; the target document information is displayed, and the target document information includes at least the target document, the document translation result corresponding to each target document, and the display information corresponding to the target document. This solution provides users with document retrieval and filtering verification functions, allowing users to quickly find specific documents for verification according to conditions such as document type, vehicle model, system version, etc.
[0192] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0193] In one embodiment, a text translation device is provided, which corresponds one-to-one to the text translation method in the above embodiment. Fig.10 As shown, the text translation device includes a receiving module 101, a response module 102, an input module 103 and a display module 104. The functional modules are described in detail as follows:
[0194] The receiving module 101 is used to receive a translation requirement, where the translation requirement includes a first document, a target translation language, a document type, and first display information of the first document on a target display screen;
[0195] A response module 102 is used to determine, in response to the translation requirement, the prior knowledge corresponding to the first text from the preset text library to obtain a prompt word template, wherein the prompt word template includes the prior knowledge and the translation requirement, and the prior knowledge includes at least a second text, and the second text is a text in the preset text library that matches the first text;
[0196] An input module 103, used for inputting the prompt word template into the target translation model to obtain a text translation result in the target translation language corresponding to the first text, wherein the text translation result is adapted to the first display information and the text type;
[0197] The display module 104 is used to display a visual preview interface according to the text translation result and the first display information, where the visual preview interface is used to show the display effect of the text translation result on the target display screen;
[0198] The response module 102 is also used to update the text translation result and / or update the display position of the text translation result on the target display screen in response to the adjustment instruction when an adjustment instruction of the user on the visual preview interface is detected, so as to obtain the target text translation content corresponding to the first text, and the display effect of the target text translation content is adapted to the target display screen.
[0199] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0200] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0201] The present application also provides a smart device, such as Fig.11 As shown, the intelligent device includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, wherein the processor implements the steps in any of the above-mentioned method embodiments when executing the computer program, or implements the functions of the modules / units in the above-mentioned device embodiments when executing the computer program.
[0202] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the smart device.
[0203] Those skilled in the art will understand that Fig.11 These are merely examples of the smart device and do not constitute a limitation of the smart device. The smart device may include more or fewer components than those shown in the figure, or a combination of certain components, or different components. For example, the smart device may also include input and output devices, network access devices, buses, etc.
[0204] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0205] The memory may be an internal storage unit of the smart device, such as a hard disk or memory of the smart device. The memory may also be an external storage device of the smart device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the smart device. Furthermore, the memory may include both an internal storage unit of the smart device and an external storage device.
[0206] An embodiment of the present application further provides a readable storage medium, wherein the readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0207] An embodiment of the present application provides a computer program product. When the computer program product is run on a smart device, the smart device can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0208] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0209] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0210] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0211] In the embodiments provided in the present application, it should be understood that the disclosed devices / equipment and methods can be implemented in other ways. For example, the device / equipment embodiments described above are merely schematic, for example, the division of the modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0212] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0213] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for translating a text, characterized in that: include: receiving a translation requirement, wherein the translation requirement includes a first text, a target translation language, a text type, and first display information of the first text on a target display screen; In response to the translation requirement, determining the prior knowledge corresponding to the first text from a preset text library to obtain a prompt word template, wherein the prompt word template includes the prior knowledge and the translation requirement, and the prior knowledge includes at least a second text, and the second text is a text in the preset text library that matches the first text; Inputting the prompt word template into the target translation model to obtain a text translation result in the target translation language corresponding to the first text, wherein the text translation result is adapted to the first display information and the text type; Displaying a visual preview interface according to the text translation result and the first display information, wherein the visual preview interface is used to show the display effect of the text translation result on the target display screen; When an adjustment instruction of the user to the visual preview interface is detected, the text translation result is updated in response to the adjustment instruction, and / or the display position of the text translation result on the target display screen is updated to obtain the target text translation content corresponding to the first text, and the display effect of the target text translation content is adapted to the target display screen.
2. The method for translating a text as claimed in claim 1, characterized in that: The preset document library includes one or more document information, the document information includes the document and the display content of the document, the display content includes: the document translation result in one or more languages corresponding to the document and the second display information; the prior knowledge also includes the display content of the second document, and the one or more languages include the target translation language; Determining the prior knowledge corresponding to the first text from the preset text library to obtain a prompt word template includes: Determining at least one target copy information related to the first copy from the preset copy library, wherein the target copy information includes the second copy and the display content of the second copy, and the target copy information is the copy information that matches the first copy and the first display information and has a confidence level greater than or equal to a preset confidence level; The prompt word template is determined according to the first text, the target translation language, the text type, the first display information, and a plurality of the target text information.
3. The method for translating a text as claimed in claim 2, characterized in that: The determining at least one target copy information related to the first copy from the preset copy library includes: Performing vector matching on the first copy and a plurality of copy information in the preset copy library to determine a plurality of matched candidate copy information; Performing vector matching on the plurality of candidate copy information and the first copy to determine a plurality of pending copy information matching the first copy; At least one target copy information is determined from the plurality of pending copy information according to the confidence levels of the plurality of pending copy information.
4. The method for translating a text as claimed in claim 1, characterized in that: The method further comprises: Acquire an initial large language model, where the initial large language model is used at least for text translation; Acquire a data set, wherein the data set at least includes one or more paragraphs of text data related to the smart device and a keyword of each paragraph of the text data; Determine a plurality of data sets according to the data set, wherein the plurality of data sets include a training set and a validation set; Selecting a target fine-tuning method and the training set to adjust the initial large language model; In the process of adjusting the initial large language model, the validation set is used to monitor and optimize the model performance to obtain an optimized model configuration; The target translation model is obtained by using the model optimization configuration as the configuration of the initial large language model.
5. The method according to claim 4, characterized in that The plurality of data sets also include a test set, and the step of obtaining the target translation model using the model optimization configuration as the configuration of the initial large language model includes: Using the test set to test the initial large language model using the model optimization configuration to evaluate the performance of the initial large language model using the model optimization configuration; When the performance meets the requirements, the initial large language model of the model optimization configuration is adopted as the target translation model.
6. The method for translating a text as claimed in any one of claims 1 to 5, characterized in that: The translation requirement includes a plurality of target translation languages, the adjustment instruction includes an editing instruction, and when the adjustment instruction triggered by the user on the visual preview interface is detected, updating the text translation result in response to the adjustment instruction includes: detecting that an editing instruction triggered by a user for a text translation result in a first target translation language among the text translation results in the plurality of target translation languages is obtained, wherein the editing instruction instructs editing a first word in the text translation result in the first target translation language; In response to the editing instruction, the first vocabulary is modified, and second vocabulary in the text translation results of other target translation languages among the multiple text translation results of the target translation languages is modified simultaneously, wherein the second vocabulary is the content in the text translation results of the other target translation languages corresponding to the first vocabulary.
7. The method for translating a text as claimed in any one of claims 1 to 5, characterized in that: The translation requirement includes a plurality of target translation languages, and the method further includes: Displaying a plurality of translation results of the text in different target translation languages in a preview manner; Outputting a text selection prompt, wherein the text selection prompt is used to prompt the user to select one of the multiple text translation results for display; Receive text selection instructions; The step of displaying a visual preview interface according to the text translation result and the first display information of the first text on the target display screen includes: In response to the text selection instruction, the text translation result selected by the text selection instruction is displayed on the visual preview interface according to the text translation result and the first display information.
8. The method for translating a text as claimed in any one of claims 1 to 5, characterized in that: The method further comprises: When an adjustment instruction triggered by the user on the visual preview interface is detected, the target text translation content corresponding to the first text is stored in the preset text library, wherein the target text translation content includes an updated text translation result corresponding to the first text and / or an updated display position of the text translation result corresponding to the first text on the target display screen; In the case where the adjustment instruction is not detected, the text translation result corresponding to the first text and / or the display position of the text translation result corresponding to the first text on the target display screen are stored in the preset text library.
9. The method for translating a text as claimed in any one of claims 1 to 5, characterized in that: The receiving translation requirements includes: Displaying a visual demand interface, wherein the visual demand interface includes a text template, wherein the text template includes multiple key fields, wherein any of the key fields includes one or more options, each of the options corresponds to a demand content, and the multiple key fields include at least a text type selection field, a text content field, a display area field, a device model field, and a system version field; The translation requirement is determined according to the requirement content corresponding to the option selected by the user on the copy template.
10. The method for translating a text according to any one of claims 1 to 5, characterized in that: The method further comprises: Displaying a visual search interface, wherein the visual search interface includes one or more search keywords, wherein the one or more search keywords include one or more of the following: document type, device model, system version; According to the search keyword set by the user in the visual search interface, determining the target copy information corresponding to the set search keyword from a preset copy library; the preset copy library at least includes the first copy; The target copy information is displayed; the target copy information at least includes the target copy, the copy translation result corresponding to each of the target copies, and the display information corresponding to the target copy.
11. An intelligent device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the text translation method according to any one of claims 1 to 10 are implemented.
12. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the text translation method according to any one of claims 1 to 10 are implemented.
13. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the text translation method according to any one of claims 1 to 10 are implemented.
Citation Information
Patent Citations
HMI configuration element translation method and device, electronic equipment and storage medium
CN114580440A
Data processing method and device, storage medium and electronic equipment
CN118567772A
Text conversion method and device based on large model, electronic equipment and storage medium
CN118734870A
KR20240053712A