Template selection model training method and page template generation method and device
By training template selection models and using AIGC technology, the problem of human-intensive development of existing page templates is solved, and the generation of personalized page templates is automatically achieved, which improves user experience and retention.
Patent Information
- Application Number
- CN202411384789.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-02-11
AI Technical Summary
The development of existing page templates requires a lot of manpower, and the templates lack personalization and cannot be changed according to user characteristics, resulting in poor user experience.
By training template selection models, use user tags and traffic data to calculate the preference index of the page template, automatically match and adjust the page template, and combine the AIGC model to generate personalized page templates.
It reduces the manpower required for page template development, generates diversified page template data, meets users' personalized requirements, and improves user retention rate.
Smart Images

Figure CN119415199A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a training method for a template selection model, and a method and device for generating a page template. Background Art
[0002] When users use various apps (Applications), the applications need to display pages for users. In the process of generating pages, corresponding page templates need to be called.
[0003] Currently, page templates are all pre-configured and stereotyped, and cannot be personalized according to user characteristics. In addition, each page template requires engineers to develop, which requires a lot of development work. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a training method for a template selection model, a method and device for generating a page template, so as to reduce the manpower consumed in page template development, generate diversified page template data, meet the personalized requirements of users, and improve user retention. The specific technical solution is as follows:
[0005] In a first aspect of the present application, a training method for a template selection model is provided, the method comprising:
[0006] Obtaining traffic data generated by target users with different user tags browsing a first page; the first page includes: a page generated based on an original page template in a first page template set; the first page template set includes original page templates of multiple page identifiers generated in advance; the traffic data includes one or more of the following: dwell time, click rate, conversion rate;
[0007] Converting the traffic data into first preference indexes for different original page templates;
[0008] Inputting the user tag and the page identifier into a template selection model to obtain a second preference index of the user tag for different original page templates under the page identifier;
[0009] Based on the first preference index and the second preference index, a preset loss function is used to calculate a loss value, and parameters of the template selection model are adjusted based on the loss value;
[0010] Return to the step of inputting the user tag and the page identifier into the template selection model until the template selection model converges or reaches a preset number of iterations, and determine a trained template selection model.
[0011] Optionally, the step of converting the traffic data into first preference indexes for different original page templates includes:
[0012] The first ratio, the click rate and the conversion rate are weighted based on the first weighting coefficient, the second weighting coefficient and the third weighting coefficient to obtain the first preference index; the first ratio is the ratio of the stay time to the preset time step.
[0013] A second aspect of the present application provides a method for generating a page template, the method comprising:
[0014] Determine user tags and target page identifiers;
[0015] Input the user tag and the target page identifier into a template selection model, and obtain the preference index of each original page template corresponding to the target page identifier in the first page template set output by the template selection model; the template selection model is trained based on the training method of the template selection model;
[0016] Determining a second page template set based on the order of the preference indexes; the second page template set includes a plurality of original page templates corresponding to the target page identifier;
[0017] For the user tag and the target page identifier, the pre-trained first AIGC model is used to split the page element data of the original page template in the second page template set, and reassemble them into multiple groups of candidate page element data;
[0018] The candidate page element data, page background image and template style data are combined to obtain a target page template set, wherein the target page template set includes multiple groups of page template data; the template style data is a cascading style sheet.
[0019] Optionally, the method further includes:
[0020] A pre-trained second AIGC model is used to generate a target page background image of a page template according to the user tag and the target page identifier; the second AIGC model is used to generate an image based on text information;
[0021] The step of combining the candidate page element data, the page background image and the template style data to obtain a target page template set includes:
[0022] The candidate page element data, the target page background image and the template style data are combined to obtain a target page template set.
[0023] Optionally, the method further includes:
[0024] According to the user tag and the target page identifier, a pre-trained third AIGC model is used to generate target template style data of a page template; the third AIGC model is used to generate a template style of a random page template;
[0025] The step of combining the candidate page element data, the page background image and the template style data to obtain a target page template set includes:
[0026] The candidate page element data, the page background image and the target template style data are combined to obtain a target page template set.
[0027] Optionally, the step of determining the user tag and the target page identifier includes:
[0028] Receive a page display request sent by a client, wherein the page display request carries a target page identifier and a user identifier of a target user;
[0029] Based on the user identifier, a user tag of the target user is determined.
[0030] Optionally, the method further includes:
[0031] Sending page template data to the client so that the client renders a page based on the page template data; the page template data is any page template data in the target page template set.
[0032] In a third aspect of the present application, a training device for a template selection model is provided, the device comprising:
[0033] An acquisition module is used to acquire traffic data generated by target users with different user tags browsing a first page; the first page includes: a page generated based on an original page template in a first page template set; the first page template set includes original page templates of multiple page identifiers generated in advance; the traffic data includes one or more of the following: dwell time, click rate, conversion rate;
[0034] A conversion module, used for converting the traffic data into first preference indexes for different original page templates;
[0035] An input module, used for inputting the user tag and the page identifier into a template selection model to obtain a second preference index of the user tag for different original page templates under the page identifier;
[0036] a calculation module, configured to calculate a loss value based on the first preference index and the second preference index using a preset loss function, and adjust parameters of the template selection model based on the loss value;
[0037] The iteration module is used to return to the step of inputting the user tag and the page identifier into the template selection model until the template selection model converges or reaches a preset number of iterations, and then determine a trained template selection model.
[0038] Optionally, the conversion module is specifically used to: perform weighted operations on the first ratio, the click-through rate and the conversion rate based on a first weighting coefficient, a second weighting coefficient and a third weighting coefficient, respectively, to obtain the first preference index; the first ratio is the ratio of the stay time to a preset time step.
[0039] In a fourth aspect of the present application, a device for generating a page template is provided, the device comprising:
[0040] A first determination module, used to determine a user tag and a target page identifier;
[0041] An input module, used to input the user tag and the target page identifier into a template selection model, and obtain a preference index of each original page template corresponding to the target page identifier in the first page template set output by the template selection model; the template selection model is trained based on the training method of the template selection model;
[0042] A second determination module is used to determine a second page template set based on the order of the preference index; the second page template set includes a plurality of original page templates corresponding to the target page identifier;
[0043] a recombining module, for splitting the page element data of the original page template in the second page template set according to the user tag and the target page identifier, and recombining the splitting into multiple groups of candidate page element data by using a pre-trained first AIGC model;
[0044] The combination module is used to combine the candidate page element data, the page background image and the template style data to obtain a target page template set, wherein the target page template set includes multiple groups of page template data; the template style data is a cascading style sheet.
[0045] Optionally, the device further comprises:
[0046] A first generating module is used to generate a target page background image of a page template using a pre-trained second AIGC model according to the user tag and the target page identifier; the second AIGC model is used to generate an image based on text information;
[0047] The combination module is specifically used to combine the candidate page element data, the target page background image and the template style data to obtain a target page template set.
[0048] Optionally, the device further comprises:
[0049] A second generation module is used to generate target template style data of a page template using a pre-trained third AIGC model according to the user tag and the target page identifier; the third AIGC model is used to generate a template style of a random page template;
[0050] The combination module is specifically used to combine the candidate page element data, the page background image and the target template style data to obtain a target page template set.
[0051] Optionally, the first determining module is specifically configured to:
[0052] Receive a page display request sent by a client, wherein the page display request carries a target page identifier and a user identifier of a target user;
[0053] Based on the user identifier, determine the user tag of the target user
[0054] Optionally, the device further comprises:
[0055] The sending module is used to send page template data to the client so that the client renders the page based on the page template data; the page template data is any page template data in the target page template set.
[0056] In a fifth aspect of the present application, an electronic device is provided, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0057] Memory, used to store computer programs;
[0058] The processor is used to implement any of the above-mentioned template selection model training methods and page template generation methods when executing the program stored in the memory.
[0059] In the sixth aspect of the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the training method of any of the above-mentioned template selection models and the method of generating a page template are implemented.
[0060] In the seventh aspect of the present application, there is also provided a computer program product comprising instructions, which, when executed on a computer, enables the computer to implement any of the above-mentioned template selection model training methods and page template generation methods.
[0061] The training method of the template selection model, the method and device for generating page templates provided in the embodiments of the present application can enable the model to learn the correlation between user tags and different original page templates. After the training is completed, the original page templates with higher preference can be automatically matched based on user tags and page identifiers, thereby providing basic material for automatically generating new personalized page templates using the AIGC model.
[0062] Furthermore, the server is pre-trained with an AIGC model for converting user identifiers and page identifiers into page template data. The server uses the AIGC model to generate diversified page template data to meet the user's personalized requirements, thereby improving user retention.
[0063] In addition, since AIGC technology is used to generate page templates, there is no need to spend manpower to develop page templates, which greatly reduces the development workload. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.
[0065] Figure 1 A schematic diagram of a flow chart of a training method for a template selection model provided in an embodiment of the present application;
[0066] Figure 2 A schematic diagram of a flow chart of a method for generating a page template provided in an embodiment of the present application;
[0067] Figure 3 A schematic diagram of the interaction between a terminal device and a server provided in an embodiment of the present application;
[0068] Figure 4 Another flowchart of a method for generating a page template provided in an embodiment of the present application;
[0069] Figure 5 A schematic diagram of a structure of a training device for a template selection model provided in an embodiment of the present application;
[0070] Figure 6 A schematic diagram of the structure of a device for generating a page template provided in an embodiment of the present application;
[0071] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0072] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0073] When users use various apps, the apps need to display pages for users. In the process of generating pages, the corresponding page templates need to be called.
[0074] Currently, page templates are all pre-configured and stereotyped, and cannot be personalized according to user characteristics. In addition, each page template requires engineers to develop, which requires a lot of development work.
[0075] In order to solve the above technical problems, the present application provides a training method for a template selection model and a method for generating a page template based on the template selection model.
[0076] See also Figure 1 , is a flow chart of a training method for a template selection model provided in an embodiment of the present application,
[0077] like Figure 1 As shown, a flow chart of a training method for a template selection model includes the following steps:
[0078] S101: Obtain traffic data generated by target users with different user tags browsing the first page; the first page includes: a page generated based on an original page template in a first page template set; the first page template set includes pre-generated original page templates of multiple page identifiers; the traffic data includes one or more of the following: dwell time, click rate, conversion rate.
[0079] In the embodiment of the present application, the page identifier represents the category of the page. For example, for a video APP, the page identifier may include film and television category information such as "TV series", "movie", and "variety show".
[0080] In the embodiment of the present application, the user tag may be user portrait information that represents the user's preferences, and the user may be tagged with a specific tag by analyzing the user's behavior information.
[0081] In one embodiment of the present application, the user tag is determined based on the user behavior information of the target user and a pre-trained user tag generation model; the user tag generation model is used to determine the user tag based on the user behavior information.
[0082] When using the APP client, the target user can interact with the server by speaking (i.e. inputting voice information), typing (i.e. inputting text information), clicking to view, sliding to turn pages, clicking to collect, etc. The above behaviors can be called user interaction behaviors. Users convey interaction behavior information to the server through interaction behaviors.
[0083] The above interactive behavior information may reflect the interests of the target user, and thus may be used as input data for evaluating the user tag of the target user. Therefore, the user tag of the user may be analyzed based on the interactive behavior information.
[0084] The collected user interaction behavior data will be cleaned, deduplicated, feature extracted, and labeled based on AIGC's text processing capabilities.
[0085] Then, you can use AI platforms to train user portrait models, such as Google Cloud AutoML, Microsoft Azure Machine Learning, etc. The above platforms provide general models for characterizing user portraits. The collected user behaviors and pre-labeled user tags are input into the model for model training. After the training is completed, user tags can be automatically generated based on user behaviors.
[0086] In the embodiment of the present application, a certain number of original page templates can be developed in advance to form a first page template set, a first page is generated based on these original page templates, and then the first page is delivered to target users.
[0087] The first page template set includes pre-generated original page templates of multiple page identifiers, that is, multiple original page templates are generated for each page identifier.
[0088] Then, the traffic data generated when the target user browses the first page is collected. The traffic data may include one or more of the following: stay time, click rate, and conversion rate.
[0089] Since the user tag of each target user is known, by collecting these traffic data, the inclination, that is, the degree of preference, of users with different user tags towards page templates can be determined.
[0090] S102: Convert the traffic data into first preference indexes for different original page templates.
[0091] Specifically, when the target user browses a page generated by a specific original page template, the traffic data generated can reflect the target user's inclination or preference for the page template. Therefore, calculations based on the above traffic data can be converted into preference indexes for different original page templates.
[0092] In one embodiment of the present application, the first ratio, click rate and conversion rate can be weighted based on the first weighting coefficient, the second weighting coefficient and the third weighting coefficient to obtain a first preference index; the first ratio is the ratio of the stay time to the preset time step.
[0093] In order to perform weighted calculation on the stay time, a time step may be preset, and a first ratio of the stay time to the preset time step may be calculated. The larger the first ratio, the higher the target user's preference for the page template.
[0094] Correspondingly, click-through rate and conversion rate can also represent the target user's preference for the page target. By calculating with the preset weighted weights, a value representing the preference can be obtained.
[0095] S103: Input the user tag and the page identifier into the template selection model to obtain a second preference index of the user tag for different original page templates under the page identifier.
[0096] The template selection model can be a neural network model. The user tags of the target users and the preference indexes of the target users for different page templates are used as training samples to train the model and let the model learn the intrinsic relationship between user tags and page templates under different page identifiers.
[0097] First, the neural network model is initialized, and then step S103 is iteratively executed. Each time step S103 is executed, the second preference index of different original page templates under the page identification of the user tag can be obtained.
[0098] Among them, the second preference index can be understood as the predicted value of the model output.
[0099] S104: Based on the first preference index and the second preference index, a preset loss function is used to calculate a loss value, and parameters of the template selection model are adjusted based on the loss value.
[0100] The loss function is used to measure the difference between the predicted value and the true value of the model. In this embodiment, the first preference index is used as the true value, and the second preference index is used as the predicted value. According to the pre-set loss function, the loss value can be calculated for each round of iteration, and the parameters of the model can be adjusted based on the loss value.
[0101] The embodiment of the present application does not specifically limit the selection of the loss function. For example, the mean square error loss function, the absolute mean error loss function, the cross entropy loss function, etc. can be used.
[0102] S105: Determine whether the termination condition of the model training is met, if not, return to execute S103. If yes, execute S106.
[0103] S106: Determine the trained template selection model.
[0104] After each round of iteration, it is determined whether the termination condition of model training has been met. For example, if the number of iterations reaches the preset number, or the loss function value no longer decreases or fluctuates significantly, the model can be considered to have converged and the termination condition has been met.
[0105] It should be noted that the original page templates are for different page identifiers, the training samples include the original page templates for different page identifiers, and the collected preference indexes are also for different page identifiers.
[0106] Specifically, the template selection model includes a sub-model corresponding to each page identifier, which can be understood as training for each page identifier respectively.
[0107] It can be seen that in the embodiment of the present application, through the above-mentioned training, the model can learn the correlation between user tags and different original page templates. After the training is completed, it can automatically match the original page templates with higher preference based on user tags and page identifiers, thereby providing basic material for automatically generating new personalized page templates using the AIGC model.
[0108] See also Figure 2 , is a flow chart of a method for generating a page template provided in an embodiment of the present application, comprising the following steps:
[0109] S201: Determine the user tag and the target page identifier.
[0110] S202: Input the user tag and the target page identifier into the template selection model, and obtain the preference index of each original page template corresponding to the target page identifier in the first page template set output by the template selection model.
[0111] S203: Determine a second page template set based on the order of preference indexes; the second page template set includes a plurality of original page templates corresponding to the target page identifier.
[0112] In the embodiment of the present application, since the template selection model has been pre-trained, when it is necessary to generate a page template for a specific user tag and target page identifier, the user tag and target page identifier are first input into the template selection model, and the generated original page template can be matched, and then these original page templates can be used as the original materials for the AIGC generation model.
[0113] Specifically, the template selection model outputs the preference index of each original page template corresponding to the target page identifier in the first page template set, and then determines a preset number of original page templates with higher preference indexes as original materials based on the order of preference indexes.
[0114] S204: Based on the user tag and the target page identifier, the pre-trained first AIGC model is used to split the page element data of the original page template in the second page template set, and reassemble them into multiple groups of candidate page element data.
[0115] AIGC is a new artificial intelligence technology. Its full name is Artificial Intelligence Generative Content, which is generative artificial intelligence. It refers to the technology based on artificial intelligence technical methods such as generative adversarial networks and large pre-trained models. It generates relevant content with appropriate generalization capabilities through learning and identifying existing data.
[0116] The core idea of AIGC is to use artificial intelligence models to automatically generate various types of text, images, audio, video and other content based on given topics, keywords, formats, styles and other conditions.
[0117] In the embodiment of the present application, the page template data includes: page element data in json format, page template background image and template style data. Among them, the template style data is CSS (Cascading Style Sheets), which is a markup language used to add style and layout to the page. It can realize various visual effects in the page, including fonts, colors, spacing, borders, etc.
[0118] In this step, the page element data of the page templates in the second page template set can be split with the help of AIGC, and then recombined to obtain multiple groups of candidate page element data.
[0119] In addition, it should be noted that since this process does not involve the generation of new page element data, it can also be directly split and reorganized, that is, without using the AIGC model for processing.
[0120] S205: combining the candidate page element data, the page background image and the template style data to obtain a target page template set, wherein the target page template set includes multiple groups of page template data; the template style data is a cascading style sheet.
[0121] Those skilled in the art can understand that page template data is essentially a combination of multiple dimensional data, specifically including page element data, page template background image, and template style. Among them, page element data is usually in json format. Template style is usually a cascading style sheet.
[0122] By randomly combining the candidate page element data, the page background image and the template style data, multiple sets of page template data can be obtained.
[0123] In one embodiment, the page background image and template style data may adopt a default style, and the candidate page element data, the default page background image and the template style data obtained by the combination in S204 are randomly combined to generate a plurality of page template data.
[0124] In another embodiment of the present application, a template background image may be generated for user tags and page logos based on a pre-trained AIGC model for converting text information to images.
[0125] Specifically, for user tags and target page identifiers, a pre-trained second AIGC model is used to generate a target page background image of a page template; the second AIGC model is used to generate images based on text information.
[0126] Those skilled in the art can understand that for the AIGC model, prompts are needed to guide the AIGC model to perform tasks. Prompts can be understood as inputs for interacting with the large model, and can be any form of text input, such as a question, a text description, etc.
[0127] Prompts can be specifically divided into three categories: instructions, contextual information, and explanatory information. Instructions can be understood as specific tasks that require the AIGC model to perform or questions that it must answer; contextual information may include: additional information related to the question or topic to help the model better understand the question, answer the question, or perform the task; explanatory information may include: supplementary explanations of the task requirements.
[0128] As an example, if the user tag is "history" and the page tag is "TV series", a prompt can be generated based on these two elements to guide the AIGC model to perform tasks. As an example, the prompt can be: generate pictures related to historical TV series.
[0129] Through the AIGC model, images related to user tags and page logos are generated as template background images, so that the combined page template is more in line with the preferences and tendencies of each user tag, further improving personalization capabilities and increasing user experience.
[0130] In another embodiment of the present application, a CSS style related to the user tag and the page identifier may be generated based on the AIGC model.
[0131] Specifically, with respect to user tags and target page identifiers, a pre-trained third AIGC model is used to generate target template style data for a page template; the third AIGC model is used to generate a template style for a random page template.
[0132] In order to guide the generation of CSS style data, the set prompt may be: please generate new CSS style data based on the stored CSS style data.
[0133] By instructing the AIGC model through the above-mentioned original materials and guiding words, the speed at which AIGC generates data can be accelerated, and the generated data is changed based on the original materials. The original materials can reflect the tendency and preference of user labels, and the template element data finally generated can also be close to the user's preferences.
[0134] It can be seen that in the embodiment of the present application, an AIGC model for converting user identifiers and page identifiers into page template data is pre-trained. With the help of the personalization capability of the AIGC model, diversified page template data can be generated to meet the user's personalized requirements, thereby improving user retention.
[0135] In one embodiment of the present application, the above step S201 may specifically include: receiving a page display request sent by a client, the page display request carrying a target page identifier and a user identifier of a target user; and determining a user tag of the target user based on the user identifier.
[0136] For details, see Figure 3 , which is a schematic diagram of the interaction between the terminal device and the server provided in the embodiment of the present application, such as Figure 3 As shown, the terminal device has the APP client installed. Figure 3 In the example shown, a mobile phone is used as the terminal device.
[0137] After the user opens the APP client on the mobile phone, he enters the login information. The client determines the user ID based on the login information. The client needs to display the page for the user. The client can send a page display request to the server, which carries the page ID and user ID. The server is configured with an AIGC model for converting user tags and page IDs into page template data. After receiving the request, the server feeds back the page template data to the client, and the client can render the page based on the page template data.
[0138] In one embodiment of the present application, when the client determines that a page needs to be displayed, it can send a page display request to the server, and the page display request carries a page identifier and a user identifier of a target user. After receiving the page display request sent by the client, the server determines a user tag based on the user identifier carried in the page display request, and determines a target page identifier, and then executes steps S202-S205 to generate a variety of page template data based on the target page identifier and the user tag.
[0139] The server may store the correspondence between the user identification and the user tag. The user tag may be collected in advance, as described above for details.
[0140] In the above embodiment, the server generates multiple sets of page template data in real time based on user tags and page identifiers only after receiving a page display request, which can minimize server resource consumption. However, the disadvantage is that it may cause the client to wait for a long time.
[0141] In another embodiment of the present application, the client can determine the user tag and page identifier by itself, and generate the corresponding page template in advance when no page display request is received. In this way, more page template data may need to be generated, increasing the resource consumption of the server, but the client's request can be responded to quickly.
[0142] The above two implementation modes can be selected according to the needs.
[0143] In one embodiment of the present application, after the target page template set is generated, page template data is sent to the client so that the client renders the page based on the page template data; the page template data is any page template data in the target page template set.
[0144] Therefore, the server uses the AIGC model to generate diversified page template data to meet the personalized requirements of users, thereby improving user retention.
[0145] Moreover, since AIGC technology is used to generate page templates, there is no need to spend manpower to develop page templates, which greatly reduces the development workload.
[0146] Combination Figure 4 The method for generating a page template provided in the embodiment of the present application is further introduced. Figure 4 As shown, the following steps are included:
[0147] S401: Collecting user behavior events.
[0148] S402: Generate a user tag corresponding to the user based on big data calculations.
[0149] S403: Receive a page template generation request, and determine the page identifier carried in the request.
[0150] S404: Generate a page template using a pre-trained AIGC model based on the user tag and user ID.
[0151] Specifically, it uses different AIGC models to generate template schemas, page template background images, and template style data in json format.
[0152] S405: The program assembles dynamic data to obtain multiple groups of page template data.
[0153] S406: Feedback at least one set of page template data to the client.
[0154] Since the server is pre-trained with an AIGC model for converting user IDs and page IDs into page template data, the server can generate diversified page template data using the AIGC model to meet the user's personalized requirements and thereby improve user retention.
[0155] In addition, since AIGC technology is used to generate page templates, there is no need to spend manpower to develop page templates, which greatly reduces the development workload.
[0156] Based on the same inventive concept, the present application embodiment also provides a training device for a template selection model, see Figure 5 , the device comprises:
[0157] The acquisition module 501 is used to acquire traffic data generated by target users with different user tags browsing a first page; the first page includes: a page generated based on an original page template in a first page template set; the first page template set includes original page templates of multiple page identifiers generated in advance; the traffic data includes one or more of the following: stay time, click rate, conversion rate;
[0158] A conversion module 502, configured to convert the traffic data into first preference indexes for different original page templates;
[0159] An input module 503 is used to input the user tag and the page identifier into a template selection model to obtain a second preference index of the user tag for different original page templates under the page identifier;
[0160] A calculation module 504, configured to calculate a loss value based on the first preference index and the second preference index using a preset loss function, and adjust parameters of the template selection model based on the loss value;
[0161] The iteration module 505 is used to return to the step of inputting the user tag and the page identifier into the template selection model until the template selection model converges or reaches a preset number of iterations, and then determine a trained template selection model.
[0162] It can be seen that in the embodiment of the present application, through the above-mentioned training, the model can learn the correlation between user tags and different original page templates. After the training is completed, it can automatically match the original page templates with higher preference based on user tags and page identifiers, thereby providing basic material for automatically generating new personalized page templates using the AIGC model.
[0163] In one embodiment of the present application, the conversion module 502 is specifically used to: perform weighted operations on the first ratio, the click-through rate and the conversion rate based on the first weighting coefficient, the second weighting coefficient and the third weighting coefficient, respectively, to obtain the first preference index; the first ratio is the ratio of the stay time to the preset time step.
[0164] The present application also provides a device for generating a page template, see Figure 6 , the device comprises:
[0165] The first determination module 601 is used to determine the user tag and the target page identifier;
[0166] An input module 602 is used to input the user tag and the target page identifier into a template selection model, and obtain a preference index of each original page template corresponding to the target page identifier in the first page template set output by the template selection model; the template selection model is trained based on the training method of the template selection model;
[0167] A second determination module 603 is used to determine a second page template set based on the order of the preference index; the second page template set includes a plurality of original page templates corresponding to the target page identifier;
[0168] The reorganization module 604 is used to split the page element data of the original page template in the second page template set according to the user tag and the target page identifier, and reorganize them into multiple groups of candidate page element data by using the pre-trained first AIGC model;
[0169] The combination module 605 is used to combine the candidate page element data, the page background image and the template style data to obtain a target page template set, wherein the target page template set includes multiple groups of page template data; the template style data is a cascading style sheet.
[0170] It can be seen that in the embodiment of the present application, an AIGC model for converting user identifiers and page identifiers into page template data is pre-trained. With the help of the personalization capability of the AIGC model, diversified page template data can be generated to meet the user's personalized requirements, thereby improving user retention.
[0171] In addition, since AIGC technology is used to generate page templates, there is no need to spend manpower to develop page templates, which greatly reduces the development workload.
[0172] In one embodiment of the present application, the device further includes: a first generating module, configured to generate a target page background image of a page template using a pre-trained second AIGC model for the user tag and the target page identifier; the second AIGC model is configured to generate an image based on text information;
[0173] Correspondingly, the combination module is specifically used to combine the candidate page element data, the target page background image and the template style data to obtain a target page template set.
[0174] Through the AIGC model, images related to user tags and page logos are generated as template background images, so that the combined page template is more in line with the preferences and tendencies of each user tag, further improving personalization capabilities and increasing user experience.
[0175] In one embodiment of the present application, the device further includes: a second generation module, configured to generate target template style data of a page template using a pre-trained third AIGC model for the user tag and the target page identifier; the third AIGC model is configured to generate a template style of a random page template;
[0176] Correspondingly, the combination module is specifically used to combine the candidate page element data, the page background image and the target template style data to obtain a target page template set.
[0177] By instructing the AIGC model through the above-mentioned original materials and guiding words, the speed at which AIGC generates data can be accelerated, and the generated data is changed based on the original materials. The original materials can reflect the tendency and preference of user labels, and the template element data finally generated can also be close to the user's preferences.
[0178] In one embodiment of the present application, the first determining module is specifically configured to:
[0179] Receive a page display request sent by a client, wherein the page display request carries a target page identifier and a user identifier of a target user;
[0180] Based on the user identifier, a user tag of the target user is determined.
[0181] In one embodiment of the present application, the device further includes:
[0182] The sending module is used to send page template data to the client so that the client renders the page based on the page template data; the page template data is any page template data in the target page template set.
[0183] The present application also provides an electronic device, which can be a server, such as Figure 7 As shown, it includes a processor 701, a communication interface 702, a memory 703 and a communication bus 704, wherein the processor 701, the communication interface 702, and the memory 703 communicate with each other through the communication bus 704.
[0184] Memory 703, used for storing computer programs;
[0185] The processor 701 is used to execute the program stored in the memory 703 to implement the following steps:
[0186] Obtaining traffic data generated by target users with different user tags browsing a first page; the first page includes: a page generated based on an original page template in a first page template set; the first page template set includes original page templates of multiple page identifiers generated in advance; the traffic data includes one or more of the following: dwell time, click rate, conversion rate;
[0187] Converting the traffic data into first preference indexes for different original page templates;
[0188] Inputting the user tag and the page identifier into a template selection model to obtain a second preference index of the user tag for different original page templates under the page identifier;
[0189] Based on the first preference index and the second preference index, a preset loss function is used to calculate a loss value, and parameters of the template selection model are adjusted based on the loss value;
[0190] Returning to the step of inputting the user tag and the page identifier into the template selection model, until the template selection model converges or reaches a preset number of iterations, determining a trained template selection model;
[0191] or,
[0192] Determine user tags and target page identifiers;
[0193] Input the user tag and the target page identifier into a template selection model, and obtain the preference index of each original page template corresponding to the target page identifier in the first page template set output by the template selection model; the template selection model is trained based on the training method of the template selection model;
[0194] Determining a second page template set based on the order of the preference indexes; the second page template set includes a plurality of original page templates corresponding to the target page identifier;
[0195] For the user tag and the target page identifier, the pre-trained first AIGC model is used to split the page element data of the original page template in the second page template set, and reassemble them into multiple groups of candidate page element data;
[0196] The candidate page element data, page background image and template style data are combined to obtain a target page template set, wherein the target page template set includes multiple groups of page template data; the template style data is a cascading style sheet.
[0197] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0198] The communication interface is used for communication between the above terminal and other devices.
[0199] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0200] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0201] In another embodiment provided by the present invention, a computer-readable storage medium is also provided, in which a computer program is stored. When the computer program is executed by a processor, the page display method and page template generation method described in any of the above embodiments are implemented.
[0202] In another embodiment provided by the present invention, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the page display method and page template generation method described in any one of the above embodiments.
[0203] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.
[0204] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0205] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0206] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A training method for a template selection model, characterized in that: The method comprises: Obtaining traffic data generated by target users with different user tags browsing a first page; the first page includes: a page generated based on an original page template in a first page template set; the first page template set includes original page templates of multiple page identifiers generated in advance; the traffic data includes one or more of the following: dwell time, click rate, conversion rate; Converting the traffic data into first preference indexes for different original page templates; Inputting the user tag and the page identifier into a template selection model to obtain a second preference index of the user tag for different original page templates under the page identifier; Based on the first preference index and the second preference index, a preset loss function is used to calculate a loss value, and parameters of the template selection model are adjusted based on the loss value; Return to the step of inputting the user tag and the page identifier into the template selection model until the template selection model converges or reaches a preset number of iterations, and determine a trained template selection model.
2. The method according to claim 1, characterized in that The step of converting the traffic data into first preference indexes for different original page templates comprises: The first ratio, the click rate and the conversion rate are weighted based on the first weighting coefficient, the second weighting coefficient and the third weighting coefficient to obtain the first preference index; the first ratio is the ratio of the stay time to the preset time step.
3. A method for generating a page template, characterized in that: The method comprises: Determine user tags and target page identifiers; Input the user tag and the target page identifier into a template selection model, and obtain the preference index of each original page template corresponding to the target page identifier in the first page template set output by the template selection model; the template selection model is obtained based on the training method according to claim 1; Determining a second page template set based on the order of the preference indexes; the second page template set includes a plurality of original page templates corresponding to the target page identifier; For the user tag and the target page identifier, the pre-trained first AIGC model is used to split the page element data of the original page template in the second page template set, and reassemble them into multiple groups of candidate page element data; The candidate page element data, page background image and template style data are combined to obtain a target page template set, wherein the target page template set includes multiple groups of page template data; the template style data is a cascading style sheet.
4. The method according to claim 3, characterized in that The method further comprises: A pre-trained second AIGC model is used to generate a target page background image of a page template according to the user tag and the target page identifier; the second AIGC model is used to generate an image based on text information; The step of combining the candidate page element data, the page background image and the template style data to obtain a target page template set includes: The candidate page element data, the target page background image and the template style data are combined to obtain a target page template set.
5. The method according to claim 3, characterized in that: The method further comprises: According to the user tag and the target page identifier, a pre-trained third AIGC model is used to generate target template style data of a page template; the third AIGC model is used to generate a template style of a random page template; The step of combining the candidate page element data, the page background image and the template style data to obtain a target page template set includes: The candidate page element data, the page background image and the target template style data are combined to obtain a target page template set.
6. The method according to claim 3, characterized in that The step of determining the user tag and the target page identifier includes: Receive a page display request sent by a client, wherein the page display request carries a target page identifier and a user identifier of a target user; Based on the user identifier, a user tag of the target user is determined.
7. The method according to claim 6, characterized in that The method further comprises: Sending page template data to the client so that the client renders a page based on the page template data; the page template data is any page template data in the target page template set.
8. A training device for a template selection model, characterized in that: The device comprises: An acquisition module is used to acquire traffic data generated by target users with different user tags browsing a first page; the first page includes: a page generated based on an original page template in a first page template set; the first page template set includes original page templates of multiple page identifiers generated in advance; the traffic data includes one or more of the following: dwell time, click rate, conversion rate; A conversion module, used for converting the traffic data into first preference indexes for different original page templates; An input module, used for inputting the user tag and the page identifier into a template selection model to obtain a second preference index of the user tag for different original page templates under the page identifier; a calculation module, configured to calculate a loss value based on the first preference index and the second preference index using a preset loss function, and adjust parameters of the template selection model based on the loss value; The iteration module is used to return to the step of inputting the user tag and the page identifier into the template selection model until the template selection model converges or reaches a preset number of iterations, and then determine a trained template selection model.
9. A device for generating a page template, characterized in that: The device comprises: A first determination module, used to determine a user tag and a target page identifier; An input module, used to input the user tag and the target page identifier into a template selection model, and obtain a preference index of each original page template corresponding to the target page identifier in the first page template set output by the template selection model; the template selection model is obtained based on the training method according to claim 1; A second determination module is used to determine a second page template set based on the order of the preference index; the second page template set includes a plurality of original page templates corresponding to the target page identifier; a recombining module, for splitting the page element data of the original page template in the second page template set according to the user tag and the target page identifier, and recombining the splitting into multiple groups of candidate page element data by using a pre-trained first AIGC model; The combination module is used to combine the candidate page element data, the page background image and the template style data to obtain a target page template set, wherein the target page template set includes multiple groups of page template data; the template style data is a cascading style sheet.
10. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 7 when executing a program stored in a memory.