Interface generation method and device, electronic equipment and storage medium
By using the target multi-modal model to identify and translate the text of the car-machine interface, and processing the interface according to the text attribute information, the problems of low efficiency and high cost in the existing technology are solved, and automated multi-language interface generation is achieved.
Patent Information
- Application Number
- CN202410803709.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-09-17
AI Technical Summary
When designing a car-machine interface, the existing technology is inefficient and requires a lot of manual participation, which increases the cost of interface generation.
The trained target multi-modal model is used to identify and translate the preset interface, generate target text according to the target language, and process the interface based on text attribute information to automatically generate the target interface to avoid manual intervention.
It improves the efficiency of interface generation, reduces costs, and realizes automated multi-language interface generation.
Smart Images

Figure CN118656160A
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle Internet technology, and specifically to an interface generation method, device, electronic device and storage medium. Background Art
[0002] With the development of new energy vehicles, intelligent and international, the languages of the car-machine interface in cars are becoming more and more diverse. At present, when designing the car-machine interface in a car, the user interface designer usually designs the car-machine interface in one language, and then transfers the text in the car-machine interface to the translator for translation. After the translator translates, the user interface designer replaces the original text in the car-machine interface with the translated text, thereby designing the car-machine interface in different languages. However, the above-mentioned car-machine interface generation method is inefficient and requires the participation of a large number of people, which increases the cost of interface generation. Summary of the invention
[0003] One of the purposes of the present application is to provide an interface generation method, which can automatically generate a target interface in a target language without manually processing the preset interface, thereby improving the interface generation efficiency and reducing the cost of interface generation; the second purpose of the present application is to provide an interface generation device; the third purpose of the present application is to provide an electronic device; the fourth purpose of the present application is to provide a storage medium.
[0004] In order to achieve the above objectives, in a first aspect, the present application provides an interface generation method, comprising:
[0005] Acquire a preset interface to be processed and a target language, wherein the target language is used to indicate that text in the preset interface is translated into text in the target language;
[0006] Using the trained target multimodal model to identify the preset interface, so as to identify the first text in the preset interface and the text attribute information corresponding to the first text;
[0007] According to the target language and the trained target multimodal model, the first text is translated to obtain a target text corresponding to the first text, wherein the language of the target text is the target language;
[0008] The preset interface is processed according to the text attribute information and the target text to generate a target interface corresponding to the preset interface.
[0009] Optionally, translating the first text according to the target language and the trained target multimodal model to obtain a target text corresponding to the first text includes:
[0010] Determining first prompt information according to the target language, wherein the first prompt information is used to instruct generating a target text in the target language from the first text;
[0011] The first text and the first prompt information are input into the trained target multimodal model, so that the target multimodal model, under the guidance of the first prompt information, translates the first text into the target language to obtain a target text in the target language.
[0012] Optionally, the text attribute information includes a text box position of a text box where the first text is located and a text format of the first text;
[0013] The translating the first text according to the target language and the trained target multimodal model to obtain a target text corresponding to the first text includes:
[0014] Determine second prompt information by using the text box position, the text format and the target language, wherein the second prompt information is used to instruct to generate a target text in the target language and located in the text box from the first text;
[0015] The first text and the second prompt information are input into the trained target multimodal model, so that the target multimodal model, under the guidance of the second prompt information, uses the target language to translate the first text to obtain the target text in the target language, and uses the text box position and the text format to process the target text to obtain the target text located in the text box.
[0016] Optionally, the processing of the preset interface according to the text attribute information and the target text to generate a target interface corresponding to the preset interface includes:
[0017] Processing the preset interface according to the text attribute information and the target text to generate a first initial interface corresponding to the preset interface;
[0018] Displaying the first initial interface;
[0019] When receiving confirmation information for the first initial interface, determining the first initial interface as a target interface corresponding to the preset interface;
[0020] When first modification information for the first initial interface is received, the first initial interface is processed according to the first modification information to obtain a target interface corresponding to the preset interface.
[0021] Optionally, the text attribute information includes a text box position of a text box where the first text is located;
[0022] The processing of the preset interface according to the text attribute information and the target text to generate a target interface corresponding to the preset interface includes:
[0023] Clearing the first text from the preset interface;
[0024] Based on the text box position of the text box where the first text is located, the obtained target text is rendered into the text box to obtain a target interface corresponding to the preset interface.
[0025] Optionally, the target multimodal model is trained in the following manner:
[0026] Acquire a sample interface set, wherein each sample interface in the sample interface set is annotated with a sample text in a first sample language, sample text attribute information corresponding to the sample text, and a second sample language, wherein the first sample language is used to represent a language of the sample text in the preset sample interface, and the second sample language is used to represent a language after the sample text in the first sample language is translated;
[0027] For each of the sample interfaces in the sample interface set, generating sample prompt information corresponding to the sample interface according to the sample text in the first sample language corresponding to the sample interface, the sample text attribute information and the sample text in the second sample language;
[0028] All the sample interfaces in the sample interface set and the corresponding sample prompt information are used to fine-tune the initial multimodal model to obtain the target multimodal model.
[0029] Optionally, before executing the step of using the trained target multimodal model to identify the preset interface to identify the first text in the preset interface and the text attribute information corresponding to the first text, the method further includes:
[0030] Acquire a preset text in the preset interface, where the preset text is used to represent a preset text to be displayed in the preset interface;
[0031] Before executing the step of translating the first text according to the target language and the trained target multimodal model to obtain a target text corresponding to the first text, the method further includes:
[0032] When the preset text is inconsistent with the recognized first text, the preset text is determined as the first text, and according to the determined first text, the step of translating the first text according to the target language and the trained target multimodal model to obtain a target text corresponding to the first text is performed;
[0033] After executing the step of processing the preset interface according to the text attribute information and the target text to generate a target interface corresponding to the preset interface, the method further includes:
[0034] When the preset text is inconsistent with the first text obtained by recognition, the preset text is used to train the target multimodal model to complete the update of the target multimodal model, and the updated target multimodal model is used to execute the step of obtaining the preset interface and target language to be processed.
[0035] Optionally, the processing of the preset interface according to the text attribute information and the target text to generate a target interface corresponding to the preset interface includes:
[0036] Processing the preset interface according to the text attribute information and the target text to obtain a second initial interface corresponding to the preset interface, wherein the target text is displayed in the second initial interface;
[0037] Determining a first terminal set and a second terminal set corresponding to the preset interface, each first terminal in the first terminal set is used to evaluate the translation effect of the obtained target text, and each second terminal in the second terminal set is used to evaluate the visual effect of the obtained second initial interface;
[0038] Sending the second initial interface to each of the first terminals in the first terminal set and sending the second initial interface to each of the second terminals in the second terminal set;
[0039] receiving first feedback information for the target text sent by each of the first terminals in the first terminal set, and receiving second feedback information for the second initial interface sent by each of the second terminals in the first terminal set;
[0040] The second initial interface is processed according to each of the first feedback information and each of the second feedback information to obtain a target interface corresponding to the preset interface.
[0041] Optionally, the first feedback information includes a first score, and the second feedback information includes a second score;
[0042] The processing of the second initial interface according to each of the first feedback information and each of the second feedback information to obtain a target interface corresponding to the preset interface includes:
[0043] Determine the average of the first scores included in all the first feedback information to obtain a first average score, and determine the average of the second scores included in all the second feedback information to obtain a second average score;
[0044] When the first average score is greater than a first score threshold and the second average score is greater than a second score threshold, the second initial interface is determined as the target interface corresponding to the preset interface, the first score threshold is used to characterize that the translation effect of the target text obtained reaches the expected lower limit value corresponding to the expected value, and the second score threshold is used to characterize that the visual effect of the second initial interface obtained reaches the expected lower limit value corresponding to the expected value.
[0045] Optionally, after obtaining the first average score and the second average score, the method further includes:
[0046] When the first average score is less than or equal to the first score threshold, if each of the first feedback information further includes second modification information for the translation effect of the target text, all of the second modification information are used to train the target multimodal model to complete the update of the target multimodal model, and the updated target multimodal model is used to perform the step of translating the first text according to the target language and the trained target multimodal model to obtain the target text corresponding to the first text, until the first average score is greater than the first score threshold; and / or,
[0047] When the second average score is less than or equal to the second score threshold, if each of the second feedback information also includes third modification information for the visual effect of the second initial interface, all the third modification information are used to train the target multimodal model to complete the update of the target multimodal model, and the updated target multimodal model is used to perform the step of translating the first text according to the target language and the trained target multimodal model to obtain a target text corresponding to the first text, until the second average score is greater than the second score threshold.
[0048] Optionally, the using the trained target multimodal model to recognize the preset interface to recognize the first text in the preset interface and the text attribute information corresponding to the first text includes:
[0049] Using the trained target multimodal model to identify the preset interface, so as to identify a first text in the preset interface, text attribute information corresponding to the first text, and a first text type to which the first text belongs;
[0050] The translating the first text according to the target language and the trained target multimodal model to obtain a target text corresponding to the first text includes:
[0051] If the first text type does not belong to a preset text type set, the first text is translated according to the target language and the trained target multimodal model to obtain a target text corresponding to the first text, and each preset text type in the preset text type set is used to indicate that there is no need to translate the text belonging to the preset text type.
[0052] In order to achieve the above-mentioned purpose, in a second aspect, the present application provides an interface generation device, comprising:
[0053] An acquisition module, used to acquire a preset interface to be processed and a target language, wherein the target language is used to indicate that the text in the preset interface is translated into a text in the target language;
[0054] A recognition module, used to recognize the preset interface using the trained target multimodal model, so as to recognize the first text in the preset interface and the text attribute information corresponding to the first text;
[0055] A translation module, configured to translate the first text according to the target language and the trained target multimodal model to obtain a target text corresponding to the first text, wherein the language of the target text is the target language;
[0056] A generating module is used to process the preset interface according to the text attribute information and the target text to generate a target interface corresponding to the preset interface.
[0057] To achieve the above objectives, in a third aspect, the present application also provides an electronic device, including: a processor and a memory, the processor is used to execute an interface generation program stored in the memory to implement the interface generation method as described above.
[0058] To achieve the above objectives, in a fourth aspect, the present application also provides a storage medium, wherein the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the interface generation method as described above.
[0059] Beneficial effects of the present application: The present application provides an interface generation method, which obtains a preset interface and a target language to be processed, and uses a trained target multimodal model to identify the preset interface, so as to identify a first text in the preset interface and text attribute information corresponding to the first text, and translates the first text according to the target language and the trained target multimodal model to obtain a target text in the target language, so as to process the preset interface according to the text attribute information and the target text, so as to automatically generate a target interface in the target language, without manually processing the preset interface, thereby improving the interface generation efficiency and reducing the interface generation cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 A schematic diagram showing a flow chart of an interface generation method provided in an embodiment of the present application;
[0061] Figure 2 A schematic diagram showing a flow chart of another interface generation method provided in an embodiment of the present application;
[0062] Figure 3 A schematic diagram showing a flow chart of another interface generation method provided in an embodiment of the present application;
[0063] Figure 4 A schematic diagram showing a flow chart of another interface generation method provided in an embodiment of the present application
[0064] Figure 5 A schematic diagram showing different language interfaces provided by an embodiment of the present application;
[0065] Figure 6 A schematic diagram showing the structure of an interface generation device provided in an embodiment of the present application is shown;
[0066] Figure 7 A schematic diagram showing the structure of an electronic device provided in an embodiment of the present application is shown;
[0067] in:
[0068] 10. Acquisition module; 20. Recognition module; 30. Translation module; 40. Generation module;
[0069] 700, electronic device; 701, processor; 702, memory; 7021, operating system; 7022, application; 703, user interface; 704, network interface; 705, bus system. DETAILED DESCRIPTION
[0070] The following will describe the implementation methods of the present application with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific implementation methods, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be understood that the preferred embodiments are only for illustrating the present application, not for limiting the scope of protection of the present application.
[0071] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.
[0072] To facilitate understanding of the embodiments of the present application, further explanation will be given below with reference to specific embodiments in conjunction with the accompanying drawings. The embodiments do not constitute a limitation on the embodiments of the present application.
[0073] refer to Figure 1 , Figure 1 A flowchart of an interface generation method provided in an embodiment of the present application. An interface generation method provided in an embodiment of the present application comprises the following steps:
[0074] S101: Obtaining a preset interface and a target language to be processed.
[0075] In this embodiment, the target language is used to indicate that the text in the preset interface is translated into a text in the target language. An information input interface may be provided, and the information input interface is used for the user to input the preset interface and the target language to be processed, and the information input interface also displays a first control for generating the interface. The language of the text in the preset interface is the preset language, and the preset language is inconsistent with the target language. For example, when the preset language is Chinese, the target language may be English, German or Russian. The preset language and the target language may be set according to actual needs, and the preset language and the target language are not specifically limited in this embodiment. The preset interface may be designed in advance by a user interface designer. After the design is completed, if the preset interface with the target language needs to be generated, the preset interface and the target language may be input through the information input interface, and by clicking or touching the first control, step S101 is executed to automatically translate the text in the preset interface, thereby generating a target interface with the target language. It should be noted that the preset interface is actually a picture.
[0076] S102: Using the trained target multimodal model to identify the preset interface, so as to identify the first text in the preset interface and the text attribute information corresponding to the first text.
[0077] In this embodiment, the initial multimodal model can be fine-tuned to obtain a target multimodal model. The initial multimodal model can be selected according to actual needs. For example, the initial multimodal model can be chatGPT-4V. The target multimodal model is used to perform image recognition on the preset interface and translate the recognized text. After the target multimodal model is obtained through fine-tuning training and the preset interface to be processed is obtained, the target multimodal model can be used to identify the text in the preset interface, so as to identify the first text in the preset interface and the text attribute information corresponding to the first text from the preset interface, so as to translate the first text, and automatically generate a target interface with a target language based on the translated first text and text attribute information. The text attribute information includes the text box position of the text box where the first text is located and the text format of the first text. The text format can be understood as the font, font size, etc. of the first text.
[0078] S103: Translate the first text according to the target language and the trained target multimodal model to obtain a target text corresponding to the first text.
[0079] In this embodiment, the language of the target text is the target language. After obtaining the trained target multimodal model and acquiring the target language, the target multimodal model can be used to translate the first text based on the target language, thereby translating the first text into a target text in the target language. For example, when the preset language of the first text is Chinese, the target language of the target text is English. The target multimodal model can automatically translate the first text in Chinese into the target text in English.
[0080] Among them, in step S102, the preset interface is recognized using the trained target multimodal model to recognize the first text in the preset interface and the text attribute information corresponding to the first text, including:
[0081] The preset interface is recognized using the trained target multimodal model to recognize the first text in the preset interface, the text attribute information corresponding to the first text, and the first text type to which the first text belongs.
[0082] In step S103, the first text is translated according to the target language and the trained target multimodal model to obtain a target text corresponding to the first text, including:
[0083] If the first text type does not belong to the preset text type set, the first text is translated according to the target language and the trained target multimodal model to obtain a target text corresponding to the first text. Each preset text type in the preset text type set is used to indicate that there is no need to translate the text belonging to the preset text type.
[0084] Specifically, the preset text type may be a brand logo type, etc. When the first text type does not belong to the preset text type set, it is indicated that the first text obtained by identification needs to be translated; and when the first text type belongs to the preset type set, it is indicated that the first text obtained by identification does not need to be translated. In the above manner, it is possible to avoid translating text that does not need to be translated, thereby improving the accuracy of the target text obtained, thereby ensuring the accuracy of the target interface generated subsequently.
[0085] More specifically, in step S103, the first text is translated according to the target language and the trained target multimodal model to obtain a target text corresponding to the first text, which specifically includes:
[0086] Determining first prompt information according to the target language, where the first prompt information is used to instruct generating a target text in the target language from the first text;
[0087] The first text and the first prompt information are input into a trained target multimodal model, so that the target multimodal model, under the guidance of the first prompt information, uses the target language to translate the first text to obtain a target text in the target language.
[0088] In this embodiment, after the target language is acquired, the target language can be filled into a pre-set prompt template to obtain a first prompt information. After obtaining the first prompt information, the first prompt information and the first text can be input into the target multimodal model, so that the target multimodal model can translate the first text using the target language under the guidance of the first prompt information to obtain the final target text in the target language.
[0089] It should be noted that when training the target multimodal model, multiple sample interfaces can be pre-selected to form a sample interface set, and the sample text, the language of the sample text, and the language of the sample text after translation in each sample interface are annotated. The sample prompt information corresponding to the sample interface is generated using the annotated information of the sample interface, and the initial multimodal model is fine-tuned using the annotated sample interface set and each sample prompt information, thereby obtaining the target multimodal model.
[0090] S104: Processing the preset interface according to the text attribute information and the target text to generate a target interface corresponding to the preset interface.
[0091] In this embodiment, after performing text recognition on the preset interface and translating the recognized text through the target multimodal model, the target text can be replaced to the same position as the first text based on the recognized text attribute information, thereby completing the processing of the preset interface and automatically generating a target interface corresponding to the preset interface without human intervention, thereby improving the efficiency of interface generation and reducing the cost of interface generation.
[0092] The present embodiment provides an interface generation method, which obtains a preset interface to be processed and a target language, and uses a trained target multimodal model to identify the preset interface, so as to identify a first text in the preset interface and text attribute information corresponding to the first text, and translates the first text according to the target language and the trained target multimodal model to obtain a target text in the target language, so as to process the preset interface according to the text attribute information and the target text, so as to automatically generate a target interface in the target language, without manually processing the preset interface, thereby improving the interface generation efficiency and reducing the interface generation cost.
[0093] refer to Figure 2 , Figure 2 A flowchart of another interface generation method provided in an embodiment of the present application. An interface generation method provided in an embodiment of the present application comprises the following steps:
[0094] S201: Obtaining a preset interface and a target language to be processed.
[0095] S202: Using the trained target multimodal model to identify the preset interface, so as to identify the first text in the preset interface and the text attribute information corresponding to the first text.
[0096] As for step S201 and step S202, step S201 is consistent with the above-mentioned step S101, and step S202 is consistent with the above-mentioned step S102. For details, please refer to step S101 and step S102, which will not be described in detail in this embodiment.
[0097] In this embodiment, the target multimodal model can be trained in the following way:
[0098] Acquire a sample interface set, each sample interface in the sample interface set is annotated with a sample text in a first sample language, sample text attribute information corresponding to the sample text, and a second sample language, the first sample language is used to represent the language of the sample text in the preset sample interface, and the second sample language is used to represent the language after the sample text in the first sample language is translated;
[0099] For each sample interface in the sample interface set, generating sample prompt information corresponding to the sample interface according to the sample text in the first sample language, the sample text attribute information and the second sample language corresponding to the sample interface;
[0100] All sample interfaces in the sample interface set and their corresponding sample prompt information are used to fine-tune the initial multimodal model to obtain the target multimodal model.
[0101] Among them, in order to ensure the accuracy of the target multimodal model obtained by subsequent fine-tuning training, all sample interfaces included in the selected sample interface set are as diverse as possible, that is, all sample interfaces in the sample interface set should have different languages and styles. After the sample interface set is selected, each sample interface in the sample interface set can be annotated. When annotating the sample interface, the sample text with the first sample language in the sample interface is mainly annotated, the sample text attribute information of the sample text with the first sample language is annotated, and the second sample language required to generate the sample text is annotated. After annotating each sample interface in the sample interface set, a suitable initial multimodal model can be selected according to actual needs. For example, the open source CLIP (Constrastive Language-Image Pre-training) model can be used, which has good text and image understanding capabilities.
[0102] After labeling each sample interface in the sample interface set and selecting the initial multimodal model, a prompt template can be pre-set according to the labeled sample interface. The prompt template describes the task that the model needs to perform. For example, the prompt template can be to recognize and translate all texts in the interface. For each sample interface in the sample interface set, the prompt template can be filled with the sample text in the first sample language, the sample text attribute information and the second sample language corresponding to each sample interface to generate the sample prompt information corresponding to each sample interface, so that all the sample interfaces in the sample interface set and their corresponding sample prompt information are fine-tuned for the selected initial multimodal model to adjust the training parameters such as the learning rate and batch size, and evaluate and test the model until the target multimodal model that meets the expectations is finally generated.
[0103] It should be noted that the first sample language is different from the second sample language. When setting the prompt template, multiple prompt templates can be pre-set, and each prompt template can be tested using a small part of the sample interface until the optimal prompt template is finally determined, so as to use the prompt template to train the initial multimodal model. The sample text attribute information includes the sample text box position of the sample text box where the sample text with the first sample language is located in the sample interface and the sample text format of the sample text with the first sample language, and the sample text format includes the font, font size, etc. of the sample text. When fine-tuning the initial multimodal model, the sample text type of the sample text in each sample interface in the sample interface set can also be annotated, so as to use the annotated sample text type in combination with the various information annotated in all the above sample interfaces to fine-tune the initial multimodal model, so as to obtain the final target multimodal model, and then when the target multimodal model is used for text recognition in the future, the text type to which the text belongs can be identified.
[0104] S203: Determine second prompt information by using the text box position of the text box where the first text is located included in the text attribute information, the text format and the target language of the first text included in the text attribute information.
[0105] S204: Input the first text and the second prompt information into the trained target multimodal model, so that the target multimodal model, under the guidance of the second prompt information, uses the target language to translate the first text to obtain a target text in the target language, and processes the target text using the text box position and text format to obtain the target text located in the text box.
[0106] For the above-mentioned steps S203 and S204, the second prompt information is used to indicate that the first text is generated into a target text having a target language and located in a text box. After obtaining the text box position of the text box where the first text is located in the preset interface and the text format of the first text using the target multimodal model and obtaining the target language, the text box position of the text box where the first text is located, the text format of the first text and the target language can be filled into the preset prompt template to obtain the second prompt information. After obtaining the second prompt information, the first text and the second prompt information can be input into the target multimodal model, so that the target multimodal model can translate the first text using the target language under the guidance of the second prompt information to obtain the target text in the target language, and can process the target text using the text box position and text format to obtain the target text located in the text box. In the above manner, since the target text finally obtained by translation is in the text box, when the target interface is generated according to the target text, the consistency and aesthetics of the target text on the target interface can be ensured.
[0107] S205: Processing the preset interface according to the text attribute information and the target text to generate a target interface corresponding to the preset interface.
[0108] In this embodiment, in step S205, the preset interface is processed according to the text attribute information and the target text to generate a target interface corresponding to the preset interface, which specifically includes:
[0109] Clear the first text from the preset interface;
[0110] Based on the text box position of the text box where the first text is located included in the text attribute information, the obtained target text is rendered into the text box to obtain a target interface corresponding to the preset interface.
[0111] Among them, an automated tool can be used to clear the first text from the preset interface, and render the target text into a text box to replace the original first text, thereby obtaining a target interface corresponding to the preset interface. Since the target text is obtained based on the text attribute information corresponding to the first text, the obtained target text can adapt to the text box where the first text is located. When the target text is rendered into the text box, the target text will be located in the text box without affecting the layout of the original interface, thereby ensuring the consistency and aesthetics of interfaces in different languages. In the above manner, automatic replacement of the target text is achieved, and the generation efficiency of the interface is improved. It should be noted that the automated tool can be Adobe XD tool, Sketch tool, PSD tool, etc. The automated tool can be selected according to actual needs, and this is not specifically limited in this embodiment.
[0112] Specifically, since the target text obtained by the target multimodal model may not be completely adapted to the text box and the translation effect of the target text may not meet expectations, in order to ensure that the translation effect and visual effect of the target text finally generated meet expectations, before generating the target interface corresponding to the preset interface, the interface generated using the target text is verified so that the final target interface meets expectations, thereby reducing the subsequent manual participation in modification and improving the efficiency of interface generation. Step S205 may also specifically include:
[0113] Processing the preset interface according to the text attribute information and the target text to generate a first initial interface corresponding to the preset interface;
[0114] Display the first initial interface;
[0115] When receiving confirmation information for the first initial interface, determining the first initial interface as a target interface corresponding to the preset interface;
[0116] When the first modification information for the first initial interface is received, the first initial interface is processed according to the first modification information to obtain a target interface corresponding to the preset interface.
[0117] More specifically, a verification staff for verifying the generated interface and a verification terminal corresponding to the verification staff can be pre-set. After the target text is generated using the target multimodal model, the preset interface can be processed using the text attribute information and the target text to obtain the first initial interface corresponding to the preset interface. The generation method of the first initial interface can refer to the generation method of the target interface mentioned above, which will not be repeated in this embodiment. After obtaining the first initial interface, the first initial interface can be displayed on the verification terminal, and the corresponding verification staff verifies the displayed first initial interface. If the translation effect of the target text in the first initial interface and the overall visual effect of the first initial interface meet expectations, the verification staff will feedback confirmation information to determine the first initial interface as the target interface. When the verification staff determines that the translation result of the target text in the currently generated first initial interface does not meet expectations, or the overall visual effect of the first initial interface does not meet expectations, the verification staff will feedback the first modification information for the first initial interface, and use the first modification information to process the first initial interface to obtain the target interface corresponding to the preset interface. The first modification information may be modification suggestions for the translation effect of the target text in the first initial interface, and the first modification information may also be modification suggestions for the visual effect of the first initial interface. Upon receiving the first modification information, the modification suggestions for the translation effect and the modification suggestions for the visual effect in the first modification information may be directly used to modify the first initial interface, thereby obtaining a target interface corresponding to the preset interface. Furthermore, after the target interface is generated, in order to improve the accuracy of the processing interface of the target multimodal model, the target multimodal model is trained using the first modification information to complete the update of the target multimodal model, and the updated target multimodal model is used to return to execute step S201.
[0118] In this embodiment, in order to ensure that the translation effect and visual effect of the target text finally generated meet expectations, before generating the target interface corresponding to the preset interface, the interface generated using the target text is verified so that the final target interface meets expectations, thereby reducing the subsequent manual participation in modification and improving the efficiency of interface generation. Step S205 may also specifically include:
[0119] Processing the preset interface according to the text attribute information and the target text to obtain a second initial interface corresponding to the preset interface, wherein the target text is displayed in the second initial interface;
[0120] Determine a first terminal set and a second terminal set corresponding to the preset interface, each first terminal in the first terminal set is used to evaluate the translation effect of the obtained target text, and each second terminal in the second terminal set is used to evaluate the visual effect of the obtained second initial interface;
[0121] Sending the second initial interface to each first terminal in the first terminal set and sending the second initial interface to each second terminal in the second terminal set;
[0122] receiving first feedback information for the target interface sent by each first terminal in the first terminal set, and receiving second feedback information for the second initial interface sent by each second terminal in the first terminal set;
[0123] The second initial interface is processed according to each of the first feedback information and each of the second feedback information to obtain a target interface corresponding to the preset interface.
[0124] Among them, since when generating the target interface, it is necessary to ensure the consistency and aesthetics of the generated target interface with the original preset interface, and it is also necessary to ensure the translation accuracy of the target text in the target interface, and the consistency and aesthetics involve the visual effect of the interface, and the judgment of the visual effect is usually achieved by the user interface designer, and the translation accuracy involves the translation effect of the text in the interface, and the judgment of the translation effect is usually achieved by the translator. Therefore, each translator who judges the translation effect of the interface and each user interface designer who judges the visual effect of the interface can be pre-set, and the first terminal corresponding to each translator and the second terminal corresponding to each user interface designer are pre-set. After the preset interface is processed according to the text attribute information and the target text, and the second initial interface corresponding to the preset interface is obtained, the second initial interface is sent to each first terminal and each second terminal, so that the translator at each first terminal evaluates the translation effect of the target text in the second initial interface and the user interface designer at each second terminal evaluates the visual effect of the second initial interface. After each first terminal evaluates and each second terminal evaluates, first feedback information sent by each first terminal and second feedback information sent by each second terminal are received, and the final target interface is generated with all the first feedback information and all the second feedback information.
[0125] It should be noted that the specific method of processing the preset interface according to the text attribute information and the target text to obtain the second initial interface corresponding to the preset interface can refer to the above-mentioned method of generating the target interface, which will not be repeated in this embodiment.
[0126] Specifically, the first feedback information includes a first score, and the second feedback information includes a second score. In the above, the second initial interface is processed according to each first feedback information and each second feedback information to obtain a target interface corresponding to the preset interface, specifically including:
[0127] Determine the mean of the first scores included in all the first feedback information to obtain a first average score, and determine the mean of the second scores included in all the second feedback information to obtain a second average score;
[0128] When the first average score is greater than the first score threshold and the second average score is greater than the second score threshold, the second initial interface is determined as the target interface corresponding to the preset interface, the first score threshold is used to characterize that the translation effect of the obtained target text reaches the expected lower limit value corresponding to the expected value, and the second score threshold is used to characterize that the visual effect of the obtained second initial interface reaches the expected lower limit value corresponding to the expected value.
[0129] In this embodiment, the specific values of the first score threshold and the second score threshold can be set according to actual needs, and the specific values of the first score threshold and the second score threshold are not limited in this embodiment. When the first average score is greater than the first score threshold, it represents that the translation effect of the target text has reached the expectation, and when the second average score is greater than the second score threshold, it represents that the visual effect of the second initial interface has reached the expectation. Therefore, when the first average score is greater than the first score threshold and the second average score is greater than the second score threshold, it represents that the final generated second initial interface has reached the expectation, and the second initial interface can be used as the final target interface. In the above manner, before the final generated target interface is applied to the vehicle, it can be ensured that the generated target interface meets expectations, which reduces subsequent manual participation and improves the efficiency of interface generation.
[0130] It should be noted that, in order to avoid errors caused by the subjectivity in evaluating the translation effect of the target text, when determining the first average score, the largest first score and the smallest first score among the first scores included in all the first feedback information may be removed to determine the average of all the remaining first scores to obtain the first average score; similarly, in order to avoid errors caused by the subjectivity in evaluating the visual effect of the second initial interface, when determining the second average score, the largest second score and the smallest second score among the second scores included in all the second feedback information may be removed to determine the average of all the remaining second scores to obtain the second average score.
[0131] In the above description, after obtaining the first average score and the second average score, the interface generation method provided in this embodiment further includes the following steps:
[0132] When the first average score is less than or equal to the first score threshold, if each first feedback information also includes second modification information for the translation effect of the target text, all the second modification information are used to train the target multimodal model to complete the update of the target multimodal model, and the updated target multimodal model is used to perform the step of determining the first prompt information by using the text box position, text format and target language until the first average score is greater than the first score threshold; and / or,
[0133] When the second average score is less than or equal to the second score threshold, if each second feedback information also includes third modification information for the visual effect of the second initial interface, all the third modification information is used to train the target multimodal model to complete the update of the target multimodal model, and the updated target multimodal model is used to execute the text box position, text format and target language to determine the first prompt information step until the second average score is greater than the second score threshold.
[0134] Among them, when the first average score is less than or equal to the first score threshold, the translation effect of the target text is not as expected, and when the second average score is less than or equal to the second score threshold, the visual effect of the second initial interface is not as expected, so the second preset interface cannot be determined as the target interface at this time. When the first average score is less than or equal to the first score threshold, the second modification information for the translation effect of the target text included in each first feedback information can be used to retrain the target multimodal model to complete the update of the target multimodal model, so as to regenerate the second initial interface using the updated target multimodal model until the first average score is greater than the first score threshold; similarly, when the second average score is less than or equal to the second score threshold, the third modification information for the visual effect of the second initial interface included in each second feedback information can be used to retrain the target multimodal model to complete the update of the target multimodal model, so as to re-obtain the target text using the updated target multimodal model, until the second average score is greater than the second score threshold. When the first average score is greater than the first score threshold and the second average score is greater than the second score threshold, the obtained second initial interface is determined as the target interface.
[0135] The present embodiment provides an interface generation method, which obtains a preset interface to be processed and a target language, and uses a trained target multimodal model to identify the preset interface, so as to identify a first text in the preset interface and text attribute information corresponding to the first text, and translates the first text according to the target language and the trained target multimodal model to obtain a target text in the target language, so as to process the preset interface according to the text attribute information and the target text, so as to automatically generate a target interface in the target language, without manually processing the preset interface, thereby improving the interface generation efficiency and reducing the interface generation cost.
[0136] refer to Figure 3 , Figure 3 A flowchart of another interface generation method provided in an embodiment of the present application. An interface generation method provided in an embodiment of the present application comprises the following steps:
[0137] S301: Obtaining a preset interface and a target language to be processed.
[0138] In this embodiment, step S301 is consistent with the above-mentioned step S101. For details, please refer to the above-mentioned step S101, and this embodiment will not be described in detail here.
[0139] S302: Obtaining a preset text in a preset interface.
[0140] In this embodiment, the preset text is used to represent the text to be displayed in the preset interface. The preset text can be input through the information input interface. By inputting the preset text, the problem of inaccurate text recognition in the preset interface by the subsequent target multimodal model is prevented. The preset text can be an Extensible Markup Language (XML) file.
[0141] S303: Using the trained target multimodal model to identify the preset interface, so as to identify the first text in the preset interface and the text attribute information corresponding to the first text.
[0142] In this embodiment, step S303 is consistent with the above-mentioned step S102. For details, please refer to the above-mentioned step S102, and this embodiment will not be described in detail.
[0143] S304: When the preset text is inconsistent with the recognized first text, the preset text is determined as the first text.
[0144] In this embodiment, the preset text and the first text recognized by the target multimodal model are used for verification to verify whether the first text recognized by the target multimodal model is accurate. When the preset text is consistent with the recognized first text, it indicates that the first text recognized by the target multimodal model is accurate, that is, the recognition of the target multimodal model is accurate, so the first text recognized by the target multimodal model can be used to perform the following S305 step. When the preset text is inconsistent with the recognized first text, it indicates that the first text recognized by the target multimodal model is inaccurate, that is, the recognition of the target multimodal model is inaccurate, so the preset text is determined as the first text to perform the following S305 step.
[0145] S305: Translate the determined first text according to the target language and the trained target multimodal model to obtain a target text corresponding to the preset text.
[0146] S306: Processing the preset interface according to the text attribute information and the target text to generate a target interface corresponding to the preset interface.
[0147] Regarding the above-mentioned step S305 and step S306, step S305 is consistent with the above-mentioned step S103, and step S306 is consistent with the above-mentioned step S104. For details, please refer to the description of step S103 and step S104, and this implementation will not be repeated here.
[0148] S307: When the preset text is inconsistent with the recognized first text, the preset text is used to train the target multimodal model to complete the update of the target multimodal model, and the updated target multimodal model is used to execute the steps of obtaining the preset interface and target language to be processed.
[0149] In this embodiment, when the preset text is consistent with the first text obtained by the target multimodal model, it indicates that the target multimodal model is accurately recognized. At this time, there is no need to further process the target multimodal model, and the process can directly return to execute step S301. When the preset text is inconsistent with the first text obtained by the target multimodal model, it indicates that the target multimodal model is inaccurately recognized. At this time, it is necessary to further train the target multimodal model using the preset text to complete the update of the target multimodal model, thereby improving the accuracy of the updated target multimodal model recognition. After completing the update of the target multimodal model, the process can return to execute step S301 to ensure the accuracy of subsequent target multimodal model recognition. In the above manner, this embodiment continuously trains and updates the target multimodal model, improves the recognition accuracy of the target multimodal model, and further improves the accuracy of the generated target interface.
[0150] The present embodiment provides an interface generation method, which obtains a preset interface to be processed and a target language, and uses a trained target multimodal model to identify the preset interface, so as to identify a first text in the preset interface and text attribute information corresponding to the first text, and translates the first text according to the target language and the trained target multimodal model to obtain a target text in the target language, so as to process the preset interface according to the text attribute information and the target text, so as to automatically generate a target interface in the target language, without manually processing the preset interface, thereby improving the interface generation efficiency and reducing the interface generation cost.
[0151] refer to Figure 4 and Figure 5As shown, the following is an example to introduce the entire interface generation process in detail, as follows:
[0152] The user interface designer uploads the preset interface and the target language, the text in the preset interface is in Chinese, and the target language is English;
[0153] The R&D engineer uploads the XML file of the text in the preset interface;
[0154] Using the target multimodal model to perform text recognition on the preset interface to obtain a first text and text attribute information corresponding to the first text;
[0155] When the first text is consistent with the preset text, translating the first text according to the target language and the target multimodal model to obtain a target text in the target language;
[0156] When the first text is inconsistent with the preset text, the preset text is used as the first text, and the first text is translated according to the target language and the target multimodal model to obtain a target text in the target language;
[0157] Processing the preset interface according to the text attribute information and the target text to generate a first initial interface corresponding to the preset interface;
[0158] Display the first initial interface;
[0159] When receiving confirmation information for the first initial interface, determining the first initial interface as a target interface corresponding to the preset interface;
[0160] When the first modification information of the first initial interface is received, the first initial interface is processed according to the first modification information to obtain the target interface corresponding to the preset interface, and the target multimodal model is retrained using the first modification information to complete the update of the target multimodal model.
[0161] refer to Figure 6 , Figure 6A schematic diagram of the structure of an interface generation device provided in an embodiment of the present application. An interface generation device provided in an embodiment of the present application includes: an acquisition module 10, a recognition module 20, a translation module 30 and a generation module 40; the acquisition module 10 is used to acquire a preset interface and a target language to be processed, and the target language is used to indicate that the text in the preset interface is translated into a text having the target language; the recognition module 20 is used to recognize the preset interface using a trained target multimodal model to recognize the first text in the preset interface and the text attribute information corresponding to the first text; the translation module 30 is used to translate the first text according to the target language and the trained target multimodal model to obtain a target text corresponding to the first text, and the language of the target text is the target language; the generation module 40 is used to process the preset interface according to the text attribute information and the target text to generate a target interface corresponding to the preset interface.
[0162] In this embodiment, the text attribute information includes the text box position of the text box where the first text is located and the text format of the first text.
[0163] In this embodiment, the translation module 30 is further used for:
[0164] Determining first prompt information according to the target language, wherein the first prompt information is used to instruct generating a target text in the target language from the first text;
[0165] The first text and the first prompt information are input into the trained target multimodal model, so that the target multimodal model, under the guidance of the first prompt information, translates the first text into the target language to obtain a target text in the target language.
[0166] In this embodiment, the translation module 30 is further used for:
[0167] Determine second prompt information by using the text box position, the text format and the target language, wherein the second prompt information is used to instruct to generate a target text in the target language and located in the text box from the first text;
[0168] The first text and the second prompt information are input into the trained target multimodal model, so that the target multimodal model, under the guidance of the second prompt information, uses the target language to translate the first text to obtain the target text in the target language, and uses the text box position and the text format to process the target text to obtain the target text located in the text box.
[0169] In this embodiment, the generating module 40 is further used for:
[0170] Processing the preset interface according to the text attribute information and the target text to generate a first initial interface corresponding to the preset interface;
[0171] Displaying the first initial interface;
[0172] When receiving confirmation information for the first initial interface, determining the first initial interface as a target interface corresponding to the preset interface;
[0173] When first modification information for the first initial interface is received, the first initial interface is processed according to the first modification information to obtain a target interface corresponding to the preset interface.
[0174] In this embodiment, the generating module 40 is further used for:
[0175] Clearing the first text from the preset interface;
[0176] Based on the text box position of the text box where the first text is located, the obtained target text is rendered into the text box to obtain a target interface corresponding to the preset interface.
[0177] The interface generation device provided in this embodiment further includes a training module, which is used to:
[0178] Acquire a sample interface set, wherein each sample interface in the sample interface set is annotated with a sample text in a first sample language, sample text attribute information corresponding to the sample text, and a second sample language, wherein the first sample language is used to represent a language of the sample text in the preset sample interface, and the second sample language is used to represent a language after the sample text in the first sample language is translated;
[0179] For each of the sample interfaces in the sample interface set, generating sample prompt information corresponding to the sample interface according to the sample text in the first sample language corresponding to the sample interface, the sample text attribute information and the sample text in the second sample language;
[0180] All the sample interfaces in the sample interface set and the corresponding sample prompt information are used to fine-tune the initial multimodal model to obtain the target multimodal model.
[0181] In this embodiment, the acquisition module 10 is further used for:
[0182] The preset text in the preset interface is obtained, where the preset text is used to represent the preset text required to be displayed in the preset interface.
[0183] In this embodiment, the translation module 30 is further used for:
[0184] When the preset text is inconsistent with the recognized first text, the preset text is determined as the first text, and the determined first text is translated according to the target language and the target multimodal model to obtain a target text corresponding to the preset text.
[0185] In this embodiment, the training module is also used to:
[0186] When the preset text is inconsistent with the first text obtained by recognition, the target multimodal model is trained using the preset text to complete the update of the target multimodal model, and the updated target multimodal model is used to return to execute the acquisition module 10.
[0187] In this embodiment, the generating module 40 is further used for:
[0188] Processing the preset interface according to the text attribute information and the target text to obtain a second initial interface corresponding to the preset interface, wherein the target text is displayed in the second initial interface;
[0189] Determining a first terminal set and a second terminal set corresponding to the preset interface, each first terminal in the first terminal set is used to evaluate the translation effect of the obtained target text, and each second terminal in the second terminal set is used to evaluate the visual effect of the obtained second initial interface;
[0190] Sending the second initial interface to each of the first terminals in the first terminal set and sending the second initial interface to each of the second terminals in the second terminal set;
[0191] receiving first feedback information for the target text sent by each of the first terminals in the first terminal set, and receiving second feedback information for the second initial interface sent by each of the second terminals in the first terminal set;
[0192] The second initial interface is processed according to each of the first feedback information and each of the second feedback information to obtain a target interface corresponding to the preset interface.
[0193] In this embodiment, the first feedback information includes a first score, and the second feedback information includes a second score.
[0194] In this embodiment, the generating module 40 is further used for:
[0195] Determine the average of the first scores included in all the first feedback information to obtain a first average score, and determine the average of the second scores included in all the second feedback information to obtain a second average score;
[0196] When the first average score is greater than a first score threshold and the second average score is greater than a second score threshold, the second initial interface is determined as the target interface corresponding to the preset interface, the first score threshold is used to characterize that the translation effect of the target text obtained reaches the expected lower limit value corresponding to the expected value, and the second score threshold is used to characterize that the visual effect of the second initial interface obtained reaches the expected lower limit value corresponding to the expected value.
[0197] In this embodiment, the training module is also used to:
[0198] When the first average score is less than or equal to the first score threshold, if each of the first feedback information further includes second modification information for the translation effect of the target text, all of the second modification information are used to train the target multimodal model to complete the update of the target multimodal model, and the translation module 30 is executed using the updated target multimodal model until the first average score is greater than the first score threshold; and / or,
[0199] When the second average score is less than or equal to the second score threshold, if each of the second feedback information also includes third modification information for the visual effect of the second initial interface, all the third modification information are used to train the target multimodal model to complete the update of the target multimodal model, and the translation module 30 is executed using the updated target multimodal model until the second average score is greater than the second score threshold.
[0200] In this embodiment, the identification module 20 is further used for:
[0201] Using the trained target multimodal model to identify the preset interface, so as to identify a first text in the preset interface, text attribute information corresponding to the first text, and a first text type to which the first text belongs;
[0202] The translating the first text according to the target language and the target multimodal model to obtain a target text corresponding to the first text includes:
[0203] If the first text type does not belong to a preset text type set, the first text is translated according to the target language and the target multimodal model to obtain a target text corresponding to the first text, and each preset text type in the preset text type set is used to indicate that there is no need to translate the text belonging to the preset text type.
[0204] The present embodiment provides an interface generation device, which obtains a preset interface to be processed and a target language, and uses a trained target multimodal model to identify the preset interface, so as to identify a first text in the preset interface and text attribute information corresponding to the first text, and translates the first text according to the target language and the trained target multimodal model to obtain a target text in the target language, so as to process the preset interface according to the text attribute information and the target text, so as to automatically generate a target interface in the target language, without manually processing the preset interface, thereby improving the interface generation efficiency and reducing the interface generation cost.
[0205] refer to Figure 7 As shown, Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 700 in this embodiment may include: at least one processor 701, a vehicle memory 702, at least one network interface 704 and other user interfaces 703. The various components in the electronic device 700 are coupled together through a bus system 705. It can be understood that the bus system 705 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 705 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are labeled as bus systems 705.
[0206] The user interface 703 may include a display, a keyboard, or a pointing device (eg, a mouse, a trackball, a touch pad, or a touch screen).
[0207] It can be understood that the memory 702 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM). The memory 702 described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0208] In some implementations, the memory 702 stores the following elements, executable units or data structures, or a subset thereof, or an extended set thereof: an operating system 7021 and an application 7022 .
[0209] The operating system 7021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application 7022 includes various application programs, such as a media player (Media Player), a browser (Browser), etc., which are used to implement various application services. The program for implementing the method of the embodiment of the present application can be included in the application 7022.
[0210] In the embodiment of the present application, by calling the program or instruction stored in the memory 702, specifically, the program or instruction stored in the application 7022, the processor 701 is used to execute the method provided by each method embodiment.
[0211] The method disclosed in the above embodiment of the present application can be applied to the processor 701, or implemented by the processor 701. The processor 701 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 701 or the instruction in the form of software. The above processor 701 can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software units in the decoding processor can be executed. The software unit can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 702, and the processor 701 reads the information in the memory 702 and completes the above method in combination with its hardware.
[0212] It is understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or at least one application specific integrated circuit (ASIC), digital signal processor (DSP), digital signal processing vehicle (DSPDevice, DSPD), programmable logic vehicle (PLD), field programmable gate array (FPGA), general purpose processor, controller, microcontroller, microprocessor, other electronic unit for performing the functions described in the present application, or a combination thereof.
[0213] For software implementation, the technology described herein can be implemented by a unit that performs the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
[0214] The embodiment of the present application also provides a storage medium (computer-readable storage medium). The storage medium here stores one or at least one program. The storage medium may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a read-only memory, a flash memory, a hard disk or a solid-state drive; the memory may also include a combination of the above-mentioned types of memory.
[0215] When one or at least one program in the storage medium can be executed by one or at least one processor. When the storage medium is applied to a vehicle, the above-mentioned method executed in an electronic device can be implemented. The processor is used to execute the electronic device program stored in the memory to implement the above-mentioned method executed in the electronic device.
[0216] The professionals should also be further aware that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0217] It should be noted that the phrases "one implementation", "an embodiment", "an exemplary embodiment", "some embodiments", etc. mentioned in the specification indicate that the described embodiments may include certain features, structures or characteristics, but not every embodiment may include the certain features, structures or characteristics. In addition, such phrases do not necessarily refer to the same embodiment. In addition, when describing certain features, structures or characteristics in conjunction with an embodiment, it is within the knowledge of those skilled in the art to implement such features, structures or characteristics in conjunction with other embodiments, whether explicitly or not explicitly described.
[0218] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method or article including a series of elements may include not only those elements, but also other elements not explicitly listed, or may also include elements inherent to such process, method, article or electronic device. In the absence of more limitations, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or electronic device including the elements.
[0219] The above embodiments are only preferred embodiments for fully illustrating the present application, and the protection scope of the present application is not limited thereto. Any equivalent substitution or change made by a person skilled in the art based on the present application is within the protection scope of the present application.
Claims
1. A method for generating an interface, characterized in that: include: Acquire a preset interface to be processed and a target language, wherein the target language is used to indicate that text in the preset interface is translated into text in the target language; Using the trained target multimodal model to identify the preset interface, so as to identify the first text in the preset interface and the text attribute information corresponding to the first text; According to the target language and the trained target multimodal model, the first text is translated to obtain a target text corresponding to the first text, wherein the language of the target text is the target language; The preset interface is processed according to the text attribute information and the target text to generate a target interface corresponding to the preset interface.
2. The interface generation method according to claim 1, characterized in that: The translating the first text according to the target language and the trained target multimodal model to obtain a target text corresponding to the first text includes: Determining first prompt information according to the target language, wherein the first prompt information is used to instruct generating a target text in the target language from the first text; The first text and the first prompt information are input into the trained target multimodal model, so that the target multimodal model, under the guidance of the first prompt information, translates the first text into the target language to obtain a target text in the target language.
3. The interface generation method according to claim 1, characterized in that: The text attribute information includes the text box position of the text box where the first text is located and the text format of the first text; The translating the first text according to the target language and the trained target multimodal model to obtain a target text corresponding to the first text includes: Determine second prompt information by using the text box position, the text format and the target language, wherein the second prompt information is used to instruct to generate a target text in the target language and located in the text box from the first text; The first text and the second prompt information are input into the trained target multimodal model, so that the target multimodal model, under the guidance of the second prompt information, uses the target language to translate the first text to obtain the target text in the target language, and uses the text box position and the text format to process the target text to obtain the target text located in the text box.
4. The interface generation method according to claim 1, characterized in that: The processing of the preset interface according to the text attribute information and the target text to generate a target interface corresponding to the preset interface includes: Processing the preset interface according to the text attribute information and the target text to generate a first initial interface corresponding to the preset interface; Displaying the first initial interface; When receiving confirmation information for the first initial interface, determining the first initial interface as a target interface corresponding to the preset interface; When first modification information for the first initial interface is received, the first initial interface is processed according to the first modification information to obtain a target interface corresponding to the preset interface.
5. The interface generation method according to claim 1, characterized in that: The text attribute information includes the text box position of the text box where the first text is located; The processing of the preset interface according to the text attribute information and the target text to generate a target interface corresponding to the preset interface includes: Clearing the first text from the preset interface; Based on the text box position of the text box where the first text is located, the obtained target text is rendered into the text box to obtain a target interface corresponding to the preset interface.
6. The interface generation method according to claim 1, characterized in that: The target multimodal model is trained in the following way: Acquire a sample interface set, wherein each sample interface in the sample interface set is annotated with a sample text in a first sample language, sample text attribute information corresponding to the sample text, and a second sample language, wherein the first sample language is used to represent a language of the sample text in the preset sample interface, and the second sample language is used to represent a language after the sample text in the first sample language is translated; For each of the sample interfaces in the sample interface set, generating sample prompt information corresponding to the sample interface according to the sample text in the first sample language corresponding to the sample interface, the sample text attribute information and the second sample language; All the sample interfaces in the sample interface set and the corresponding sample prompt information are used to fine-tune the initial multimodal model to obtain the target multimodal model.
7. The interface generation method according to claim 1, characterized in that: Before executing the step of using the trained target multimodal model to identify the preset interface to identify the first text in the preset interface and the text attribute information corresponding to the first text, the method further includes: Acquire a preset text in the preset interface, where the preset text is used to represent a preset text to be displayed in the preset interface; Before executing the step of translating the first text according to the target language and the trained target multimodal model to obtain a target text corresponding to the first text, the method further includes: When the preset text is inconsistent with the recognized first text, the preset text is determined as the first text, and according to the determined first text, the step of translating the first text according to the target language and the trained target multimodal model to obtain a target text corresponding to the first text is performed; After executing the step of processing the preset interface according to the text attribute information and the target text to generate a target interface corresponding to the preset interface, the method further includes: When the preset text is inconsistent with the first text obtained by recognition, the preset text is used to train the target multimodal model to complete the update of the target multimodal model, and the updated target multimodal model is used to execute the step of obtaining the preset interface and target language to be processed.
8. The interface generation method according to claim 1, characterized in that: The processing of the preset interface according to the text attribute information and the target text to generate a target interface corresponding to the preset interface includes: Processing the preset interface according to the text attribute information and the target text to obtain a second initial interface corresponding to the preset interface, wherein the target text is displayed in the second initial interface; Determining a first terminal set and a second terminal set corresponding to the preset interface, each first terminal in the first terminal set is used to evaluate the translation effect of the obtained target text, and each second terminal in the second terminal set is used to evaluate the visual effect of the obtained second initial interface; Sending the second initial interface to each of the first terminals in the first terminal set and sending the second initial interface to each of the second terminals in the second terminal set; receiving first feedback information for the target text sent by each of the first terminals in the first terminal set, and receiving second feedback information for the second initial interface sent by each of the second terminals in the first terminal set; The second initial interface is processed according to each of the first feedback information and each of the second feedback information to obtain a target interface corresponding to the preset interface.
9. The interface generation method according to claim 8, characterized in that: The first feedback information includes a first score, and the second feedback information includes a second score; The processing of the second initial interface according to each of the first feedback information and each of the second feedback information to obtain a target interface corresponding to the preset interface includes: Determine the average of the first scores included in all the first feedback information to obtain a first average score, and determine the average of the second scores included in all the second feedback information to obtain a second average score; When the first average score is greater than a first score threshold and the second average score is greater than a second score threshold, the second initial interface is determined as the target interface corresponding to the preset interface, the first score threshold is used to characterize that the translation effect of the target text obtained reaches the expected lower limit value corresponding to the expected value, and the second score threshold is used to characterize that the visual effect of the second initial interface obtained reaches the expected lower limit value corresponding to the expected value.
10. The interface generation method according to claim 9, characterized in that: After obtaining the first average score and the second average score, the method further includes: When the first average score is less than or equal to the first score threshold, if each of the first feedback information further includes second modification information for the translation effect of the target text, all of the second modification information are used to train the target multimodal model to complete the update of the target multimodal model, and the updated target multimodal model is used to perform the step of translating the first text according to the target language and the trained target multimodal model to obtain the target text corresponding to the first text, until the first average score is greater than the first score threshold; and / or, When the second average score is less than or equal to the second score threshold, if each of the second feedback information also includes third modification information for the visual effect of the second initial interface, all the third modification information are used to train the target multimodal model to complete the update of the target multimodal model, and the updated target multimodal model is used to perform the step of translating the first text according to the target language and the trained target multimodal model to obtain a target text corresponding to the first text, until the second average score is greater than the second score threshold.
11. The interface generation method according to claim 1, characterized in that: The using the trained target multimodal model to identify the preset interface to identify the first text in the preset interface and the text attribute information corresponding to the first text includes: Using the trained target multimodal model to identify the preset interface, so as to identify a first text in the preset interface, text attribute information corresponding to the first text, and a first text type to which the first text belongs; The translating the first text according to the target language and the trained target multimodal model to obtain a target text corresponding to the first text includes: If the first text type does not belong to a preset text type set, the first text is translated according to the target language and the trained target multimodal model to obtain a target text corresponding to the first text, and each preset text type in the preset text type set is used to indicate that there is no need to translate the text belonging to the preset text type.
12. An interface generation device, characterized in that: include: An acquisition module, used to acquire a preset interface to be processed and a target language, wherein the target language is used to indicate that the text in the preset interface is translated into a text in the target language; A recognition module, used to recognize the preset interface using the trained target multimodal model, so as to recognize the first text in the preset interface and the text attribute information corresponding to the first text; A translation module, configured to translate the first text according to the target language and the trained target multimodal model to obtain a target text corresponding to the first text, wherein the language of the target text is the target language; A generating module is used to process the preset interface according to the text attribute information and the target text to generate a target interface corresponding to the preset interface.
13. An electronic device, characterized in that: include: A processor and a memory, wherein the processor is used to execute an interface generation program stored in the memory to implement the interface generation method of any one of claims 1 to 11.
14. A storage medium, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the interface generation method of any one of claims 1 to 11.
