Page 242 - 《软件学报》2021年第7期
P. 242
2160 Journal of Software 软件学报 Vol.32, No.7, July 2021
Table 4 Examples of generated comment by models (Continued)
表 4 模型生成的注释例子(续)
序号 例子
PersistentRegistrarImpl(String[] configArgs, LifeCycle lifeCycle) throws Exception{
super(configArgs, null, True, lifeCycle);
}
Human-written: constructs a non activatable persistentregistrarimpl based on a configuration obtained using the
7
provided arguments.
Hybrid-DeepCom: create an instance registrar based based on the configuration.
CodePtr-PGN: creates a new instance based on the given arguments.
CodePtr: constructs an activatable persistentregistrarimpl using the provided obtained from the using the provided
configuration.
public Boolean isVirtualICH7MPresent(){
return virtualICH7MPresent;
}
8
Human-written: gets the value of the virtualich mpresent property.
Hybrid-DeepCom: returns indicator image data is enabled.
CodePtr-PGN: gets the value of the UNK property.
CodePtr: gets the value of the virtualich7mpresent property.
public boolean isSetBonk(){
return this.bonk !=null;
}
9
Human-written: returns true if field bonk is set has been assigned a value and false otherwise
Hybrid-DeepCom: returns true if field UNK is set has been assigned a value and false otherwise
CodePtr-PGN: returns true if field UNK is set has been assigned a value and false otherwise
CodePtr: returns true if field bonk is set has been assigned a value and false otherwise
我们同时分析了 CodePtr 在解码例子 9 的过程中,在生成每一个单词时的 Attention 权重分布图和 p gen 的取
值,由于 Source Encoder 专门用于使指针生成网络发挥作用,因此这里只考虑 Source Encoder 的输入,如图 6
所示.
Fig.6 Attention weights distribution and p gen values of CodePtr when decoding Example 9
图 6 CodePtr 解码例子 9 时的 Attention 权重分布和 p gen 取值
图 6 中上方为 Attention 权重分布,横轴为时间轴,表示解码时的每个时刻,纵轴为 Source Encoder 的输入,
图中的色块表示在生成每一个单词时解码器对 Source Encoder 输入序列中每个单词的 Attention 权重,颜色越深