arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2407.06360cs.SE
收藏

CodeCSE:一种用于代码与注释句子嵌入的简单多语言模型

CodeCSE: A Simple Multilingual Model for Code and Comment Sentence Embeddings

Anthony Varkey, Siyuan Jiang, Weijing Huang

AI总结:

针对现有文献缺乏开箱即用的代码函数嵌入模型的问题,本文提出对比学习模型CodeCSE,可在同一空间学习函数及其描述的嵌入,其多语言零样本效果媲美针对特定语言从GraphCodeBERT微调的模型,且已开源。

摘要:

用于代码词元嵌入的预训练语言模型被应用于代码搜索、代码克隆检测及其他代码相关任务。同理,代码函数嵌入在此类任务中也很有用。然而,当前文献中尚无开箱即用的函数嵌入模型。因此,本文提出CodeCSE——一种对比学习模型,可在同一空间中学习函数及其描述的嵌入。我们通过代码搜索任务评估了CodeCSE。CodeCSE的多语言零样本方法与从GraphCodeBERT针对特定语言微调得到的模型效率相当。CodeCSE在https://github.com/emu-se/codecse开源,预训练模型可在HuggingFace公共中心获取:https://huggingface.co/sjiang1/codecse

英文摘要:

Pretrained language models for code token embeddings are used in code search, code clone detection, and other code-related tasks. Similarly, code function embeddings are useful in such tasks. However, there are no out-of-box models for function embeddings in the current literature. So, this paper proposes CodeCSE, a contrastive learning model that learns embeddings for functions and their descriptions in one space. We evaluated CodeCSE using code search. CodeCSE's multi-lingual zero-shot approach is as efficient as the models finetuned from GraphCodeBERT for specific languages. CodeCSE is open source at https://github.com/emu-se/codecse and the pretrained model is available at the HuggingFace public hub: https://huggingface.co/sjiang1/codecse

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑