Advertising translation method, apparatus, device, medium, and program product
By receiving translation requests, a visual preview interface is generated using a pre-set text library and target translation model. This allows users to adjust the translation results and display position in real time, solving the problem of incomplete display caused by different language lengths, improving the display effect and reducing tedious operations in the development process.
Patent Information
- Application Number
- CN202411904150.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2044-12-20
AI Technical Summary
Because languages vary in length, directly translated text may exceed the display area of the screen, resulting in incomplete display of information on function pages and poor display quality.
By receiving translation requests, utilizing a pre-set text library and target translation model, a visual preview interface is generated, allowing users to adjust the translation results and display position in real time to ensure that the translated content is adapted to the display screen.
It effectively alleviates the mismatch between text translation and display effects, reduces the possibility of translated text exceeding the display range, improves the display effect of functional pages, and reduces cumbersome operations and waste of human resources in the development process.
Smart Images

Figure CN119721059B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a method, apparatus, device, medium, and program product for text translation. Background Technology
[0002] With the continuous development of intelligent cockpit technology for electric vehicles, the number of functional pages provided by vehicle cockpits is also increasing. With the globalization of the automotive market, the language compatibility of various functional pages has become a major challenge in cockpit function development.
[0003] To ensure that the text on interactive pages is compatible with different languages, it needs to be translated into the corresponding languages and then displayed. Since different languages differ, the length of the same text may vary depending on the language it is translated into. However, the screen size for displaying text in the same language on the same device is usually the same. Therefore, if the translated text is directly displayed on the screen, it may exceed the original text's display area, resulting in incomplete information display and poor visual quality. Summary of the Invention
[0004] This invention provides a text translation method, apparatus, device, medium, and program product to solve the problem in related technologies that the translated text may exceed the display range of the original text, resulting in incomplete display of information on functional pages and poor display effects.
[0005] In a first aspect, embodiments of this application provide a document translation method, including:
[0006] Receive translation requests, which include the first text, the target translation language, the text type, and the first display information of the first text on the target display screen;
[0007] In response to translation needs, the prior knowledge corresponding to the first copy is determined from the preset copy library to obtain the prompt word template. The prompt word template includes the prior knowledge and the translation needs. The prior knowledge includes at least the second copy, which is the copy in the preset copy library that matches the first copy.
[0008] Inputting the prompt word template into the target translation model yields the text translation result in the target language corresponding to the first text. The text translation result is adapted to the first displayed information and text type.
[0009] Based on the translation results and the first display information, a visual preview interface is displayed. The visual preview interface is used to show the display effect of the translation results on the target display screen.
[0010] Upon detecting a user's adjustment instruction to 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, 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 copywriting library includes one or more copywriting information, which includes copywriting and the display content of the copywriting. The display content includes: the copywriting translation results in one or more languages corresponding to the copywriting and the second display information; the prior knowledge also includes the display content of the second copywriting, 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 the prompt word template, including:
[0013] Determine at least one target text information related to the first text from the preset text library. The target text information includes the display content of the second text and the second text. The target text information is text information that matches the first text and the first display information and has a confidence level greater than or equal to the preset confidence level.
[0014] Determine the prompt word template based on the first text, the target translation language, the text type, the first display information, and at least one target text information.
[0015] Optionally, at least one target copy information related to the first copy is determined from a preset copy library, including:
[0016] Perform vector matching between the first copy and multiple copy information in the preset copy library to determine multiple candidate copy information that have been matched;
[0017] Vector matching is performed between multiple candidate copy information and the first copy to determine multiple undetermined copy information that match the first copy;
[0018] Based on the confidence level of multiple pending copy information, at least one target copy information is determined from the multiple pending copy information.
[0019] Optionally, the method further includes;
[0020] Obtain an initial large language model, which will be used at least for copywriting translation.
[0021] Obtain a dataset that includes at least one or more pieces of text data related to smart devices, as well as keywords for each piece of text data.
[0022] Based on the dataset, multiple datasets are determined, including a training set and a validation set.
[0023] Select a target fine-tuning method and training set to adjust the initial large language model;
[0024] During the adjustment of the initial large language model, the model performance is monitored and optimized using the validation set to obtain the optimized model configuration;
[0025] The target translation model is obtained by using the optimized configuration of the model as the initial configuration of the large language model.
[0026] Optionally, the multiple datasets also include a test set, which is used as the initial configuration for the large language model to obtain the target translation model, including:
[0027] The initial large language model with model optimization configuration was tested using a test set to evaluate its performance.
[0028] If the performance meets the requirements, the initial large language model with optimized configuration will be used as the target translation model.
[0029] Optionally, the translation requirements include multiple target languages, and the adjustment instructions include editing instructions. Upon detecting an adjustment instruction triggered by the user on the visual preview interface, the translation results are updated in response to the adjustment instruction, including:
[0030] The system detects an editing instruction triggered by a user for the translation results in the first target language among multiple target translation languages. The editing instruction instructs the user to edit the first word in the translation results in the first target language.
[0031] In response to the editing command, the first word is modified, and the second word in the translation results of other target languages is modified simultaneously. The second word is the content in the translation results of other target languages that corresponds to the first word.
[0032] Optionally, the visual preview interface includes a first copy displayed side-by-side, along with the translation results of the first copy in one or more target translation languages.
[0033] Optionally, the translation requirements may include multiple target languages, and the methods may also include:
[0034] Displays multiple translation results for different target languages in preview mode;
[0035] Output text selection prompts, which are used to prompt users to select one translation result from multiple translation results for display;
[0036] Receive text selection instructions;
[0037] The process includes displaying a visual preview interface based on the translation results and the initial display information of the first copy on the target screen, including:
[0038] In response to the text selection command, the translation result of the text selected by the text selection command is displayed on the visual preview interface based on the text translation result and the first display information.
[0039] Optionally, the method further includes:
[0040] Upon detecting an adjustment command triggered by the user on the visual preview interface, the target text translation content corresponding to the first text is stored in the preset text library. 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.
[0041] If no adjustment instruction is detected, the translation result of the first copy and / or the display position of the translation result of the first copy on the target display screen are stored in the preset copy library.
[0042] Optionally, receive translation requests, including:
[0043] The visual requirements interface is displayed. The visual requirements interface includes a copy template. The copy template includes multiple key fields. Each key field includes one or more options. Each option corresponds to a requirement 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.
[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. The display area field includes the maximum number of rows and column width, which are used to indicate the maximum space that the first text can occupy within 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] The translation requirements are determined based on the options selected by the user on the copy template.
[0046] Optionally, the method further includes:
[0047] Display a visual search interface, which includes one or more search keywords. The one or more search keywords include one or more of the following: text type, device model, system version;
[0048] Based on the search keywords set by the user in the visual search interface, the target copy information corresponding to the set search keywords is determined from the preset copy library; the preset copy library includes at least the first copy.
[0049] Display target text information, which includes at least the target text, the translation results for each target text, and the display information for the target text.
[0050] Secondly, embodiments of this application provide a document translation device, including:
[0051] The receiving module is used to receive translation requests, which include a first text, the target translation language, the text type, and the first display information of the first text on the target display screen.
[0052] The response module is used to respond to translation needs by determining the prior knowledge corresponding to the first copy from the preset copy library to obtain the prompt word template. The prompt word template includes the prior knowledge and the translation needs. The prior knowledge includes at least the second copy, which is the copy in the preset copy library that matches the first copy.
[0053] The input module is used to input the prompt word template into the target translation model to obtain the text translation result of the target translation language corresponding to the first text. The text translation result is adapted to the first display information and text type.
[0054] The display module is used to display a visual preview interface based on the translation results and the first display information. The visual preview interface is used to show the display effect of the translation results 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 user's adjustment instruction on the visual preview interface, 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] Thirdly, embodiments of this application provide a smart device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described text translation method.
[0057] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described document translation method.
[0058] Fifthly, embodiments of this application provide a computer program product, which includes a computer program that, when executed by a processor, enables the implementation of the above-described document translation method.
[0059] In one solution provided by the aforementioned copywriting translation method, apparatus, device, medium, and program products, a translation request is received, which includes a first copy, a target translation language, a copy type, and first display information of the first copy on a target display screen. In response to the translation request, prior knowledge corresponding to the first copy is determined from a preset copy library to obtain a prompt word template. The prompt word template includes prior knowledge and the translation request, and the prior knowledge includes at least a second copy, which is a copy in the preset copy library that matches the first copy. The prompt word template is input into a target translation model to obtain a copywriting translation result in the target translation language corresponding to the first copy. The copywriting translation result is adapted to the first display information and the copy type. Based on the copywriting translation result and the first display information, a visual preview interface is displayed to show the display effect of the copywriting translation result on the target display screen. Upon detecting a user's adjustment instruction to the visual preview interface, in response to the adjustment instruction, the copywriting translation result is updated, and / or the display position of the copywriting translation result on the target display screen is updated to obtain the target copywriting translation content corresponding to the first copy. The display effect of the target copywriting translation content is adapted to the target display screen. In this embodiment, the display effect of the translation result can be automatically adjusted based on prior knowledge, text type, and display information. Through a visual preview interface, users can view and adjust the translation result in real time to ensure that the final display effect meets user needs. The intelligent mechanism for adjusting and adapting the translation and display effect effectively alleviates the mismatch between the translation and display effect, reduces the possibility of the translated text exceeding the original text display range, reduces the incomplete display of page information, and improves the display effect of functional pages. Attached Figure Description
[0060] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0061] Figure 1 This is a schematic diagram of the structure of a text translation system according to one embodiment of the present invention;
[0062] Figure 2 This is a flowchart illustrating a text translation method according to one embodiment of the present invention;
[0063] Figure 3 yes Figure 2 A schematic diagram of the implementation process of step S10;
[0064] Figure 4 yes Figure 2 A schematic diagram of the 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 This is a schematic diagram of a visual preview interface in one embodiment of the present invention;
[0068] Figure 8 This is a schematic diagram illustrating an implementation process of a text translation method according to an embodiment of the present invention;
[0069] Figure 9 This is a schematic diagram illustrating another implementation process of the text translation method in one embodiment of the present invention;
[0070] Figure 10 yes Figure 1 A schematic diagram of the Chinese translation device;
[0071] Figure 11 This is a schematic diagram of the structure of a smart device according to an embodiment of the present invention. Detailed Implementation
[0072] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0073] It should be understood that, when used in this 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 collections thereof. It should also be understood that, as used in this specification and the appended claims, the term "and / or" refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0074] Furthermore, in the description of this invention and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0075] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of the invention include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0076] It should be understood that the sequence number of each step in the following embodiments does not imply 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 embodiments of the present invention.
[0077] To illustrate the technical solution of the present invention, specific embodiments are described below.
[0078] It's important to understand that to ensure the text on interactive pages is compatible with different languages, it needs to be translated into the corresponding language and displayed. However, due to the varying lengths of different spoken texts, directly displaying the translated text on the interactive page may cause it to exceed the original text's display area, resulting in incomplete information and poor display quality. Furthermore, to address this issue, manufacturers typically adjust the text display on interactive pages during the product development phase. For example, they might pre-generate translated text in different languages and fill the text areas on the interactive page with the translated text. However, even in this process, due to differences in spoken text length and screen sizes, translated text may still exceed the original text's display area. Developers then need to readjust the text translation and modify the page display scheme. This process may need to be repeated until all text in different languages is compatible with the interactive pages on various screens. The entire process is cumbersome, resulting in a significant waste of human resources and low efficiency.
[0079] To address the aforementioned problems, the document translation method provided in this embodiment of the invention can be applied to, for example... Figure 1The document translation system shown includes a terminal device and a document translation apparatus, wherein the terminal device communicates with the document translation apparatus via a network. In other embodiments, the document translation system may include a document translation apparatus, which may include a control device and a display interface, with the control device communicating with the display screen via a cable.
[0080] In the case of a text translation task with functional pages, the user can input relevant information and send a translation request through a terminal device (or the display screen of a text translation device). This translation request includes translation requirements such as a first text, a target translation language, a text type, and the first display information of the first text on the target display screen. The text translation device (or control device) receives the translation request and, in response to the translation request and translation requirements, determines the prior knowledge corresponding to the first text 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, which is a text in the preset text library that matches the first text. The text translation device (or control device) inputs the prompt word template into the target translation model to obtain the text translation result in the target translation language corresponding to the first text. The text translation result is adapted to the first display information and text type. Based on the text translation result and the first display information, a visual preview interface is displayed, which is used to demonstrate the display effect of the text translation result on the target display screen. Upon detecting a user's adjustment instruction to the visual preview interface, the text translation device (or control device) responds to the adjustment instruction by updating the text translation result and / or updating the display position of the text translation result on the target display screen, thereby obtaining 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 translated text can be automatically adjusted based on prior knowledge, text type, and display information. A visual preview interface allows users to view and adjust the translation results in real time, ensuring the final display effect meets user needs. This intelligent mechanism for adjusting and adapting the translated text to the display effect effectively alleviates mismatches between the two, reduces the possibility of translated text exceeding the original text display range, minimizes incomplete page information display, and improves the display effect of functional pages. Furthermore, this solution eliminates the need for multiple translations and modifications to the page display scheme, reducing tedious operations in the functional page development process, minimizing wasted human resources, and improving the efficiency of functional page development.
[0082] The terminal devices include, but are not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The document translation device can be a server, which can be implemented using a standalone server or a server cluster consisting of multiple servers. In other embodiments, the document translation device can also be a smart device. For example, a smart device can be various personal computers, laptops, smartphones, tablets, etc.
[0083] The smart device in this embodiment can also be a vehicle. The vehicle includes a smart cockpit system, and the text translation method provided in this embodiment can also be implemented by the smart cockpit system. The smart cockpit system can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0084] The intelligent cockpit system can be a complete system comprising a central control platform, a full LCD instrument panel, a central control display, an entertainment system, a smart speaker, as well as a vehicle networking module, a streaming media rearview mirror, and a remote information processing system. Centered on the driver's cockpit area controller, the intelligent cockpit system implements the aforementioned functions on a unified hardware and software platform, integrating intelligent interaction, intelligent scenarios, and personalized services. The intelligent cockpit system forms the foundation for human-vehicle interaction and vehicle-to-external connectivity. The usage scenarios of the intelligent cockpit system typically cover all scenarios in which users use the vehicle. Specifically, user usage scenarios can include the time before, during, and after vehicle use. User usage scenarios can also include spatial scenarios involving the driver, front passenger, rear passengers, and relevant people or objects outside the vehicle. Compared to past command-based interactions, the human-machine interaction of the intelligent cockpit system can combine vehicle and user usage scenarios, based on image recognition, voice recognition, and environmental perception, to achieve more intelligent effects that better meet user needs. In other words, a smart cockpit system refers to a vehicle electronic system equipped with intelligent and connected in-vehicle devices and services, such as in-vehicle infotainment systems, instrument panels, head-up displays (HUDs), streaming rearview mirrors, and voice interaction systems.
[0085] In one embodiment, such as Figure 2 As shown, a copywriting translation method is provided, which can be... Figure 1 The text translation can be performed by a physical translation device or a smart device. This method can be applied to... Figure 1 Taking a text translation device as an example, the following steps are included:
[0086] S10: Receive translation request, which includes the first text, the target translation language, the text type, and the first display information of the first text on the target display screen.
[0087] In the case of a text translation task with a functional page, the user can input relevant information and send a translation request through the terminal device (or the display interface of the text translation device). The translation request includes the translation requirements, including the first text, the target translation language, the text type, and the first display information of the first text on the target display screen.
[0088] The first text type includes menus, warnings, prompts, and informational descriptions. The target display screen can be the vehicle's central control screen or instrument panel screen. The first display information indicates relevant information restricting the display area, display space, and display method of the first text. The first display information includes the display location (indicating the screen and specific location where the first text needs to be displayed), the maximum number of rows and column widths (indicating the maximum space the first text can occupy within the display area), and whether the text can be omitted (whether certain information can be omitted without affecting understanding to accommodate space constraints). Translation requirements may also include the device model of the device to which the first text is applicable and the system version used by the device.
[0089] S20: In response to translation needs, determine the prior knowledge corresponding to the first copy from the preset copy library to obtain the prompt word template.
[0090] Upon receiving a translation request, the text translation device responds to the request and the translation requirements by determining the prior knowledge corresponding to the first text from a pre-set 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, which is a text from the pre-set text library that matches the first text.
[0091] S30: Input the prompt word template into the target translation model to obtain the copy translation result in the target language corresponding to the first copy.
[0092] The text translation device inputs prompt word templates into the target translation model to obtain a text translation result in the target language corresponding to the first text. The text translation result is adapted to the first displayed information and text type. The target translation model is a pre-trained large language model. This target translation model can be obtained by fine-tuning and training the large language model based on relevant data from smart devices (such as vehicles).
[0093] The text translation device inputs a prompt word template, which includes prior knowledge and translation requirements, into the target translation model. The target translation model then converts the first text into translated text in the target language based on the prior knowledge and translation requirements, thus obtaining the text translation result in the target language corresponding to the first text.
[0094] The first text is in Chinese, and the target translation languages include English and German. There are multiple translation texts for different target translation languages, including at least one translation text for English and at least one translation text for German.
[0095] S40: Display a visual preview interface based on the translation results and the first displayed information.
[0096] The text translation device displays a visual preview interface based on the text translation result and the initial display information. This visual preview interface demonstrates how the text translation result will appear on the target display screen.
[0097] The text translation device generates a visual preview interface adapted to the target display screen based on the text type of the first text, the target display screen, and the text translation result. This visual preview interface displays the text translation result at the display location of the first text. The translation request may include multiple target display screens, and the visual preview interface is used to demonstrate how the text translation result is displayed on different target display screens.
[0098] Users can input adjustment commands through the visual preview interface. These commands instruct modifications to the translated text, such as adjusting content, font size, and layout to address errors, inaccuracies, or excessive length. The commands can also specify the text's position on the target screen, allowing for personalized optimization to ensure the text displays according to actual needs and user preferences. The visual preview interface intuitively displays the translation's appearance on the page, enabling users to quickly identify and adjust issues, significantly shortening the feedback cycle of the optimization process.
[0099] S50: Upon detecting a user's adjustment instruction for the visual preview interface, in response to the adjustment instruction, update the copy translation result and / or update the display position of the copy translation result on the target display screen to obtain the target copy translation content corresponding to the first copy.
[0100] Upon detecting a user's adjustment instruction to the visual preview interface, the text translation device responds to the instruction by updating the text translation result and / or updating the display position of the text translation result on the target display screen, thereby obtaining 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 translated text can be automatically adjusted based on prior knowledge, text type, and display information. A visual preview interface allows users to view and adjust the translation results in real time, ensuring the final display effect meets user needs. This intelligent mechanism for adjusting and adapting the translated text to the display effect effectively alleviates mismatches between the two, reduces the possibility of translated text exceeding the original text display range, minimizes incomplete page information display, and improves the display effect of functional pages. Furthermore, this solution eliminates the need for multiple translations and modifications to the page display scheme, reducing tedious operations in the functional page development process, minimizing wasted human resources, and improving the efficiency of functional page development.
[0102] In one embodiment, before step S30, i.e., before inputting the prompt word template into the target translation model, the target translation model needs to be obtained first. The target translation model is trained in the following manner:
[0103] S01: Obtain the initial large language model.
[0104] S02: Obtain the dataset.
[0105] First, the text translation device can acquire an initial large language model. This initial large language model is used at least for text translation. Simultaneously, the text translation device acquires a dataset comprising multiple data samples, each containing at least one or more segments of text data relevant to the smart device, along with keywords for each segment.
[0106] For example, a text translation device acquires data related to smart devices (such as vehicles) to obtain multiple initial data sets for smart devices; it extracts keywords from each initial data set and combines the initial data and its keywords into JSON format data as a key-value pair; it iterates through multiple initial data sets to obtain multiple key-value pair data sets; it then performs data cleaning on these key-value pair data sets, such as removing duplicates, handling missing values, standardizing the format of specific data (such as dates, numbers, etc.), and removing or correcting outliers, to ensure that the key-value pair data sets meet the format requirements for model training, resulting in multiple data samples and forming a dataset.
[0107] S03: Determine multiple datasets based on the dataset, including training and validation sets.
[0108] The text translation device determines multiple datasets based on the dataset, including a training set and a validation set. For example, it can directly divide multiple data samples in the dataset into a training set, a validation set (and a test set) according to a certain proportion.
[0109] S04: Select the target fine-tuning method and the training set to adjust the initial large language model.
[0110] The text translation device selects a target fine-tuning method and adjusts the initial large language model using the training set.
[0111] Among them, the text translation device determines the target fine-tuning method that matches its hardware performance, such as the low-rank adaptation (LoRA) fine-tuning method, the quantized low-rank adaptation (QLoRA) fine-tuning method, and the full model fine-tuning method. The target fine-tuning method is used to fine-tune the initial large language model using the training set.
[0112] S05: During the process of adjusting the initial large language model, the model performance is monitored and optimized using the validation set to obtain the optimized model configuration.
[0113] During the adjustment of 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 optimized model configuration.
[0114] S06: The target translation model is obtained by using the optimized configuration of the model as the initial configuration of the large language model.
[0115] Then, the text translation device uses the optimized model configuration as the initial configuration of the large language model to obtain the target translation model.
[0116] In this embodiment, an initial large language model is obtained, which is used at least for text translation. A dataset is obtained, which includes at least one or more pieces of text data related to smart devices and keywords for each piece of text data. Multiple datasets are determined based on the dataset, including a training set and a validation set. A target fine-tuning method and the training set are selected to adjust the initial large language model. During the adjustment of the initial large language model, the validation set is used to monitor and optimize the model performance to obtain an optimized model configuration. The optimized model configuration is used as the configuration of the initial large language model to obtain the target translation model. By fine-tuning and training the large language model using data related to smart devices, the pre-trained large language model's ability to process data from smart devices is improved, thereby increasing the accuracy of the output text translation results.
[0117] In one embodiment, the multiple datasets also include a test set; step S06, which uses the optimized model configuration as the initial configuration of the large language model to obtain the target translation model, specifically includes the following steps:
[0118] S061: Test the initial large language model with model optimization configuration using a test set to evaluate the performance of the initial large language model with model optimization configuration.
[0119] The text translation device uses a test set to test the initial large language model with optimized model configuration in order to evaluate the performance of the initial large language model with optimized model configuration. If the performance of the initial large language model does not meet the requirements, the device continues to fine-tune, validate, and test the model using the training set, validation set, and test set until the performance of the initial large language model meets the requirements.
[0120] S062: If the performance meets the requirements, the initial large language model with optimized configuration will be used as the target translation model.
[0121] If the performance meets the requirements, the text translation device will use the initial large language model with optimized model configuration as the target translation model.
[0122] In this embodiment, after obtaining the target translation model using the optimized model configuration as the initial large language model configuration, a test set is used to test the initial large language model with the optimized model configuration to evaluate its performance. If the performance meets the requirements, the initial large language model with the optimized model configuration is used as the target translation model. By testing the performance of the initial large language model with the optimized model configuration using the test set, and outputting the initial large language model with satisfactory performance as the improved target translation model, the data processing capability of the target translation model is improved.
[0123] In one embodiment, such as Figure 3 As shown, step S10, which involves receiving translation requests, specifically includes the following steps:
[0124] S11: Display the visual requirements interface, which includes a copy template. The copy template includes multiple key fields, and each key field includes one or more options. Each option corresponds to a requirement.
[0125] The text translation device displays a visual requirements interface on its own screen or the screen of a terminal device. This visual requirements interface includes a text template with multiple key fields. Each key field includes one or more options, each option corresponding to a specific requirement. Users can select or input different key fields according to their needs, following the prompts in the text template.
[0126] Several 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 the first text in a predefined first language (e.g., Chinese). The display area field includes the display position, indicating the screen and specific location where the first text should be displayed. The display area field also includes the maximum number of rows and column width, indicating the maximum space the first text can occupy within the display area. The device model field indicates the applicable device model (e.g., vehicle model). The system version field indicates the system version used by the device to which the first text is applicable.
[0127] S12: Determine the translation requirements based on the options selected by the user on the copy template.
[0128] The text translation device determines the translation requirements based on the options selected by the user on the text template. Specifically, it obtains different fields based on the user's choices, such as text type selection, text content, display area, device model, and system version. These fields are then concatenated to generate the translation requirements. The text template can prompt the user to input different data fields, such as the first text of the specified page, the target translation language, and display information. A clear and concise visual interface provides input prompts and information input, allowing users to easily fill in relevant information and send translation requests. In other embodiments, the text translation device can also use form controls to collect the aforementioned field information, implement form validation to ensure all required fields are filled correctly, and validate data format for certain specific fields (such as maximum number of rows, column width, etc.).
[0129] In this embodiment, a visual requirements interface is displayed, which includes a text template. The text template includes multiple key fields, each of which includes one or more options. Each option corresponds to a requirement. 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. Based on the requirement content corresponding to the option selected by the user on the text template, the translation requirements are determined. This provides the user with a visual requirements interface, allowing for the collection of text translation requirements information through the text template to obtain translation requirements with a unified structure. This method is simple, intuitive, and easy to operate.
[0130] In one embodiment, the preset text library includes one or more text information items. The text information includes texts and their display content. The display content includes translation results of the texts in one or more languages corresponding to the texts, and second display information. Prior knowledge also includes the display content of the second texts. The one or more languages include the target translation language. Figure 4 As shown, step S20, which involves determining the prior knowledge corresponding to the first copy from the preset copy library to obtain the prompt word template, specifically includes the following steps:
[0131] S21: Determine at least one target copy information related to the first copy from the preset copy library;
[0132] In this embodiment, the preset text library includes one or more text information items. The text information includes texts and their display content. The display content includes the translation results of the texts in one or more languages corresponding to the texts, and second display information; the one or more languages include the target translation language. Prior knowledge includes second texts and their display content (including first display information and text type). The display content may also include the text type, and the second display information includes display position, maximum number of rows and column width, and whether the text can be omitted. The text information includes texts in different languages and the display content of each text.
[0133] The process of acquiring the preset copywriting library is as follows: First, acquire multiple copywriting information in the first language (e.g., Chinese) of all pages on the smart device. This copywriting information includes the text itself and its displayed content. The displayed content includes the translation results of the text in one or more languages and second display information. Second, acquire multiple first-language copywriting data (including the first text and display information). Third, format and standardize the multiple copywriting information to ensure dataset consistency. This can be done by encoding the multiple copywriting information using the lightweight data format JSON (JavaScript Object Notation) to obtain encoding vectors for the multiple copywriting information. Then, bind the copywriting information to its encoding vectors and store them in a specified database to obtain the preset copywriting library. You can choose a non-relational NoSQL (No Structured Query Language) database or a relational database (using JSON field types) to store and manage this JSON data.
[0134] The copywriting translation device determines at least one target copywriting information related to the first copywriting from a preset copywriting library. The target copywriting information includes the second copywriting and the display content of the second copywriting. The target copywriting information is copywriting information that matches the first copywriting 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 its display content are matched with multiple copy information in the 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 the preset confidence level is used as the target copy information, so as to obtain at least one target copy information.
[0136] Specifically, the first copy and its display content can be determined, and their similarity with multiple copy information can be determined. Copy information with a similarity greater than a first threshold can be obtained, multiple candidate copy information can be obtained, the confidence level of multiple candidate copy information can be determined, and candidate copy information with a confidence level greater than or equal to a preset confidence level can be used as target copy information to obtain at least one target copy information.
[0137] S22: Determine the prompt word template based on the first copy, the target translation language, the copy type, the first display information, and at least one target copy information.
[0138] The text translation device determines a prompt word template based on a first text, a target translation language, a text type, and first display information, as well as at least one piece of target text information. Specifically, at least one piece of target text information is used as prior knowledge, and the first text, target translation language, text type, and first display information are used as translation requirements to obtain the prompt word template.
[0139] In this embodiment, at least one target text information related to the first text is determined from a preset text library. The target text information includes the display content of the second text and the second text. The target text information is text information that matches the first text and the first display information and has a confidence level greater than or equal to a preset confidence level. Based on the first text, the target translation language, the text type, the first display information, and at least one target text information, a prompt word template is determined. By comprehensively considering factors such as the text itself, the text type, and the display information, the target text information related to the first text can be efficiently and accurately identified and matched. The optimal matching target text information is selected, ultimately forming a prompt word template. This improves the accuracy and diversity of input information, enhances the accuracy of text translation results, saves time on manual translation and matching, and improves work efficiency.
[0140] In one embodiment, step S21, namely determining at least one target text information related to the first text from a preset text library, specifically includes the following steps:
[0141] S211: Perform vector matching between the first copy and multiple copy information in the preset copy library to determine multiple candidate copy information that have been matched.
[0142] The text translation device performs vector matching between the first text and multiple text information in the preset text library to determine multiple candidate text information that have been matched.
[0143] Specifically, the preset copywriting library includes multiple copywriting information and the encoding vector of each copywriting information; the copywriting translation device uses a first vectorization model to vectorize the first copywriting and the displayed content of the first copywriting to obtain the first encoding vector of the first copywriting; the first encoding vector of the first copywriting and the encoding vector of each copywriting information are used to calculate the similarity to obtain the similarity of each copywriting information; the copywriting information is sorted in descending order according to the similarity, and the n copywriting information with the highest similarity are selected as multiple candidate copywriting information for matching.
[0144] S212: Perform vector matching between multiple candidate copy information and the first copy to determine multiple pending copy information that match the first copy.
[0145] The text translation device performs secondary vector matching between multiple candidate text information and the first text to determine multiple pending text information that match the first text.
[0146] Specifically, the text translation device uses a second vectorization model to vectorize the first text and its displayed content into a second encoding vector of the displayed text, thus obtaining the second encoding vector of the first text; it calculates the similarity between the first encoding vector of the second text and the encoding vectors of each candidate text information, thus obtaining the similarity of each candidate text information; it sorts each candidate text information in descending order according to the similarity, and selects the k candidate text information with the highest similarity ranking as multiple undetermined text information that have been matched.
[0147] Among them, the first vectorization model and the second vectorization model are vectorization models of different types. For example, the first vectorization model can be embedded in a vectorization model, and the second vectorization model can be a hash vectorization model.
[0148] S213: Based on the confidence level of multiple pending copy information, determine at least one target copy information from multiple pending copy information.
[0149] The text translation device determines the confidence level of multiple pending text information based on multiple candidate text data, and takes the pending text information with a confidence level greater than the preset confidence level as the target text information, thus obtaining at least one target text information.
[0150] In this embodiment, vector matching is performed between the first text and multiple text information in a preset text library to determine multiple candidate text information that match; vector matching is then performed between the multiple candidate text information and the first text to determine multiple pending text information that match the first text; based on the confidence level of the multiple pending text information, at least one target text information is determined from the multiple pending text information. By performing vector matching twice, interference from irrelevant data can be reduced, and possible noise and mismatches can be effectively filtered out. The data correlation is enhanced through layer-by-layer screening and confidence level filtering, thereby improving the reliability and accuracy of the matching results.
[0151] In one embodiment, the translation requirements include multiple target translation languages. For example... Figure 5 As shown, in step S40, which involves displaying a visual preview interface based on the translation results and the first display information of the first text on the target display screen, the following steps are included:
[0152] S41: Display the translation results of multiple texts in different target languages in preview mode.
[0153] After obtaining the translation result of the first copy in the target language, the copy translation device displays multiple copy translation results in different target languages in preview mode.
[0154] S42: Output text selection prompt. The text selection prompt is used to prompt the user to select one text translation result from multiple text translation results for display.
[0155] The text translation device outputs a text selection prompt, which prompts the user to select one text translation result from multiple text translation results for display on the target screen.
[0156] For example, the copywriting translation device sends multiple copywriting translation results in different target languages to the terminal device or the display screen of the copywriting translation device. The display screen displays the multiple copywriting translation results in different target languages in preview mode, and outputs text selection prompts on the display screen to prompt the user to select one copywriting translation result from the multiple copywriting translation results for display on the target display screen.
[0157] S43: Receive text selection command.
[0158] S44: In response to the text selection instruction, based on the text translation result and the first display information, display the text translation result selected by the text selection instruction on the visual preview interface.
[0159] The text translation device receives a text selection instruction and responds to the text selection instruction by displaying the text translation result selected by the text selection instruction on the visual preview interface based on the text translation result selected by the text selection instruction and the first display information.
[0160] In this embodiment, multiple translation results of texts in different target languages are displayed in preview mode; a text selection prompt is output to guide the user to select one translation result from the multiple results; a text selection instruction is received and, in response to the instruction, the selected translation result is displayed on the visual preview interface based on the original translation results and the first display information. The first text is converted into multiple translation results in different target languages for the user to choose from, allowing the user to select the translation version that best meets their expectations. The multilingual support and multiple 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. For example... Figure 6 As shown, in step S50, when an adjustment command triggered by the user on the visual preview interface is detected, the translation result is updated in response to the adjustment command, specifically including the following steps:
[0162] S51: Detects an editing command triggered by a user for the translation results in the first target language among multiple target translation languages.
[0163] In this embodiment, the first target translation language is selected from multiple target translation languages for display on the target screen. The translation requirements include multiple target translation languages, and the adjustment instructions include editing instructions. The visual preview interface includes a first text displayed side-by-side, along with translation results in one or more target translation languages corresponding to the first text.
[0164] The document translation device can also display a visual preview interface based on the document translation results in multiple target languages and the first display information. That is, the visual preview interface is used to show the display effect of the document translation results in the first target language on the target display screen, as well as the document translation results in multiple target languages.
[0165] The visual preview interface includes a display area and an editable area. The editable area displays the first text and the translation results in one or more target languages. Users can edit the vocabulary of the first text and the translation results in multiple target languages in the editable area. The display area shows how the translation results in the first target language are displayed on the target screen; since the translation requirements may include multiple target screens, the display area is used to show the display effect of the translation results in the first target language on different target screens in different locations.
[0166] For example, the first text is in Chinese. Translation requirements may include a primary target display screen (such as a vehicle's center console screen) and a secondary target display screen (such as a vehicle's dashboard); the multiple target translation languages in the translation requirements include English and German, where the primary target translation language can be English. Figure 7 As shown, the preview interface displays the English translation of the first text on the first target screen and the English translation of the first text on the second target screen. The editable area of the preview interface displays the Chinese version of the first text, its English translation, and its German translation side-by-side. Users can edit the vocabulary in the English translation of the first text in the editable area based on how it appears on different target screens, such as deleting, modifying, or inserting one or more words.
[0167] The text translation device detects user editing instructions (i.e., editing operations) within the editable area. It detects editing instructions triggered by the user in the first target language of the text translation results across multiple target languages. The editing instruction instructs the user to edit the first word in the first target language text translation result.
[0168] S52: In response to the editing command, modify the first word and simultaneously modify the second word in the translation results of other target languages in the translation results of multiple target languages.
[0169] The text translation device responds to editing instructions, modifies the first term, and simultaneously modifies the second term in the text translation results of other target languages within the text translation results of multiple target languages. The second term refers to the content in the text translation results of other target languages that corresponds to the first term.
[0170] The display area and the editable area are interconnected. If the user edits the editable area, the translation device responds to the user's adjustments to the translated text by synchronously adjusting and updating the translation results of the first text or target language in the first display adjustment area. The device also synchronously adjusts and updates the translation results of other target languages, as well as the translation results in the display area. User modifications to the translation results can be propagated to all relevant areas in real time, facilitating verification of the semantic match between the translated content and the original text, ensuring the accuracy and consistency of the translation results, and eliminating the tedious manual synchronization process, significantly improving adjustment efficiency.
[0171] In this embodiment, an editing instruction triggered by a user for the translation results in the first target language among multiple target language translation results is detected. The editing instruction instructs the editing of a first word in the translation results in the first target language. In response to the editing instruction, the first word is modified, and simultaneously, a second word in the translation results in other target languages is modified. The second word is the content in the translation results in other target languages that corresponds to the first word. This solution provides real-time preview and adjustment functions. By integrating real-time preview and interactive adjustment, operational efficiency is improved, and the display effect, adaptability, and interaction efficiency of the translation results are significantly enhanced.
[0172] In one embodiment, after step S40, that is, after displaying the visual preview interface based on the text translation result and the first display information, the method further includes the following steps:
[0173] S501: Upon detecting an adjustment command triggered by the user on the visual preview interface, store the target text translation content corresponding to the first text into the preset text library.
[0174] Based on the translation results and the first display information, after displaying the visual preview interface, the translation device, upon detecting an adjustment command triggered by the user on the visual preview interface, stores the target translation content corresponding to the first text in a preset text library. The target translation content includes the updated translation result corresponding to the first text, and / or the updated display position of the translation result corresponding to the first text on the target display screen.
[0175] In other words, upon detecting a user's adjustment command triggered by the visual preview interface, the text translation device responds to the adjustment command by updating the text translation result and / or updating the display position of the text translation result on the target display screen to obtain the target text translation content corresponding to the first text. Subsequently, if a user's storage command 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 could be the updated display position) are merged to obtain a text information. This text information is then vectorized to obtain its encoding vector, and the text information and its encoding vector are stored in a preset text library for subsequent retrieval.
[0176] S502: If no adjustment instruction is detected, store the translation result of the first copy and / or the display position of the translation result of the first copy on the target display screen in a preset copy library.
[0177] If no adjustment instruction is detected, it means that the user does not need to adjust the copy translation result. If the user's storage instruction is received, the first copy, the copy translation result of the first copy in the target translation language, and / or the display position of the copy translation result of the first copy on the target display screen are merged to obtain a copy information. The copy information is then vectorized to obtain the encoding vector of the copy information. The copy information and the encoding vector of the copy information are then stored in the preset copy library for subsequent retrieval.
[0178] The text translation device assigns a unique text identification code to each piece of text information and stores the text information, the text identification code, and the encoding vector in a preset text library for easy retrieval later.
[0179] In this embodiment, when a user-triggered adjustment command on the visual preview interface is detected, the target text translation content corresponding to the first text is stored in a preset text library. 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 command 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, by storing the first text, the text translation result, and their updated display position on the target display screen in a preset text library, achieves persistent storage and consistent management of translated content, significantly improving the system's reliability and scalability, and is suitable for complex scenarios involving multilingual content production and management.
[0180] During the process of transferring the aforementioned text information to the preset text library, all data can be uniformly converted into binary byte data using binary serialization and stored in the preset text library. Simultaneously, during this storage process, a compiler can be used to convert each piece of text information into serialized code, which is then stored in a code repository. An interface is also provided for calling the text information, facilitating its subsequent publication by the text translation device upon receiving a user's publishing request—that is, text publishing.
[0181] In one embodiment, such as Figure 8 As shown, the copywriting translation device displays a visual requirement interface, which includes a copywriting template. Users select and / or input key fields within the template to define their translation request. Responding to the translation request, the device retrieves prior knowledge corresponding to the first copywriting from a pre-set copywriting library to obtain a prompt word template. This prompt word template is then input to invoke the target translation model for copywriting translation, resulting in a copywriting translation result in the target language corresponding to the first copywriting. Based on the translation result and the first display information, a visual preview interface is displayed to preview and adjust the translation result. The adjusted first copywriting, the translation result (and / or the display position of the translation result on the target display screen), are converted into serialized code and stored. Finally, upon receiving a user's publishing request, the device publishes the copywriting information.
[0182] In a specific embodiment, such as Figure 9 As shown, the text translation device pre-acquires an initial large language model and a dataset related to smart devices (such as a dataset of vehicle-related data). Based on this dataset, it uses a target selection fine-tuning method to fine-tune the initial large language model, obtains a target translation model, and stores it. The text translation device pre-acquires multiple texts from different pages on the smart device, the translation results of each text, and display information, obtains multiple text information and summarizes them into a text information dataset. It then vectorizes the multiple text information in the text information dataset to obtain the encoding vectors of the multiple text information, and stores the multiple text information and their encoding vectors in a preset text library.
[0183] In practical applications, such as Figure 9As shown, the copywriting translation device displays a visual requirement interface, which includes a copywriting template. Users select and / or input key fields within the template to define their translation request. The device vectorizes the first copywriting, copywriting type, and displayed information from the translation request to obtain an encoding vector for the first copywriting. This encoded vector is then matched with the encoding vectors of multiple copywriting entries in a pre-set copywriting library based on similarity. The matched copywriting entries are filtered for confidence to obtain a target copywriting entry related to the first copywriting. The target copywriting entry and the translation request are combined to form a prompt word template, which is then input into the target translation model for copywriting translation, resulting in a copywriting translation of the first copywriting in the target language. Then, the copywriting translation device displays a visual preview interface based on the copywriting translation result and the first display information to preview and adjust the copywriting translation result. The adjusted first copywriting, copywriting translation result (and / or the display position of the copywriting translation result on the target display screen) are converted into binary byte data in a binary serialization manner and stored in the copywriting information dataset for vectorization and storage in the preset copywriting library.
[0184] In one embodiment, the text translation device also provides users with text retrieval and filtering verification functions. The method further includes the following steps:
[0185] S60: Displays a visual search interface, which includes one or more search keywords.
[0186] The text translation device displays a visual search interface on its own screen or the screen of a terminal device. This visual search interface includes one or more search keywords, which may include one or more of the following: text keywords, text type, device model (e.g., vehicle model), system version, and text identification code.
[0187] S70: Based on the search keywords set by the user in the visual search interface, determine the target copy information corresponding to the set search keywords from the preset copy library.
[0188] The text translation device determines the target text information corresponding to the search keywords set by the user in the visual search interface from multiple text information in a preset text library. The preset text library includes at least one example text.
[0189] S80: Display target text information, which includes at least the target text, the translation result of each target text, and the display information corresponding to the target text.
[0190] The text translation device displays target text information, which includes at least the target text, the corresponding translation result for each target text, and the display information for the target text. The target text information may also include text type, device model (e.g., vehicle model), system version, and text identification code. The text translation device provides users with text search and filtering verification functions, enabling users to quickly find specific texts for verification based on text type, target vehicle model, system version, and other criteria.
[0191] In this embodiment, a visual search interface is displayed, which includes one or more search keywords. These keywords include one or more of the following: text type, device model, and system version. Based on the search keywords set by the user in the visual search interface, target text information corresponding to the set search keywords is determined from a preset text library. The preset text library includes at least a first text. The target text information is displayed, including at least the target text, the text translation result corresponding to each target text, and the display information corresponding to the target text. This solution provides users with text retrieval and filtering verification functions, enabling users to quickly find specific texts for verification based on conditions such as text type, vehicle model, and system version.
[0192] It should be understood that the sequence number of each step in the above embodiments does not imply 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 embodiments of the present invention.
[0193] In one embodiment, a text translation device is provided, which corresponds one-to-one with the text translation methods described in the above embodiments. For example... Figure 10 As shown, the document translation device includes a receiving module 101, a response module 102, an input module 103, and a display module 104. Detailed descriptions of each functional module are as follows:
[0194] The receiving module 101 is used to receive translation requests, which include a first text, a target translation language, a text type, and the first display information of the first text on the target display screen.
[0195] The response module 102 is used to respond to translation requirements by determining the prior knowledge corresponding to the first copy from the preset copy library to obtain the prompt word template. The prompt word template includes the prior knowledge and the translation requirements. The prior knowledge includes at least the second copy, which is a copy in the preset copy library that matches the first copy.
[0196] The input module 103 is used to input the prompt word template into the target translation model to obtain the 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 text type;
[0197] Display module 104 is used to display a visual preview interface based on the copy translation result and the first display information. The visual preview interface is used to show the display effect of the copy 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 of the user on the visual preview interface when the user's adjustment instruction 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 and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0200] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to 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 embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0201] This application also provides an intelligent device, such as... Figure 11 As shown, the smart device includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor. When the processor executes the computer program, it implements the steps in any of the above method embodiments, or when the processor executes the computer program, it implements the functions of each module / unit in the above device embodiments.
[0202] For example, 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 this application. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the smart device.
[0203] Those skilled in the art will understand that Figure 11 This is merely an example of a smart device and does not constitute a limitation on the smart device. It may include more or fewer components than shown in the figure, or combine certain components, or different components. For example, the smart device may also include input / output devices, network access devices, buses, etc.
[0204] The aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0205] The memory can be an internal storage unit of the smart device, such as the hard drive or RAM of the smart device. The memory can also be an external storage device of the smart device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the smart device. Furthermore, the memory can include both internal storage units and external storage devices of the smart device.
[0206] This application also provides a readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the various method embodiments above.
[0207] This application provides a computer program product that, when run on a smart device, enables the smart device to perform the steps described in the above-described method embodiments.
[0208] If the integrated unit is implemented as 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, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a photographing device / terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0209] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0210] Those skilled in the art will recognize that the units and algorithm steps of the various examples 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 implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0211] In the embodiments provided in this application, it should be understood that the disclosed apparatus / devices and methods can be implemented in other ways. For example, the apparatus / device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0212] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0213] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for translating text, characterized in that, include: Receive a translation request, the translation request including a first document, a target translation language, a document type, and first display information of the first document 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 the prior knowledge and the translation requirement. The prior knowledge includes at least the second text and the display content of the second text. The second text is a text in the preset text library that matches the first text. The display content of the second text includes the translation result of the text in one or more languages corresponding to the second text and second display information. The prompt word template is input into the target translation model to obtain the text translation result of the first text in the target translation language, and the text translation result is adapted to the first display information and the text type; Based on the translation result and the first display information, a visual preview interface is displayed, which is used to show the display effect of the translation result on the target display screen. Upon detecting a user's adjustment instruction to 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 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 text translation method as described in claim 1, characterized in that, The preset copywriting library includes one or more copywriting information, the copywriting information includes the copywriting and the display content of the copywriting, the display content includes: the copywriting translation results in one or more languages corresponding to the copywriting and second display information; the one or more languages include the target translation language; Determine the prior knowledge corresponding to the first text from the preset text library to obtain the prompt word template, including: At least one target text information related to the first text is determined from the preset text library. The target text information includes the second text and the display content of the second text. The target text information is the text information that matches the first text 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 based on the first text, the target translation language, the text type, the first display information, and at least one of the target text information.
3. The text translation method as described in claim 2, characterized in that, The step of determining at least one target text information related to the first text from the preset text library includes: The first copy is matched with multiple copy information in the preset copy library by vector matching to determine multiple candidate copy information that are matched. Vector matching is performed on multiple candidate text information and the first text to determine multiple undetermined text information that match the first text; Based on the confidence levels of the multiple undetermined copy information, at least one target copy information is determined from the multiple undetermined copy information.
4. The text translation method as described in claim 1, characterized in that, The method further includes; Obtain an initial large language model, which is used at least for copywriting translation; Obtain a dataset, which includes at least one or more pieces of text data related to smart devices and keywords for each piece of text data; Based on the dataset, multiple datasets are determined, including a training set and a validation set; The initial large language model is adjusted by selecting a target fine-tuning method and the training set; During the adjustment of the initial large language model, the model performance is monitored and optimized using the validation set to obtain the optimized model configuration; The target translation model is obtained by using the optimized configuration of the model 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 by using the optimized model configuration as the configuration of the initial large language model includes: The initial large language model with the optimized configuration of the model is tested using the test set to evaluate the performance of the initial large language model with the optimized configuration of the model. If the performance meets the requirements, the initial large language model with the optimized configuration of the model will be used as the target translation model.
6. The text translation method as described in any one of claims 1-5, characterized in that, The translation requirements include multiple target languages, the adjustment instructions include editing instructions, and the step of updating the text translation result in response to the adjustment instruction triggered by the user on the visual preview interface, upon detecting the adjustment instruction, includes: An editing instruction triggered by a user for the translation result of the first target language among multiple target translation languages is detected, the editing instruction instructing the editing of the first word in the translation result of the first target language; In response to the editing instruction, the first word is modified, and simultaneously the second word in the text translation results of other target languages in the text translation results of multiple target translation languages is modified, wherein the second word is the content in the text translation results of other target translation languages that corresponds to the first word.
7. The text translation method as described in any one of claims 1-5, characterized in that, The translation requirements include multiple target translation languages, and the method further includes: The translation results of multiple texts in different target languages are displayed in preview mode. Output text selection prompt, which is used to prompt the user to select one of the multiple text translation results for display; Receive text selection instructions; The process includes displaying a visual preview interface based on the translation result and the first display information of the first text on the target display screen, including: In response to the text selection instruction, the text translation result selected by the text selection instruction is displayed on the visual preview interface based on the text translation result and the first display information.
8. The text translation method as described in any one of claims 1-5, characterized in that, The method further includes: Upon detecting an adjustment command triggered by the user on the visual preview interface, the target text translation content corresponding to the first text is stored in the preset text library. 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. If the adjustment instruction is not detected, the translation result of the first text and / or the display position of the translation result of the first text on the target display screen are stored in the preset text library.
9. The text translation method as described in any one of claims 1-5, characterized in that, The received translation request includes: Display a visual requirement interface, which includes a copy template. The copy template includes multiple key fields, each of which includes one or more options. Each option corresponds to a requirement 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 requirements are determined based on the options selected by the user on the copy template.
10. The text translation method according to any one of claims 1-5, characterized in that, The method further includes: Display a visual search interface, which includes one or more search keywords, and the one or more search keywords include one or more of the following: text type, device model, system version; Based on the search keywords set by the user in the visual search interface, target text information corresponding to the set search keywords is determined from a preset text library; the preset text library includes at least the first text. The target text information is displayed; the target text information includes at least the target text, the text translation result corresponding to each target text, and the display information corresponding to the target text.
11. A smart 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, it implements the steps of the text translation method as described in any one of claims 1 to 10.
12. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the text translation method as described in any one of claims 1 to 10.
13. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, causes to implement the steps of the text translation method as described in any one of claims 1 to 10.
Citation Information
Patent Citations
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