Code search is a task to find programming codes that semantically match the given natural language queries. Even though some of the existing datasets for this task are multilingual on the programming language side, their query data are only in English. In this research, we create a multilingual code search dataset in four natural and four programming languages using a neural machine translation model. Using our dataset, we pre-train and fine-tune the Transformer-based models and then evaluate them on multiple code search test sets. Our results show that the model pre-trained with all natural and programming language data has performed best in most cases. By applying back-translation data filtering to our dataset, we demonstrate that the translation quality affects the model's performance to a certain extent, but the data size matters more.
翻译:代码搜索是一项任务,旨在寻找与给定自然语言查询在语义上匹配的编程代码。尽管现有的一些数据集在编程语言方面是多语言的,但其查询数据仅为英文。在本研究中,我们利用神经机器翻译模型构建了一个包含四种自然语言和四种编程语言的多语言代码搜索数据集。基于该数据集,我们对基于Transformer的模型进行了预训练和微调,并在多个代码搜索测试集上进行了评估。结果表明,在大多数情况下,使用所有自然语言和编程语言数据预训练的模型表现最佳。通过对我们的数据集应用反向翻译数据过滤,我们发现翻译质量在一定程度上影响模型性能,但数据规模更为关键。