Webpage data processing method, device, storage medium and program product
By converting and analyzing the predicted rendering parameters of web page elements and combining VAE and MarkupLM models, automatic web page design is achieved, solving the problem of low efficiency in manually writing rendering parameters in existing technologies and improving the efficiency of web page design.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ALIBABA (CHINA) CO LTD
- Filing Date
- 2024-03-25
- Publication Date
- 2026-08-04
AI Technical Summary
In the current web design process, the rendering of each element requires manual coding, which is inefficient and the design is complex and time-consuming, increasing development costs.
By predicting and transforming the rendering parameters of the target webpage elements, constructing latent vectors, and combining them with the webpage feature vectors, rendering parameters are automatically generated using a parameter generation model. The model is trained and analyzed using a variational autoencoder (VAE) and a markup language model (MarkupLM) to achieve automatic webpage design.
It improves the efficiency of web design, automatically generates rendering parameters, simplifies the web design process, and reduces the need for manual intervention.
Smart Images

Figure CN118364192B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a web page data processing method, an electronic device, a computer-readable storage medium, and a computer program product. Background Technology
[0002] Web pages have become an indispensable part of modern society. It is well known that web design plays a crucial role in conveying visual information, affecting not only user satisfaction but also directly influencing user behavior. Web design is a complex and time-consuming task, requiring the consideration and coordination of various types and numbers of elements, such as headings, paragraphs, and buttons at different levels. The design process must also adhere to a series of explicit and implicit standards and guidelines, including maintaining consistency, simplicity, and clear visual hierarchy. It requires a significant investment of time and effort to learn relevant knowledge and skills, or to seek help from professional designers, which can increase development costs.
[0003] In recent years, research and solutions for automated web design have emerged continuously. However, current web design mainly involves handling specific sub-tasks, such as layout generation, font recommendation, or color matching. Rendering individual elements on a webpage often requires manual coding, which is inefficient. Summary of the Invention
[0004] This application provides a web page data processing method to improve web page design efficiency.
[0005] Accordingly, embodiments of this application also provide an electronic device, a computer-readable storage medium, and a computer program product to ensure the implementation and application of the above-mentioned system.
[0006] To address the aforementioned problems, this application provides a webpage data processing method, wherein the method includes:
[0007] Transform at least one predicted rendering parameter of a webpage element in the target webpage to obtain the corresponding latent vector;
[0008] The webpage code of the target webpage is analyzed to determine the corresponding webpage feature vector;
[0009] Based on the potential vector and the webpage feature vector, the corresponding prediction vector is determined;
[0010] The predicted vector is transformed to determine at least one corresponding rendering parameter.
[0011] Optionally, the transformation of at least one predicted rendering parameter of a webpage element in the target webpage to obtain the corresponding latent vector includes:
[0012] Input at least one predictive rendering parameter of a web page element into the encoder of the parametric compression model, and output the corresponding latent vector.
[0013] Optionally, the step of analyzing the webpage code of the target webpage to determine the corresponding webpage feature vector includes:
[0014] Obtain the corresponding Document Object Model (DOM) tree based on the webpage code of the target webpage;
[0015] The DOM tree is input into the markup language model, and the corresponding webpage feature vector is output.
[0016] Optionally, the step of inputting the DOM tree into the markup language model and outputting the corresponding webpage feature vector includes:
[0017] The DOM tree is input into the markup language model to determine the first vector at the semantic level, the second vector at the hierarchical level, and the third vector for each character.
[0018] The first vector, the second vector, and the third vector are merged to obtain the corresponding webpage feature vector.
[0019] Optionally, based on the latent vector and the webpage feature vector, the corresponding prediction vector is determined, including:
[0020] The latent vector and the webpage feature vector are merged to obtain the input vector;
[0021] The input vector is fed into the parameter generation model, and the corresponding prediction vector is output.
[0022] Optionally, the transformation of the prediction vector to determine at least one corresponding rendering parameter includes:
[0023] The predicted vector is input into the decoder of the parametric compression model, and at least one corresponding rendering parameter is output.
[0024] Optional, also includes:
[0025] The webpage code of the target webpage is parsed to determine the corresponding DOM tree;
[0026] Traverse the DOM tree to determine multiple web page elements in the target web page;
[0027] For each webpage element, set at least one predictive rendering parameter for that webpage element.
[0028] Optionally, the parameter generation model includes: a maximum likelihood estimation model and / or a diffusion model; the parameter compression model includes: a variational autoencoder (VAE) model; the method further includes:
[0029] The parameter generation model and the VAE model are jointly trained.
[0030] Optionally, the joint training of the parameter generation model and the VAE model includes:
[0031] Obtain the webpage code of the sample webpage and at least one first rendering parameter of the webpage element of the sample webpage from the sample set;
[0032] The at least one first rendering parameter is input into the encoder of the VAE model, and the corresponding latent vector is output.
[0033] The webpage code of the sample webpage is analyzed to determine the corresponding webpage feature vector;
[0034] The latent vector and webpage feature vector are merged into an input vector, which is then input into a parameter generation model to output the corresponding prediction vector.
[0035] The predicted vector is input into the encoder of the VAE model, and at least one second rendering parameter corresponding to the web page element is output.
[0036] Loss information is calculated based on at least one second rendering parameter and a loss function, and the parameters of the VAE model and the parameter generation model are adjusted based on the loss information.
[0037] This application provides a webpage generation method, wherein the method includes:
[0038] Provide website templates;
[0039] Receive the template parameters corresponding to the webpage template;
[0040] Generate the webpage code for the target webpage based on the template parameters and webpage template;
[0041] Transform at least one predicted rendering parameter of a webpage element in the target webpage to obtain the corresponding latent vector;
[0042] The webpage code of the target webpage is analyzed to determine the corresponding webpage feature vector;
[0043] Based on the potential vector and the webpage feature vector, the corresponding prediction vector is determined;
[0044] The predicted vector is transformed to determine at least one corresponding rendering parameter;
[0045] Web page data for the target web page is generated based on the web page code and rendering parameters.
[0046] Optionally, the transformation of at least one predicted rendering parameter of a webpage element in the target webpage to obtain the corresponding latent vector includes:
[0047] Input at least one predictive rendering parameter of a web page element into the encoder of the parametric compression model, and output the corresponding latent vector.
[0048] Optionally, the step of analyzing the webpage code of the target webpage to determine the corresponding webpage feature vector includes:
[0049] Obtain the corresponding Document Object Model (DOM) tree based on the webpage code of the target webpage;
[0050] The DOM tree is input into the markup language model, and the corresponding webpage feature vector is output.
[0051] Optionally, the step of inputting the DOM tree into the markup language model and outputting the corresponding webpage feature vector includes:
[0052] The DOM tree is input into the markup language model to determine the first vector at the semantic level, the second vector at the hierarchical level, and the third vector for each character.
[0053] The first vector, the second vector, and the third vector are merged to obtain the corresponding webpage feature vector.
[0054] Optionally, based on the latent vector and the webpage feature vector, the corresponding prediction vector is determined, including:
[0055] The latent vector and the webpage feature vector are merged to obtain the input vector;
[0056] The input vector is fed into the parameter generation model, and the corresponding prediction vector is output.
[0057] Optionally, the transformation of the prediction vector to determine at least one corresponding rendering parameter includes:
[0058] The predicted vector is input into the decoder of the parametric compression model, and at least one corresponding rendering parameter is output.
[0059] Optional, also includes:
[0060] The webpage code of the target webpage is parsed to determine the corresponding DOM tree;
[0061] Traverse the DOM tree to determine multiple web page elements in the target web page;
[0062] For each webpage element, set at least one predictive rendering parameter for that webpage element.
[0063] Optionally, the parameter generation model includes: a maximum likelihood estimation model and / or a diffusion model; the parameter compression model includes: a variational autoencoder (VAE) model; the method further includes:
[0064] The parameter generation model and the VAE model are jointly trained.
[0065] Optionally, the joint training of the parameter generation model and the VAE model includes:
[0066] Obtain the webpage code of the sample webpage and at least one first rendering parameter of the webpage element of the sample webpage from the sample set;
[0067] The at least one first rendering parameter is input into the encoder of the VAE model, and the corresponding latent vector is output.
[0068] The webpage code of the sample webpage is analyzed to determine the corresponding webpage feature vector;
[0069] The latent vector and webpage feature vector are merged into an input vector, which is then input into a parameter generation model to output the corresponding prediction vector.
[0070] The predicted vector is input into the encoder of the VAE model, and at least one second rendering parameter corresponding to the web page element is output.
[0071] Loss information is calculated based on at least one second rendering parameter and a loss function, and the parameters of the VAE model and the parameter generation model are adjusted based on the loss information.
[0072] This application also discloses a webpage generation method, wherein the method includes:
[0073] Receive API call requests;
[0074] Obtain the webpage code of the target webpage based on the received call request;
[0075] Transform at least one predicted rendering parameter of a webpage element in the target webpage to obtain the corresponding latent vector;
[0076] The webpage code of the target webpage is analyzed to determine the corresponding webpage feature vector;
[0077] Based on the potential vector and the webpage feature vector, the corresponding prediction vector is determined;
[0078] The predicted vector is transformed to determine at least one corresponding rendering parameter;
[0079] Feedback on the rendering parameters of the web page elements in the target web page.
[0080] Optionally, the transformation of at least one predicted rendering parameter of a webpage element in the target webpage to obtain the corresponding latent vector includes:
[0081] Input at least one predictive rendering parameter of a web page element into the encoder of the parametric compression model, and output the corresponding latent vector.
[0082] Optionally, the step of analyzing the webpage code of the target webpage to determine the corresponding webpage feature vector includes:
[0083] Obtain the corresponding Document Object Model (DOM) tree based on the webpage code of the target webpage;
[0084] The DOM tree is input into the markup language model, and the corresponding webpage feature vector is output.
[0085] Optionally, the step of inputting the DOM tree into the markup language model and outputting the corresponding webpage feature vector includes:
[0086] The DOM tree is input into the markup language model to determine the first vector at the semantic level, the second vector at the hierarchical level, and the third vector for each character.
[0087] The first vector, the second vector, and the third vector are merged to obtain the corresponding webpage feature vector.
[0088] Optionally, based on the latent vector and the webpage feature vector, the corresponding prediction vector is determined, including:
[0089] The latent vector and the webpage feature vector are merged to obtain the input vector;
[0090] The input vector is fed into the parameter generation model, and the corresponding prediction vector is output.
[0091] Optionally, the transformation of the prediction vector to determine at least one corresponding rendering parameter includes:
[0092] The predicted vector is input into the decoder of the parametric compression model, and at least one corresponding rendering parameter is output.
[0093] Optional, also includes:
[0094] The webpage code of the target webpage is parsed to determine the corresponding DOM tree;
[0095] Traverse the DOM tree to determine multiple web page elements in the target web page;
[0096] For each webpage element, set at least one predictive rendering parameter for that webpage element.
[0097] Optionally, the parameter generation model includes: a maximum likelihood estimation model and / or a diffusion model; the parameter compression model includes: a variational autoencoder (VAE) model; the method further includes:
[0098] The parameter generation model and the VAE model are jointly trained.
[0099] Optionally, the joint training of the parameter generation model and the VAE model includes:
[0100] Obtain the webpage code of the sample webpage and at least one first rendering parameter of the webpage element of the sample webpage from the sample set;
[0101] The at least one first rendering parameter is input into the encoder of the VAE model, and the corresponding latent vector is output.
[0102] The webpage code of the sample webpage is analyzed to determine the corresponding webpage feature vector;
[0103] The latent vector and webpage feature vector are merged into an input vector, which is then input into a parameter generation model to output the corresponding prediction vector.
[0104] The predicted vector is input into the encoder of the VAE model, and at least one second rendering parameter corresponding to the web page element is output.
[0105] Loss information is calculated based on at least one second rendering parameter and a loss function, and the parameters of the VAE model and the parameter generation model are adjusted based on the loss information.
[0106] This application also discloses an electronic device, which includes: a processor and a memory communicatively connected to the processor;
[0107] The memory stores computer-executed instructions;
[0108] The processor executes computer execution instructions stored in the memory to implement the method described in the embodiments of this application.
[0109] This application also discloses a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method described in the embodiments of this application.
[0110] This application also discloses a computer program product, including a computer program / computer executable instructions, wherein the computer program / computer executable instructions implement the method described in this application embodiment when executed by a processor in an electronic device.
[0111] Compared with the prior art, the embodiments of this application have the following advantages:
[0112] In this embodiment, at least one predicted rendering parameter of a webpage element in the target webpage is transformed to obtain a corresponding latent vector. A latent vector corresponding to the rendering parameter of the webpage element can be constructed. This latent vector is the vector to be predicted. Then, the webpage code of the target webpage is analyzed to determine the corresponding webpage feature vector, thereby determining the features of the target webpage. Based on the latent vector and the webpage feature vector, the corresponding predicted vector is determined. The predicted vector is transformed to determine at least one corresponding rendering parameter, thereby automatically generating rendering parameters, improving the efficiency of rendering parameter generation, and thus improving the efficiency of webpage design. Attached Figure Description
[0113] Figure 1 This is a flowchart illustrating the steps of an embodiment of a web page data processing method according to this application;
[0114] Figure 2 This is a flowchart illustrating the steps of an embodiment of a multi-model joint training method of this application;
[0115] Figure 3 This is a flowchart illustrating the steps of another embodiment of the web page data processing method of this application;
[0116] Figure 4 This is a flowchart illustrating the steps of an embodiment of a web page data processing method according to this application;
[0117] Figure 5 This is a flowchart illustrating the steps of another embodiment of the web page data processing method of this application;
[0118] Figure 6 This is a schematic diagram of the structure of an exemplary device provided in one embodiment of this application. Detailed Implementation
[0119] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0120] The embodiments of this application can be applied to the field of web page design, and can automatically generate rendering parameters of web page elements based on web page code, thereby realizing automatic web page design and improving the efficiency of web page design.
[0121] Reference Figure 1 The diagram illustrates a flowchart of an embodiment of a web page data processing method according to this application.
[0122] Step 102: Transform at least one predicted rendering parameter of the web page element in the target web page to obtain the corresponding latent vector.
[0123] The webpage whose rendering parameters are to be analyzed is taken as the target webpage, and the webpage code of the target webpage is known. Therefore, based on the webpage code, each webpage element in the target webpage can be determined. For each webpage element, at least one predictive rendering parameter is set. This predictive rendering parameter can be constructed using a mask method, that is, the specific parameter is replaced by a mask identifier, such as 0, x, etc., to indicate that the parameter exists, but the specific parameter value is unknown.
[0124] Each webpage element can correspond to at least one predicted rendering parameter. The predicted rendering parameters of a webpage element are transformed to generate a latent vector. The dimension of this latent vector is related to the number of rendering parameters of the webpage element. This latent vector is a predicted vector, a vector representation of the predicted rendering parameters of the webpage element.
[0125] In this embodiment of the application, the conversion of rendering parameters to vectors can be achieved by a vector encoder, such as using the encoder in a variational autoencoder (VAE) to convert each predicted rendering parameter into a latent vector.
[0126] Step 104: Analyze the webpage code of the target webpage to determine the corresponding webpage feature vector.
[0127] This application also analyzes the webpage code of the target webpage to deeply analyze the content and structural features of the webpage itself, obtaining the corresponding webpage feature vector. Webpage analysis can be based on multiple dimensions such as semantics, structural hierarchy, and character count to obtain the webpage feature vector. The dimension of the webpage feature vector is the same as the dimension of the latent vector.
[0128] The analysis of webpage code can be handled using appropriate document analysis models, such as Markup Language Model (MarkupLM) and Layout Language Model (LayoutLM). Document analysis models allow for a multi-dimensional understanding of webpages, including the target webpage.
[0129] Step 106: Determine the corresponding prediction vector based on the latent vector and the webpage feature vector.
[0130] Analysis is performed based on the latent vector and webpage feature vector. The latent vector and webpage feature vector are merged into a single vector, which serves as the input vector for subsequent processing. Analysis is then performed based on this input vector to predict the required rendering vector. In this embodiment, a parameter generation model can be used to predict the vectors corresponding to the parameters. Therefore, the merged input vector can be input into the parameter generation model, and analysis is performed based on this model to output the corresponding predicted vector. During training, the parameter generation model learns to predict the vectors of rendering parameters, thus enabling it to predict vectors after training and determine the corresponding rendering parameters based on these vectors.
[0131] Step 108: Transform the predicted vector to determine at least one corresponding rendering parameter.
[0132] After obtaining the prediction vector, it can be transformed into at least one corresponding rendering parameter. This transformation can be achieved using a vector decoder, such as the decoder of a VAE model.
[0133] In summary, by transforming at least one predicted rendering parameter of a webpage element in the target webpage to obtain the corresponding latent vector, a latent vector corresponding to the rendering parameter of the webpage element can be constructed. This latent vector is the predicted vector. Then, the webpage code of the target webpage is analyzed to determine the corresponding webpage feature vector, thereby determining the features of the target webpage. Based on the latent vector and the webpage feature vector, the corresponding predicted vector is determined. The predicted vector is transformed to determine at least one corresponding rendering parameter, thereby automatically generating rendering parameters and improving webpage design efficiency.
[0134] Based on the above embodiments, this application provides a model training method that can train various models required for generating rendering parameters.
[0135] In this embodiment, the generation of rendering parameters for web page elements can be abstracted into a Web Rendering Parameters Generation (WebRPG) task. This task can generate corresponding rendering parameters for each web page element based on given web page code. The model of this WebRPG task can be implemented through the following modules: a rendering parameter compression module, a web page encoding module, and a generation module. The rendering parameter compression module is used for the conversion between rendering parameters and vectors, the web page encoding module is used for identifying web page features, and the generation module is used for predicting and generating vectors corresponding to the rendering parameters. The web page can be an HTML (HyperText Markup Language) web page.
[0136] Here, let's assume a webpage is... Its corresponding HTML code is denoted as This webpage contains a series of webpage elements, denoted as... Where S represents webpage The total number of elements on a webpage. Each webpage element X i The visual appearance is determined by a set of rendering parameters P i Control, in form, is expressed as Here This represents the set of indices for all rendering parameters, where k is the index of the rendering parameter. Therefore, the webpage... The complete set of rendering parameters can be represented as Therefore, the core objective of the WebRPG task is to construct a function f that can generate rendering parameters based on HTML code, formally represented as: in Yes The prediction.
[0137] In the WebRPG model, the encoder of the rendering parameter compression module converts the predicted rendering parameters of web page elements into latent vectors in the latent space. The web page encoding module identifies web page features to obtain web page feature vectors. Then, the parameter generation model analyzes the latent vectors and web page feature vectors to predict the latent vectors, obtaining the corresponding predicted vectors. Finally, the decoder of the rendering parameter compression module converts the predicted vectors into rendering parameters, thus obtaining all the rendering parameters for each web page element.
[0138] The rendering parameter compression module can be implemented using a VAE model, which includes an encoder and a decoder. The encoder converts parameters into vectors, and the decoder converts vectors back into parameters. The VAE model can be trained as follows.
[0139] A sample set is determined, wherein the samples in the sample set are the rendering parameters of web page elements and the encoding vectors of the rendering parameters. In the sample set, the rendering parameters of some samples are the actual rendering parameters of the corresponding web page elements, and the rendering parameters of some samples are the rendering parameters after masking the web page rendering parameters, that is, the rendering parameters after being replaced by specified markers, thereby enriching the samples and improving the robustness of the trained model.
[0140] For the encoder, rendering parameters of the webpage are obtained from the sample set, and these parameters are input into the encoder to output the corresponding encoded vector, i.e., the latent vector. The loss is calculated based on the encoded vector and the loss function, and the encoder parameters are adjusted based on this loss. This process is iterated until the encoder training is complete.
[0141] For the decoder, an encoded vector is obtained from the sample set, input into the decoder, and the transformed rendering parameters are output. The loss is calculated based on the rendering parameters and the loss function, and the decoder parameters are adjusted based on this loss. This process is iterated until the decoder training is complete.
[0142] Among them, in processing web page elements When defining rendering parameters, V represents the size of the rendering parameter vocabulary, and its corresponding latent vector is defined as... Define the generating distribution as p θ (P i |Z i ), with a posterior distribution of q φ (Z i |P i The loss function of a variational autoencoder (VAE) is defined as follows:
[0143]
[0144] Where θ and φ represent the parameters of the encoder and decoder, respectively, E represents the expected value, KL represents the Kourbak-Leibler divergence, and λ KL It is a hyperparameter used to balance the relationship between the two terms. In one example, the encoder and decoder of the VAE both consist of five layers of multilayer perceptrons.
[0145] In this embodiment, the markup language model of the webpage encoding module is used to identify the webpage, determine its semantics, hierarchical structure, and other features, thereby ensuring that the visual presentation of the webpage is consistent with the content and structure defined by its code. The HTML webpage encoding embedding integrates information from three key dimensions: semantic information, hierarchical structure, and character count. Given an element X... i Its HTML embedding The definition is as follows:
[0146]
[0147] in, and These represent semantic embedding vectors, hierarchical embedding vectors, and character counts, respectively.
[0148] The embedding vector of °, Λ() is the linear projection layer.
[0149] For semantic embedding: For a webpage element containing multiple HTML code (webpage, code) tags (tokens) in, The total number of tags, and their semantic embedding vectors The definition is as follows:
[0150]
[0151] In this context, MarkupLM represents the MarkupLM model, and Pool(·) refers to the average pooling operation.
[0152] For hierarchical structure information: hierarchical structure embedding is implemented using an XPath embedding layer. Assume xp i For web page element X i The XPath expression, then The definition is as follows:
[0153]
[0154] Here, XPathEmb represents the XPath embedding layer.
[0155] For character counting: for an element X containing k characters i , The definition is as follows:
[0156]
[0157] EmbCharC is an embedding layer that can convert character counts into embedding vectors.
[0158] In this embodiment, the MarkupLM model is used to process webpage code as an example. This MarkupLM model is used for multi-dimensional analysis based on webpage code, extracting semantic, hierarchical, and character features. The MarkupLM model extracts a tree-structured Document Object Model (DOM) from the webpage code and uses the DOM tree to output an XMLPath Language (XPath) expression for each node in the document for localization. The MarkupLM model can quickly obtain the position information of each piece of text in the DOM tree in a dynamic document and encode it together with the corresponding text, thereby enhancing the model's ability to model documents. XML (Extensible Markup Language) is an extensible markup language. Therefore, this MarkupLM model can parse the DOM tree, determine the text information corresponding to each node, and perform semantic analysis on the text information to determine the first semantic-level vector.
[0159] The MarkupLM model can also parse the DOM tree to determine the language hierarchy expression. Then, by analyzing XPath units at different levels and depths, it can obtain a second vector of the hierarchy structure, which can represent the hierarchy information between web page elements.
[0160] Based on the text information analyzed above, character statistics can be performed to obtain a third vector representing the number of characters.
[0161] By analyzing semantics, hierarchical structure, and character statistics as described above, webpage features can be characterized from multiple dimensions. Therefore, the first vector, the second vector, and the third vector can be merged to obtain the corresponding webpage feature vector.
[0162] In this embodiment, the parameter generation model is used to predict the vector corresponding to the rendering parameters. The parameter generation model can be constructed using various models, such as likelihood-based models, diffusion models, adversarial networks, and implicit generative models. This embodiment uses the Maximum Likelihood Estimation (MLE) model and the diffusion model as examples.
[0163] Based on the above embodiments, this application provides a multi-model joint training method that can improve the accuracy of the models.
[0164] Reference Figure 2 The diagram shows a flowchart of an embodiment of a multi-model joint training method according to this application.
[0165] Step 202: Obtain the webpage code of the sample webpage and at least one first rendering parameter of the webpage element of the sample webpage from the sample set.
[0166] Step 204: Input the at least one first rendering parameter into the encoder of the VAE model and output the corresponding latent vector. To distinguish it from the usage process, this latent vector can be called the training latent vector.
[0167] Step 206: For the webpage code of the sample webpage, determine the corresponding webpage feature vector. To distinguish it from the usage process, this webpage feature vector can be called the training webpage feature vector.
[0168] Step 208: The latent vector and the webpage feature vector are merged into an input vector, which is then input into the parameter generation model to output the corresponding prediction vector. To distinguish this from the usage process, this input vector can be called the training input vector, and the prediction vector can be called the training prediction vector.
[0169] Step 210: Input the predicted vector into the encoder of the VAE model and output at least one second rendering parameter corresponding to the web page element.
[0170] Step 212: Calculate loss information based on the at least one second rendering parameter and the loss function, and adjust the parameters of the VAE model and the parameters of the parameter generation model based on the loss information.
[0171] Construct a parameter generation model using the MLE model.
[0172] To improve the stability of the model during training, this application introduces a method for masking latent vectors, namely using... This is used to mask the vector (or the actual potential vector) corresponding to the actual rendering parameters. The construction process consists of two steps. The first step involves encoding the actual rendering parameters into latent vectors using the VAE's encoder. The second step involves introducing a MASK vector and a binary mask M = {m_i|i∈S} to partially replace the latent vector with the MASK, as shown in the following equation:
[0173] Z mask,i =m i MASK+(1-m) i )·θ(P i )
[0174] M is generated by a cosine-form mask scheduling function γ(r)∈(0,1], where the MASK vector is a learnable parameter with dimensions equal to Z. i Maintain consistency. During the reasoning phase, Z i All will be masked, i.e., M = {mi =1|1≤i≤S}.
[0175] Parameter generation model uses latent vectors such as and webpage feature vectors The sum is used as input to generate the prediction vector. Then it is decoded by the VAE decoder.
[0176] In one optional embodiment of this application, the VAE model and the parameter generation model are jointly trained. Therefore, rendering parameters of webpage elements can be obtained from the sample set. These rendering parameters are input to the encoder of the VAE model to obtain the corresponding latent vector. Webpage feature vectors are then determined based on the webpage code. The latent vector and the webpage feature vector are merged into an input vector, which is input to the parameter generation model to output the corresponding predicted vector. This predicted vector is then input to the decoder of the VAE model to output the corresponding predicted rendering parameters. The loss is calculated based on the predicted rendering parameters and a loss function. The parameters of the VAE model and the parameter generation model are then adjusted based on the loss. The loss function is as follows:
[0177]
[0178] Where ψ represents the parameters of the parameter generation model.
[0179] In this embodiment of the application, a parameter generation model is constructed based on the MLE model, wherein variants of the maximum likelihood estimation model can be used, namely autoregressive and non-autoregressive models, to construct the required parameter generation model.
[0180] When using an autoregressive MLE model, the loss function is as follows:
[0181]
[0182] When using a non-autoregressive MLE model, the loss function is as follows:
[0183]
[0184] A parameter generation model is constructed using a diffusion model.
[0185] The diffusion model includes forward and backward Markov processes of length T. In the VAE model, the rendering parameters P are encoded into the latent space, specifically represented as follows: Similar to successful diffusion models, in this embodiment, the diffusion model can be understood as a series of denoising autoencoders with equal weights.
[0186] Train the diffusion model to predict latent vectors Noise in latent vector By from The initial forward process is obtained, defined as Where α t It is a set of predefined coefficients. Latent vector and webpage feature vectors The summation is then input into the model. The diffusion model uses the standard variational lower bound as the training loss and is jointly optimized with the VAE to form the overall loss function:
[0187]
[0188] In the reasoning process, prediction Obtained step by step through the reverse process, as follows:
[0189]
[0190] Then, The VAE model is decoded in one go by its decoder φ.
[0191] Therefore, embodiments of this application can construct a parameter generation model in multiple ways, and combine this parameter generation model to determine the training process and loss function. Furthermore, the encoder output of the VAE model can correspond to the input of the parameter generation model, and the output of the parameter generation model can correspond to the input of the decoder of the VAE model, thereby predicting the rendering parameters. Thus, the VAE model and the parameter generation model can be jointly trained to improve the model's accuracy.
[0192] Based on the above embodiments, this application provides another web page data processing method that can automatically generate rendering parameters for web page elements by combining web page code.
[0193] Reference Figure 3 The diagram illustrates a flowchart of another embodiment of the web page data processing method of this application.
[0194] Step 302: Parse the webpage code of the target webpage to determine the corresponding DOM tree.
[0195] Step 304: Traverse the DOM tree to determine multiple web page elements in the target web page.
[0196] Step 306: For each webpage element, set at least one prediction rendering parameter for the webpage element.
[0197] In this embodiment, the webpage code is known, but the rendering parameters of the webpage elements are unknown. Therefore, rendering parameters can be automatically generated based on the known webpage code. Specifically, the webpage code of the target webpage is parsed to determine the DOM tree of the target webpage. Then, the DOM tree is traversed to determine the webpage elements corresponding to each node, thus obtaining each webpage element in the target webpage. For each webpage element, since its rendering parameters are unknown, it is necessary to predict the rendering parameters of the webpage element. Each webpage element has multiple rendering parameters. To predict the rendering parameters of the webpage element, at least one predicted rendering parameter can be set for the webpage element. Each predicted rendering parameter can be represented by a specified identifier, such as 0 or x. This predicted rendering parameter can be understood as a mask rendering parameter, that is, a rendering parameter with an unknown value.
[0198] Step 308: Input at least one predicted rendering parameter of the web page element into the encoder of the parametric compression model and output the corresponding latent vector.
[0199] The parametric compression model can adopt a VAE model, which includes an encoder and a decoder. The predicted rendering parameters of each web page element are input into the encoder of the parametric compression model for encoding processing, which can convert the predicted rendering parameters into latent vectors in the latent space.
[0200] Step 310: Input the DOM tree into the markup language model and output the corresponding webpage feature vector.
[0201] The step of inputting the DOM tree into the markup language model and outputting the corresponding webpage feature vector includes: inputting the DOM tree into the markup language model to determine the semantic level first vector, the hierarchical structure second vector, and the character third vector; merging the first vector, the second vector, and the third vector to obtain the corresponding webpage feature vector.
[0202] Markup language models, such as MarkupLM models, can be used for HTML encoders. MarkupLM directly processes the markup language source code of these documents, rendering the actual visual effects of dynamic documents without any additional computing resources. MarkupLM models can traverse and parse the DOM tree, outputting an XPath expression for each node to locate the position of each piece of text in the DOM tree. This position information is then co-encoded with the corresponding text to understand semantic information and obtain a semantic-level first vector.
[0203] XPath expressions can be used to analyze the hierarchical structure of a webpage, yielding a second vector representing the corresponding hierarchical structure. Furthermore, the number of characters can be counted, resulting in a third vector representing the characters. The first, second, and third vectors are then merged to obtain the corresponding webpage feature vector.
[0204] Step 312: Merge the latent vector and the webpage feature vector to obtain the input vector.
[0205] Step 314: Input the input vector into the parameter generation model and output the corresponding prediction vector.
[0206] The latent vector and the webpage feature vector are merged to obtain the corresponding input vector. The input vector is then input into the parameter generation model, which processes the input vector and outputs the corresponding prediction vector. This prediction vector is the vector corresponding to the predicted rendering parameters.
[0207] Step 316: Input the predicted vector into the decoder of the parameter compression model and output at least one corresponding rendering parameter.
[0208] The predicted vector is input into the decoder of the parameter compression model. The decoder decodes the predicted vector and converts it into at least one rendering parameter, thereby obtaining the rendering parameters of each web page element.
[0209] The webpage can then be rendered based on these rendering parameters to complete the webpage design.
[0210] In summary, by employing a variational autoencoder (VAE) to process web page elements and rendering parameters, and utilizing customized HTML embedding technology to effectively capture the key semantics and hierarchical structure of HTML code, and then using a parameter generation model to generate rendering parameters for web page elements based on the HTML code, web page rendering parameters can be generated efficiently, thereby accelerating the web page development process and improving developer efficiency.
[0211] The embodiments of this application can be applied to various web page design scenarios and are suitable for various website pages and application (APP) pages. Some websites and APP pages have specific style requirements, and corresponding templates can be provided to quickly generate web pages.
[0212] Taking e-commerce websites and apps as examples, rendering parameters can be quickly generated in the following ways, thereby improving webpage generation efficiency. When merchants on e-commerce websites and apps register to provide product sales services, they need to generate their own webpages to provide corresponding store homepages, product detail pages, etc. Webpage generation services can be provided to merchants, making it easier for users to quickly access services.
[0213] Reference Figure 4 The diagram illustrates a flowchart of an embodiment of a web page data processing method.
[0214] Step 402: Provide a webpage template.
[0215] Step 404: Receive the template parameters corresponding to the webpage template.
[0216] To facilitate user onboarding, website generation services can be provided. For e-commerce websites, merchants' homepages, product detail pages, and other pages typically have specific styles. Therefore, the server can provide webpage templates for different page types. Users (such as merchants) can request the corresponding webpage template based on their needs, and the template will be displayed on the user's terminal device. Then, based on this template, corresponding template parameters can be provided, including various text, images, videos, and other webpage elements. For example, setting the page's theme name, images, and body text in various locations. The server can then receive these template parameters.
[0217] Step 406: Generate the webpage code of the target webpage based on the template parameters and webpage template.
[0218] The server can automatically merge template parameters and webpage templates into a webpage and generate the webpage code. Then, it can automatically generate rendering parameters for webpage elements based on the webpage code. The server parses the webpage code of the target webpage to determine the corresponding DOM tree; it traverses the DOM tree to identify multiple webpage elements in the target webpage; and for each webpage element, it sets at least one predicted rendering parameter.
[0219] Step 408: Transform at least one predicted rendering parameter of the web page element in the target web page to obtain the corresponding latent vector.
[0220] The step of converting at least one predicted rendering parameter of a webpage element in the target webpage to obtain a corresponding latent vector includes: inputting at least one predicted rendering parameter of the webpage element into the encoder of the parameter compression model and outputting the corresponding latent vector.
[0221] Step 410: Analyze the webpage code of the target webpage to determine the corresponding webpage feature vector.
[0222] The step of analyzing the webpage code of the target webpage to determine the corresponding webpage feature vector includes: obtaining the corresponding Document Object Model (DOM) tree based on the webpage code of the target webpage; inputting the DOM tree into a markup language model and outputting the corresponding webpage feature vector.
[0223] The step of inputting the DOM tree into the markup language model and outputting the corresponding webpage feature vector includes: inputting the DOM tree into the markup language model, determining the first vector at the semantic level, the second vector at the hierarchical level, and the third vector at the character level; merging the first vector, the second vector, and the third vector to obtain the corresponding webpage feature vector.
[0224] Step 412: Determine the corresponding prediction vector based on the latent vector and the webpage feature vector.
[0225] The analysis based on the latent vector and webpage feature vector determines the corresponding prediction vector, including: merging the latent vector and webpage feature vector to obtain an input vector; inputting the input vector into a parameter generation model and outputting the corresponding prediction vector.
[0226] Step 414: Transform the predicted vector to determine at least one corresponding rendering parameter.
[0227] The step of transforming the predicted vector to determine at least one corresponding rendering parameter includes: inputting the predicted vector into the decoder of the parameter compression model and outputting at least one corresponding rendering parameter.
[0228] The process of generating rendering parameters for web page elements is similar to that in the above embodiments, so it will not be described again.
[0229] Step 416: Generate webpage data for the target webpage based on the webpage code and rendering parameters.
[0230] Based on the webpage code and rendering parameters, webpage data for the target webpage is generated and can be fed back to the user's terminal device, so that the target webpage can be displayed on the user's terminal device. Any problematic parts can also be fed back for adjustment.
[0231] In summary, template parameters can be obtained based on a webpage template to automatically generate webpage code. Based on this webpage code, rendering parameters can be automatically generated, thus improving webpage generation efficiency.
[0232] This application's embodiments can be applied to various web page design scenarios and are suitable for various website web pages and application (APP) pages. This application's embodiments can encapsulate the above-mentioned method for generating rendering parameters for web page elements into a rendering parameter generation service, providing an interface for the rendering parameter generation service and offering services to the outside world.
[0233] Reference Figure 5 The diagram illustrates a flowchart of an embodiment of a web page data processing method.
[0234] Step 502: Receive the interface call request.
[0235] Step 504: Obtain the webpage code of the target webpage according to the received call request.
[0236] When a user has completed compiling the webpage code but has not yet set the rendering parameters for the webpage elements, they can use a rendering parameter generation service to automatically generate the rendering parameters for the webpage elements. Therefore, the user can call the service's API and send an API call request. This request can carry the webpage code or the storage address of the webpage code, thereby enabling the user to obtain the webpage code of the target webpage.
[0237] The webpage code of the target webpage is parsed to determine the corresponding DOM tree; the DOM tree is traversed to determine multiple webpage elements in the target webpage; and for each webpage element, at least one prediction rendering parameter is set.
[0238] Step 506: Transform at least one predicted rendering parameter of the web page element in the target web page to obtain the corresponding latent vector.
[0239] The step of converting at least one predicted rendering parameter of a webpage element in the target webpage to obtain a corresponding latent vector includes: inputting at least one predicted rendering parameter of the webpage element into the encoder of the parameter compression model and outputting the corresponding latent vector.
[0240] Step 508: Analyze the webpage code of the target webpage to determine the corresponding webpage feature vector.
[0241] The step of analyzing the webpage code of the target webpage to determine the corresponding webpage feature vector includes: obtaining the corresponding Document Object Model (DOM) tree based on the webpage code of the target webpage; inputting the DOM tree into a markup language model and outputting the corresponding webpage feature vector.
[0242] The step of inputting the DOM tree into the markup language model and outputting the corresponding webpage feature vector includes: inputting the DOM tree into the markup language model, determining the first vector at the semantic level, the second vector at the hierarchical level, and the third vector at the character level; merging the first vector, the second vector, and the third vector to obtain the corresponding webpage feature vector.
[0243] Step 510: Determine the corresponding prediction vector based on the latent vector and the webpage feature vector.
[0244] The analysis based on the latent vector and webpage feature vector determines the corresponding prediction vector, including: merging the latent vector and webpage feature vector to obtain an input vector; inputting the input vector into a parameter generation model and outputting the corresponding prediction vector.
[0245] Step 512: Transform the predicted vector to determine at least one corresponding rendering parameter.
[0246] The step of transforming the predicted vector to determine at least one corresponding rendering parameter includes: inputting the predicted vector into the decoder of the parameter compression model and outputting at least one corresponding rendering parameter.
[0247] The process of generating rendering parameters for web page elements is similar to that in the above embodiments, so it will not be described again.
[0248] Step 514: Feedback the rendering parameters of the web page elements in the target web page.
[0249] It provides feedback on the rendering parameters of web page elements in the target web page, allowing users to generate web page data based on these rendering parameters and the web page code, and complete the web page design.
[0250] In summary, a rendering parameter generation service can be used to automatically generate rendering parameters based on the webpage code, thereby improving webpage generation efficiency.
[0251] It should be noted that the embodiments of this application may involve the use of user data. In practical applications, user-specific personal data may be used in the scheme described herein within the scope permitted by applicable laws and regulations, provided that it complies with the applicable laws and regulations of the country (e.g., with the user's explicit consent, with the user being properly notified, etc.).
[0252] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of this application are not limited to the described order of actions, because according to the embodiments of this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of this application.
[0253] Based on the above embodiments, this embodiment also provides a web page data processing device, applied in electronic devices such as server-side equipment, wherein the device includes:
[0254] The vector transformation module is used to transform at least one predicted rendering parameter of a webpage element in the target webpage to obtain the corresponding latent vector.
[0255] The webpage analysis module is used to analyze the webpage code of the target webpage and determine the corresponding webpage feature vector;
[0256] The vector prediction module is used to determine the corresponding prediction vector based on the potential vector and the webpage feature vector;
[0257] The parameter conversion module is used to convert the prediction vector and determine at least one corresponding rendering parameter.
[0258] In summary, by transforming at least one predicted rendering parameter of a webpage element in the target webpage to obtain the corresponding latent vector, a latent vector corresponding to the rendering parameter of the webpage element can be constructed. This latent vector is the predicted vector. Then, by analyzing the webpage code of the target webpage, the corresponding webpage feature vector can be determined, thereby identifying the features of the target webpage. Based on the latent vector and the webpage feature vector, the corresponding predicted vector is determined. The predicted vector is then transformed to determine at least one corresponding rendering parameter, thus enabling the automatic generation of rendering parameters and improving webpage design efficiency.
[0259] The vector conversion module is used to input at least one predicted rendering parameter of a web page element into the encoder of the parameter compression model and output the corresponding latent vector.
[0260] The webpage analysis module is used to obtain the corresponding Document Object Model (DOM) tree based on the webpage code of the target webpage; input the DOM tree into the markup language model, and output the corresponding webpage feature vector.
[0261] The webpage analysis module is used to input the DOM tree into the markup language model to determine the first vector at the semantic level, the second vector at the hierarchical level, and the third vector at the character level; and to merge the first vector, the second vector, and the third vector to obtain the corresponding webpage feature vector.
[0262] The vector prediction module is used to merge the potential vector and the webpage feature vector to obtain the input vector;
[0263] The input vector is fed into the parameter generation model, and the corresponding prediction vector is output.
[0264] The parameter conversion module is used to input the prediction vector into the decoder of the parameter compression model and output at least one corresponding rendering parameter.
[0265] It also includes: a web page processing module, used to parse the web page code of the target web page and determine the corresponding DOM tree; traverse the DOM tree to determine multiple web page elements in the target web page; and set at least one prediction rendering parameter for each web page element.
[0266] The parameter generation model includes a maximum likelihood estimation model and / or a diffusion model; the parameter compression model includes a variational autoencoder (VAE) model; the device further includes a training module for jointly training the parameter generation model and the VAE model.
[0267] The training module is used to obtain at least one rendering parameter of the webpage code and webpage element of the sample webpage from the sample set; input the at least one rendering parameter into the encoder of the VAE model and output the corresponding latent vector; analyze the webpage code of the sample webpage to determine the corresponding webpage feature vector; merge the latent vector and the webpage feature vector into an input vector, input the input vector into the parameter generation model and output the corresponding prediction vector; input the prediction vector into the encoder of the VAE model and output at least one rendering parameter of the corresponding webpage element; calculate loss information based on the at least one rendering parameter and the loss function, and adjust the parameters of the VAE model and the parameter generation model based on the loss information.
[0268] Based on the above embodiments, this embodiment also provides a web page data processing device, applied in electronic devices such as server-side equipment, wherein the device includes:
[0269] The template provider module is used to provide webpage templates;
[0270] The parameter acquisition module is used to receive the template parameters corresponding to the webpage template;
[0271] A webpage processing module is used to generate webpage code for a target webpage based on the template parameters and the webpage template.
[0272] The vector transformation module is used to transform at least one predicted rendering parameter of a webpage element in the target webpage to obtain the corresponding latent vector.
[0273] The webpage analysis module is used to analyze the webpage code of the target webpage and determine the corresponding webpage feature vector;
[0274] The vector prediction module is used to determine the corresponding prediction vector based on the potential vector and the webpage feature vector;
[0275] The parameter conversion module is used to convert the prediction vector and determine at least one corresponding rendering parameter;
[0276] The webpage generation module is used to generate webpage data for the target webpage based on the webpage code and rendering parameters.
[0277] In this embodiment, the vector conversion module, webpage analysis module, vector prediction module, and parameter conversion module are similar to those in the above embodiments, and therefore will not be described again.
[0278] In summary, template parameters can be obtained based on a webpage template to automatically generate webpage code. Based on this webpage code, rendering parameters can be automatically generated, thus improving webpage generation efficiency.
[0279] Based on the above embodiments, this embodiment also provides a web page data processing device, applied in electronic devices such as server-side equipment, wherein the device includes:
[0280] The interface call module is used to receive interface call requests and obtain the webpage code of the target webpage based on the received call request.
[0281] The vector transformation module is used to transform at least one predicted rendering parameter of a webpage element in the target webpage to obtain the corresponding latent vector.
[0282] The webpage analysis module is used to analyze the webpage code of the target webpage and determine the corresponding webpage feature vector;
[0283] The vector prediction module is used to determine the corresponding prediction vector based on the potential vector and the webpage feature vector;
[0284] The parameter conversion module is used to convert the prediction vector and determine at least one corresponding rendering parameter;
[0285] The feedback module is used to provide feedback on the rendering parameters of the web page elements in the target web page.
[0286] In this embodiment, the vector conversion module, webpage analysis module, vector prediction module, and parameter conversion module are similar to those in the above embodiments, and therefore will not be described again.
[0287] In summary, a rendering parameter generation service can be used to automatically generate rendering parameters based on the webpage code, thereby improving webpage generation efficiency.
[0288] This application also provides a non-volatile readable storage medium storing one or more modules (programs). When these modules are applied to a device, they enable the device to execute the instructions for the method steps in this application.
[0289] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the methods described in this application.
[0290] This application also provides an electronic device, including: a processor and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the method described in this application embodiment. In this application embodiment, the electronic device includes devices such as servers and terminal devices.
[0291] This application also discloses a computer program product, including a computer program / computer executable instructions, wherein the computer program / computer executable instructions, when executed by a processor in an electronic device, implement the method described in this application.
[0292] Embodiments of this disclosure can be implemented as an apparatus with any suitable hardware, firmware, software, or any combination thereof, configured as desired, and the apparatus may include electronic devices such as servers (clusters) and terminals. Figure 6 An exemplary apparatus 600 is schematically shown that can be used to implement the various embodiments described in this application.
[0293] In one embodiment, Figure 6 An exemplary device 600 is shown, which includes one or more processors 602, a control module (chipset) 604 coupled to at least one of the processors 602, a memory 606 coupled to the control module 604, a non-volatile memory (NVM) / storage device 608 coupled to the control module 604, one or more input / output devices 610 coupled to the control module 604, and a network interface 612 coupled to the control module 604.
[0294] Processor 602 may include one or more single-core or multi-core processors, and processor 602 may include any combination of general-purpose processors or special-purpose processors (e.g., graphics processors, application processors, baseband processors, etc.). In some embodiments, device 600 can serve as a server, terminal, or other device as described in the embodiments of this application.
[0295] In some embodiments, the apparatus 600 may include one or more computer-readable media (e.g., memory 606 or NVM / storage device 608) having instructions 614 and one or more processors 602 that are combined with the one or more computer-readable media and configured to execute the instructions 614 to implement the module and thus perform the actions described in this disclosure.
[0296] In one embodiment, the control module 604 may include any suitable interface controller to provide any suitable interface to at least one of the processors 602 and / or any suitable device or component communicating with the control module 604.
[0297] The control module 604 may include a memory controller module to provide an interface to the memory 606. The memory controller module may be a hardware module, a software module, and / or a firmware module.
[0298] Memory 606 may be used, for example, to load and store data and / or instructions 614 for device 600. In one embodiment, memory 606 may include any suitable volatile memory, such as suitable DRAM. In some embodiments, memory 606 may include double data rate type quad synchronous dynamic random access memory (DDR4 SDRAM).
[0299] In one embodiment, the control module 604 may include one or more input / output controllers to provide an interface to the NVM / storage device 608 and (one or more) input / output devices 610.
[0300] For example, NVM / storage device 608 may be used to store data and / or instructions 614. NVM / storage device 608 may include any suitable non-volatile memory (e.g., flash memory) and / or may include any suitable (one or more) non-volatile storage devices (e.g., one or more hard disk drives (HDDs), one or more optical disc drives (CDs), and / or one or more digital universal optical disc (DVD) drives).
[0301] NVM / storage device 608 may include storage resources that are part of a device on which device 600 is mounted, or that are accessible to the device but do not necessarily have to be part of the device. For example, NVM / storage device 608 may be accessed via a network through one or more input / output devices 610.
[0302] One or more input / output devices 610 may provide an interface for device 600 to communicate with any other suitable device. Input / output devices 610 may include communication components, audio components, sensor components, etc. A network interface 612 may provide an interface for device 600 to communicate via one or more networks. Device 600 may wirelessly communicate with one or more components of a wireless network according to any of one or more wireless network standards and / or protocols, such as accessing a wireless network based on communication standards, such as Bluetooth, WiFi, 2G, 3G, 4G, 5G, 6G, etc., or combinations thereof.
[0303] In one embodiment, at least one of the processors 602 may be logically packaged with one or more controllers (e.g., memory controller modules) of the control module 604. In one embodiment, at least one of the processors 602 may be logically packaged with one or more controllers of the control module 604 to form a system-in-package (SiP). In one embodiment, at least one of the processors 602 may be integrated with the logic of one or more controllers of the control module 604 on the same die. In one embodiment, at least one of the processors 602 may be integrated with the logic of one or more controllers of the control module 604 on the same die to form a system-on-a-chip (SoC).
[0304] In various embodiments, device 600 may be, but is not limited to, a server, desktop computing device, or mobile computing device (e.g., laptop, handheld computing device, tablet, netbook, etc.). In various embodiments, device 600 may have more or fewer components and / or different architectures. For example, in some embodiments, device 600 includes one or more cameras, a keyboard, a liquid crystal display (LCD) screen (including a touchscreen display), a non-volatile memory port, multiple antennas, a graphics chip, an application-specific integrated circuit (ASIC), and a speaker.
[0305] The detection device can use a main control chip as a processor or control module, and sensor data, position information, etc. can be stored in a memory or NVM / storage device. The sensor group can be used as an input / output device, and the communication interface can include a network interface.
[0306] This application also provides an electronic device, including: a processor; and a memory storing executable code thereon. When the executable code is executed, the processor performs one or more methods as described in this application embodiment. In this application embodiment, the memory can store various types of data, such as target files, file-application association data, and user behavior data, thereby providing a data foundation for various processing operations.
[0307] This application also provides one or more machine-readable media having executable code stored thereon, which, when executed, causes a processor to perform one or more of the methods described in this application.
[0308] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0309] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0310] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0311] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0312] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0313] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.
[0314] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0315] The foregoing has provided a detailed description of a web page data processing method, an electronic device, a computer-readable storage medium, and a computer program product provided by this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A webpage data processing method, wherein, The method includes: Transform at least one predicted rendering parameter of a webpage element in the target webpage to obtain the corresponding latent vector; The webpage code of the target webpage is analyzed to determine the corresponding webpage feature vector; Based on the potential vector and the webpage feature vector, the corresponding prediction vector is determined; The predicted vector is transformed to determine at least one corresponding rendering parameter.
2. The method according to claim 1, wherein, The process of transforming at least one predicted rendering parameter of a webpage element in the target webpage to obtain the corresponding latent vector includes: At least one predictive rendering parameter of the web page element is input into the encoder of the parametric compression model, and the corresponding latent vector is output.
3. The method according to claim 1, wherein, The step of analyzing the webpage code of the target webpage to determine the corresponding webpage feature vector includes: Obtain the corresponding document object model tree based on the webpage code of the target webpage; The document objectification model tree is input into the markup language model, and the corresponding webpage feature vector is output.
4. The method according to claim 3, wherein, The step of inputting the document objectification model tree into the markup language model and outputting the corresponding webpage feature vector includes: The document objectification model tree is input into the markup language model to determine the first vector at the semantic level, the second vector at the hierarchical level, and the third vector for each character. The first vector, the second vector, and the third vector are merged to obtain the corresponding webpage feature vector.
5. The method according to claim 2, wherein, Based on the latent vector and the webpage feature vector, the corresponding prediction vector is determined, including: The latent vector and the webpage feature vector are merged to obtain the input vector; The input vector is fed into the parameter generation model, and the corresponding prediction vector is output.
6. The method according to claim 5, wherein, The step of transforming the predicted vector to determine at least one corresponding rendering parameter includes: The predicted vector is input into the decoder of the parametric compression model, and at least one corresponding rendering parameter is output.
7. The method according to claim 1, wherein, Also includes: The webpage code of the target webpage is parsed to determine the corresponding document object model tree; Traverse the document object model tree to determine multiple web page elements in the target web page; For each of the web page elements, at least one of the predicted rendering parameters for the web page element is set.
8. The method according to claim 5, wherein, The parameter generation model includes: a maximum likelihood estimation model and / or a diffusion model; the parameter compression model includes: a variational autoencoder model; the method further includes: The parameter generation model and the variational autoencoder model are jointly trained.
9. The method according to claim 8, wherein, The joint training of the parameter generation model and the variational autoencoder model includes: Obtain the webpage code of the sample webpage and at least one first rendering parameter of the webpage element of the sample webpage from the sample set; The at least one first rendering parameter is input into the encoder of the variational autoencoder model, and the corresponding latent vector is output. The webpage code of the sample webpage is analyzed to determine the corresponding webpage feature vector; The latent vector and webpage feature vector are merged into an input vector, which is then input into a parameter generation model to output the corresponding prediction vector. The predicted vector is input into the encoder of the variational autoencoder model, and at least one second rendering parameter corresponding to the web page element is output. Loss information is calculated based on the at least one second rendering parameter and the loss function, and the parameters of the variational autoencoder model and the parameter generation model are adjusted based on the loss information.
10. A webpage data processing method, wherein, The method includes: Provide website templates; Receive the template parameters corresponding to the webpage template; Generate the webpage code for the target webpage based on the template parameters and the webpage template; Transform at least one predicted rendering parameter of a webpage element in the target webpage to obtain the corresponding latent vector; The webpage code of the target webpage is analyzed to determine the corresponding webpage feature vector; Based on the potential vector and the webpage feature vector, the corresponding prediction vector is determined; The predicted vector is transformed to determine at least one corresponding rendering parameter; The webpage data of the target webpage is generated based on the webpage code and the rendering parameters.
11. A webpage data processing method, wherein, The method includes: Receive API call requests; Obtain the webpage code of the target webpage based on the interface call request; At least one predicted rendering parameter of the web page element in the target web page is transformed to obtain the corresponding latent vector; The webpage code of the target webpage is analyzed to determine the corresponding webpage feature vector; Based on the potential vector and the webpage feature vector, the corresponding prediction vector is determined; The predicted vector is transformed to determine at least one corresponding rendering parameter; Feedback is provided on the rendering parameters of the web page elements in the target web page.
12. An electronic device, wherein, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-11.
13. A computer-readable storage medium, wherein, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-11.
14. A computer program product comprising a computer program / computer-executable instructions, wherein, When the computer program / computer executable instructions are executed by a processor in an electronic device, the method of any one of claims 1-11 is implemented.