Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to main content

Transformers-Based Automated PHP Code Generator

  • Conference paper
  • First Online:
Innovations in Computational Intelligence and Computer Vision (ICICV 2022)

Part of the book series: Lecture Notes in Networks and Systems ((LNNS,volume 680))

  • 237 Accesses

Abstract

Over the past ten years, technological development has accelerated. It has attained human-like performance in various tasks involving natural language processing. Numerous studies are being undertaken in this area, and natural language programming tools have been developed (which take natural language description and generates source code). By utilizing natural language programming, communicating with machines can be possible without grasping the syntax of each programming language individually. Several tools have been developed with features such as code completion, the generation of brief code samples, and code suggestions. This paper presents a method capable of generating source code from a natural language description. In this work, transformer-based language model is employed and trained it with the PHP dataset collected from multiple platforms. Thus, the model can generate PHP code using natural language. PHP is a common server-side scripting language. PHP is used by 77.4% of all websites, according to a W3Tech research. Moreover, the model has been tested on various problems, and the results are rather encouraging. The model is able to achieve 85% accuracy, while tested on 40 sample problems.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 189.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 249.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Allamanis M, Barr ET, Devanbu P, Sutton C (2018) A survey of machine learning for big code and naturalness. ACM Comput Surv (CSUR) 51(4):1–37

    Article  Google Scholar 

  2. Choudhury A (2019) 10 AI applications that can generate code themselves

    Google Scholar 

  3. Lee JS, Hsiang J (2020) Patent claim generation by fine-tuning OpenAI GPT-2. World Patent Information 62:101983

    Google Scholar 

  4. Li H (2011) Tabix: fast retrieval of sequence features from generic tab-delimited files. Bioinformatics 27(5):718–719

    Article  Google Scholar 

  5. Li Y, Choi D, Chung J, Kushman N, Schrittwieser J, Leblond R, Eccles T, Keeling J, Gimeno F, Lago AD et al (2022) Competition-level code generation with alphacode. arXiv preprint arXiv:2203.07814

  6. Nguyen N, Nadi S (2022) An empirical evaluation of GitHub Copilot’s code suggestions. In: 2022 IEEE/ACM 19th international conference on mining software repositories (MSR). IEEE, pp 1–5

    Google Scholar 

  7. Perez L, Ottens L, Viswanathan S (2021) Automatic code generation using pre-trained language models. arXiv preprint arXiv:2102.10535

  8. Radford A, Wu J, Child R, Luan D, Amodei D, Sutskever I et al (2019) Language models are unsupervised multitask learners. OpenAI blog 1(8):9

    Google Scholar 

  9. Sentdex: GPyT—generating python code with transformer models

    Google Scholar 

  10. Shin J, Nam J (2021) A survey of automatic code generation from natural language. J Inf Process Syst 17(3):537–555

    Google Scholar 

  11. Singh A (2021) Auto-code generation using GPT-2

    Google Scholar 

  12. Sinha A. Automation and its impact on the contemporary world

    Google Scholar 

  13. Vaswani A, Shazeer N, Parmar N, Uszkoreit J, Jones L, Gomez AN, Kaiser Ł, Polosukhin I (2017) Attention is all you need. Adv Neural Inf Process Syst 30

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Yatin Tomer .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2023 The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd.

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Tomer, Y., Sharma, R., Pandey, R. (2023). Transformers-Based Automated PHP Code Generator. In: Roy, S., Sinwar, D., Dey, N., Perumal, T., Tavares, J.M.R.S. (eds) Innovations in Computational Intelligence and Computer Vision. ICICV 2022. Lecture Notes in Networks and Systems, vol 680. Springer, Singapore. https://doi.org/10.1007/978-981-99-2602-2_44

Download citation

Publish with us

Policies and ethics