Electronic poster generation method, device, terminal and storage medium
By acquiring and utilizing the co-occurrence relationship feature vectors between material elements, the problem of poor quality of electronic poster generation in the prior art is solved, and a higher quality electronic poster generation is achieved.
Patent Information
- Application Number
- CN202111152524.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-29
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2041-09-29
AI Technical Summary
In the prior art, when generating electronic posters, the final generated posters are of poor quality due to the independence of the material elements.
By obtaining the poster data of the electronic poster to be generated, the feature vectors of multiple material elements are obtained, and these feature vectors represent the co-occurrence relationship between the material elements, thereby determining the feature vector of the poster data, and obtaining matching material elements from the material library based on the feature vector to generate an electronic poster.
The quality of electronic posters is improved, ensuring a good match between material elements and poster data is ensured, and the overall effect of generating electronic posters is improved.
Smart Images

Figure CN113947648B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image generation technology, and in particular to an electronic poster generation method, device, terminal and storage medium. Background Art
[0002] At present, online shopping has become an inseparable part of the lives of more and more people. In order to improve the transaction conversion rate of goods, e-commerce platforms often recommend product information to users through advertisements in the form of electronic posters (also known as banner ads); therefore, how to generate electronic posters has become a focus of attention in the industry.
[0003] In the related art, poster data of the electronic poster to be generated is determined, a plurality of material elements matching the poster data are selected from a plurality of material elements, and the poster data and the plurality of material elements are combined into a poster.
[0004] However, in the above method, since each material element is independent of each other, combining the selected multiple material elements together will result in poor quality of the final generated poster. Summary of the invention
[0005] The embodiment of the present application provides a method, device, terminal and storage medium for generating an electronic poster. The technical solution is as follows:
[0006] According to one aspect of an embodiment of the present application, a method for generating an electronic poster is provided, the method comprising:
[0007] Based on poster data of the electronic poster to be generated, obtaining first feature vectors of a plurality of first material elements, the plurality of first material elements match the poster data, and the first feature vectors of the first material elements are used to represent a co-occurrence relationship between the first material elements and other material elements;
[0008] Determining a second feature vector of the poster data based on the first feature vectors of the plurality of first material elements;
[0009] Based on the second feature vector, acquiring a plurality of second material elements from a material library;
[0010] A first electronic poster is generated based on the poster data and the plurality of second material elements.
[0011] In a possible implementation, the acquiring first feature vectors of a plurality of first material elements based on the poster data of the electronic poster to be generated includes:
[0012] Based on the poster data, acquiring the plurality of first material elements;
[0013] For each first material element, determining multiple node paths from the first heterogeneous graph, each node path includes a node corresponding to the first material element, the nodes in the first heterogeneous graph are nodes corresponding to the material elements in the material library, and the connection line between each two nodes in the first heterogeneous graph is used to represent the co-occurrence relationship between the two nodes;
[0014] Based on each node in the plurality of node paths, a first feature vector of the first material element is determined.
[0015] In another possible implementation manner, determining the first feature vector of the first material element based on each node in the multiple node paths includes:
[0016] Determine a third feature vector of a first node corresponding to the first material element, wherein the third feature vector is used to represent a feature of material content of the first material element;
[0017] For each node path, updating the third eigenvector based on a fourth eigenvector of at least one second node in the node path, the second node being a node in the node path other than the first node;
[0018] Determining a first weight of the node path;
[0019] Based on the first weight of each node path, weighted sum is performed on the third eigenvector to obtain the first eigenvector.
[0020] In another possible implementation manner, determining the first weight of the node path includes:
[0021] Determining a fifth eigenvector of the node path based on the updated third eigenvector of each node included in the node path;
[0022] Based on the fifth eigenvectors of the plurality of node paths, a first weight of each node path is determined.
[0023] In another possible implementation, determining the fifth feature vector of the node path based on the updated third feature vector of each node included in the node path includes:
[0024] Based on the updated third feature vector of each node included in the node path, determine the fifth feature vector of the node path by the following formula 1;
[0025] Formula 1:
[0026] represents the fifth eigenvector of the node path, V represents each node included in the node path, express The node path includes the updated third eigenvector of the ith node, q, W and b are parameter matrices, and tanh represents the hyperbolic tangent function.
[0027] In another possible implementation manner, updating the third feature vector based on a fourth feature vector of at least one second node in the node path includes:
[0028] determining a second weight of each second node;
[0029] Based on the second weight and the fourth eigenvector of each second node, the third eigenvector is updated by the following formula 2;
[0030] Formula 2:
[0031] represents the updated third eigenvector, h' j represents the fourth eigenvector of the j-th second node in the node path, represents the second weight of the j-th second node, represents the identifier of the node path, i represents the identifier of the first node, and σ represents a nonlinear activation function.
[0032] In another possible implementation, determining the second feature vector of the poster data based on the first feature vectors of the plurality of first material elements includes:
[0033] Obtaining a third weight for each first eigenvector;
[0034] Based on the third weight of each first feature vector, weighted sum is performed on each first feature vector to obtain a second feature vector of the poster data.
[0035] In another possible implementation, generating a first electronic poster based on the poster data and the plurality of second material elements includes:
[0036] Determine a first size and a first position of the poster data, where the first size and the first position are respectively the size and the position of the poster data displayed in the poster template;
[0037] For each second material element, determining a second size and a second position of the second material element, wherein the second size and the second position are respectively the size and the position of the second material element displayed in the poster template;
[0038] Based on the first size, the first position, the second size and the second position, the poster data and each second material element are displayed in the poster template to obtain the first electronic poster.
[0039] In another possible implementation manner, determining the second size and the second position of the second material element includes:
[0040] Determine a plurality of third sizes and a plurality of third positions, wherein the third sizes and the third positions are sizes and positions of the second material element in the second electronic poster;
[0041] Determine a size probability distribution and a position probability distribution of the second material element based on the multiple third sizes and the third positions;
[0042] Based on the size probability distribution and the position probability distribution, the second size and the second position are determined.
[0043] In another possible implementation, obtaining poster data of the electronic poster to be generated includes:
[0044] Acquire a plurality of images, and determine the poster data from the plurality of images; or,
[0045] Acquire text information, and determine the poster data from the text information.
[0046] In another possible implementation manner, determining the poster data from the multiple images includes at least one of the following implementation manners:
[0047] Performing a text-image consistency test on each image, obtaining an image with a text-image consistency test result from the multiple images, and determining the poster data based on the image; or,
[0048] Determine a quality parameter of each of the images, select an image whose quality parameter satisfies a condition from the multiple images, and determine the poster data based on the image; or,
[0049] Aesthetic parameters of each of the images are determined, images whose aesthetic parameters satisfy conditions are selected from the plurality of images, and the poster data is determined based on the images.
[0050] In another possible implementation, the acquiring first feature vectors of a plurality of first material elements based on the poster data of the electronic poster to be generated further includes:
[0051] Based on the poster data, acquiring the plurality of first material elements;
[0052] Based on the multiple first material elements, determining multiple first nodes in the second heterogeneous graph, where the first nodes are nodes corresponding to the first material elements;
[0053] Based on the multiple first nodes, first feature vectors of the multiple first material elements are obtained from the second heterogeneous graph, where the second heterogeneous graph includes a node corresponding to each material element in the material library and a first feature vector corresponding to each node.
[0054] According to one aspect of an embodiment of the present application, there is provided an electronic poster generation device, the device comprising:
[0055] A first acquisition module, configured to acquire first feature vectors of a plurality of first material elements based on poster data of an electronic poster to be generated, wherein the plurality of first material elements match the poster data, and the first feature vectors of the first material elements are used to represent a co-occurrence relationship between the first material elements and other material elements;
[0056] A determination module, configured to determine a second feature vector of the poster data based on the first feature vectors of the plurality of first material elements;
[0057] A second acquisition module, configured to acquire a plurality of second material elements from a material library based on the second feature vector;
[0058] A generating module is used to generate a first electronic poster based on the poster data and the plurality of second material elements.
[0059] In a possible implementation, the first acquisition module includes:
[0060] A first acquisition unit, configured to acquire the plurality of first material elements based on the poster data;
[0061] a first determining unit, configured to determine, for each first material element, a plurality of node paths from a first heterogeneous graph, each node path including a node corresponding to the first material element, the nodes in the first heterogeneous graph being nodes corresponding to the material elements in the material library, and a connection line between every two nodes in the first heterogeneous graph being used to represent a co-occurrence relationship between the two nodes;
[0062] The second determining unit is configured to determine a first feature vector of the first material element based on each node in the plurality of node paths.
[0063] In another possible implementation manner, the second determining unit includes:
[0064] A first determining subunit, configured to determine a third feature vector of a first node corresponding to the first material element, wherein the third feature vector is used to represent a feature of a material content of the first material element;
[0065] an updating subunit, configured to update the third eigenvector for each node path based on a fourth eigenvector of at least one second node in the node path, the second node being a node other than the first node in the node path;
[0066] A second determining subunit, used to determine a first weight of the node path;
[0067] The processing subunit is used to perform weighted summation on the third feature vector based on the first weight of each node path to obtain the first feature vector.
[0068] In another possible implementation, the second determination subunit is used to determine the fifth feature vector of the node path based on the updated third feature vector of each node included in the node path; and determine the first weight of each node path based on the fifth feature vectors of the multiple node paths.
[0069] In another possible implementation, the second determining subunit is configured to determine a fifth eigenvector of the node path based on the updated third eigenvector of each node included in the node path by using the following formula 1:
[0070] Formula 1:
[0071] represents the fifth eigenvector of the node path, V represents each node included in the node path, express The node path includes the updated third eigenvector of the ith node, q, W and b are parameter matrices, and tanh represents the hyperbolic tangent function.
[0072] In another possible implementation, the updating subunit is used to determine the second weight of each second node; based on the second weight of each second node and the fourth eigenvector, the third eigenvector is updated by the following formula 2;
[0073] Formula 2:
[0074] represents the updated third eigenvector, h' j represents the fourth eigenvector of the j-th second node in the node path, represents the second weight of the j-th second node, represents the identifier of the node path, i represents the identifier of the first node, and σ represents a nonlinear activation function.
[0075] In another possible implementation, the determining module includes:
[0076] A second acquisition unit, used to acquire a third weight of each first eigenvector;
[0077] The processing unit is configured to perform weighted summation on each of the first feature vectors based on a third weight of each of the first feature vectors to obtain a second feature vector of the poster data.
[0078] In another possible implementation, the generating module includes:
[0079] A third determining unit, configured to determine a first size and a first position of the poster data, wherein the first size and the first position are respectively a size and a position of the poster data displayed in the poster template;
[0080] A fourth determining unit, configured to determine, for each second material element, a second size and a second position of the second material element, wherein the second size and the second position are respectively a size and a position of the second material element displayed in the poster template;
[0081] A display unit is used to display the poster data and each second material element in the poster template based on the first size, the first position, the second size and the second position to obtain the first electronic poster.
[0082] In another possible implementation, the fourth determination unit is used to determine multiple third sizes and multiple third positions, where the third sizes and the third positions are the sizes and positions of the second material element in the second electronic poster; based on the multiple third sizes and the third positions, determine the size probability distribution and the position probability distribution of the second material element; based on the size probability distribution and the position probability distribution, determine the second size and the second position.
[0083] In another possible implementation, the device further includes:
[0084] A third acquisition module, used for acquiring a plurality of images and determining the poster data from the plurality of images;
[0085] The fourth acquisition module is used to acquire text information and determine the poster data from the text information.
[0086] In another possible implementation, the third acquisition module includes:
[0087] A detection unit, configured to perform image-text consistency detection on each image, obtain an image whose detection result is that the image and text are consistent from the multiple images, and determine the poster data based on the image;
[0088] A fifth determining unit, configured to determine a quality parameter of each of the images, select an image whose quality parameter satisfies a condition from the plurality of images, and determine the poster data based on the image;
[0089] The sixth determination unit is configured to determine the aesthetic parameter of each image, select an image whose aesthetic parameter satisfies a condition from the plurality of images, and determine the poster data based on the image.
[0090] In another possible implementation, the first acquisition module further includes:
[0091] A third acquisition unit, configured to acquire the plurality of first material elements based on the poster data;
[0092] A seventh determining unit, configured to determine, based on the plurality of first material elements, a plurality of first nodes in the second heterogeneous graph, wherein the first nodes are nodes corresponding to the first material elements;
[0093] The fourth acquisition unit is used to acquire the first feature vectors of the multiple first material elements from the second heterogeneous graph based on the multiple first nodes, wherein the second heterogeneous graph includes a node corresponding to each material element in the material library and a first feature vector corresponding to each node.
[0094] According to one aspect of an embodiment of the present application, a terminal is provided, which includes one or more processors and one or more memories, wherein at least one program code is stored in the one or more memories, and the at least one program code is loaded and executed by the one or more processors to implement the operations performed by the electronic poster generation method in any possible implementation method as described above.
[0095] According to one aspect of an embodiment of the present application, a storage medium is provided, in which at least one program code is stored. The at least one program code is loaded and executed by a processor to implement the operations performed by the electronic poster generation method in any possible implementation manner as described above.
[0096] According to one aspect of an embodiment of the present application, a computer program or a computer program product is provided, wherein the computer program or the computer program product comprises: a computer program code, wherein when the computer program code is executed by a computer, the computer implements the operations performed by the electronic poster generation method in any possible implementation manner as described above.
[0097] In the embodiment of the present application, since the feature vector of the first element is determined by the co-occurrence relationship between the material elements, the feature vector of the poster data determined by the feature vector contains the co-occurrence information between the material elements, so that the other material elements determined by the feature vector of the poster data have a better matching effect with the poster data, thereby improving the quality of the generated electronic poster in the process of generating an electronic poster from other material elements and the poster data. BRIEF DESCRIPTION OF THE DRAWINGS
[0098] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0099] Figure 1 It is a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application;
[0100] Figure 2 is a flow chart of an electronic poster generation method provided by an exemplary embodiment of the present application;
[0101] Figure 3 is a flow chart of an electronic poster generation method provided by an exemplary embodiment of the present application;
[0102] Figure 4 is a calculation flow chart of an electronic poster generation method provided by an exemplary embodiment of the present application;
[0103] Figure 5 is a flowchart of updating a node feature vector provided by an exemplary embodiment of the present application;
[0104] Figure 6 is a flow chart of an electronic poster generation method provided by an exemplary embodiment of the present application;
[0105] Figure 7 is a flow chart of an electronic poster generation method provided by an exemplary embodiment of the present application;
[0106] Figure 8 It is a structural block diagram of an electronic poster generating device provided by an exemplary embodiment of the present application;
[0107] Fig. 9 It is a structural block diagram of a terminal provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0108] In order to make the purpose, technical scheme and advantages of the present application clearer, the implementation mode of the present application will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0109] It is understood that the terms "first", "second", etc. used in this application can be used in this article to describe various concepts, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, a first position can be referred to as a second position, and similarly, a second position can be referred to as a first position without departing from the scope of the application.
[0110] The terms "at least one", "multiple", "each", and "any" used in this application, at least one includes one, two or more than two, multiple includes two or more than two, each refers to each of the corresponding multiple, and any refers to any one of the multiple. For example, multiple first material elements include 3 first material elements, and each refers to each first material element of the 3 first material elements, and any refers to any one of the 3 first material elements, which can be the first, the second, or the third.
[0111] Figure 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application, such as Figure 1 As shown, the implementation environment includes a terminal 101 and a server 102. The terminal 101 and the server 102 are connected via a wireless or wired network.
[0112] Optionally, the terminal 101 is any type of terminal such as a smart phone, a tablet computer or a desktop computer, etc. The server 102 is a server, or a server cluster composed of several servers, or a cloud computing service center.
[0113] The terminal 101 is installed with an application provided by the server 102, and the terminal 101 can realize functions such as data transmission and message interaction through the application. Optionally, the application is an application in the operating system of the terminal 101, or an application provided by a third party. For example, the application is an e-commerce application; wherein the application at least has a display function, and of course, the application also has other functions, such as a matching function, a detection function, etc.
[0114] In some embodiments, the terminal 101 obtains poster data of the electronic poster to be generated, and sends the poster data to the server 102. The server 102 generates the electronic poster based on the poster data, and sends the electronic poster to the terminal 101. The terminal 101 receives the electronic poster and displays the electronic poster when a trigger operation of the user manipulating the terminal is detected. In other embodiments, the terminal may also generate the electronic poster locally.
[0115] The electronic poster generation method provided in the embodiment of the present application can be applied to any e-commerce application to recommend product information to users.
[0116] For example, it is used in scenarios where a food delivery app recommends food information to users.
[0117] The food delivery application obtains poster data related to the recommended food, such as food pictures or text related to the food, and sends the poster data to the server. The server generates an electronic poster related to the recommended food. When the terminal detects that the user has opened the food delivery application, it displays the electronic poster and recommends the food on the electronic poster to the user.
[0118] Figure 2 This is a flow chart of a method for generating an electronic poster provided in an embodiment of the present application. The embodiment of the present application is executed by a terminal, and the method includes the following steps:
[0119] Step 201: The terminal obtains first feature vectors of multiple first material elements based on poster data of the electronic poster to be generated, the multiple first material elements match the poster data, and the first feature vectors of the first material elements are used to represent the co-occurrence relationship between the first material elements and other material elements.
[0120] Step 202: The terminal determines a second feature vector of the poster data based on the first feature vectors of the plurality of first material elements.
[0121] Step 203: The terminal obtains a plurality of second material elements from the material library based on the second feature vector.
[0122] Step 204: The terminal generates an electronic poster based on the poster data and the plurality of second material elements.
[0123] In the embodiment of the present application, since the feature vector of the first element is determined by the co-occurrence relationship between the material elements, the feature vector of the poster data determined by the feature vector contains the co-occurrence information between the material elements, so that the other material elements determined by the feature vector of the poster data have a better matching effect with the poster data, thereby improving the quality of the generated electronic poster in the process of generating an electronic poster from other material elements and the poster data.
[0124] Figure 3This is a flow chart of a method for generating an electronic poster provided in an embodiment of the present application. The embodiment of the present application is executed by a terminal, and the method includes the following steps:
[0125] Step 301: The terminal obtains poster data of the electronic poster to be generated.
[0126] E-commerce platforms often recommend product information to users through terminals in the form of electronic posters, which requires the terminal to obtain poster data to be generated in order to generate the electronic poster. Figure 4 , wherein the poster data is data used to generate an electronic poster, which may be an image or text.
[0127] In a first implementation manner, the poster data is an image; then the step of the terminal acquiring the poster data of the electronic poster to be generated may be: the terminal acquires a plurality of images, and determines the poster data from the plurality of images.
[0128] In a possible implementation, an image contains image information and text information, and the image information and text information in some of the images are inconsistent. The terminal needs to filter out these images. Accordingly, the terminal obtains multiple first images, and the step of determining the poster data from the multiple first images includes: the terminal performs a text-image consistency test on each image, obtains an image with a consistent text-image test result from the multiple first images, and determines the poster data based on the image. The text-image consistency means that the information expressed by the image and text in the image is the same. For example, the image in the image is "zongzi", and the text in the image is "zongzi special today", it can be determined that the image and text are consistent, and the image can be determined as poster data; if the image in the image is "scenery" and the text in the image is "zongzi special today", it can be determined that the image and text are inconsistent, and the terminal will discard the image.
[0129] In the embodiment of the present application, the terminal performs a text-image consistency check on each image, and can filter out images with inconsistent texts and images, thereby improving the quality of the poster data of the electronic poster to be generated.
[0130] In another possible implementation, part of the acquired images contain restrictive content. In order to prevent the restrictive content from spreading in the electronic poster, the terminal needs to filter out this part of the image. Accordingly, the terminal acquires multiple first images. The step of determining the poster data from the multiple first images includes: the terminal determines the quality parameter of each image, selects an image whose quality parameter meets the conditions from the multiple images, and determines the poster data based on the image.
[0131] The quality parameter is used to indicate the quality of the image. For example, images containing restrictive content are all low-quality images. The terminal pre-sets a first threshold. For each first image, if the quality parameter of the image exceeds the first threshold, the terminal determines that the quality parameter of the image meets the condition and uses the image as poster data. If the quality parameter of the image does not exceed the first threshold, the terminal determines that the quality parameter of the image does not meet the condition and discards the image.
[0132] In the embodiment of the present application, the terminal selects an image whose quality parameter meets the conditions from multiple images, and can filter out low-quality images, thereby improving the quality of the poster data of the electronic poster to be generated.
[0133] In another possible implementation, poster data is used to generate a first electronic poster to recommend products to users, which requires that the poster data of the image type has aesthetics. Accordingly, the terminal obtains multiple first images, and the step of determining the poster data from the multiple first images includes: the terminal determines the aesthetic parameters of each first image, selects an image whose aesthetic parameters meet the conditions from the multiple first images, and determines the poster data based on the image. The aesthetic parameters are the judgment results of the terminal on the image from an aesthetic perspective, which are used to indicate the aesthetic degree of the image. The terminal pre-sets a second threshold. When the aesthetic parameters of the image exceed the second threshold, the terminal determines that the aesthetic parameters of the image meet the conditions and uses the image as poster data. When the aesthetic parameters of the image do not exceed the aesthetic threshold, the terminal determines that the aesthetic parameters of the image meet the conditions and discards the image.
[0134] In the embodiment of the present application, the terminal selects an image whose aesthetic parameters meet the conditions from multiple images, which can improve the aesthetics of the poster data of the electronic poster to be generated, thereby making the generated electronic poster more beautiful.
[0135] In another possible implementation, the image includes an image subject and an image background. When the terminal is acquiring poster data, irrelevant data such as the image background is not required. Accordingly, the terminal acquires multiple first images. The step of determining the poster data from the multiple second images includes: the terminal performs cropping processing on the multiple first images to obtain multiple second images, and determines the multiple second images as poster data, wherein the subjects in the first images are highlighted in the second images.
[0136] In the embodiment of the present application, the terminal only selects the main part of the image as the poster data, which can remove irrelevant data such as the image background, and can improve the quality of the poster data of the electronic poster to be generated.
[0137] One point that needs to be explained is that the above-mentioned methods can be combined, that is, in the process of obtaining the poster data of the electronic poster to be generated, the terminal can combine multiple methods such as image and text consistency detection, quality parameters, aesthetic parameters and cropping processing to determine the image used to generate the electronic poster. For example, the terminal can determine the third image from the multiple first images obtained through multiple methods such as image and text consistency detection, quality parameters, aesthetic parameters, etc., and then crop the third image to determine the image used to generate the electronic poster.
[0138] In an embodiment of the present application, the terminal performs quality screening from multiple dimensions based on at least one of image and text consistency detection, quality parameters and aesthetic parameters, and then combines it with cropping processing to make the acquired poster data of higher quality, which is conducive to generating high-quality electronic posters that can contain more information.
[0139] In a second implementation, the poster data is text; then the step of the terminal acquiring the poster data of the electronic poster to be generated may be: the terminal acquires a plurality of text information, and determines the poster data from the plurality of text information.
[0140] In a possible implementation, part of the acquired text information contains restrictive content, and the terminal needs to filter out the part of the text information. Accordingly, the terminal acquires the text information, and the step of determining the poster data from the text information includes: the terminal extracts multiple keywords from multiple text information, determines the first matching degree between the keyword and the restrictive content, selects a keyword whose first matching degree meets the condition from the multiple keywords, determines the text information corresponding to the keyword, and determines the poster data based on the text information. The terminal pre-sets a third threshold value, and when the first matching degree of the keyword does not exceed the third threshold value, the terminal determines that the first matching degree of the keyword meets the condition, determines the corresponding text information based on the keyword, and determines the poster data based on the text information.
[0141] In an embodiment of the present application, the terminal can filter out text information containing restrictive content, thereby improving the quality of the poster data of the electronic poster to be generated.
[0142] Step 302: The terminal obtains a plurality of first material elements based on the poster data.
[0143] The first material element is an element in the material library that matches the poster data. The step of the terminal acquiring multiple first material elements based on the poster data includes: the terminal acquiring the sixth feature vector of the poster data and the seventh feature vector of each material element in the material library, determining the second matching degree between the poster data and each material element in the material library based on the sixth feature vector of the poster data and the seventh feature vector of each material element in the material library, and determining multiple first material elements whose matching degrees meet the conditions from the material library.
[0144] Among them, the sixth eigenvector is used to represent the characteristics of the data content of the poster data, that is, the initial eigenvector of the poster data; the seventh eigenvector is used to represent the characteristics of the material content of each material element in the material library, that is, the initial eigenvector of each material element in the material library; the second matching degree is used to represent the similarity between the sixth eigenvector of the poster data and the seventh eigenvector of each material element in the material library.
[0145] The terminal pre-sets a fourth threshold value. When the second matching degree exceeds the fourth threshold value, the terminal determines that the second matching degree meets the condition, determines the material element in the material library corresponding to the second matching degree based on the second matching degree, and uses the material element as the first material element. When the second matching degree does not exceed the fourth threshold value, the terminal determines that the second matching degree does not meet the condition, and will not perform the step of determining the material element corresponding to the second matching degree from the material library.
[0146] In the embodiment of the present application, the terminal obtains the first material element that has a high degree of match with the poster data, which is beneficial for obtaining a more accurate feature vector of the poster data when the feature vector of the poster data is subsequently determined through the first material element.
[0147] The poster data may be an image or text, and different types of poster data may obtain the sixth eigenvector in different ways; accordingly, the step of the terminal obtaining the sixth eigenvector of the poster data includes: the terminal determines the way to obtain the sixth eigenvector based on the type of the poster data, and obtains the sixth eigenvector of the poster data based on the way. For example, the terminal determines that the type of the poster data is an image, and based on the type, determines to use a convolutional neural network in deep learning to obtain the sixth eigenvector of the poster data, and the sixth eigenvector is used to represent the visual information of the image. The terminal determines that the type of the poster data is text, and based on the type, determines to use a method of extracting text features in natural language processing to obtain the sixth eigenvector of the poster data, and the sixth eigenvector is used to represent the content information of the text.
[0148] It should be noted that the method for the terminal to obtain the seventh eigenvector of each material element in the material library is the same as the method for the terminal to obtain the sixth eigenvector of the poster data, which will not be described in detail here.
[0149] In an embodiment of the present application, the terminal uses different feature extraction methods for different types of poster data and different types of material elements, which can make the obtained sixth feature vector of the poster data and the seventh feature vector of each material element in the material library more accurate.
[0150] Step 303: For each first material element, the terminal determines a plurality of node paths from the first heterogeneous graph, each node path including a node corresponding to the first material element.
[0151] For example, see Figure 4 The terminal constructs a first heterogeneous graph, which includes multiple nodes. The nodes in the first heterogeneous graph are nodes corresponding to material elements in the material library. Different types of material elements in the material library correspond to different types of nodes in the first heterogeneous graph. For example, the material library contains material elements such as text elements, picture elements, and background elements, and the corresponding nodes in the first heterogeneous graph are text element nodes, picture element nodes, background element nodes, etc.
[0152] The line between each two nodes in the first heterogeneous graph is used to represent the co-occurrence relationship between the two nodes. The co-occurrence relationship is used to indicate that the material elements corresponding to the two nodes appear in the same third electronic poster, and the third electronic poster is another generated electronic poster. That is, when the two material elements corresponding to the two nodes appear in the same electronic poster, the terminal connects the two nodes with a line. When the two material elements corresponding to the two nodes have never appeared in the same electronic poster, the terminal does not perform the step of connecting the two nodes with a line, indicating that there is no co-occurrence relationship between the two nodes.
[0153] Correspondingly, the step of constructing the first heterogeneous graph by the terminal includes: the terminal obtains multiple third electronic posters, obtains multiple material elements based on the multiple third electronic posters, stores the multiple material elements in the material library, marks the corresponding nodes in the first heterogeneous graph for each material element, connects the nodes corresponding to the material elements with lines based on the co-occurrence relationship between the material elements, and constructs the first heterogeneous graph based on the nodes and the lines.
[0154] The lines between the nodes in the first heterogeneous graph can form a node path, and each node path includes multiple nodes. For each first material element, the terminal finds the first node corresponding to each first material element in the heterogeneous graph, thereby determining multiple node paths where the first node is located. Each node path includes a node corresponding to the first material element.
[0155] In an embodiment of the present application, the terminal constructs a first heterogeneous graph and determines a node path by utilizing the co-occurrence relationship between material elements, which is beneficial for determining the third eigenvector of the first material element based on the co-occurrence relationship between the material elements in a subsequent process, thereby making the obtained third eigenvector more accurate.
[0156] Step 304: For each first material element, the terminal determines a third eigenvector of the first node corresponding to the first material element.
[0157] The third eigenvector is used to represent the characteristics of the material content of the first material element, and the first node is a node corresponding to the first material element in the first heterogeneous graph.
[0158] Since there are different types of nodes in the first heterogeneous graph, in order to better reflect the co-occurrence relationship between the material elements corresponding to the nodes and obtain more accurate element features, the terminal needs to map different types of nodes in a unified feature space. Accordingly, for each first material element, the terminal determines the third feature vector of the first node corresponding to the first material element, which can be achieved through the following two steps, including:
[0159] (1) The terminal obtains the seventh eigenvector of the first material element.
[0160] The seventh feature vector is used to represent the feature of the material content of the first material element, that is, the initial feature vector of the first material element. The method for the terminal to obtain the seventh feature vector of the first material element is the same as the method for obtaining the sixth feature vector of the poster data in step 302, which will not be repeated here.
[0161] (2) The seventh eigenvector is mapped to the third eigenvector using formula 3.
[0162] For example, see Figure 5 , the terminal determines the third eigenvector of the first node corresponding to the first material element through the following formula three:
[0163] Formula 3:
[0164]
[0165] Where i represents the identifier of the first node, is the feature map matrix, h i is the seventh eigenvector of the first material element, h′ i It is the third eigenvector after the first material element is mapped in the unified feature space.
[0166] In an embodiment of the present application, the terminal maps different types of nodes in a unified feature space, which can better reflect the co-occurrence relationship between material elements and facilitate obtaining more accurate element features in subsequent processes.
[0167] Step 305: For each node path, the terminal updates the third eigenvector based on the fourth eigenvector of at least one second node in the node path.
[0168] For each first material element, the terminal determines multiple node paths from the first heterogeneous graph, each node path includes a first node corresponding to the first material element. The node path is a line between nodes, which is used to represent the co-occurrence relationship between nodes, the second node is a node other than the first node in the node path, and the fourth feature vector is used to represent the characteristics of the material content in the material element corresponding to the second node.
[0169] In one possible implementation, the terminal directly updates the third eigenvector of the first node based on the fourth eigenvector of the second node, that is, the importance of multiple second nodes in each path to the first node is the same, and the terminal directly sums the fourth eigenvectors of the multiple second nodes to obtain the third eigenvector of the first node, and so on. The terminal updates the third eigenvectors of all nodes in the first heterogeneous graph through this method.
[0170] In the embodiment of the present application, the terminal does not need to distinguish the importance of each second node to the first node, and directly updates the third feature vector, which is simple to operate.
[0171] In another possible implementation, the terminal updates the third eigenvector of the first node based on the second weight and the fourth eigenvector of the second node. Figure 5 Accordingly, for each node path, the terminal updates the third feature vector based on the fourth feature vector of at least one second node in the node path, including: the terminal determines the second weight of each second node, and based on the second weight and the fourth feature vector of each second node, updates the third feature vector by the following formula 2:
[0172] Formula 2:
[0173]
[0174] in, represents the updated third eigenvector, h' j represents the fourth eigenvector of the jth second node in the node path, represents the second weight of the j-th second node, represents the identifier of the node path, i represents the identifier of the first node, and σ represents the nonlinear activation function.
[0175] Among them, the second weight of the second node can be set in advance. The terminal obtains the number of times the first material element and the material element corresponding to the second node appear together in the second electronic poster, and sets the second weight of each second node based on the number of times. The size of the second weight is positively correlated with the number of times. That is, the first material element and the material element corresponding to the second node appear together more times in other electronic posters, and the second weight of the second node is larger.
[0176] By analogy, the terminal updates the third eigenvectors of all nodes in the first heterogeneous graph through this method.
[0177] In the embodiment of the present application, the terminal updates the third eigenvector based on the second weight and the fourth eigenvector of each second node, which can accurately reflect the influence of the co-occurrence relationship between different material elements and make the updated third eigenvector more accurate.
[0178] Step 306: The terminal determines a first weight of the node path.
[0179] The terminal can determine the first weight of the node path by using the third eigenvector of each node in the node path and the fifth eigenvector of the node path itself. Accordingly, the process of the terminal determining the first weight of the node path can be implemented by the following two steps, including:
[0180] (3061) The terminal determines the fifth eigenvector of the node path based on the updated third eigenvector of each node included in the node path.
[0181] For example, see Figure 5 , the terminal determines the fifth eigenvector of the node path based on the updated third eigenvector of each node included in the node path through the following formula 3:
[0182] Formula 1:
[0183]
[0184] in, represents the fifth eigenvector of the node path, V represents each node included in the node path, express The node path includes the updated third eigenvector of the ith node, q, W and b are parameter matrices, and tanh represents the hyperbolic tangent function.
[0185] In an embodiment of the present application, the terminal determines the feature vector of the node path based on the feature vector of the node in the node path, so that the obtained feature vector of the node path is more accurate.
[0186] (3062) The terminal determines a first weight of each node path based on the fifth eigenvectors of the multiple node paths.
[0187] For example, see Figure 5 , the terminal determines the first weight of each node path based on the fifth eigenvectors of the multiple node paths through the following formula 4:
[0188] Formula 4:
[0189]
[0190] in, is the first weight of each node path, P represents the number of node paths containing the first node, represents the fifth eigenvector of the node path, i represents the identifier of the first node, It represents the identifier of the node path including the first node, and exp represents an exponential function with the natural constant e as the base.
[0191] The first weight is the importance of each node path to the first node in the node path.
[0192] Step 307: The terminal performs weighted summation on the third eigenvector based on the first weight of each node path to obtain the first eigenvector.
[0193] For example, see Figure 5 , the terminal performs weighted summation of the third eigenvector based on the first weight of each node path through the following formula 5 to obtain the first eigenvector:
[0194] Formula 5:
[0195]
[0196] Wherein, Z represents the first characteristic vector of the first material element corresponding to the first node, P represents the number of node paths including the first node, i represents the identifier of the first node, represents the identifier of the node path containing the first node, is the first weight of each node path, represents the updated third eigenvector.
[0197] In an embodiment of the present application, the terminal updates the first feature vector of the first material element corresponding to the first node based on the feature vector of the neighbor node of the first node, which can not only include the attribute information of the first material element, but also reflect the co-occurrence relationship between the material elements, so that the obtained first feature vector is more accurate, which is conducive to the subsequent generation of high-quality electronic posters.
[0198] Step 308: The terminal determines a second feature vector of the poster data based on the first feature vectors of the plurality of first material elements.
[0199] The second feature vector is used to represent the characteristics of the content information of the poster data. In a possible implementation, the terminal directly determines the second feature vector of the poster data based on the first feature vectors of multiple first material elements, that is, the multiple first material elements have the same importance to the poster data, and the terminal directly sums the first feature vectors of the multiple first material elements to obtain the second feature vector of the poster data.
[0200] In the embodiment of the present application, the terminal does not need to distinguish the importance of each first material element to the poster data, and directly determines the second feature vector of the poster data, which is simple to operate.
[0201] In another possible implementation, the terminal determines the second feature vector of the poster data by the third weight of each first feature vector. Figure 4 Correspondingly, the step of determining the second feature vector of the poster data based on the first feature vectors of multiple first material elements by the terminal includes: the terminal obtains the third weight of each first feature vector, and based on the third weight of each first feature vector, performs weighted summation on each first feature vector to obtain the second feature vector of the poster data.
[0202] Among them, the third weight of each first eigenvector can be set in advance, and the terminal sets the third weight of each first eigenvector based on the third matching degree between each first material element and the poster data, wherein the size of the third matching degree is positively correlated with the size of the third weight, that is, the higher the third matching degree between the first material element and the poster data, the higher the third weight of the corresponding first eigenvector.
[0203] In the embodiment of the present application, the terminal obtains the second eigenvector of the poster data through the third weight of each first eigenvector, which can accurately reflect the influence of different first eigenvectors on the poster data, making the obtained second eigenvector of the poster data more accurate.
[0204] Step 309: The terminal obtains a plurality of second material elements from the material library based on the second feature vector.
[0205] The second material element is a material element used to generate an electronic poster and exists in the material library. For example, the second material element is a material element such as a background color, a background image, or an embellishment pattern. Figure 4 The step of the terminal obtaining multiple second material elements from the material library based on the second feature vector includes: the terminal matches the poster data with the material elements of the material library based on the second feature vector to obtain multiple fourth matching degrees, and obtains multiple second material elements from the material library based on the multiple fourth matching degrees.
[0206] The fourth matching degree is used to represent the similarity between the second feature vector of the poster data and the eighth feature vector of each material element in the material library, and the eighth feature vector is the updated feature vector of each material element in the material library. The terminal pre-sets a fifth threshold value, and when the fourth matching degree exceeds the fifth threshold value, the terminal determines the material element corresponding to the fourth matching degree and uses it as the second material element for generating the electronic poster. When the fourth matching degree exceeds the fifth threshold value, the terminal does not perform the step of determining the material element corresponding to the fourth matching degree.
[0207] In the embodiment of the present application, the terminal obtains the second material element with a high degree of matching with the poster data, which can improve the quality of the electronic poster generated by the poster data and the second material element.
[0208] Step 310: The terminal generates a first electronic poster based on the poster data and multiple second material elements.
[0209] In a possible implementation, the terminal generates the first electronic poster based on a poster template. The poster template is used to generate the first electronic poster. The terminal pre-stores the poster template, directly places the poster data and the plurality of second material elements into the poster template, and generates the first electronic poster based on the poster template.
[0210] In the embodiment of the present application, the terminal directly places the poster data and multiple second material elements into the poster template to generate the first electronic poster, which is simple to operate.
[0211] In another possible implementation, the terminal generates a first electronic poster based on the poster data and the sizes and positions of the plurality of second elements in the poster template. Figure 4 The process of generating an electronic poster based on the poster data and the plurality of second material elements by the terminal can be implemented by the following steps (3101) to (3103), including:
[0212] (3101) The terminal determines a first size and a first position of poster data.
[0213] The first size and the first position are the size and the position of the poster data displayed in the poster template. The terminal determines the first size and the first position of the poster data based on the third material element of the same type as the poster data. Accordingly, this step can be implemented by the following steps (1) to (4), including:
[0214] (1) The terminal obtains the third material element.
[0215] The third material element is a material element of the same type as the poster data in the material library. The step of the terminal acquiring the third material element based on the poster data is the same as step 302, and will not be repeated here.
[0216] (2) The terminal determines a plurality of fourth sizes and fourth positions based on the third material element.
[0217] The fourth size and the fourth position are the size and the position of the third material element displayed in the fourth electronic poster, and the fourth electronic poster is another generated electronic poster. The terminal obtains the fourth electronic poster, searches for the third material element in the fourth electronic poster, records the fourth size and the fourth position displayed by the third material element, obtains multiple fourth sizes and multiple fourth positions, and at the same time, the terminal counts the first number of occurrences of each fourth size and the second number of occurrences of each fourth position.
[0218] (3) The terminal determines a first size probability distribution and a first position probability distribution of the second material element based on the multiple fourth sizes and fourth positions.
[0219] The terminal obtains multiple fourth sizes and multiple fourth positions, determines the first size probability distribution of the third material element based on each fourth size and the first number of times each fourth size appears in the second electronic poster, and determines the first position probability distribution of the third material element based on each fourth position and the second number of times each fourth position appears in the fourth electronic poster. In the embodiment of the present application, the first size probability distribution and the second position probability distribution can be Gaussian distributions, which are not specifically limited here.
[0220] (4) The terminal determines the first size and the first position based on the first size probability distribution and the first position probability distribution.
[0221] The terminal selects the fourth size with the highest probability in the first size probability distribution as the first size of the poster data, and selects the fourth position with the highest probability in the first position probability distribution as the second position of the poster data.
[0222] In an embodiment of the present application, the terminal obtains the maximum size and position of the material element of the same type as the poster data from other generated electronic posters, so that the first size and the first position of the poster data can be obtained more accurately.
[0223] (3102) The terminal determines, for each second material element, a second size and a second position of the second material element.
[0224] The second size and the second position are the size and the position of the second material element displayed in the poster template. The terminal determines the second size and the second position of the second material element by the size and the position of each second element in the second electronic poster. Accordingly, this step can be implemented by the following steps (2-1) to (2-3), including:
[0225] (1) The terminal determines a plurality of third sizes and a plurality of third positions.
[0226] The third size and the third position are the size and position of the second material element in other electronic posters. The terminal obtains the second electronic poster, searches for the second material element in the second electronic poster, records the third size and the third position displayed by the second material element, obtains multiple third sizes and multiple third positions, and at the same time, the terminal counts the first number of occurrences of each third size and the second number of occurrences of each third position.
[0227] (2) The terminal determines a second size probability distribution and a second position probability distribution of the second material element based on the multiple third sizes and third positions.
[0228] The terminal obtains multiple third sizes and multiple third positions, determines the second size probability distribution of the second material element based on each third size and the third number of times each third size appears in the second electronic poster, and determines the second position probability distribution of the second material element based on each third position and the fourth number of times each third position appears in the second electronic poster. In the embodiment of the present application, the second size probability distribution and the second position probability distribution can be Gaussian distributions, which are not specifically limited here.
[0229] (3) The terminal determines the second size and the second position based on the second size probability distribution and the second position probability distribution.
[0230] The terminal selects the third size with the highest probability in the second size probability distribution as the second size of the second material element, and selects the third position with the highest probability in the second position probability distribution as the second position of the second material element.
[0231] In the embodiment of the present application, the terminal obtains the second size and second position of the second element with the highest probability of appearing from other electronic posters, so that the size and position of the second element can be obtained more accurately.
[0232] (3103) The terminal displays the poster data and each second material element in the poster template based on the first size, the first position, the second size and the second position to obtain a first electronic poster.
[0233] In one possible implementation, the terminal directly displays the poster data in the poster template based on the first size and first position of the poster data, and directly displays each second material element in the poster template based on the second size and second position of each second material element, to obtain a first electronic poster.
[0234] In an embodiment of the present application, the terminal directly displays the poster data and each second material element in the poster template based on the first size, the first position, the second size and the second position to generate an electronic poster, which is easy to operate.
[0235] In another possible implementation, the terminal displays the poster data and each second material element in the poster template based on the first size, the first position, the second size and the second position. The poster data and the second element may be incompletely displayed or overlapped. Therefore, it is necessary to further optimize and adjust the first size and the first position of the poster data, and the second size and the second position of each second element. Accordingly, the step of adjusting the first size, the first position, the second size and the second position by the terminal can be implemented by the following steps (1) to (3), including:
[0236] (1) The terminal adjusts the first size and the second size.
[0237] The terminal displays the poster data and each second material element in the poster template based on the first size and the second size. There may be a situation where the poster data and the second material element are not fully displayed in the template, and it is necessary to further optimize and adjust the first size of the poster data and the second size of the second material element. Accordingly, the step of adjusting the first size and the second size by the terminal includes: the terminal obtains the size of the poster template, and based on the size, scales the first size of the poster data and the second size of each second material element according to the first scaling ratio, and determines the fifth size of the poster data and the sixth size of each second material element. Among them, the first scaling ratio is the scaling ratio of the poster template, the fifth size is the size of the poster data in the fifth electronic poster, and the sixth size is the size of each second material element in the fifth electronic poster.
[0238] In the embodiment of the present application, the terminal further optimizes and adjusts the first size and the second size to ensure that the poster data and each second material element can be displayed in the poster template, thereby improving the quality of the generated electronic poster.
[0239] (2) The terminal adjusts the first position and the second position.
[0240] Based on the first position of the poster data and the second position of each second material element, the terminal displays the poster data and each second material element in the poster template. There may be overlapping parts between the poster data and the second elements, and further optimization and adjustment are required for the first position of the poster data and the second position of each second material element. Accordingly, the step of adjusting the first position and the second position by the terminal includes: the terminal determines whether there is an overlapping part between the poster data and each second element, and if there is an overlapping part, the poster data and each second material element are translated in various directions until the poster data is located at the fifth position and each second material element is located at the sixth position. The fifth position is the position of the poster data when there is no overlapping part between the poster data and each second material element; the sixth position is the position of each second material element when there is no overlapping part between the poster data and each second material element.
[0241] In an embodiment of the present application, the terminal further optimizes and adjusts the first position and the second position to ensure that there is no overlapping between the poster data and each second material element, thereby improving the quality of the generated electronic poster.
[0242] (3) The terminal determines multiple fifth electronic posters based on the poster data and the multiple second material elements.
[0243] Among them, the fifth electronic poster is a preliminarily generated electronic poster.
[0244] The terminal displays the poster data and each second material element in the poster template based on the fifth size, the fifth position, the sixth size and the sixth position, and determines a plurality of fifth electronic posters.
[0245] In an embodiment of the present application, the terminal optimizes the size and position of the poster data and the second material element to make the generated electronic poster more beautiful and of higher quality.
[0246] One thing that needs to be explained is that in order to improve the conversion rate of goods, the terminal needs to display high-quality electronic posters to recommend goods to users. Therefore, the terminal needs to judge the quality of the fifth electronic poster generated and select a higher-quality electronic poster for display. Figure 4 Accordingly, the step of selecting a higher quality electronic poster by the terminal can be implemented by following the steps (4) to (5), including:
[0247] (4) The terminal determines the scoring parameters of each fifth electronic poster.
[0248] The terminal scores each fifth electronic poster through a discriminant function to obtain a scoring parameter for each fifth electronic poster. The discriminant function is a network model composed of a multi-layer perception mechanism. Accordingly, the terminal determines the scoring parameter for each fifth electronic poster by: the terminal inputs each fifth electronic poster into the network model, the model extracts the features of the material elements that constitute each fifth electronic poster, outputs the third matching degree of the material element combination corresponding to each fifth electronic poster, and uses the third matching degree as the scoring parameter for each fifth electronic poster. The material element combination is a combination of the poster data in the fifth electronic poster and each second material element, and the third matching degree is used to represent the similarity between the poster data in the fifth electronic poster and each second material element.
[0249] It should be noted that in the process of training the discriminant function, the terminal will obtain the material element combination from the seventh electronic poster as a positive sample, and the material element combination obtained by random negative sampling as a negative sample. The scoring parameter of the positive sample is higher, and the scoring parameter of the negative sample is lower. Among them, the seventh electronic poster is a real electronic poster that has been generated.
[0250] (5) The terminal determines a first electronic poster whose scoring parameter satisfies the condition from among the plurality of fifth electronic posters.
[0251] The terminal pre-sets the sixth threshold of the scoring parameter; accordingly, step (5) may be: the terminal selects a fifth electronic poster whose scoring parameter satisfies the condition from multiple fifth electronic posters based on the scoring parameter of each fifth electronic poster and the sixth threshold, and determines the first electronic poster based on the fifth electronic poster. For each fifth electronic poster, if the scoring parameter of the fifth electronic poster exceeds the sixth threshold, the terminal determines that the scoring parameter of the fifth electronic poster satisfies the condition and uses the fifth electronic poster as the first electronic poster; if the scoring parameter of the fifth electronic poster does not exceed the sixth threshold, the terminal determines that the scoring parameter of the fifth electronic poster does not satisfy the condition and discards the fifth electronic poster.
[0252] In the embodiment of the present application, the terminal screens the generated electronic posters through a discriminant function, and selects the electronic posters with high scoring parameters, so that the obtained electronic posters are more beautiful and of higher quality.
[0253] In the embodiment of the present application, since the feature vector of the first element is determined by the co-occurrence relationship between the material elements, the feature vector of the poster data determined by the feature vector contains the co-occurrence information between the material elements, so that the other material elements determined by the feature vector of the poster data have a better matching effect with the poster data, thereby improving the quality of the generated electronic poster in the process of generating an electronic poster from other material elements and the poster data.
[0254] Figure 6 This is a flow chart of a method for generating an electronic poster provided in an embodiment of the present application. The embodiment of the present application is executed by a terminal, and the method includes the following steps:
[0255] Step 601: The terminal constructs a second heterogeneous graph.
[0256] The second heterogeneous graph includes nodes corresponding to each material element in the material library and a first feature vector corresponding to each node. Accordingly, the step of constructing the second heterogeneous graph by the terminal includes: the terminal obtains multiple sixth electronic posters, obtains multiple material elements based on the multiple sixth electronic posters, stores the multiple material elements in the material library, annotates the corresponding nodes in the second heterogeneous graph for each material element, connects the nodes corresponding to the material elements with lines based on the co-occurrence relationship between the material elements, determines the feature vector corresponding to each node, and constructs the second heterogeneous graph based on the nodes, lines and the feature vector corresponding to each node.
[0257] The step of the terminal determining the feature vector corresponding to each node in the second heterogeneous graph can be implemented by the following steps (1) to (4), including:
[0258] (1) For each fourth material element, the terminal determines a ninth characteristic vector of a third node corresponding to the fourth material element and a plurality of node paths where the third node is located, and the fourth material element is a material element in the material library;
[0259] (2) The terminal updates the ninth eigenvector for each node path based on the tenth eigenvector of at least one fourth node in the node path;
[0260] (3) The terminal determines the fourth weight of each node path;
[0261] (4) The terminal performs weighted summation on the ninth eigenvector based on the fourth weight of each node path to obtain the first eigenvector.
[0262] Steps (1) to (4) are the same as steps 304-307 and will not be repeated here.
[0263] In an embodiment of the present application, the terminal pre-constructs a second heterogeneous graph to generate an electronic poster. Step 601 only needs to be executed once. When the electronic poster needs to be generated, the terminal only needs to go through steps 602 to 608 to generate the electronic poster. There is no need to repeat step 601, thereby reducing operating consumption and improving the efficiency of generating electronic posters.
[0264] Step 602: The terminal obtains poster data of the electronic poster to be generated.
[0265] Step 603: The terminal obtains a plurality of first material elements based on the poster data.
[0266] Steps 602-603 are the same as steps 301-302 and will not be repeated here.
[0267] Step 604: The terminal determines a plurality of first nodes in the second heterogeneous graph based on the plurality of first material elements.
[0268] The first node is a node corresponding to the first material element.
[0269] Step 605: The terminal obtains first feature vectors of multiple first material elements from the second heterogeneous graph based on the multiple first nodes.
[0270] Based on the multiple first material elements, the terminal directly obtains the first feature vectors of the multiple first material elements from the second heterogeneous graph, and the second heterogeneous graph includes an element node corresponding to each material element in the material library and a feature vector corresponding to each element node.
[0271] Step 606: The terminal determines a second feature vector of the poster data based on the first feature vectors of the plurality of first material elements.
[0272] Step 607: The terminal obtains a plurality of second material elements from the material library based on the second feature vector.
[0273] Step 608: The terminal generates a first electronic poster based on the poster data and the plurality of second material elements.
[0274] Steps 606-608 are the same as steps 308-310 and will not be described again here.
[0275] In an embodiment of the present application, the terminal pre-constructs a second heterogeneous graph. When obtaining the first eigenvector of the first material element, it can be directly obtained from the second heterogeneous graph. The operation is simple, and it can not only generate high-quality electronic posters, but also improve the efficiency of generating electronic posters.
[0276] Figure 7 : is a flow chart of an electronic poster generation method provided in an embodiment of the present application. The embodiment of the present application is executed by a server, and the method includes the following steps:
[0277] Step 701: The terminal obtains poster data of the electronic poster to be generated.
[0278] Step 701 is the same as step 301 and will not be described again here.
[0279] Step 702: The terminal sends the poster data to the server.
[0280] Step 703: The server obtains a plurality of first material elements based on the poster data.
[0281] Step 704: For each first material element, the server determines a plurality of node paths from the first heterogeneous graph.
[0282] Step 705: For each first material element, the server determines a third feature vector of the first node corresponding to the first material element.
[0283] Step 706: For each node path, the server updates the third feature vector based on the fourth feature vector of at least one second node in the node path.
[0284] Step 707: The server determines a first weight of each node path.
[0285] Step 708: The server performs weighted summation on the third feature vector based on the first weight of each node path to obtain the first feature vector.
[0286] Step 709: The server determines a second feature vector of the poster data based on the first feature vectors of the plurality of first material elements.
[0287] Step 710: The server obtains a plurality of second material elements from the material library based on the second feature vector.
[0288] Step 711: The server generates a first electronic poster based on the poster data and multiple second material elements.
[0289] Steps 703-711 are the same as steps 302-310 and will not be repeated here.
[0290] Step 712: The server sends the first electronic poster to the terminal.
[0291] Step 713: The terminal receives the electronic poster and outputs the first electronic poster.
[0292] In the embodiment of the present application, since the feature vector of the first element is determined by the co-occurrence relationship between the material elements, the feature vector of the poster data determined by the feature vector contains the co-occurrence information between the material elements, so that the other material elements determined by the feature vector of the poster data have a better matching effect with the poster data, thereby improving the quality of the generated electronic poster in the process of generating an electronic poster from other material elements and the poster data.
[0293] Figure 8 This is a schematic diagram of the structure of a device for obtaining epidemic prevention information provided in an embodiment of the present application, see Figure 8 , the device comprises:
[0294] A first acquisition module 801 is used to acquire first feature vectors of a plurality of first material elements based on poster data of the electronic poster to be generated, wherein the plurality of first material elements match the poster data, and the first feature vectors of the first material elements are used to represent a co-occurrence relationship between the first material elements and other material elements;
[0295] A determination module 802, configured to determine a second feature vector of the poster data based on the first feature vectors of the plurality of first material elements;
[0296] A second acquisition module 803, configured to acquire a plurality of second material elements from a material library based on the second feature vector;
[0297] The generating module 804 is used to generate a first electronic poster based on the poster data and a plurality of second material elements.
[0298] In a possible implementation, the first acquisition module 801 includes:
[0299] A first acquisition unit, configured to acquire a plurality of first material elements based on the poster data;
[0300] A first determining unit is used to determine, for each first material element, a plurality of node paths from the first heterogeneous graph, each node path includes a node corresponding to the first material element, the nodes in the first heterogeneous graph are nodes corresponding to the material elements in the material library, and a connection line between every two nodes in the first heterogeneous graph is used to represent a co-occurrence relationship between the two nodes;
[0301] The second determining unit is used to determine a first feature vector of the first material element based on each node in the plurality of node paths.
[0302] In another possible implementation, the second determining subunit includes:
[0303] A first determining subunit, used to determine a third eigenvector of a first node corresponding to a first material element, the third eigenvector being used to represent a feature of a material content of the first material element;
[0304] An updating subunit, configured to update the third eigenvector for each node path based on a fourth eigenvector of at least one second node in the node path, where the second node is a node other than the first node in the node path;
[0305] A second determining subunit, used to determine a first weight of the node path;
[0306] The processing subunit is used to perform weighted summation on the third eigenvector based on the first weight of each node path to obtain the first eigenvector.
[0307] In another possible implementation, the second determination subunit is used to determine the fifth eigenvector of the node path based on the updated third eigenvector of each node included in the node path; and determine the first weight of each node path based on the fifth eigenvectors of multiple node paths.
[0308] In another possible implementation, the second determining subunit is configured to determine a fifth eigenvector of the node path based on the updated third eigenvector of each node included in the node path by using the following formula 1;
[0309] Formula 1:
[0310] represents the fifth eigenvector of the node path, V represents each node included in the node path, express The node path includes the updated third eigenvector of the ith node, q, W and b are parameter matrices, and tanh represents the hyperbolic tangent function.
[0311] In another possible implementation, the updating subunit is used to determine the second weight of each second node; based on the second weight of each second node and the fourth eigenvector, the third eigenvector is updated by the following formula 2;
[0312] Formula 2:
[0313] represents the updated third eigenvector, h' j represents the fourth eigenvector of the jth second node in the node path, represents the second weight of the j-th second node, represents the identifier of the node path, i represents the identifier of the first node, and σ represents the nonlinear activation function.
[0314] In another possible implementation, the determining module 802 includes:
[0315] A second acquisition unit, used to acquire a third weight of each first eigenvector;
[0316] The processing unit is used to perform weighted summation on each first eigenvector based on the third weight of each first eigenvector to obtain a second eigenvector of the poster data.
[0317] In another possible implementation, the generating module 804 includes:
[0318] A third determining unit, used to determine a first size and a first position of the poster data, where the first size and the first position are respectively the size and the position of the poster data displayed in the poster template;
[0319] A fourth determining unit is used to determine, for each second material element, a second size and a second position of the second material element, where the second size and the second position are respectively a size and a position of the second material element displayed in the poster template;
[0320] The display unit is used to display the poster data and each second material element in the poster template based on the first size, the first position, the second size and the second position to obtain a first electronic poster.
[0321] In another possible implementation, the fourth determination unit is used to determine multiple third sizes and multiple third positions, where the third size and the third position are the size and position of the second material element in the second electronic poster; based on the multiple third sizes and the third positions, determine the size probability distribution and the position probability distribution of the second material element; based on the size probability distribution and the position probability distribution, determine the second size and the second position.
[0322] In another possible implementation, the device further includes:
[0323] A third acquisition module is used to acquire multiple images and determine poster data from the multiple images;
[0324] The fourth acquisition module is used to acquire text information and determine the poster data from the text information.
[0325] In another possible implementation, the third acquisition module includes:
[0326] A detection unit, used to perform image-text consistency detection on each image, obtain an image whose detection result is that the image and text are consistent from multiple images, and determine the poster data based on the image;
[0327] A fifth determining unit, configured to determine a quality parameter of each image, select an image whose quality parameter satisfies a condition from a plurality of images, and determine poster data based on the image;
[0328] The sixth determination unit is used to determine the aesthetic parameter of each image, select an image whose aesthetic parameter meets the conditions from the multiple images, and determine the poster data based on the image.
[0329] In another possible implementation, the first obtaining module 801 further includes:
[0330] A third acquisition unit, configured to acquire a plurality of first material elements based on the poster data;
[0331] A seventh determining unit, configured to determine, based on the plurality of first material elements, a plurality of first nodes in the second heterogeneous graph, wherein the first nodes are nodes corresponding to the first material elements;
[0332] The fourth acquisition unit is used to acquire first feature vectors of multiple first material elements from the second heterogeneous graph based on multiple first nodes, wherein the second heterogeneous graph includes a node corresponding to each material element in the material library and a first feature vector corresponding to each node.
[0333] In an embodiment of the present application, the terminal determines the characteristic vector of the poster data of the electronic poster to be generated through the co-occurrence relationship between the material elements, and determines other material elements based on the characteristic vector. The poster data of the electronic poster to be generated is freely combined with the other material elements to generate an electronic poster, which can make the generated electronic poster more diverse, richer in style, and higher in quality.
[0334] Fig. 9The structure block diagram of a terminal 900 provided by an exemplary embodiment of the present application is shown. The terminal 900 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, Moving Picture Experts Group Audio Layer 3), an MP4 player (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Group Audio Layer 4), a laptop computer or a desktop computer. The terminal 900 may also be called a user device, a portable terminal, a laptop terminal, a desktop terminal or other names.
[0335] Typically, the terminal 900 includes a processor 901 and a memory 902 .
[0336] The processor 901 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 901 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 901 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 901 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 901 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0337] The memory 902 may include one or more computer-readable storage media, which may be non-transitory. The memory 902 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 902 is used to store at least one instruction, which is used to be executed by the processor 901 to implement the electronic poster generation method provided in the method embodiment of the present application.
[0338] In some embodiments, the terminal 900 may also optionally include: a peripheral device interface 903 and at least one peripheral device. The processor 901, the memory 902 and the peripheral device interface 903 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 903 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 904, a touch display screen 905, a camera 906 camera assembly 906, an audio circuit 907, a positioning assembly 908 and a power supply 909.
[0339] The peripheral device interface 903 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 901 and the memory 902. In some embodiments, the processor 901, the memory 902, and the peripheral device interface 903 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 901, the memory 902, and the peripheral device interface 903 may be implemented on a separate chip or circuit board, which is not limited in the embodiments of the present application.
[0340] The radio frequency circuit 904 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 904 communicates with communication networks and other communication devices through electromagnetic signals. The radio frequency circuit 904 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 904 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The radio frequency circuit 904 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 904 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.
[0341] The display screen 905 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos and any combination thereof. When the display screen 905 is a touch display screen, the display screen 905 also has the ability to collect touch signals on the surface or above the surface of the display screen 905. The touch signal can be input to the processor 901 as a control signal for processing. At this time, the display screen 905 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 905 can be one, and the front panel of the terminal 900 is set; in other embodiments, the display screen 905 can be at least two, which are respectively set on different surfaces of the terminal 900 or are folded; in some embodiments, the display screen 905 can be a flexible display screen, which is set on the curved surface or folded surface of the terminal 900. Even, the display screen 905 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 905 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode, organic light-emitting diode).
[0342] The camera assembly 906 is used to capture images or videos. Optionally, the camera assembly 906 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 906 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.
[0343] The audio circuit 907 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 901 for processing, or input them into the radio frequency circuit 904 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal 900. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 901 or the radio frequency circuit 904 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 907 may also include a headphone jack.
[0344] The positioning component 908 is used to locate the current geographical location of the terminal 900 to implement navigation or LBS (Location Based Service). The positioning component 908 can be a positioning component based on the US GPS (Global Positioning System), China's Beidou system, Russia's Grenas system, or Russia's European Union's Galileo system.
[0345] The power supply 909 is used to power various components in the terminal 900. The power supply 909 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 909 includes a rechargeable battery, the rechargeable battery can be a battery that supports wired charging or a wireless charging battery. A wired charging battery is a battery that is charged through a wired line, and a wireless charging battery is a battery that is charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0346] In some embodiments, the terminal 900 further includes one or more sensors 910 , including but not limited to: an acceleration sensor 911 , a gyroscope sensor 912 , a pressure sensor 913 , a fingerprint sensor 914 , an optical sensor 915 , and a proximity sensor 916 .
[0347] The acceleration sensor 911 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal 900. For example, the acceleration sensor 911 can be used to detect the components of gravity acceleration on the three coordinate axes. The processor 901 can control the touch display screen 905 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 911. The acceleration sensor 911 can also be used for collecting game or user motion data.
[0348] The gyro sensor 912 can detect the body direction and rotation angle of the terminal 900, and the gyro sensor 912 can cooperate with the acceleration sensor 911 to collect the user's 3D actions on the terminal 900. The processor 901 can implement the following functions based on the data collected by the gyro sensor 912: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
[0349] The pressure sensor 913 can be set on the side frame of the terminal 900 and / or the lower layer of the touch display screen 905. When the pressure sensor 913 is set on the side frame of the terminal 900, it can detect the user's holding signal of the terminal 900, and the processor 901 performs left and right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 913. When the pressure sensor 913 is set on the lower layer of the touch display screen 905, the processor 901 controls the operability controls on the UI interface according to the user's pressure operation on the touch display screen 905. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
[0350] The fingerprint sensor 914 is used to collect the user's fingerprint, and the processor 901 identifies the user's identity based on the fingerprint collected by the fingerprint sensor 914, or the fingerprint sensor 914 identifies the user's identity based on the collected fingerprint. When the user's identity is identified as a trusted identity, the processor 901 authorizes the user to perform relevant sensitive operations, which include unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings. The fingerprint sensor 914 can be set on the front, back, or side of the terminal 900. When a physical button or a manufacturer logo is set on the terminal 900, the fingerprint sensor 914 can be integrated with the physical button or the manufacturer logo.
[0351] The optical sensor 915 is used to collect the ambient light intensity. In one embodiment, the processor 901 can control the display brightness of the touch display screen 905 according to the ambient light intensity collected by the optical sensor 915. Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 905 is increased; when the ambient light intensity is low, the display brightness of the touch display screen 905 is reduced. In another embodiment, the processor 901 can also dynamically adjust the shooting parameters of the camera component 906 according to the ambient light intensity collected by the optical sensor 915.
[0352] The proximity sensor 916, also called a distance sensor, is usually arranged on the front panel of the terminal 900. The proximity sensor 916 is used to collect the distance between the user and the front of the terminal 900. In one embodiment, when the proximity sensor 916 detects that the distance between the user and the front of the terminal 900 is gradually decreasing, the processor 901 controls the touch display screen 905 to switch from the screen-on state to the screen-off state; when the proximity sensor 916 detects that the distance between the user and the front of the terminal 900 is gradually increasing, the processor 901 controls the touch display screen 905 to switch from the screen-off state to the screen-on state.
[0353] Those skilled in the art will understand that Fig. 9 The structure shown in the figure does not constitute a limitation on the terminal 900, and the terminal 900 may include more or less components than those shown in the figure, or combine some components, or adopt a different component arrangement.
[0354] In an exemplary embodiment, a computer-readable storage medium is also provided, in which at least one instruction is stored, and the at least one instruction is loaded and executed by a terminal to implement the electronic poster generation method in the above embodiment. The computer-readable storage medium can be a memory. For example, the computer-readable storage medium can be a ROM (Read-Only Memory), a RAM (Random Access Memory), a CD-ROM (Compact Disc Read-Only Memory), a magnetic tape, a floppy disk, an optical data storage device, etc.
[0355] In an exemplary embodiment, a computer program or a computer program product is also provided. The computer program or the computer program product includes a computer program code. When the computer program code is executed by a computer, the computer implements the electronic poster generation method in the above embodiment.
[0356] In an exemplary embodiment, the computer program involved in the embodiments of the present application may be deployed and executed on a computer device, or on multiple computer devices located at one location, or on multiple computer devices distributed at multiple locations and interconnected by a communication network. Multiple computer devices distributed at multiple locations and interconnected by a communication network may constitute a blockchain system.
[0357] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0358] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for generating an electronic poster, characterized in that: The method comprises: Based on poster data of the electronic poster to be generated, obtaining first feature vectors of a plurality of first material elements, the plurality of first material elements match the poster data, and the first feature vectors of the first material elements are used to represent a co-occurrence relationship between the first material elements and other material elements; Determining a second feature vector of the poster data based on the first feature vectors of the plurality of first material elements; Based on the second feature vector, acquiring a plurality of second material elements from a material library; Generate a first electronic poster based on the poster data and the plurality of second material elements; The determining of the second feature vector of the poster data based on the first feature vectors of the plurality of first material elements includes: the second feature vector is used to represent the feature of the content information of the poster data; the plurality of first material elements have the same importance to the poster data, the terminal directly sums the first feature vectors of the plurality of first material elements to obtain the second feature vector of the poster data or the terminal obtains the third weight of each first feature vector, performs weighted summation on each first feature vector based on the third weight of each first feature vector to obtain the second feature vector of the poster data, and the terminal sets the third weight of each first feature vector based on the third matching degree between each first material element and the poster data, wherein the magnitude of the third matching degree is positively correlated with the magnitude of the third weight; The method of obtaining multiple second material elements from the material library based on the second feature vector includes: the terminal matches the poster data with the material elements in the material library based on the second feature vector to obtain multiple fourth matching degrees, and obtains multiple second material elements from the material library based on the multiple fourth matching degrees, wherein the fourth matching degree is used to represent the similarity between the second feature vector of the poster data and the eighth feature vector of each material element in the material library, and the eighth feature vector is an updated feature vector of each material element in the material library, and the terminal pre-sets a fifth threshold value. When the fourth matching degree exceeds the fifth threshold value, the terminal determines the material element corresponding to the fourth matching degree and uses it as the second material element for generating the electronic poster.
2. The method according to claim 1, characterized in that: The step of obtaining first feature vectors of a plurality of first material elements based on the poster data of the electronic poster to be generated includes: Based on the poster data, acquiring the plurality of first material elements; For each first material element, determining multiple node paths from the first heterogeneous graph, each node path includes a node corresponding to the first material element, the nodes in the first heterogeneous graph are nodes corresponding to the material elements in the material library, and the connection line between each two nodes in the first heterogeneous graph is used to represent the co-occurrence relationship between the two nodes; Based on each node in the plurality of node paths, a first feature vector of the first material element is determined.
3. The method according to claim 2, characterized in that: The determining, based on each node in the plurality of node paths, a first feature vector of the first material element comprises: Determine a third feature vector of a first node corresponding to the first material element, wherein the third feature vector is used to represent a feature of material content of the first material element; For each node path, updating the third eigenvector based on a fourth eigenvector of at least one second node in the node path, the second node being a node in the node path other than the first node; Determining a first weight of the node path; Based on the first weight of each node path, weighted sum is performed on the third eigenvector to obtain the first eigenvector.
4. The method according to claim 3, characterized in that: The determining the first weight of the node path includes: Determining a fifth eigenvector of the node path based on the updated third eigenvector of each node included in the node path; Based on the fifth eigenvectors of the plurality of node paths, a first weight of each node path is determined.
5. The method according to claim 4, characterized in that: The step of determining the fifth feature vector of the node path based on the updated third feature vector of each node included in the node path comprises: Based on the updated third feature vector of each node included in the node path, determine the fifth feature vector of the node path by the following formula 1; Formula 1: represents the fifth eigenvector of the node path, V represents each node included in the node path, It represents the updated third eigenvector of the ith node included in the node path, q, W and b are parameter matrices respectively, and tanh represents the hyperbolic tangent function.
6. The method according to claim 3, characterized in that: The updating of the third feature vector based on a fourth feature vector of at least one second node in the node path comprises: determining a second weight of each second node; Based on the second weight and the fourth eigenvector of each second node, the third eigenvector is updated by the following formula 2; Formula 2: represents the updated third eigenvector, h' j represents the fourth eigenvector of the j-th second node in the node path, represents the second weight of the j-th second node, represents the identifier of the node path, i represents the identifier of the first node, and σ represents a nonlinear activation function.
7. The method according to claim 1, characterized in that: The step of generating a first electronic poster based on the poster data and the plurality of second material elements includes: Determine a first size and a first position of the poster data, where the first size and the first position are respectively the size and the position of the poster data displayed in the poster template; For each second material element, determining a second size and a second position of the second material element, wherein the second size and the second position are respectively the size and the position of the second material element displayed in the poster template; Based on the first size, the first position, the second size and the second position, the poster data and each second material element are displayed in the poster template to obtain the first electronic poster.
8. The method according to claim 7, characterized in that: The determining the second size and the second position of the second material element includes: Determine a plurality of third sizes and a plurality of third positions, wherein the third sizes and the third positions are sizes and positions of the second material element in the second electronic poster; Determine a size probability distribution and a position probability distribution of the second material element based on the multiple third sizes and the third positions; Based on the size probability distribution and the position probability distribution, the second size and the second position are determined.
9. The method according to claim 1, characterized in that: Get the poster data of the electronic poster to be generated, including: A plurality of images are acquired, and the poster data is determined from the plurality of images; or text information is acquired, and the poster data is determined from the text information.
10. The method according to claim 9, characterized in that: The determining the poster data from the multiple images includes at least one of the following implementations: Performing a text-image consistency test on each image, acquiring an image whose text-image consistency test result is obtained from the multiple images, and determining the poster data based on the image; Alternatively, determining a quality parameter of each image, selecting an image whose quality parameter satisfies a condition from the plurality of images, and determining the poster data based on the image; Alternatively, the aesthetic parameter of each image is determined, an image whose aesthetic parameter satisfies a condition is selected from the plurality of images, and the poster data is determined based on the image.
11. The method according to claim 1, characterized in that: The step of obtaining first feature vectors of a plurality of first material elements based on the poster data of the electronic poster to be generated further includes: Based on the poster data, acquiring the plurality of first material elements; Based on the multiple first material elements, determining multiple first nodes in the second heterogeneous graph, where the first nodes are nodes corresponding to the first material elements; Based on the multiple first nodes, first feature vectors of the multiple first material elements are obtained from the second heterogeneous graph, where the second heterogeneous graph includes a node corresponding to each material element in the material library and a first feature vector corresponding to each node.
12. An electronic poster generating device, characterized in that: The device comprises: A first acquisition module, configured to acquire first feature vectors of a plurality of first material elements based on poster data of an electronic poster to be generated, wherein the plurality of first material elements match the poster data, and the first feature vectors of the first material elements are used to represent a co-occurrence relationship between the first material elements and other material elements; A determination module, configured to determine a second feature vector of the poster data based on the first feature vectors of the plurality of first material elements; A second acquisition module, configured to acquire a plurality of second material elements from a material library based on the second feature vector; A generating module, configured to generate a first electronic poster based on the poster data and the plurality of second material elements; The determining of the second feature vector of the poster data based on the first feature vectors of the plurality of first material elements includes: the second feature vector is used to represent the feature of the content information of the poster data; the plurality of first material elements have the same importance to the poster data, the terminal directly sums the first feature vectors of the plurality of first material elements to obtain the second feature vector of the poster data or the terminal obtains the third weight of each first feature vector, performs weighted summation on each first feature vector based on the third weight of each first feature vector to obtain the second feature vector of the poster data, and the terminal sets the third weight of each first feature vector based on the third matching degree between each first material element and the poster data, wherein the magnitude of the third matching degree is positively correlated with the magnitude of the third weight; The method of obtaining multiple second material elements from the material library based on the second feature vector includes: the terminal matches the poster data with the material elements in the material library based on the second feature vector to obtain multiple fourth matching degrees, and obtains multiple second material elements from the material library based on the multiple fourth matching degrees, wherein the fourth matching degree is used to represent the similarity between the second feature vector of the poster data and the eighth feature vector of each material element in the material library, and the eighth feature vector is an updated feature vector of each material element in the material library, and the terminal pre-sets a fifth threshold value. When the fourth matching degree exceeds the fifth threshold value, the terminal determines the material element corresponding to the fourth matching degree and uses it as the second material element for generating the electronic poster.
13. A terminal, characterized in that: The terminal includes one or more processors and one or more memories, wherein at least one program code is stored in the one or more memories, and the at least one program code is loaded and executed by the one or more processors to implement the method for generating an electronic poster as described in any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that: At least one program code is stored in the storage medium, and the at least one program code is loaded and executed by the processor to implement the method for generating an electronic poster as described in any one of claims 1 to 11.
Citation Information
Patent Citations
Method and system for automatically generating an advertisement
CN109493116A
Poster generation method, device and equipment and computer storage medium
CN109727298A