Method for generating scalable vector graphic poster, model training method and equipment
Through a model-based method, the preset poster generation model is used to automatically generate scalable vector graphic posters, which solves the problems of poor versatility, low efficiency and low accuracy of poster generation in the prior art, and achieves more efficient, universal and accurate poster generation.
Patent Information
- Application Number
- CN202510125497.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-26
- Publication Date
- 2025-05-30
AI Technical Summary
In the prior art, generating scalable vector graphics (SVG) posters requires users to have certain SVG code editing capabilities, resulting in poor versatility, low efficiency and low accuracy of generated posters.
Using a model-based method, the key information in the poster generation request is processed through the preset poster generation model, the scalable vector graphic code is generated, and the poster is displayed. The model is trained through the training dataset, automatically generates posters, and reduces manual intervention.
It improves the generation efficiency, versatility and accuracy of scalable vector graphic posters, reduces the requirements for SVG code editing capabilities, and makes the poster generation process more automated and efficient.
Smart Images

Figure CN120066487A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of big data technology in the field of data processing technology, and in particular, to a method, a model training method, and a device for generating a scalable vector graphics poster. Background Art
[0002] A scalable vector graphics poster is a digital poster made using scalable vector graphics (SVG) technology. SVG is a vector-based image format with unique advantages such as scalability, resolution independence, and editability.
[0003] In the prior art, SVG code needs to be written manually to generate the corresponding SVG poster.
[0004] However, the method in the prior art requires users to have a certain ability to edit SVG code, which results in problems such as poor generality, low generation efficiency, and low accuracy in poster generation. Summary of the Invention
[0005] The present disclosure provides a method, a model training method, and a device for generating a scalable vector graphics poster.
[0006] According to a first aspect of the present disclosure, there is provided a method for generating a scalable vector graphics poster based on a model, including:
[0007] In response to a poster generation request, processing key information in the poster generation request based on a preset poster generation model to obtain scalable vector graphics code; wherein, the poster generation request is used to request the generation of a scalable vector graphics poster, and the poster generation request includes key information of the scalable vector graphics poster to be generated;
[0008] Processing the scalable vector graphics code based on the preset poster generation model to generate and display a scalable vector graphics poster.
[0009] According to a second aspect of the present disclosure, there is provided a method for training a poster generation model, including:
[0010] Obtaining a first training data set; wherein, the first training data set includes code generation prompt words and scalable vector graphics code; the code generation prompt words are obtained based on the key information of the scalable vector graphics poster;
[0011] Training an initial model according to the code generation prompt words and the scalable vector graphics code in the first training data set to obtain a poster generation model;
[0012] wherein, the poster generation model is the preset poster generation model as described in the first aspect above.
[0013] According to a third aspect of the present disclosure, there is provided an apparatus for generating a scalable vector graphic poster based on a model, including:
[0014] A processing unit, configured to process key information in the poster generation request based on a preset poster generation model in response to a poster generation request, to obtain scalable vector graphic code; wherein, the poster generation request is used to request the generation of a scalable vector graphic poster, and the poster generation request includes key information of the scalable vector graphic poster to be generated;
[0015] A generating unit, configured to process the scalable vector graphic code based on the preset poster generation model, to generate and display a scalable vector graphic poster.
[0016] According to a fourth aspect of the present disclosure, there is provided a training apparatus for a poster generation model, including:
[0017] A first obtaining unit, configured to obtain a first training data set; wherein, the first training data set includes code generation prompt words and scalable vector graphic code; the code generation prompt words are obtained based on key information of the scalable vector graphic poster;
[0018] A first training unit, configured to train an initial model according to the code generation prompt words and the scalable vector graphic code in the first training data set, to obtain a poster generation model;
[0019] wherein, the poster generation model is the preset poster generation model as described in the first aspect above.
[0020] According to a fifth aspect of the present disclosure, there is provided a computer program product, which includes: a computer program, the computer program is stored in a readable storage medium, and at least one processor of an electronic device can read the computer program from the readable storage medium, and the at least one processor executes the computer program to enable a terminal device to execute the method described in the first aspect or the second aspect.
[0021] According to a sixth aspect of the present disclosure, there is provided an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method described in the first aspect or the second aspect.
[0022] According to a seventh aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method described in the first aspect or the second aspect.
[0023] The technology according to the present disclosure improves the efficiency, versatility, and accuracy of scalable vector graphic poster generation.
[0024] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. Description of the Drawings
[0025] The drawings are used to better understand the solution and do not constitute a limitation to the present disclosure. Among them:
[0026] Figure 1 is a schematic diagram according to the first embodiment of the present disclosure;
[0027] Figure 2 is a schematic diagram according to the second embodiment of the present disclosure;
[0028] Figure 3 is a schematic diagram according to the third embodiment of the present disclosure;
[0029] Figure 4 is a schematic diagram according to the fourth embodiment of the present disclosure;
[0030] Figure 5 is a schematic diagram according to the fifth embodiment of the present disclosure;
[0031] Figure 6 is a block diagram of a device for implementing the generation of a model-based scalable vector graphic poster according to an embodiment of the present disclosure;
[0032] Figure 7 is another block diagram of a device for implementing the generation of a model-based scalable vector graphic poster according to an embodiment of the present disclosure;
[0033] Figure 8 is a block diagram of a device for training a poster generation model according to an embodiment of the present disclosure;
[0034] Figure 9 is another block diagram of a device for training a poster generation model according to an embodiment of the present disclosure;
[0035] Figure 10 is a schematic block diagram of an exemplary electronic device 100 for implementing an embodiment of the present disclosure. Detailed Embodiments
[0036] The following describes exemplary embodiments of the present disclosure with reference to the accompanying drawings. Various details of the embodiments of the present disclosure are included to facilitate understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, descriptions of well-known functions and structures are omitted below for clarity and conciseness.
[0037] The present disclosure provides a method, a model training method, and a device for generating a scalable vector graphics poster, which are applied to the field of big data technology in the field of data processing, so as to achieve the effects of improving the efficiency, generality, and accuracy of generating scalable vector graphics posters.
[0038] Figure 1 is a schematic diagram according to the first embodiment of the present disclosure. As Figure 1 shown, the method for generating a scalable vector graphics poster based on a model provided by the first embodiment of the present disclosure includes:
[0039] Step S101: In response to a poster generation request, process the key information in the poster generation request based on a preset poster generation model to obtain scalable vector graphics code.
[0040] Specifically, in response to a poster generation request, the key information in the poster generation request can be processed based on a preset poster generation model to obtain scalable vector graphics code.
[0041] Among them, the poster generation request is used to request the generation of a scalable vector graphics poster. Specifically, a scalable vector graphics (SVG for short) poster is a digital poster made using scalable vector graphics (SVG) technology. Among them, scalable vector graphics is a vector-based image format with unique advantages such as scalability, resolution independence, and editability. Compared with traditional bitmap graphics (such as JPG, PNG), scalable vector graphics can maintain high clarity of the graphics at different sizes and can add various animation effects, providing more possibilities for creation and interaction. Among them, the characteristics of SVG posters include: scalability, resolution independence, editability, and support for various animation effects. Specifically, scalability means that SVG images can be enlarged or reduced as needed without losing clarity, which is suitable for display on screens of different sizes; resolution independence means that SVG images are not restricted by resolution and can maintain a consistent display effect on various devices; editability means that users can easily modify the content and design of SVG images, which is suitable for scenarios that need to be updated frequently; SVG supports various animation effects, which can increase the interactivity and attractiveness of the poster.
[0042] Specifically, this application does not limit the poster generation request. Any request for generating a scalable vector graphics poster can be used as the poster generation request provided by this application. Optionally, the poster generation request may include information indicating the generation of a scalable vector graphics poster. For example, the poster generation request may include the following information: Please generate a scalable vector graphics poster related to...
[0043] Among them, the poster generation request includes the key information of the scalable vector graphics poster to be generated. Among them, the key information refers to the information that can indicate the generation of the scalable vector graphics poster to be generated. Specifically, this application does not limit the key information. Any information indicating the generation of the scalable vector graphics poster to be generated can be used as the key information provided by this application. Optionally, the key information may be information describing the content of the scalable vector graphics poster to be generated. Optionally, the information describing the scalable vector graphics poster to be generated may be information describing the content of the scalable vector graphics poster to be generated in at least one form such as words, phrases, paragraphs, articles, etc. For example, the key information may be "save water", or it may be an article describing water conservation. Optionally, the information describing the content of the scalable vector graphics poster to be generated may be information describing at least one of the format content, text content, image content, etc.
[0044] Among them, the preset poster generation model is a pre-constructed model for automatically generating scalable vector graphics code and generating a corresponding scalable vector graphics poster based on the generated scalable vector graphics code. Specifically, this application does not limit the preset poster generation model. Any pre-constructed model for automatically generating scalable vector graphics code and generating a corresponding scalable vector graphics poster based on the generated scalable vector graphics code can be used as the preset poster generation model provided by this application.
[0045] Among them, this application does not limit the process of processing the key information in the poster generation request based on the preset poster generation model to obtain the scalable vector graphics code. Optionally, the key information in the poster generation request may be processed based on the preset poster generation model to obtain at least one code generation prompt word; based on the preset poster generation model, code writing processing is performed according to the code generation prompt word to obtain the scalable vector graphics code.
[0046] Among them, this application does not limit the number of scalable vector graphics codes obtained by processing the key information in the poster generation request based on the preset poster generation model. Optionally, processing the key information in the poster generation request based on the preset poster generation model may obtain at least one scalable vector graphics code.
[0047] Step S102: Process the Scalable Vector Graphics (SVG) code based on a preset poster generation model, and generate and display an SVG poster.
[0048] Specifically, the preset poster generation model can process the SVG code obtained in step S101 to generate and display an SVG poster.
[0049] Herein, the present application does not limit the process of processing the SVG code based on the preset poster generation model to generate and display an SVG poster. Optionally, the preset poster generation model may include an editor, and the SVG code can be rendered and edited based on the editor to generate and display an SVG poster.
[0050] Herein, the present application does not limit the number of SVG posters generated and displayed by processing the SVG code based on the preset poster generation model. The number of SVG posters generated and displayed corresponds to the number of SVG codes obtained by processing the key information in the poster generation request based on the preset poster generation model in step S101. That is, each SVG code obtained in step S101 corresponds to one SVG poster generated and displayed.
[0051] In the embodiments of the present disclosure, by responding to a poster generation request, processing the key information in the poster generation request based on a preset poster generation model to obtain SVG code, and processing the SVG code based on the preset poster generation model to generate and display an SVG poster. Herein, by automatically generating an SVG poster in response to the poster generation request based on the preset poster generation model, the generality and efficiency of SVG poster generation can be improved. Herein, during the process of automatically generating an SVG poster based on the preset poster generation model, automatically generating SVG code can improve the accuracy of SVG poster generation. Based on the above description, the method for generating an SVG poster based on a model provided by the present application can improve the generality, efficiency, and accuracy of SVG poster generation.
[0052] It should be noted that the head model in this embodiment is not a head model for a specific user and does not reflect the personal information of a specific user. It should be noted that the two-dimensional face images in this embodiment are from a public dataset.
[0053] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision, and disclosure of the user's personal information and other processing comply with the provisions of relevant laws and regulations and do not violate public order and good customs.
[0054] To enable readers to more deeply understand the implementation principle of the present disclosure, the following Figures 2 - 10 will be Figure 1 further refined with reference to the illustrated embodiments.
[0055] Figure 2 is a schematic diagram according to the second embodiment of the present disclosure. As Figure 2 shown, the process of processing the key information in the poster generation request based on a preset poster generation model to obtain scalable vector graphic code provided by the second embodiment of the present disclosure includes:
[0056] Step S201: Process the key information in the poster generation request based on a preset poster generation model to obtain at least one code generation prompt word.
[0057] Specifically, based on a preset poster generation model, the key information in the poster generation request can be processed to obtain at least one code generation prompt word.
[0058] Among them, the description of the key information in the poster generation request can refer to the description in step S101 and will not be elaborated here.
[0059] Among them, the description of the preset poster generation model can refer to the description in step S101 and will not be elaborated here. On this basis, the preset poster generation model is also used to process the key information in the poster generation request to obtain at least one code generation prompt word.
[0060] Among them, the code generation prompt word is used to indicate the generation of the scalable vector graphic code to be generated, and the scalable vector graphic code to be generated is used to generate the scalable vector graphic poster to be generated. Specifically, the present application does not limit the code generation prompt word. Optionally, the code generation prompt word can be used to indicate the generation of the scalable vector graphic code to be generated based on the key information in the poster generation request.
[0061] Among them, the present application does not limit the number of code generation prompt words obtained by processing the key information in the poster generation request based on a preset poster generation model. Specifically, the number of code generation prompt words obtained corresponds to the number of scalable vector graphic codes obtained in step S101, that is, one code generation prompt word indicates the generation of one scalable vector graphic code to be generated, and one scalable vector graphic code to be generated is used to generate one scalable vector graphic poster to be generated.
[0062] Specifically, this application does not limit the process of processing the key information in the poster generation request based on a preset poster generation model to obtain at least one code generation prompt. Optionally, the process of processing the key information in the poster generation request based on a preset poster generation model to obtain at least one code generation prompt may include:
[0063] Performing a matching process on the key information based on a preset poster generation model to obtain at least one poster content template.
[0064] Performing a combination process on the key information and the poster content template based on a preset poster generation model to obtain at least one code generation prompt.
[0065] Among them, the poster content template is a template for indicating the content of the generated poster. Specifically, based on the description of the key information in step S101, if the code generation prompt is directly generated based on the key information, the generated code generation prompt will be too random, resulting in inaccurate scalable vector graphics code and scalable vector graphics posters generated. Therefore, the poster content template can be matched based on the key information first, and then the scalable vector graphics code can be generated based on the key information and the poster content template, so that the scalable vector graphics code indicates the scalable vector graphics code to be generated based on the key information in the poster generation request and the matched content template.
[0066] Among them, this application does not limit the number of the matched poster content templates. The number of the poster content templates corresponds to the number of the obtained code generation prompts, that is, the combination process is performed on the key information and each poster content template based on a preset poster generation model to obtain the code generation prompt corresponding to each poster content template.
[0067] Among them, if the code generation prompt is obtained by performing a combination process on the key information and the poster content template based on a preset poster generation model, the code generation prompt can be used to indicate the scalable vector graphics code to be generated based on the key information and the poster content template in the poster generation request.
[0068] Among them, in the process of generating the code generation prompt, matching the poster content template based on the key information first can make the generated code generation prompt more targeted, thereby reducing the randomness of the scalable vector graphics code generated based on the code generation prompt and further improving the accuracy of the scalable vector graphics poster generation.
[0069] Optionally, the process of processing the key information in the poster generation request based on a preset poster generation model to obtain at least one code generation prompt word may further include: randomly matching a preset number of poster content templates from a preset content template library based on the preset poster generation model. Combining and processing the key information and the poster content templates based on the preset poster generation model to obtain at least one code generation prompt word.
[0070] Specifically, this application does not limit the process of matching and processing the key information based on a preset poster generation model to obtain at least one poster content template. Optionally, the process of matching and processing the key information based on a preset poster generation model to obtain at least one poster content template may include:
[0071] Based on the preset poster generation model, matching at least one poster content template from the preset content template library according to the key information.
[0072] Among them, the preset content template library includes at least one preset poster content template. The preset content template library is a pre-constructed database of preset poster content templates. Among them, this application does not limit the process of constructing the poster content template library. Optionally, the content template corresponding to the historical poster may be determined as the preset poster content template. Optionally, a poster content template that meets the user's or scenario's needs may also be directly constructed as the preset poster content template.
[0073] Specifically, this application does not limit the process of matching at least one poster content template from the preset content template library based on the preset poster generation model according to the key information. Optionally, based on the preset poster generation model, based on a vectorization algorithm and a similarity calculation algorithm, at least one poster content template may be matched from the preset content template library according to the key information.
[0074] Among them, in the process of matching the poster content template, matching from the preset content template library can improve the rationality of the matched poster content template, and also improve the template matching efficiency, thereby improving the rationality and generation efficiency of the obtained code generation prompt word, improving the accuracy and efficiency of the scalable vector graphic code generation, and further improving the accuracy and efficiency of the scalable vector graphic poster generation.
[0075] Specifically, this application does not limit the process of matching at least one poster content template from the preset content template library based on the preset poster generation model according to the key information. Optionally, the process of matching at least one poster content template from the preset content template library based on the preset poster generation model according to the key information may include:
[0076] Vectorize the preset poster content templates included in the content template library based on a preset poster generation model to obtain at least one vectorized preset poster content template. And vectorize the key information to obtain the vectorized key information.
[0077] Calculate the similarity between the vectorized key information and each vectorized preset poster content template based on the preset poster generation model. And determine the preset poster content templates with calculation results exceeding the preset similarity threshold as the matched poster content templates.
[0078] Specifically, based on the above descriptions of the key information and the poster content templates, directly matching the poster content templates from the content template library according to the key information will cause problems of low matching efficiency and low accuracy. Therefore, the key information and each preset poster content template in the content template library can be further processed to improve the matching efficiency and accuracy.
[0079] Among them, the application does not limit the process of further processing. Optionally, vectorization processing can be performed first, then similarity calculation processing can be performed according to the results of the vectorization processing, and poster content template matching can be performed according to the results of the similarity calculation processing.
[0080] Among them, the preset similarity threshold is the threshold of the preset similarity for poster content template matching. For example, if the preset similarity threshold is 80%, then the preset poster content templates with similarity calculation results exceeding 80% are determined as the matched poster content templates.
[0081] Optionally, after the similarity calculation processing, the results of the similarity calculation processing can be sorted, and a preset number of preset poster content templates can be selected as the matched poster content templates according to the results of the sorting. Among them, the preset number is the number of preset poster content templates to be matched. For example, if the preset number is three, then the three preset poster content templates with the highest similarity calculation results are determined as the matched poster content templates.
[0082] Among them, in the process of matching at least one poster content template from the preset content template library according to the key information, by combining vectorization processing and similarity calculation processing, the matching efficiency and matching accuracy of the key information and the poster content template can be improved, thereby improving the accuracy and generation efficiency of the obtained code generation prompt words, improving the accuracy and efficiency of the generation of scalable vector graphic codes, and further improving the accuracy and efficiency of the generation of scalable vector graphic posters.
[0083] Specifically, this application does not limit the process of combining key information and poster content templates based on a preset poster generation model to obtain at least one code generation prompt. Optionally, the process of combining key information and poster content templates based on a preset poster generation model to obtain at least one code generation prompt may include:
[0084] Based on a preset poster generation model, generate a template according to a preset prompt, and combine and process the key information and the poster content template to obtain at least one code generation prompt.
[0085] Specifically, if the key information and the poster content template are directly combined, the generated code generation prompt cannot accurately indicate the generation of the scalable vector graphic code to be generated based on the key information and the poster content template in the poster generation request. Therefore, based on a preset poster generation model, generate a template according to a preset prompt, and combine and process the key information and each poster content template to obtain a code generation prompt corresponding to each poster content template.
[0086] Among them, the preset prompt generation template is used to indicate the combination method of the key information and the poster content template. The preset prompt generation template is also used to indicate the method of generating scalable vector graphic code based on the key information and the poster content template.
[0087] Among them, an example of the preset prompt generation template is as follows:
[0088] "PROMPT_TPL_GEN_CONTENT_PHL="""**Task description**:
[0089] Based on the
query
content
content template
[0090] Please note:
[0091] 1. The
content template
[0092] 2. In the
content template
[0093] 3. Please make sure that the number of characters in the main title does not exceed 8!!!
[0094] The following is a specific example of a
content template
[0095]
Content template
[0096] {}
[0097] The
query
[0098] {}
[0099] **Task Requirements**:
[0100] step1: Title creation
[0101] Create a title with the same number of characters as the title part in the
content template
query
[0102] step2: Content generation
[0103] 1. The number of titles cannot be less and must be the same as that in the
content template
[0104] 2. Strictly follow the template specifications: Ensure that the generated
content
content template
content template
[0105] 3. Keep the number of lines consistent: The number of lines of the generated
content
content template
content template
content
[0106] 4. Output format requirements: Please strictly organize the output content according to the structure of the
content template
[0107] The final output
content
[0108] """”
[0109] Among them,
query
content template
content
[0110] Specifically, a process of generating a template according to a preset prompt word and combining and processing key information and a poster content template to obtain at least one code generation prompt word may be to combine the key information in the poster generation request and the matched poster content template to a preset position in the preset prompt word generation template to generate a code generation prompt word corresponding to each poster content template.
[0111] Among them, in the process of combining and processing key information and a poster content template based on a preset poster generation model to obtain at least one code generation prompt word, if the combination and processing are performed based on a preset prompt word generation template, the generated code generation prompt word can indicate a way to generate a scalable vector graphics code based on the key information and the poster content template, thereby improving the accuracy of generating the scalable vector graphics code and further improving the accuracy of generating the scalable vector graphics poster.
[0112] Step S202: Based on a preset poster generation model, perform code writing processing according to the code generation prompt word to obtain a scalable vector graphics code.
[0113] Specifically, based on a preset poster generation model, code writing processing can be performed according to the code generation prompt word obtained in step S201 to obtain a scalable vector graphics code.
[0114] Among them, the description of the preset poster generation model can refer to the description in step S201 and will not be elaborated here. On this basis, the preset poster generation model is also used to perform code writing processing according to the code generation prompt word to obtain a scalable vector graphics code.
[0115] Specifically, based on a preset poster generation model, code writing processing can be performed according to each code generation prompt word to obtain a scalable vector graphics code corresponding to each code generation prompt word.
[0116] Among them, the present application does not limit the process of performing code writing processing based on a preset poster generation model according to the code generation prompt word to obtain a scalable vector graphics code. Optionally, the process of performing code writing processing based on a preset poster generation model according to the code generation prompt word to obtain a scalable vector graphics code may include:
[0117] Based on a preset poster generation model, perform code writing processing according to the key information and the poster content template in the code generation prompt word to obtain a scalable vector graphics code.
[0118] Among them, the code generation prompt word includes the key information in the poster generation request and the poster content template. Among them, the description of the code generation prompt word can refer to the description in step S201 and will not be elaborated here.
[0119] Among them, in the process of generating a prompt word according to the code and performing code writing processing to obtain scalable vector graphic code, performing code writing processing according to the key information in the code generation prompt word and the poster content template can improve the accuracy of the obtained scalable vector graphic code, and further improve the accuracy of generating a scalable vector graphic poster.
[0120] Specifically, this application does not limit the process of generating scalable vector graphic code by performing code writing processing according to the key information in the code generation prompt word and the poster content template based on a preset poster generation model. Optionally, the process of generating scalable vector graphic code by performing code writing processing according to the key information in the code generation prompt word and the poster content template based on a preset poster generation model may include:
[0121] Based on a preset poster generation model, perform title generation processing according to the key information in the code generation prompt word and the poster content template to obtain at least one poster title.
[0122] Based on a preset poster generation model, perform code writing processing according to at least one poster title, the key information in the code generation prompt word, and the poster content template to obtain scalable vector graphic code.
[0123] Among them, the poster title refers to the title in the scalable vector graphic poster. Among them, this application does not limit the type and quantity of the poster titles included in the scalable vector graphic poster. Optionally, the type of the included poster titles may be title types such as main title, subtitle, and tertiary title. Among them, the type and quantity of the obtained poster titles correspond to the type and quantity of the poster titles indicated to be generated by the poster content template.
[0124] Among them, after obtaining at least one poster title, code writing processing can be performed according to at least one poster title, the key information in the code generation prompt word, and the poster content template to obtain scalable vector graphic code. Optionally, the poster content under each poster title may be generated first according to at least one poster title, the key information in the code generation prompt word, and the poster content template, and then code writing processing may be performed according to at least one poster title and the poster content under each poster title to obtain scalable vector graphic code.
[0125] Among them, in the process of performing code writing processing to obtain scalable vector graphic code, generating the poster title first and then performing code writing processing based on the poster title can improve the accuracy of generating scalable vector graphic code, and further improve the accuracy of generating a scalable vector graphic poster.
[0126] In the embodiments of the present disclosure, by processing the key information in the poster generation request based on a preset poster generation model, at least one code generation prompt word is obtained. Based on the preset poster generation model, code writing processing is performed according to the code generation prompt word to obtain scalable vector graphic code. Among them, in the process of generating the scalable vector graphic code, first generating the code generation prompt word for indicating the generation of the scalable vector graphic code to be generated can improve the accuracy of the generated scalable vector graphic code and further improve the accuracy of the scalable vector graphic poster generation.
[0127] In a possible embodiment, the preset poster generation model includes an editor. The process of generating and displaying a scalable vector graphic poster by processing the scalable vector graphic code based on the preset poster generation model may include:
[0128] Based on the editor, rendering processing and editing processing are performed on the scalable vector graphic code to generate and display a scalable vector graphic poster.
[0129] Among them, the editor is used to perform rendering processing and editing processing on the scalable vector graphic code to generate and display a scalable vector graphic poster. Among them, the present application does not limit the editor set in the preset poster generation model. Any editor that can be used to perform rendering processing and editing processing on the scalable vector graphic code to generate and display a scalable vector graphic poster can be used as the editor set in the preset poster generation model provided by the present application.
[0130] Among them, by setting the editor in the preset poster generation model, the preset poster generation model can automatically convert the scalable vector graphic code into a scalable vector graphic poster without the need for additional processing by an editor, improving the efficiency and versatility of the scalable vector graphic poster generation.
[0131] In a possible embodiment, the method for generating a scalable vector graphic poster based on a model further includes:
[0132] In response to a poster modification request, modification processing is performed on the scalable vector graphic code.
[0133] Among them, the poster modification request is used to request modification of the presented scalable vector graphic poster.
[0134] Specifically, based on the description of the scalable vector graphic poster in step S101, if the scalable vector graphic poster is modified, the scalable vector graphic code needs to be modified. Therefore, in response to the poster modification request, modification processing can be performed on the scalable vector graphic code to complete the modification of the scalable vector graphic poster.
[0135] Among them, this application does not limit the process of obtaining the poster modification request. Optionally, a poster modification request can be generated based on the user's modification operation on the scalable vector graphic code. The user's modification operation on the scalable vector graphic code is input by the user based on the generated and displayed scalable vector graphic poster. Among them, when generating the scalable vector graphic code, the scalable vector graphic code can also be displayed so that the user can input an operation to modify the generated and displayed scalable vector graphic code based on the generated and displayed scalable vector graphic poster.
[0136] Optionally, performing a rendering process and an editing process on the modified scalable vector graphic code can regenerate and display the corresponding scalable vector graphic poster.
[0137] Among them, if it is necessary to modify the scalable vector graphic poster, it can be modified by modifying the scalable vector graphic code through the poster modification request, which improves the efficiency of modifying the scalable vector graphic poster.
[0138] Figure 3 is a schematic diagram according to the third embodiment of the present disclosure. As Figure 3 shown, the training method of the poster generation model provided by the third embodiment of the present disclosure includes:
[0139] Step S301, obtain the first training data set.
[0140] Specifically, the first training data set can be obtained. Among them, the first training data set includes code generation prompt words and scalable vector graphic codes. Specifically, for the description of the code generation prompt words, reference can be made to Figure 1 or Figure 2 the description in the embodiments shown, which will not be elaborated here. Among them, the code generation prompt words are obtained based on the key information of the scalable vector graphic poster. The code generation prompt words and the scalable vector graphic codes included in the first training data set have a one-to-one correspondence.
[0141] Specifically, this application does not limit the process of obtaining the first training data set. Any process that can obtain one-to-one corresponding code generation prompt words and scalable vector graphic codes can be used as the process of obtaining the first training data set provided by this application. Optionally, a poster generation request can be obtained; among them, the poster generation is used to request the generation of a scalable vector graphic poster; the poster generation request includes the key information of the scalable vector graphic poster to be generated; the key information in the poster generation request is processed to generate a scalable vector graphic code; according to the scalable vector graphic code, a code generation prompt word is generated; the generated scalable vector graphic code and the code generation prompt word constitute the first training data set.
[0142] Step S302: Generate a prompt word and a Scalable Vector Graphics (SVG) code based on the code in the first training data set, and train the initial model to obtain a poster generation model.
[0143] Specifically, generating a prompt word and an SVG code based on the code in the first training data set obtained in step S301 can be used to train the initial model to obtain a poster generation model.
[0144] The poster generation model is the preset poster generation model described in any of the above embodiments.
[0145] The initial model is the initial model used to train the poster generation model. In this application, the initial model is not limited. Any initial model that can be used to train the poster generation model can be used as the initial model provided in this application.
[0146] Specifically, this application does not limit the process of generating a prompt word and an SVG code based on the code in the first training data set and training the initial model to obtain a poster generation model. Optionally, a prompt word and an SVG code can be generated based on the code in the first training data set, and the code generation layer can be supervised and fine-tuned to obtain a poster generation model.
[0147] In the embodiments of the present disclosure, by obtaining the first training data set, generating a prompt word and an SVG code based on the code in the first training data set, and training the initial model to obtain a poster generation model, where the first training data set includes the code for generating the prompt word and the SVG code. Since the code for generating the prompt word is obtained based on the key information of the SVG poster, the poster generation model trained based on the code for generating the prompt word can accurately generate the SVG code corresponding to the key information, thereby accurately generating the corresponding SVG poster, improving the accuracy of the trained poster generation model.
[0148] In a possible embodiment, the initial model includes a code generation layer. The process of generating a prompt word and an SVG code based on the code in the first training data set and training the initial model to obtain a poster generation model may include:
[0149] Based on the code in the first training data set, generate a prompt word and an SVG code, and perform supervised fine-tuning training on the code generation layer to obtain a poster generation model.
[0150] The code generation layer is the network layer in the initial model used to generate the SVG code. Specifically, based on Figure 2According to the description in the illustrated embodiment, based on a preset poster generation model, code writing processing can be performed according to the code generation prompt words to obtain scalable vector graphics code. Therefore, the initial model for training the poster generation model includes a code generation layer.
[0151] Specifically, based on Figure 2 the description in the illustrated embodiment of the process of performing code writing processing according to the code generation prompt words based on a preset poster generation model to obtain scalable vector graphics code, the code generation layer can be subjected to supervised fine-tuning training processing based on the code generation prompt words and the scalable vector graphics code in the first training data set to obtain a poster generation model.
[0152] Among them, supervised fine-tuning training (Supervised Fine-Tuning, abbreviated as SFT) is a method of fine-tuning using labeled data based on a pre-trained model. The purpose of SFT is to make the model perform better on a specific task by adjusting the model's parameters to adapt to the specific requirements of the task, that is, to make the code generation layer perform better when generating the scalable vector graphics code corresponding to the scalable vector graphics poster, so that the poster generation model performs better when generating the scalable vector graphics poster.
[0153] Among them, in the process of training to obtain a poster generation model, only training the code generation layer in the initial model can improve the training efficiency of the model on the basis of ensuring the accuracy of the trained poster generation model. Among them, through supervised fine-tuning training processing, the code generation layer can perform better when generating the scalable vector graphics code corresponding to the scalable vector graphics poster, so that the trained poster generation model performs better when generating the scalable vector graphics poster. Based on the above description, the process of training the initial model according to the code generation prompt words and the scalable vector graphics code in the first training data set provided by the present application to obtain a poster generation model can improve the training efficiency of the poster generation model and the accuracy of the trained poster generation model.
[0154] Figure 4 is a schematic diagram according to the fourth embodiment of the present disclosure. As Figure 4 shown, the process of performing supervised fine-tuning training processing on the code generation layer based on the code generation prompt words and the scalable vector graphics code in the first training data set provided by the fourth embodiment of the present disclosure to obtain a poster generation model includes:
[0155] Step S401: Based on the code generation layer, perform code writing processing according to the code generation prompt words in the first training data set to obtain an initial poster code.
[0156] Specifically, based on the code generation layer, code writing processing can be performed according to the code generation prompts in the first training data set to obtain the initial poster code.
[0157] Specifically, the code generation prompts can be extracted from the first training set, and the extracted code generation prompts are input into the code generation layer for code writing processing to output the initial poster code.
[0158] Step S402: Based on the initial poster code and the scalable vector graphic code in the first training data set, perform supervised fine-tuning training on the code generation layer to obtain a poster generation model.
[0159] Specifically, based on the initial poster code obtained in step S401 and the scalable vector graphic code in the first training data set, the code generation layer can be subjected to supervised fine-tuning training to obtain a poster generation model.
[0160] Among them, the purpose of the supervised fine-tuning training of the code generation layer is to make the initial poster code regenerated based on the trained code generation layer closer to the scalable vector graphic code in the first training data set, that is, to improve the accuracy of the code generation layer in generating scalable vector graphic code based on the code generation prompts.
[0161] Specifically, the present application does not limit the process of performing supervised fine-tuning training on the code generation layer based on the initial poster code and the scalable vector graphic code in the first training data set. Optionally, the process of performing supervised fine-tuning training on the code generation layer based on the initial poster code and the scalable vector graphic code in the first training data set to obtain a poster generation model may include:
[0162] In the process of training the code generation layer based on the initial poster code and the scalable vector graphic code in the first training data set, the code generation layer is adjusted based on the first configuration parameter to obtain a poster generation model.
[0163] Among them, the first training data set also includes a first configuration parameter, where the first configuration parameter is a parameter used to indicate the adjustment method for the code generation layer. Specifically, the first configuration parameter is a model training parameter used to indicate the adjustment method for the code generation layer during the supervised fine-tuning training of the code generation layer.
[0164] Optionally, during the supervised fine-tuning training of the code generation layer, the first configuration parameter is used to indicate the network layer parameters in the code generation layer to be adjusted. Optionally, it can indicate the adjustment of all network layer parameters, and optionally, it can also indicate the adjustment of the network layer parameters of the low-rank part.
[0165] Optionally, during the process of supervised fine-tuning training of the code generation layer, the first configuration parameter is used to indicate whether it is incremental training.
[0166] Optionally, during the process of supervised fine-tuning training of the code generation layer, the first configuration parameter is used to indicate parameters such as the number of training iterations, learning rate, and sequence length.
[0167] Optionally, during the process of supervised fine-tuning training of the code generation layer, the first configuration parameter is used to indicate whether to perform hybrid training.
[0168] Optionally, during the process of supervised fine-tuning training of the code generation layer, the first configuration parameter is used to indicate the proportion of the validation set during training.
[0169] Specifically, this application does not limit the process of training the code generation layer based on the initial poster code and the scalable vector graphic code in the first training data set, and adjusting the code generation layer based on the first configuration parameter to obtain the poster generation model. Among them, this process corresponds to the parameters of the adjustment method of the code generation layer indicated by the first configuration parameter. For example, if the first configuration parameter indicates that the network layer parameters in the code generation layer to be adjusted are full network layer parameters, then during the process of training the code generation layer based on the initial poster code and the scalable vector graphic code in the first training data set, the full network layer parameters in the code generation layer are adjusted based on the first configuration parameter to obtain the poster generation model.
[0170] Among them, during the process of supervised fine-tuning training of the code generation layer based on the initial poster code and the scalable vector graphic code in the first training data set to obtain the poster generation model, adjusting the code generation layer based on the first configuration parameter can make the trained code generation layer and the poster generation model conform to the adjustment method indicated by the first configuration parameter, so that the process of supervised fine-tuning training can be configured, thereby improving the configurability of the model training process.
[0171] Optionally, the first training data set includes the first configuration parameter, where the first configuration parameter is a parameter used to indicate the adjustment method of the code generation layer. Obtaining the first configuration parameter includes:
[0172] Obtaining the parameter used to indicate the adjustment method of the code generation layer input by the user on the first preset interface to obtain the first configuration parameter.
[0173] Specifically, the first preset interface is presented before the supervised fine-tuning training of the code generation layer and is used to input parameters indicating the adjustment method for the code generation layer. For the description of the parameters indicating the adjustment method for the code generation layer, reference can be made to the description of the first configuration parameters above, which will not be elaborated here.
[0174] Among them, this application does not limit the input method of the user on the first preset interface. Optionally, it can be one or more of input methods such as selection input, string input, upload input, etc.
[0175] Optionally, the first preset interface may further include an input box for the first training data set, which is used to input the first training data set.
[0176] Optionally, the first preset interface may further include an input box for the initial model of the code generation layer, which is used to select the initial model of the code generation layer. Optionally, the ERNIE Speed model can be selected as the initial model of the code generation layer. Optionally, the first preset interface may further include an input box for the version of the initial model of the code generation layer, which is used to select the version of the initial model of the code generation layer.
[0177] Among them, in the process of obtaining the first configuration parameters, presenting the first preset interface for the user to input can not only obtain the first configuration parameters simply and efficiently, but also make the process of supervised fine-tuning training and the training process of the poster generation model meet the user's needs, improving the user experience of the training of the poster generation model.
[0178] In the embodiments of the present disclosure, based on the code generation layer, code writing processing is performed according to the code generation prompts in the first training data set to obtain the initial poster code. Based on the initial poster code and the scalable vector graphics code in the first training data set, the code generation layer is subjected to supervised fine-tuning training to obtain a poster generation model. Among them, in the process of performing supervised fine-tuning training on the code generation layer, training is performed based on the difference between the initial poster code and the scalable vector graphics code in the first training data set, which can improve the accuracy and efficiency of the code generation layer training, further improve the accuracy and efficiency of the poster generation model training, and improve the accuracy of the trained poster generation model.
[0179] In a possible embodiment, the training method of the poster generation model further includes:
[0180] Obtain a second training data set.
[0181] According to the syntax code in the second training data set, the initial model is trained and adjusted to obtain an adjusted initial model.
[0182] Among them, the second training data set includes syntax codes, and the syntax codes are codes indicating the syntax requirements of scalable vector graphic codes.
[0183] Specifically, based on Figure 3 or Figure 4 the training process of the embodiment shown, the obtained poster generation model may generate inaccurate scalable vector graphic posters because the generated scalable vector graphic codes do not meet the syntax requirements of the scalable vector graphic codes. Therefore, before generating prompts and scalable vector graphic codes according to the codes in the first training data set and training the initial model to obtain the poster generation model, a second training data set can be obtained, and the initial model can be trained and adjusted according to the syntax codes in the second training data set to obtain an adjusted initial model, so that the adjusted initial model can generate scalable vector graphic codes that meet the syntax requirements.
[0184] Among them, if the initial model is trained and adjusted before generating prompts and scalable vector graphic codes according to the codes in the first training data set and training the initial model to obtain the poster generation model, then Figure 3 or Figure 4 the initial model trained in the embodiment shown is the adjusted initial model.
[0185] Among them, the process of obtaining the second training data set in this application is not limited. Optionally, the syntax codes of open-source scalable vector graphic codes can be obtained, and then the obtained syntax codes of open-source scalable vector graphic codes can be subjected to processing such as cleaning processing and label marking processing to improve the accuracy of the syntax codes.
[0186] Among them, before generating prompts and scalable vector graphic codes according to the codes in the first training data set and training the initial model to obtain the poster generation model, training and adjusting the initial model according to the syntax codes in the second training data set can make the generated scalable vector graphic codes of the adjusted initial model meet the syntax requirements, thereby improving the accuracy of the training of the poster generation model and the accuracy of the obtained poster generation model.
[0187] Optionally, the initial model includes a code generation layer. The process of training and adjusting the initial model according to the syntax codes in the second training data set to obtain an adjusted initial model may include:
[0188] Based on the syntax codes in the second training data set, perform post-pretraining adjustment on the code generation layer to obtain an adjusted initial model.
[0189] Among them, for the description of the code generation layer, reference can be made to the description in the above embodiments, which will not be elaborated here. Based on the description of the code generation layer in the above embodiments, the code generation layer is the network layer in the initial model for generating scalable vector graphic code. Therefore, during the process of training and adjusting the initial model, only the code generation layer included in the initial model can be trained and adjusted.
[0190] Among them, the training and adjustment performed on the code generation layer is post-pretraining adjustment. Among them, post-pretraining (Post-pretrain) generally refers to further training after a pre-trained (pretrain) model. The pre-trained model is trained on a large amount of unlabeled data to learn general language representations, while Post-pretrain is fine-tuned on labeled data in a specific task or domain to improve the performance of the model on that task. Among them, in this application, the initial model is a pre-trained model. After training and adjusting the initial model based on the second data set, the post-pretrained initial model obtained is more in line with the syntax requirements of the scalable vector graphic code when generating the scalable vector graphic code.
[0191] Among them, during the process of training and adjusting the initial model, only training and adjusting the code generation layer in the initial model can improve the adjustment efficiency of the model on the basis of ensuring the accuracy of the adjusted initial model obtained, thereby improving the training efficiency of the model. Through post-pretraining processing, the adjusted initial model can be made more in line with the syntax requirements of the scalable vector graphic code when generating the scalable vector graphic code, improving the training accuracy of the model and the accuracy of the generated poster generation model. Based on the above description, the process of training and adjusting the initial model according to the syntax code in the second training data set to obtain the adjusted initial model in the embodiments of this application improves the training efficiency and accuracy of the model and the accuracy of the trained poster generation model.
[0192] Optionally, the process of performing post-pretraining adjustment on the code generation layer based on the syntax code in the second training data set to obtain the adjusted initial model may include:
[0193] During the process of performing post-pretraining adjustment on the code generation layer based on the syntax code in the second training data set, the code generation layer is adjusted based on the second configuration parameter to obtain the adjusted initial model.
[0194] Among them, the second training data set includes a second configuration parameter, where the second configuration parameter is a parameter used to indicate the adjustment method for the code generation layer. Specifically, the second configuration parameter is a model training parameter used to indicate the adjustment method for the code generation layer during the process of performing post-pretraining adjustment on the code generation layer.
[0195] Among them, for the description of the second configuration parameter, reference can be made to the description of the first configuration parameter in the above embodiments, and details will not be repeated here.
[0196] Specifically, this application does not limit the process of adjusting the post-pretraining of the code generation layer based on the syntax codes in the second training data set and the process of adjusting the code generation layer based on the second configuration parameter to obtain the adjusted initial model. Among them, this process corresponds to the parameters indicating the adjustment method of the code generation layer in the second configuration parameter. For example, if the second configuration parameter indicates that the network layer parameters in the code generation layer to be adjusted are the network layer parameters of the low-rank part, then in the process of adjusting the post-pretraining of the code generation layer based on the syntax codes in the second training data set, the network layer parameters of the low-rank part of the code generation layer are adjusted based on the second configuration parameter to obtain the adjusted initial model.
[0197] Among them, in the process of adjusting the post-pretraining of the code generation layer based on the syntax codes in the second training data set and the process of adjusting the code generation layer based on the second configuration parameter to obtain the adjusted initial model, adjusting the code generation layer based on the second configuration parameter can make the adjusted code generation layer and the initial model conform to the adjustment method indicated by the second configuration parameter, so that the process of post-pretraining adjustment can be configured, thereby improving the configurability of the model training process.
[0198] The second training data set includes a second configuration parameter, where the second configuration parameter is a parameter used to indicate the adjustment method of the code generation layer. Obtaining the second configuration parameter includes:
[0199] Obtaining the parameter input by the user on the second preset interface for indicating the adjustment method of the code generation layer to obtain the second configuration parameter.
[0200] Specifically, the second preset interface is presented before the adjustment of the post-pretraining of the code generation layer and is used to input the parameter for indicating the adjustment method of the code generation layer. Among them, for the description of the parameter for indicating the adjustment method of the code generation layer, reference can be made to the description of the second configuration parameter above, and details will not be repeated here.
[0201] Among them, this application does not limit the input method of the user on the second preset interface. Optionally, it can be one or more of input methods such as selection input, string input, and upload input.
[0202] Optionally, the second preset interface may further include an input box for the second training data set to input the second training data set.
[0203] Optionally, the second preset interface may further include an input box for the initial model of the code generation layer, which is used to select the initial model of the code generation layer. Optionally, the ERNIE Speed model may be selected as the initial model of the code generation layer. Optionally, the second preset interface may further include an input box for the version of the initial model of the code generation layer, which is used to select the version of the initial model of the code generation layer.
[0204] Optionally, if the initial model is trained and adjusted before training the initial model according to the code generation prompt words and scalable vector graphic codes in the first training data set to obtain the poster generation model, then based on the input box for the initial model of the code generation layer included in the first preset interface, the selected initial model of the code generation layer is the adjusted initial model.
[0205] Among them, in the process of obtaining the second configuration parameter, presenting the second preset interface for the user to input can not only obtain the second configuration parameter simply and efficiently, but also make the process of post-pretraining adjustment and the training process of the poster generation model meet the user's needs, improving the user experience of training the poster generation model.
[0206] Figure 5 It is a schematic diagram according to the fifth embodiment of the present disclosure. As Figure 5 shown, the process of obtaining the first training data set provided by the fifth embodiment of the present disclosure includes:
[0207] Step S501, obtain a poster generation request.
[0208] Specifically, a poster generation request may be obtained. Among them, the obtained poster generation request here is used to obtain the first training data set. Among them, the description of the poster generation request may refer to the description in step S101, which will not be elaborated here. Among them, the poster generation is used to request the generation of a scalable vector graphic poster. The poster generation request includes the key information of the scalable vector graphic poster to be generated.
[0209] Step S502, process the key information in the poster generation request to generate scalable vector graphic codes.
[0210] Specifically, after obtaining the poster generation request, the key information in the poster generation request may be processed to generate scalable vector graphic codes.
[0211] Among them, this application does not limit the process of processing the key information in the poster generation request to generate scalable vector graphic code. Any process that can process the key information in the poster generation request to generate scalable vector graphic code can be used as the process of processing the key information in the poster generation request provided by this application to generate scalable vector graphic code.
[0212] Optionally, scalable vector graphic code manually written based on the key information in the poster generation request can be obtained.
[0213] Optionally, scalable vector graphic code can also be generated based on large models and other data processing processes.
[0214] Optionally, the process of processing the key information in the poster generation request to generate scalable vector graphic code may include:
[0215] Identifying and processing the key information in the poster generation request based on a large model to generate an initial scalable vector graphic code.
[0216] Performing data insight processing on the initial scalable vector graphic code to obtain the scalable vector graphic code.
[0217] Among them, this application does not limit it. Optionally, the large model can be a general large model.
[0218] Specifically, the process of identifying and processing the key information in the poster generation request based on a large model to generate an initial scalable vector graphic code can be to input the poster generation request into the large model, so that the large model identifies and processes the key information in the poster generation request and outputs the initial scalable vector graphic code. Among them, due to the generality of the large model, the accuracy of the output initial scalable vector graphic code is relatively low. Therefore, data insight processing can be performed on the initial scalable vector graphic code to obtain the scalable vector graphic code.
[0219] Among them, data insight processing is a process of conducting refined research, information extraction, and conclusion formation on a large amount of collected data through advanced data mining and analysis techniques. Its purpose is to promote the development of the business, formulate implementable action plans based on the obtained conclusions, verify and iterate the conclusions, so as to promote the continuous progress of the business. In this application, data insight processing can improve the accuracy of the initial scalable vector graphic code to obtain the final scalable vector graphic code.
[0220] Among them, based on the large model, the initial scalable vector graphics code can be efficiently generated. Based on data insight processing, the accuracy of the initial scalable vector graphics code can be improved. Therefore, by combining the two processing processes, the scalable vector graphics code corresponding to the poster generation request can be efficiently and accurately generated, thereby improving the efficiency and accuracy of obtaining the first training data set.
[0221] Among them, this application does not limit the process of performing data insight processing on the initial scalable vector graphics code to obtain the scalable vector graphics code. Optionally, the process of performing data insight processing on the initial scalable vector graphics code to obtain the scalable vector graphics code may include:
[0222] Perform rendering processing and editing processing on the initial scalable vector graphics code to generate and display the initial scalable vector graphics poster.
[0223] In response to the data insight request, perform data insight processing on the initial scalable vector graphics code and the poster generation request corresponding to the initial scalable vector graphics code to generate the scalable vector graphics code.
[0224] Among them, the description of the process of performing rendering processing and editing processing on the initial scalable vector graphics code to generate and display the initial scalable vector graphics poster can refer to the description of the process of performing rendering processing and editing processing on the scalable vector graphics code based on the editor to generate and display the scalable vector graphics poster in the above embodiments, and will not be elaborated here.
[0225] Among them, the data insight request is generated based on the user's modification instruction for the corresponding poster generation request. The modification instruction is input by the user based on the initial scalable vector graphics poster. For example, if there are problems with the initially generated and displayed scalable vector graphics poster, such as font out-of-bounds and other problems, the instruction for modifying the poster generation request input by the user based on this problem can be received.
[0226] Optionally, the process of performing data insight processing on the initial scalable vector graphics code and the poster generation request corresponding to the initial scalable vector graphics code in response to the data insight request to generate the scalable vector graphics code may include:
[0227] In response to the data insight request, perform data insight processing on the corresponding poster generation request, that is, perform modification processing on the corresponding poster generation request.
[0228] Identify and process the key information in the poster generation request after data insight processing based on the large model to obtain the initial scalable vector graphics code after data insight processing, that is, re-enter the poster generation request after data insight processing into the large model, and the output code is the initial scalable vector graphics code after data insight processing.
[0229] Among them, in the process of performing data insight processing on the initial scalable vector graphics code to obtain the scalable vector graphics code, if directly performing data insight processing on the initial scalable vector graphics code, the processing efficiency is low and the accuracy is low. By generating and displaying the initial scalable vector graphics poster of the initial scalable vector graphics code, the efficiency and accuracy of data insight processing can be improved, thereby improving the efficiency and accuracy of obtaining the first training data set.
[0230] Optionally, the process of performing data insight processing on the initial scalable vector graphics code to obtain the scalable vector graphics code further includes:
[0231] If a new data insight request is obtained, in response to the new data insight request, repeat the data insight processing on the initial scalable vector graphics code after data insight processing and the poster generation request after data insight processing. Otherwise, determine the initial scalable vector graphics code after data insight processing as the scalable vector graphics code.
[0232] Among them, the new data insight request is generated based on the modification instruction of the user for the poster generation request after data insight processing. The modification instruction is input by the user based on the poster corresponding to the initial scalable vector graphics code after data insight processing.
[0233] Specifically, after one data insight processing, if the obtained scalable vector graphics code after data insight processing still does not meet the requirements, that is, there are still problems with the corresponding scalable vector graphics poster, a new data insight request will be received.
[0234] Specifically, if a new data insight request is received, repeat the above data insight process until the obtained scalable vector graphics code after data insight processing meets the requirements, that is, there are no longer problems with the corresponding scalable vector graphics poster.
[0235] Among them, if a new data insight request is received and it is determined that the scalable vector graphics code after data insight processing meets the requirements, then repeat the data insight processing. This process can improve the accuracy of data insight processing and further improve the accuracy of the first training data set.
[0236] Step S503: Generate a code generation prompt word according to the key information and the scalable vector graphics code.
[0237] Specifically, according to the key information in the poster generation request and the scalable vector graphics code obtained in step S502, a code generation prompt can be generated.
[0238] Among them, the description of the code generation prompt can refer to the description in the above embodiments, and will not be elaborated here.
[0239] Among them, the generated scalable vector graphics code and the code generation prompt constitute the first training data set.
[0240] Optionally, the process of generating a code generation prompt according to the scalable vector graphics code may include:
[0241] Obtain a poster content template according to the scalable vector graphics code.
[0242] Obtain a code generation prompt according to the poster content template and the key information in the poster generation request.
[0243] Among them, the description of the poster content template can refer to the description in the above embodiments, and will not be elaborated here.
[0244] Among them, the present application does not limit the process of obtaining a poster content template according to the scalable vector graphics code. Optionally, the process of obtaining a poster content template according to the scalable vector graphics code may be to present the generated scalable vector graphics code to the user to obtain the poster content template input by the user based on the presented scalable vector graphics code. Optionally, it is also possible to automatically obtain the poster content template corresponding to the scalable vector graphics code based on a large model and other data processing methods.
[0245] Among them, the description of the process of obtaining a code generation prompt according to the poster content template and the key information in the poster generation request, and obtaining a poster content template according to the scalable vector graphics code, can refer to the description in the above embodiments of the process of combining and processing the key information and the poster content template based on a preset poster generation model to obtain at least one code generation prompt, and combining and processing the poster content template and the key information in the poster generation request to obtain a code generation prompt.
[0246] Among them, in the process of generating a code generation prompt according to the scalable vector graphics code, obtaining the corresponding poster content template first can make the generated code generation prompt more targeted, thereby reducing the randomness of the scalable vector graphics code generated based on the code generation prompt, and further improving the accuracy of training the poster generation model and the accuracy of the trained poster generation model.
[0247] In the embodiments of the present disclosure, by obtaining a poster generation request, processing the key information in the poster generation request to generate Scalable Vector Graphics (SVG) code, and generating a code generation prompt word based on the key information and the SVG code. Among them, generating the corresponding code generation prompt word according to the generated SVG code can ensure that the code generation prompt word corresponds to the SVG code, improving the accuracy of the first training data set, and further improving the accuracy of training the poster generation model and the accuracy of the trained poster generation model.
[0248] Optionally, after obtaining the first training data set, the SVG code in the first training data set can be verified.
[0249] Among them, the present application does not limit the process of verification. Optionally, the process of verification includes but is not limited to manual verification, rule verification, model verification and other verification processes. For example, manual verification includes but is not limited to: verifying whether the poster corresponding to the code is out of the frame and whether there are problems with rendering; for example, rule verification includes but is not limited to: whether the code ends with <svg>Start< / svg> For example, model verification is a pre-built model for verifying SVG code. Optionally, the code can be input into the pre-built verification model, and the model can directly output the corresponding verification result. For example, 0 points - unqualified, 1 point - qualified.
[0250] Optionally, the initial model further includes: a poster content template matching layer, a prompt word generation layer, and an editor.
[0251] Among them, the poster content template matching layer is used to perform matching processing on the key information in the poster generation request to obtain at least one poster content template.
[0252] The prompt word generation layer is used to perform combination processing on the key information and the poster content template to obtain at least one code generation prompt word.
[0253] The editor is used to perform rendering processing and editing processing on the SVG code to generate and display an SVG poster.
[0254] Optionally, the poster generation model also includes the above-described poster content template matching layer, prompt word generation layer, and editor.
[0255] Optionally, after obtaining the trained initial model, the trained initial model can be evaluated. The specific process may include:
[0256] First, obtain a poster generation request.
[0257] Then, input the poster generation request into the poster content template matching layer, and output at least one poster content template.
[0258] Next, input the poster generation request and each poster content template into the prompt word generation layer, and output the code generation prompt words corresponding to each poster content template.
[0259] Input each code generation prompt word into the trained code generation layer to obtain the scalable vector graphics code corresponding to each code generation prompt word.
[0260] Input each scalable vector graphics code into the poster generation layer to obtain the scalable vector graphics posters corresponding to each code generation prompt word.
[0261] Among them, if it is determined that the scalable vector graphics code corresponding to each code generation prompt word passes the verification process, and the scalable vector graphics posters corresponding to each code generation prompt word pass the evaluation, then determine the trained poster generation model to which the trained initial code generation layer belongs as the pre-built poster generation model. Otherwise, re-train the trained initial code generation layer according to the training data set, that is, the first training data set and the second training data set.
[0262] Figure 6 It is a block diagram of a device for implementing the generation of a model-based scalable vector graphics poster according to an embodiment of the present disclosure. As Figure 6 shown, the device 600 for generating a model-based scalable vector graphics poster provided in the sixth embodiment of the present disclosure includes:
[0263] A processing unit 601, configured to, in response to a poster generation request, process key information in the poster generation request based on a preset poster generation model to obtain a scalable vector graphics code; wherein, the poster generation request is used to request the generation of a scalable vector graphics poster, and the poster generation request includes key information of the scalable vector graphics poster to be generated.
[0264] A generating unit 602, configured to process the scalable vector graphics code based on a preset poster generation model to generate and display a scalable vector graphics poster.
[0265] In some embodiments, the processing unit 601 includes:
[0266] A first processing module 603, configured to process key information in the poster generation request based on a preset poster generation model to obtain at least one code generation prompt word;
[0267] A second processing module 604, configured to perform code writing processing based on a preset poster generation model according to the code generation prompt word to obtain a scalable vector graphics code.
[0268] In some embodiments, the first processing module 603 includes:
[0269] The first processing sub-module 605 is configured to perform matching processing on the key information based on a preset poster generation model to obtain at least one poster content template;
[0270] The second processing sub-module 606 is configured to perform combination processing on the key information and the poster content template based on a preset poster generation model to obtain at least one code generation prompt.
[0271] In some embodiments, the second processing sub-module 606 is specifically configured to generate a template based on a preset prompt word according to a preset poster generation model, and perform combination processing on the key information and the poster content template to obtain at least one code generation prompt; wherein, the preset prompt word generation template is used to indicate the combination manner of the key information and the poster content template.
[0272] In some embodiments, the first processing sub-module 605 is specifically configured to match at least one poster content template from a preset content template library based on a preset poster generation model according to the key information; wherein, the preset content template library includes at least one preset poster content template.
[0273] In some embodiments, the first processing sub-module 605 is further specifically configured to perform vectorization processing on the preset poster content templates included in the content template library based on a preset poster generation model to obtain at least one vectorized preset poster content template; and perform vectorization processing on the key information to obtain vectorized key information; perform similarity calculation processing on the vectorized key information and each vectorized preset poster content template based on a preset poster generation model; and determine the preset poster content template whose calculation result exceeds a preset similarity threshold as the matched poster content template.
[0274] In some embodiments, the code generation prompt includes the key information and the poster content template in the poster generation request; the second processing module 604 is specifically configured to perform code writing processing based on a preset poster generation model according to the key information and the poster content template in the code generation prompt to obtain a scalable vector graphics code.
[0275] In some embodiments, the second processing module 604 is further specifically configured to perform title generation processing based on a preset poster generation model according to the key information and the poster content template in the code generation prompt to obtain at least one poster title; perform code writing processing based on a preset poster generation model according to at least one poster title, the key information and the poster content template in the code generation prompt to obtain a scalable vector graphics code.
[0276] In some embodiments, the preset poster generation model includes an editor; a generation unit 602, specifically configured to perform rendering processing and editing processing on the scalable vector graphics code based on the editor, and generate and display a scalable vector graphics poster.
[0277] In some embodiments, the apparatus 600 for generating a scalable vector graphics poster based on a model further includes: a modification unit 607, configured to perform modification processing on the scalable vector graphics code in response to a poster modification request; wherein, the poster modification request is used to request modification of the presented scalable vector graphics poster.
[0278] Figure 7 It is another block diagram of the apparatus for generating a scalable vector graphics poster based on a model to implement the embodiments of the present disclosure.
[0279] Figure 8 It is a block diagram of the training apparatus for the poster generation model to implement the embodiments of the present disclosure. As Figure 8 shown, the training apparatus 800 for the poster generation model provided in the seventh embodiment of the present disclosure includes:
[0280] A first acquisition unit 801, configured to acquire a first training data set; wherein, the first training data set includes code generation prompt words and scalable vector graphics codes; the code generation prompt words are obtained based on the key information of the scalable vector graphics poster;
[0281] A first training unit 802, configured to train an initial model according to the code generation prompt words and the scalable vector graphics codes in the first training data set to obtain a poster generation model;
[0282] Wherein, the poster generation model is the preset poster generation model described above.
[0283] In some embodiments, the initial model includes a code generation layer; the first training unit 802 is specifically configured to perform supervised fine-tuning training processing on the code generation layer based on the code generation prompt words and the scalable vector graphics codes in the first training data set to obtain a poster generation model.
[0284] In some embodiments, the first training unit 802 includes a first training module 803, configured to perform code writing processing based on the code generation layer according to the code generation prompt words in the first training data set to obtain an initial code; a second training module 804, configured to perform supervised fine-tuning training on the code generation layer based on the initial code and the scalable vector graphics codes in the first training data set to obtain a poster generation model.
[0285] In some embodiments, the first training data set further includes a first configuration parameter, where the first configuration parameter is a parameter for indicating an adjustment method for the code generation layer; the second training module 804 is specifically configured to, in the process of training the code generation layer based on the initial code and the scalable vector graphics code in the first training data set, adjust the code generation layer based on the first configuration parameter to obtain a poster generation model.
[0286] In some embodiments, the first training data set includes a first configuration parameter, where the first configuration parameter is a parameter for indicating an adjustment method for the code generation layer; the first acquisition unit 801 is specifically configured to acquire a parameter for indicating an adjustment method for the code generation layer input by a user on a first preset interface to obtain the first configuration parameter.
[0287] In some embodiments, it further includes:
[0288] The second acquisition unit 805 is configured to acquire a second training data set; where the second training data set includes a syntax code, and the syntax code is a code indicating the syntax requirements of the scalable vector graphics code;
[0289] The second training unit 806 is configured to train and adjust an initial model according to the syntax code in the second training data set to obtain an adjusted initial model.
[0290] In some embodiments, the initial model includes a code generation layer; the second training unit 806 is specifically configured to perform post-pretraining adjustment on the code generation layer based on the syntax code in the second training data set to obtain an adjusted initial model.
[0291] In some embodiments, the second training data set includes a second configuration parameter, where the second configuration parameter is a parameter for indicating an adjustment method for the code generation layer; the second training unit 806 is further specifically configured to, in the process of performing post-pretraining adjustment on the code generation layer based on the syntax code in the second training data set, adjust the code generation layer based on the second configuration parameter to obtain an adjusted initial model.
[0292] In some embodiments, the second training data set includes a second configuration parameter, where the second configuration parameter is a parameter for indicating an adjustment method for the code generation layer; the second acquisition unit 805 is further configured to acquire a parameter for indicating an adjustment method for the code generation layer input by a user on a second preset interface to obtain the second configuration parameter.
[0293] In some embodiments, the first acquisition unit 801 includes:
[0294] The first acquisition module 807 is configured to acquire a poster generation request; wherein, the poster generation is used to request the generation of a scalable vector graphics poster; the poster generation request includes key information of the scalable vector graphics poster to be generated.
[0295] The second acquisition module 808 is configured to process the key information in the poster generation request to generate scalable vector graphics code; and generate a code generation prompt word according to the key information and the scalable vector graphics code; wherein, the generated scalable vector graphics code and the code generation prompt word constitute the first training data set.
[0296] In some embodiments, the second acquisition module 808 includes:
[0297] The first acquisition sub-module 809 is configured to obtain a poster content template according to the scalable vector graphics code; and obtain a code generation prompt word according to the poster content template and the key information in the poster generation request.
[0298] In some embodiments, the second acquisition module 808 further includes:
[0299] The second acquisition sub-module 810 is configured to perform recognition processing on the key information in the poster generation request based on a large model to generate an initial scalable vector graphics code; and perform data insight processing on the initial scalable vector graphics code to obtain the scalable vector graphics code.
[0300] In some embodiments, the second acquisition sub-module 810 is specifically configured to perform rendering processing and editing processing on the initial scalable vector graphics code to generate and display an initial scalable vector graphics poster; in response to a data insight request, perform data insight processing on the initial scalable vector graphics code and the corresponding poster generation request to generate the scalable vector graphics code; wherein, the data insight request is generated based on a modification instruction of the user for the corresponding poster generation request; the modification instruction is input by the user based on the initial scalable vector graphics poster.
[0301] In some embodiments, the second acquisition sub-module 810 is further specifically configured to, if a new data insight request is obtained, in response to the new data insight request, repeatedly perform data insight processing on the initial scalable vector graphics code after data insight processing and the poster generation request after data insight processing; otherwise, determine the initial scalable vector graphics code after data insight processing as the scalable vector graphics code; wherein, the new data insight request is generated based on a modification instruction of the user for the poster generation request after data insight processing; the modification instruction is input by the user based on the poster corresponding to the initial scalable vector graphics code after data insight processing.
[0302] Figure 9It is another block diagram of the training device for implementing the poster generation model of the embodiments of the present disclosure.
[0303] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a non-transitory computer-readable storage medium storing computer instructions, and a computer program product.
[0304] According to an embodiment of the present disclosure, the present disclosure also provides a computer program product, which includes: a computer program stored in a readable storage medium, and at least one processor of the electronic device can read the computer program from the readable storage medium, and the at least one processor executes the computer program to enable the terminal device to execute the solution provided in any of the above embodiments.
[0305] Figure 10 It is a schematic block diagram of the exemplary electronic device 100 for implementing the embodiments of the present disclosure.
[0306] The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0307] As Figure 8 shown, the device 100 includes a computing unit 101, which can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 102 or the computer program loaded from the storage unit 108 into the random access memory (RAM) 103. In the RAM 103, various programs and data required for the operation of the device 100 can also be stored. The computing unit 101, the ROM 102, and the RAM 103 are connected to each other through a bus 104. The input / output (I / O) interface 105 is also connected to the bus 104.
[0308] Multiple components in the device 100 are connected to the I / O interface 105, including: an input unit 106, such as a keyboard, a mouse, etc.; an output unit 107, such as various types of displays, speakers, etc.; a storage unit 108, such as a magnetic disk, an optical disc, etc.; and a communication unit 109, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 109 allows the device 100 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0309] The computing unit 101 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 101 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 101 executes the various methods and processes described above, such as the method for generating a model-based scalable vector graphic poster or the method for training a poster generation model. For example, in some embodiments, the method for generating a model-based scalable vector graphic poster or the method for training a poster generation model can be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as the storage unit 108. In some embodiments, part or all of the computer program can be loaded and / or installed onto the device 100 via the ROM 102 and / or the communication unit 109. When the computer program is loaded into the RAM 103 and executed by the computing unit 101, one or more steps of the method for generating a model-based scalable vector graphic poster or the method for training a poster generation model described above can be executed. Alternatively, in other embodiments, the computing unit 101 can be configured to execute the method for generating a model-based scalable vector graphic poster or the method for training a poster generation model in any other suitable way (e.g., by means of firmware).
[0310] Various embodiments of the systems and techniques described above in this document can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor, and can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0311] The program code for implementing the methods of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing devices, such that when the program codes are executed by the processor or controller, the functions / operations specified in the flowchart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, executed partially on the machine and partially on a remote machine as an independent software package, or executed entirely on a remote machine or server.
[0312] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0313] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0314] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), and the Internet.
[0315] A computer system can include a client and a server. The client and the server are generally remote from each other and typically interact through a communication network. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, solving the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services ("Virtual Private Server", or simply "VPS" for short). The server can also be a server of a distributed system, or a server combined with blockchain.
[0316] It should be understood that various forms of the processes shown above can be used, with steps reordered, added, or deleted. For example, the steps recited in this disclosure can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and no limitations are imposed herein.
[0317] The above specific embodiments do not constitute a limitation on the protection scope of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the protection scope of this disclosure.
Claims
1. A method for generating a scalable vector graphics poster based on a model, comprising: In response to a poster generation request, key information in the poster generation request is processed based on a preset poster generation model to obtain a scalable vector graphics code; wherein the poster generation request is used to request generation of a scalable vector graphics poster, and the poster generation request includes key information of the scalable vector graphics poster to be generated; The scalable vector graphics code is processed based on the preset poster generation model to generate and display a scalable vector graphics poster.
2. The method according to claim 1, wherein: The key information in the poster generation request is processed based on a preset poster generation model to obtain a scalable vector graphics code, including: Processing key information in the poster generation request based on the preset poster generation model to obtain at least one code generation prompt word; Based on the preset poster generation model, code writing processing is performed according to the code generation prompt words to obtain the scalable vector graphics code.
3. The method according to claim 2, wherein: The key information in the poster generation request is processed based on the preset poster generation model to obtain at least one code generation prompt word, including: Performing matching processing on the key information based on the preset poster generation model to obtain at least one poster content template; The key information and the poster content template are combined and processed based on the preset poster generation model to obtain the at least one code generation prompt word.
4. The method according to claim 3, wherein: Combining the key information and the poster content template based on the preset poster generation model to obtain the at least one code generation prompt word includes: Based on the preset poster generation model, according to the preset prompt word generation template, the key information and the poster content template are combined and processed to obtain the at least one code generation prompt word; The preset prompt word generation template is used to indicate the combination method of the key information and the poster content template.
5. The method according to claim 3 or 4, wherein: The key information is matched based on the preset poster generation model to obtain at least one poster content template, including: Based on the preset poster generation model, at least one poster content template is matched from a preset content template library according to the key information; wherein the preset content template library includes at least one preset poster content template.
6. The method according to any one of claims 2 to 5, wherein: The code generation prompt includes the key information in the poster generation request and the poster content template; Based on the preset poster generation model, code writing processing is performed according to the code generation prompt words to obtain the scalable vector graphics code, including: Based on the preset poster generation model, code writing is performed according to key information in the code generation prompt words and the poster content template to obtain the scalable vector graphics code.
7. The method according to claim 6, wherein: Based on the preset poster generation model, code writing is performed according to the key information in the code generation prompt word and the poster content template to obtain the scalable vector graphics code, including: Based on the preset poster generation model, a title generation process is performed according to key information in the code generation prompt word and a poster content template to obtain at least one poster title; Based on the preset poster generation model, code writing processing is performed according to the at least one poster title, key information in the code generation prompt words and the poster content template to obtain the scalable vector graphics code.
8. The method according to any one of claims 1 to 7, wherein: The preset poster generation model includes an editor; processing the scalable vector graphics code based on the preset poster generation model to generate and display a scalable vector graphics poster, including: The scalable vector graphics code is rendered and edited based on the editor, and a scalable vector graphics poster is generated and displayed.
9. The method according to any one of claims 1 to 8, further comprising: In response to the poster modification request, modifying the scalable vector graphics code; The poster modification request is used to request modification of the presented scalable vector graphics poster.
10. A method for training a poster generation model, comprising: Acquire a first training data set; wherein the first training data set includes code generation prompt words and scalable vector graphics code; the code generation prompt words are obtained based on key information of the scalable vector graphics poster; Training the initial model according to the code generation prompt words and scalable vector graphics codes in the first training data set to obtain a poster generation model; Wherein, the poster generation model is the preset poster generation model described in any one of claims 1-9.
11. The method according to claim 10, wherein: The initial model includes a code generation layer; the initial model is trained according to the code generation prompt words and scalable vector graphics codes in the first training data set to obtain a poster generation model, including: Based on the code generation layer, code writing processing is performed according to the code generation prompt words in the first training data set to obtain initial code; Based on the initial code and the scalable vector graphics code in the first training data set, supervised fine-tuning training is performed on the code generation layer to obtain the poster generation model.
12. The method according to claim 10 or 11, wherein: The initial model includes a code generation layer; the method further includes: Acquire a second training data set; wherein the second training data set includes a syntax code, and the syntax code is a code indicating the syntax requirements of the scalable vector graphics code; Based on the grammatical codes in the second training data set, the code generation layer is adjusted after pre-training to obtain the adjusted initial model.
13. The method according to any one of claims 10 to 12, wherein: Obtaining a first training data set, including: Obtaining a poster generation request; wherein the poster generation is used to request the generation of a scalable vector graphics poster; the poster generation request includes key information of the scalable vector graphics poster to be generated; Based on the large model, key information in the poster generation request is identified and processed to generate an initial scalable vector graphics code; data insight processing is performed on the initial scalable vector graphics code to obtain the scalable vector graphics code; Obtaining a poster content template according to the scalable vector graphics code; obtaining a code generation prompt word according to the poster content template and key information in the poster generation request; The generated scalable vector graphics code and the code generation prompt words constitute the first training data set.
14. A device for generating a model-based scalable vector graphics poster, comprising: A processing unit, configured to, in response to a poster generation request, process key information in the poster generation request based on a preset poster generation model to obtain a scalable vector graphics code; wherein the poster generation request is used to request generation of a scalable vector graphics poster, and the poster generation request includes key information of the scalable vector graphics poster to be generated; A generating unit is used to process the scalable vector graphics code based on the preset poster generating model to generate and display a scalable vector graphics poster.
15. The device according to claim 14, wherein: The processing unit comprises: A first processing module, configured to process key information in the poster generation request based on the preset poster generation model to obtain at least one code generation prompt word; The second processing module is used to perform code writing processing based on the preset poster generation model and the code generation prompt words to obtain the scalable vector graphics code.
16. The device according to claim 15, wherein: The first processing module comprises: A first processing submodule, configured to perform matching processing on the key information based on the preset poster generation model to obtain at least one poster content template; The second processing submodule is used to combine the key information and the poster content template based on the preset poster generation model to obtain the at least one code generation prompt word.
17. The device according to claim 16, wherein: The second processing submodule is specifically used to generate a template based on the preset poster generation model and according to the preset prompt word, combine the key information and the poster content template to obtain the at least one code generation prompt word; wherein the preset prompt word generation template is used to indicate the combination method of the key information and the poster content template.
18. The device according to claim 16 or 17, wherein: The first processing submodule is specifically used to match at least one poster content template from a preset content template library based on the preset poster generation model and according to the key information; wherein the preset content template library includes at least one preset poster content template.
19. The device according to any one of claims 15 to 18, wherein: The code generation prompt includes key information in the poster generation request and a poster content template; the second processing module is specifically used to perform code writing processing based on the preset poster generation model, according to the key information in the code generation prompt and the poster content template, to obtain the scalable vector graphics code.
20. The device according to claim 19, wherein The second processing module is further specifically used to perform title generation processing based on the preset poster generation model, according to the key information in the code generation prompt words and the poster content template, to obtain at least one poster title; based on the preset poster generation model, perform code writing processing according to the at least one poster title, the key information in the code generation prompt words and the poster content template, to obtain the scalable vector graphics code.
21. The device according to any one of claims 14 to 20, wherein: The preset poster generation model includes an editor; the generation unit is specifically used to render and edit the scalable vector graphics code based on the editor to generate and display the scalable vector graphics poster.
22. The device according to any one of claims 14 to 21, further comprising: The modification unit is used to modify the scalable vector graphics code in response to a poster modification request; wherein the poster modification request is used to request modification of the presented scalable vector graphics poster.
23. A training device for a poster generation model, comprising: A first acquisition unit is used to acquire a first training data set; wherein the first training data set includes code generation prompt words and scalable vector graphics codes; the code generation prompt words are obtained based on key information of the scalable vector graphics poster; A first training unit is used to generate prompt words and scalable vector graphics codes according to the codes in the first training data set, train the initial model, and obtain a poster generation model; Wherein, the poster generation model is the preset poster generation model described in any one of claims 1-9.
24. The device according to claim 23, wherein: The initial model includes a code generation layer; the first training unit includes a first training module, which is used to perform code writing processing based on the code generation layer and the code generation prompt words in the first training data set to obtain initial code; The second training module is used to perform supervised fine-tuning training on the code generation layer based on the initial code and the scalable vector graphics code in the first training data set to obtain the poster generation model.
25. The device according to any one of claims 23-24, wherein: The initial model includes a code generation layer; the device also includes: A second acquisition unit is used to acquire a second training data set; wherein the second training data set includes a syntax code, and the syntax code is a code indicating a syntax requirement of a scalable vector graphics code; The second training unit is used to perform post-pre-training adjustment on the code generation layer based on the grammatical code in the second training data set to obtain the adjusted initial model.
26. The device according to any one of claims 23 to 25, wherein: The first acquisition unit includes: A first acquisition module is used to acquire a poster generation request; wherein the poster generation is used to request the generation of a scalable vector graphics poster; the poster generation request includes key information of the scalable vector graphics poster to be generated; The second acquisition module is used to identify and process the key information in the poster generation request based on the large model to generate an initial scalable vector graphics code; perform data insight processing on the initial scalable vector graphics code to obtain the scalable vector graphics code; obtain a poster content template according to the scalable vector graphics code; obtain a code generation prompt word according to the poster content template and the key information in the poster generation request. The generated scalable vector graphics code and the code generation prompt word constitute the first training data set.
27. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-9 or claims 10-13.
28. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-9 or claims 10-13.
29. A computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 9 or claims 10 to 13.