Font Size: a A A

Intelligent Front-end Code Generation Algorithm Based On Deep Learning

Posted on:2024-07-07Degree:MasterType:Thesis
Country:ChinaCandidate:Z H ZhangFull Text:PDF
GTID:2568307091988079Subject:Computer Science and Technology
Abstract/Summary:PDF Full Text Request
The Graphical User Interface(GUI)serves as a vital bridge for user interaction in the majority of computer and web-based applications.A well-designed GUI can reduce the learning curve for users and lower barriers to entry.The aesthetics and usability of a GUI have a substantial impact on user experience and influence their perception of the software or website.However,GUI developers often face challenges in converting GUI designs into frontend code,as the process can be time-consuming.GUI designs typically need constant updates based on current trends,which leads to front-end code that is difficult to reuse and results in considerable redundancy.In recent years,deep learning methods have made remarkable progress in the visual and linguistic fields,enabling the application of artificial intelligence technologies to understand GUI screenshots and generate front-end code.Therefore,it is essential to conduct thorough research on leveraging deep learning methods to generate frontend code from GUI screenshots.Numerous studies have investigated deep learning methods for generating front-end code from GUI screenshots,focusing on aspects such as model design and evaluation.Prevailing model designs primarily employ encoder-decoder architectures.Encoders typically utilize convolutional neural networks to extract high-level abstract representations from GUI screenshots,providing guidance for decoders in generating code.Decoders,conversely,mainly use structures resembling recurrent neural networks to predict subsequent code based on the abstract representations of GUI screenshots and the generated code sequence.Current methods for generating front-end code from GUI screenshots still have scope for improvement in terms of accuracy on intricate datasets.In the realm of model evaluation,existing evaluation methods predominantly stem from the field of machine translation.However,front-end code exhibits a highly structured hierarchy compared to natural language,which can result in neglecting the structural information of generated code when applying machine translation metrics.Consequently,there remains room for research in devising more intuitive evaluation methods.Addressing the issues with existing methods for generating frontend code from GUI screenshots and evaluation methods,this study investigates data,models,and evaluation from three perspectives and makes two primary contributions:In terms of model design,we propose a decoder construction method based on the multihead attention mechanism.The decoder first learns contextual dependencies in the code through a multi-head attention layer,then aligns the frontend code with the abstract representation of the image using another multi-head attention layer.Subsequent experiments revealed that the decoder designed in this study did not demonstrate a significant advantage in code generation quality compared to existing decoders on public datasets.Analysis of public datasets and model-generated results indicated that public datasets are overly simplistic compared to real-world GUI screenshots,allowing models to easily achieve satisfactory generation results.Consequently,we propose a more intricate dataset based on public datasets to test the model’s generation performance.The multi-head attention-based decoder proposed in this study outperforms other comparative decoder methods concerning code generation quality.Regarding model evaluation,we propose a method for assessing the effectiveness of generated code based on the code’s structure.The suggested method extracts connections between nodes in the code’s tree structure as the smallest evaluation unit,laying the groundwork for evaluating the relationships between nodes.We then employ an approach similar to the Bilingual Evaluation Understudy(BLEU)metric for calculating the final results.The proposed method can assess the structure of generated code,yielding results more aligned with human intuition.In summary,this study emphasizes the importance of graphical user interfaces and the challenges faced by GUI developers when converting design diagrams into frontend code.We present two primary contributions:(1)the proposal of a decoder construction method based on the multi-head attention mechanism and the creation of a more intricate dataset for evaluating the method;(2)the introduction of a structure-based code generation quality assessment method.This research endeavors to tackle the issue of generating frontend code from GUI screenshots,and the contributions of this study can provide fresh insights for frontend development based on GUI screenshots.Simultaneously,our work can serve as a reference for better understanding and utilizing deep learning technologies in other fields.
Keywords/Search Tags:Code generation, User interface programming, Human-computer interaction, End-to-end code generation system
PDF Full Text Request
Related items