# Bi-LSTM-Based Neural Source Code Summarization
## 3 Related Works and Motivations  
### Related Works  
In this section, we show some of the existing approaches in source code comment generation. In [22], the authors presented CODE-NN, which uses LSTM and neural attention to model the source code. They created a dataset of C# and SQL language codes from Stack Overflow. Their approach achieved a 20.5% bilingual evaluation understudy (BLUE-4) for C# and 18.4% for SQL. [PERSON] et al. [23] considered the code summarization problem as a machine translation problem. Their approach translated Java source code to comments written in naturallanguage. They proposed DeepCom, which is an attention-based LSTM encoder-decoder. Abstract syntax tree (AST) was used as an input to DeepCom after converting it to a formatted sequence using a structure-based traversal (SBT). Their solution scored 38.17% in terms of BLUE-4 on a dataset of 69,708 Java methods. [PERSON] et al. [15] worked on two problems: one was the code representation, and the other was exposure bias. In their methodology, they first encoded the structural and the sequential content of the source code using AST-based LSTM and hybrid attention for integration. Then they fed the code vector into deep reinforcement learning. Their model achieved 4.41% BLEU-4 with a Python dataset of 108,726 code snippets. [PERSON] et al. [24] proposed a model named TL-CodeSum that made use of API knowledge and Java methods. Their approach consisted of three main parts: first, the data processing, then the training, and finally, the online code summary generation. The model performed two tasks: first, the API sequence summarization, and second, the source code summarization task. The API summarization task built a mapping between API knowledge and the description of its functionality; then, this knowledge was applied to the code summarization task. Both tasks were built using deep neural networks; specifically, they used GRU for the encoder and decoder. They used 340,922 pairs (API sequence, summary) and 69,708 tuples (API sequence, code, summary). Their work showed an impressive result of 41.98% BLEU. [PERSON] et al. [25] presented a bi-variational autoencoder named BVAE for source code summarization. They introduced two instances of BVAE: one for code retrieval and the other for code summarization. Their framework allowed bidirectional mapping between source code and its natural language summary. They tested their model on C# and SQL. BVAE gave a 20.9% BLEU-4 in C# and 19.7% in SQL. [PERSON] et al. [26] proposed a framework consisting of three components: parsing code into ASTs, encoding the ASTs, and decoding the generated sequences with attention. First, they converted each code snippet into an AST using a standard AST parser. Each node in the tree was then embedded into a vector of a fixed length. The AST with labeled nodes was then encoded by a multi-way tree-LSTM. Then, finally, they decoded the encoded vectors into sentences using an LSTM attention-based decoder. They ran their experiments on a dataset of 588 108 Java code comment pairs. They achieved a 20.4% BLUE-4. In [13], the authors proposed a model that took input code and AST separately, which allowed it to learn code structure independently of the text in code. They used the attentional encoder-decoder with two GRU encoders: one for text and the other one for AST. They evaluated their technique with a dataset that they created from 2.1 million Java methods. They compared a text-only input model to the text/AST input model. They found that the performances of the two models were close to each other: 19.6% BLEU for the AST-based model and 19.4% for the text-only-based model. [PERSON] et al. [16] presented an end-to-end model for code retrieval and summarization named CO3. CO3 used dual learning and multi-task learning. They worked on finding the correlation between code summarization in natural language and code written in a programming language.