IDEAS home Printed from https://ideas.repec.org/a/gam/jmathe/v10y2022i4p604-d750560.html
   My bibliography  Save this article

Retrieval-Based Transformer Pseudocode Generation

Author

Listed:
  • Anas Alokla

    (Faculty of Computer and Information Sciences, Ain Shams University, Cairo 11566, Egypt)

  • Walaa Gad

    (Faculty of Computer and Information Sciences, Ain Shams University, Cairo 11566, Egypt)

  • Waleed Nazih

    (College of Computer Engineering and Sciences, Prince Sattam Bin Abdulaziz University, Al-Kharj 11942, Saudi Arabia)

  • Mustafa Aref

    (Faculty of Computer and Information Sciences, Ain Shams University, Cairo 11566, Egypt)

  • Abdel-Badeeh Salem

    (Faculty of Computer and Information Sciences, Ain Shams University, Cairo 11566, Egypt)

Abstract

The comprehension of source code is very difficult, especially if the programmer is not familiar with the programming language. Pseudocode explains and describes code contents that are based on the semantic analysis and understanding of the source code. In this paper, a novel retrieval-based transformer pseudocode generation model is proposed. The proposed model adopts different retrieval similarity methods and neural machine translation to generate pseudocode. The proposed model handles words of low frequency and words that do not exist in the training dataset. It consists of three steps. First, we retrieve the sentences that are similar to the input sentence using different similarity methods. Second, pass the source code retrieved (input retrieved) to the deep learning model based on the transformer to generate the pseudocode retrieved. Third, the replacement process is performed to obtain the target pseudo code. The proposed model is evaluated using Django and SPoC datasets. The experiments show promising performance results compared to other language models of machine translation. It reaches 61.96 and 50.28 in terms of BLEU performance measures for Django and SPoC, respectively.

Suggested Citation

  • Anas Alokla & Walaa Gad & Waleed Nazih & Mustafa Aref & Abdel-Badeeh Salem, 2022. "Retrieval-Based Transformer Pseudocode Generation," Mathematics, MDPI, vol. 10(4), pages 1-16, February.
  • Handle: RePEc:gam:jmathe:v:10:y:2022:i:4:p:604-:d:750560
    as

    Download full text from publisher

    File URL: https://www.mdpi.com/2227-7390/10/4/604/pdf
    Download Restriction: no

    File URL: https://www.mdpi.com/2227-7390/10/4/604/
    Download Restriction: no
    ---><---

    Citations

    Citations are extracted by the CitEc Project, subscribe to its RSS feed for this item.
    as


    Cited by:

    1. Jani Dugonik & Mirjam Sepesy Maučec & Domen Verber & Janez Brest, 2023. "Reduction of Neural Machine Translation Failures by Incorporating Statistical Machine Translation," Mathematics, MDPI, vol. 11(11), pages 1-22, May.
    2. Robert Waszkowski & Grzegorz Bocewicz, 2022. "Visibility Matrix: Efficient User Interface Modelling for Low-Code Development Platforms," Sustainability, MDPI, vol. 14(13), pages 1-24, July.
    3. Anas Alokla & Walaa Gad & Waleed Nazih & Mustafa Aref & Abdel-badeeh Salem, 2022. "Pseudocode Generation from Source Code Using the BART Model," Mathematics, MDPI, vol. 10(21), pages 1-14, October.

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:gam:jmathe:v:10:y:2022:i:4:p:604-:d:750560. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    We have no bibliographic references for this item. You can help adding them by using this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: MDPI Indexing Manager (email available below). General contact details of provider: https://www.mdpi.com .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.