<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.3 20210610//EN" "JATS-journalpublishing1-3.dtd">
<article article-type="research-article" dtd-version="1.3" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xml:lang="ru"><front><journal-meta><journal-id journal-id-type="publisher-id">intechngu</journal-id><journal-title-group><journal-title xml:lang="ru">Вестник НГУ. Серия: Информационные технологии</journal-title><trans-title-group xml:lang="en"><trans-title>Vestnik NSU. Series: Information Technologies</trans-title></trans-title-group></journal-title-group><issn pub-type="ppub">1818-7900</issn><issn pub-type="epub">2410-0420</issn><publisher><publisher-name>НГУ</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.25205/1818-7900-2024-22-3-28-39</article-id><article-id custom-type="elpub" pub-id-type="custom">intechngu-281</article-id><article-categories><subj-group subj-group-type="heading"><subject>Research Article</subject></subj-group><subj-group subj-group-type="section-heading" xml:lang="ru"><subject>Статьи</subject></subj-group></article-categories><title-group><article-title>Дообучение модели CodeBERT для написания комментариев к SQL-запросам</article-title><trans-title-group xml:lang="en"><trans-title>Further training of the CodeBERT model for writing comments on SQL queries</trans-title></trans-title-group></title-group><contrib-group><contrib contrib-type="author" corresp="yes"><name-alternatives><name name-style="eastern" xml:lang="ru"><surname>Комлев</surname><given-names>Д. А.</given-names></name><name name-style="western" xml:lang="en"><surname>Komlev</surname><given-names>D. A.</given-names></name></name-alternatives><bio xml:lang="ru"><p>Данила Александрович Комлев, студент магистратуры</p><p>Москва</p></bio><bio xml:lang="en"><p>Danila A. Komlev, Graduate Student</p><p>Moscow</p></bio><email xlink:type="simple">komlevdanila742@gmail.com</email><xref ref-type="aff" rid="aff-1"/></contrib></contrib-group><aff-alternatives id="aff-1"><aff xml:lang="ru"><institution>НИТУ МИСИС</institution><country>Россия</country></aff><aff xml:lang="en"><institution>NUST MISIS</institution><country>Russian Federation</country></aff></aff-alternatives><pub-date pub-type="collection"><year>2024</year></pub-date><pub-date pub-type="epub"><day>09</day><month>12</month><year>2024</year></pub-date><volume>22</volume><issue>3</issue><fpage>28</fpage><lpage>39</lpage><permissions><copyright-statement>Copyright &amp;#x00A9; Комлев Д.А., 2024</copyright-statement><copyright-year>2024</copyright-year><copyright-holder xml:lang="ru">Комлев Д.А.</copyright-holder><copyright-holder xml:lang="en">Komlev D.A.</copyright-holder><license xml:lang="ru" license-type="creative-commons-attribution" xlink:href="https://creativecommons.org/licenses/by/4.0/" xlink:type="simple"><license-p>Данная работа распространяется под лицензией Creative Commons Attribution 4.0.</license-p></license><license xml:lang="en" license-type="creative-commons-attribution" xlink:href="https://creativecommons.org/licenses/by/4.0/" xlink:type="simple"><license-p>This work is licensed under a Creative Commons Attribution 4.0 License.</license-p></license></permissions><self-uri xlink:href="https://intechngu.elpub.ru/jour/article/view/281">https://intechngu.elpub.ru/jour/article/view/281</self-uri><abstract><p>   Автоматизированное создание комментариев к исходному коду – актуальная тема в разработке программного обеспечения, где модели машинного перевода применяются для «перевода» кода в текстовые описания. Предобученная на шести языках программирования модель CodeBERT используется для поиска кода, генерации документации, исправления ошибок. Эта модель хорошо понимает семантики естественного языка, языков программировани, а также связи между ними, эта модель хорошо подходит для дообучения на различные прикладные задачи, связанные с кодом. В статье рассматривается дообучение модели CodeBERT для генерации комментариев к SQL-запросам. Эта задача является актуальной, так как в крупных проектах может использоваться множество SQL-запросов различной сложности, и комментарии помогают улучшить их читаемость и понимание. Однако ручное написание и поддержание актуальности комментариев требует времени и усилий разработчиков. В статье предложено использовать предобученную модель CodeBERT для автоматической генерации комментариев к SQL-коду, что сократит время и позволит поддерживать комментарии в актуальном состоянии. Для дообучения используются открытые датасеты, содержание SQL-запрос, а также комментарий к нему. Результаты тестирования показали, что дообученная модель успешно справляется с задачей создания комментариев к SQL-запросам, что также подтверждается полученными значениями метрики Bleu.</p></abstract><trans-abstract xml:lang="en"><p>   Automated creation of comments to the source code is an urgent topic in software development, where machine translation models are used to “translate” code into text descriptions. The CodeBERT model, pre-trained in six programming languages, is used to search for code, generate documentation, and correct errors. This model understands well the semantics of natural language, programming languages, as well as the connections between them, this model is well suited for additional training on various applied tasks related to code. The article discusses the further training of the CodeBERT model for generating comments on SQL queries. This task is relevant, since large projects can use many SQL queries of varying complexity, and comments help to improve their readability and understanding. However, manually writing and keeping comments up-to-date takes time and effort from developers. The article suggests using the pre-trained CodeBERT model to automatically generate comments on SQL code, which will reduce time and allow you to keep comments up to date. For further training, open datasets, the contents of the SQL query, as well as comments on it are used. The test results showed that the pre-trained model successfully copes with the task of creating comments to an SQL query, which is also confirmed by the obtained values of the Bleu metric.</p></trans-abstract><kwd-group xml:lang="ru"><kwd>SQL-запрос</kwd><kwd>CodeBERT</kwd><kwd>Transformers</kwd><kwd>NLP</kwd><kwd>Bleu</kwd><kwd>дообучение</kwd><kwd>генерация комментариев</kwd></kwd-group><kwd-group xml:lang="en"><kwd>SQL query</kwd><kwd>CodeBERT</kwd><kwd>Transformers</kwd><kwd>NLP</kwd><kwd>Bleu</kwd><kwd>additional training</kwd><kwd>comment generation</kwd></kwd-group></article-meta></front><back><ref-list><title>References</title><ref id="cit1"><label>1</label><citation-alternatives><mixed-citation xml:lang="ru">What Is Declarative Programming? URL: https://codefresh.io/learn/infrastructure-as-code/declarative-vs-imperative-programming-4-key-differences/</mixed-citation><mixed-citation xml:lang="en">What Is Declarative Programming? URL: https://codefresh.io/learn/infrastructure-as-code/declarative-vs-imperative-programming-4-key-differences/</mixed-citation></citation-alternatives></ref><ref id="cit2"><label>2</label><citation-alternatives><mixed-citation xml:lang="ru">Vaswani О., Shazeer N., Parmar N. etc. Attention Is All You Need. URL: https://arxiv.org/abs/1706.03762</mixed-citation><mixed-citation xml:lang="en">Vaswani О., Shazeer N., Parmar N. etc. Attention Is All You Need. URL: https://arxiv.org/abs/1706.03762</mixed-citation></citation-alternatives></ref><ref id="cit3"><label>3</label><citation-alternatives><mixed-citation xml:lang="ru">Masked Language Modeling in BERT. URL: https://www.scaler.com/topics/nlp/masked-language-model-explained/</mixed-citation><mixed-citation xml:lang="en">Masked Language Modeling in BERT. URL: https://www.scaler.com/topics/nlp/masked-language-model-explained/</mixed-citation></citation-alternatives></ref><ref id="cit4"><label>4</label><citation-alternatives><mixed-citation xml:lang="ru">Clark К., Luong М.-Т. D. Manning С Electra: pre-training text encoders as discriminators rather than generators. URL: https://openreview.net/pdf?id=r1xMH1BtvB</mixed-citation><mixed-citation xml:lang="en">Clark К., Luong М.-Т. D. Manning С Electra: pre-training text encoders as discriminators rather than generators. URL: https://openreview.net/pdf?id=r1xMH1BtvB</mixed-citation></citation-alternatives></ref><ref id="cit5"><label>5</label><citation-alternatives><mixed-citation xml:lang="ru">Natural Language Processing: Bleu Score. URL: https://www.baeldung.com/cs/nlp-bleu-score</mixed-citation><mixed-citation xml:lang="en">Natural Language Processing: Bleu Score. URL: https://www.baeldung.com/cs/nlp-bleu-score</mixed-citation></citation-alternatives></ref><ref id="cit6"><label>6</label><citation-alternatives><mixed-citation xml:lang="ru">N-граммы. URL: https://deepai.org/machine-learning-glossary-and-terms/n-gram</mixed-citation><mixed-citation xml:lang="en">N-граммы. URL: https://deepai.org/machine-learning-glossary-and-terms/n-gram</mixed-citation></citation-alternatives></ref><ref id="cit7"><label>7</label><citation-alternatives><mixed-citation xml:lang="ru">CodeXGLUE. URL: https://microsoft.github.io/CodeXGLUE/</mixed-citation><mixed-citation xml:lang="en">CodeXGLUE. URL: https://microsoft.github.io/CodeXGLUE/</mixed-citation></citation-alternatives></ref><ref id="cit8"><label>8</label><citation-alternatives><mixed-citation xml:lang="ru">Cross Enptropy. URL: https://ml-cheatsheet.readthedocs.io/en/latest/loss_functions.html</mixed-citation><mixed-citation xml:lang="en">Cross Enptropy. URL: https://ml-cheatsheet.readthedocs.io/en/latest/loss_functions.html</mixed-citation></citation-alternatives></ref><ref id="cit9"><label>9</label><citation-alternatives><mixed-citation xml:lang="ru">Beam Search. URL: https://d2l.ai/chapter_recurrent-modern/beam-search.html</mixed-citation><mixed-citation xml:lang="en">Beam Search. URL: https://d2l.ai/chapter_recurrent-modern/beam-search.html</mixed-citation></citation-alternatives></ref><ref id="cit10"><label>10</label><citation-alternatives><mixed-citation xml:lang="ru">Zhu Qingfu, Zhang Weinan, Zhou Lianqiang, Liu Ting. Learning to Start for Sequence to Sequence Architecture. 2016. URL: https://www.researchgate.net/publication/306357583_Learning_to_Start_for_Sequence_to_Sequence_Architecture</mixed-citation><mixed-citation xml:lang="en">Zhu Qingfu, Zhang Weinan, Zhou Lianqiang, Liu Ting. Learning to Start for Sequence to Sequence Architecture. 2016. URL: https://www.researchgate.net/publication/306357583_Learning_to_Start_for_Sequence_to_Sequence_Architecture</mixed-citation></citation-alternatives></ref></ref-list><fn-group><fn fn-type="conflict"><p>The authors declare that there are no conflicts of interest present.</p></fn></fn-group></back></article>
