To support the understanding of programs and understanding of procedures, we think need to automatically generate comments from source code. As a method, we learn the source code and comment pair by Encoder-Decoder translation model using LSTM, thereby generating comments of the source code that was the target of learning. In the Encoder-Decoder translation model, the source code of a program and its pair of comments are learned. However, that method does not know the domain of the program being used, so the comments that can be generated automatically may not be appropriate. In the use of learning, such as programs and algorithms for the purpose of computational thinking, it is possible to obtain relate information, such as problem statements and explanations. Therefore, we propose some methods to improve generated comments by using relate external information, such as question sentences. Also, we generate comments for each line and each block.