{"id":347933,"date":"2023-05-26T09:02:57","date_gmt":"2023-05-26T09:02:57","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=347933"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=347933","title":{"rendered":"<span>CodeBert \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u043a \u043a\u043e\u0434\u0443<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cff\/42c\/3ec\/cff42c3ec6d612c57c42986923be68e4.jpg\" alt=\"Code_Bert_Auto-generation_of_code_comments_without_people_4b671736-35d5-4735-8c13-b99cbeaaf4bc\" title=\"\" width=\"1024\" height=\"1024\"><\/figure>\n<p>\u041a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 \u0438\u0437-\u0437\u0430 \u0435\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043c\u0430 \u0438 \u0441\u0442\u0440\u043e\u0433\u043e\u0441\u0442\u0438, \u043e\u0434\u043d\u0430\u043a\u043e \u043d\u0438\u0447\u0442\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0435\u0433\u043e \u043a\u0430\u043a \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0438\u043c, \u043a\u0430\u043a \u0441 \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u044f\u0437\u044b\u043a\u043e\u043c. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438, \u0447\u0442\u043e \u043c\u043e\u0434\u0435\u043b\u044c BERT, \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u0430\u044f \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c\u0438 \u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u044f \u0431\u0443\u0434\u0443 \u0440\u0435\u0448\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u0430\u0432\u0442\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u043a \u043d\u0435\u043c\u0443. \u0412\u044b \u0443\u0437\u043d\u0430\u0435\u0442\u0435, \u043a\u0430\u043a \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<h3>\u0414\u0430\u043d\u043d\u044b\u0435<\/h3>\n<p>\u0414\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0432\u0438\u0434\u0435 \u043d\u0430\u0431\u043e\u0440\u0430 \u043f\u0430\u0440 [\u0444\u0443\u043d\u043a\u0446\u0438\u044f \u2014 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439] \u0434\u043b\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (<a href=\"https:\/\/s3.amazonaws.com\/code-search-net\/CodeSearchNet\/v2\/java.zip\"><u>awesome Code Search Net Challenge dataset<\/u><\/a>). \u041a\u0441\u0442\u0430\u0442\u0438 \u0433\u043e\u0432\u043e\u0440\u044f, \u044d\u0442\u043e\u0442 \u043d\u0430\u0431\u043e\u0440 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u043d\u0435 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438, \u043e\u0434\u043d\u0430\u043a\u043e \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043f\u0435\u0440\u0435\u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434 \u0441\u0432\u043e\u0438 \u043d\u0443\u0436\u0434\u044b.&nbsp;<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"center\"><strong>\u0414\u0430\u043d\u043d\u044b\u0435<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>\u0426\u0435\u043b\u044c<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">public string getlhsbindingtype(final string var)<\/p>\n<p align=\"left\">&nbsp;{ if (this.lhs == null) { return null; } for (int i = 0; i &lt; this.lhs.length; i++) { string type = getlhsbindingtype(this.lhs[i], var); if (type != null) { return type; } } return null; }<\/p>\n<\/td>\n<td>\n<p align=\"left\">get the data-type associated with the binding<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u042f \u043d\u0435 \u0441\u0442\u0430\u043d\u0443 \u043e\u0447\u0438\u0449\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u044d\u0442\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e <a href=\"https:\/\/nathancooper.io\/i-am-a-nerd\/code\/summarization\/deep-learning\/seq2seq\/2020\/12\/26\/Improved_Code_Commenter.html\"><u>\u0437\u0434\u0435\u0441\u044c<\/u><\/a>. \u042f \u0436\u0435 \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0436\u0435 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043e\u0431\u044a\u0435\u043c\u0435 1 % \u043e\u0442 \u043e\u0431\u0449\u0435\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043e\u0431\u0440\u0430\u0437\u0446\u043e\u0432 \u0432 \u043d\u0430\u0431\u043e\u0440\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u041d\u043e, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c, \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u0434\u0430\u0436\u0435 \u043d\u0430 1 % \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435\u043f\u043b\u043e\u0445\u043e. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0430 \u0432\u0441\u0451\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u043e\u043b\u0443\u0447\u0448\u0435.<\/p>\n<h3>CodeBERT<\/h3>\n<p>\u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0432\u0437\u044f\u0442\u0430 \u0438\u0437 <a href=\"https:\/\/arxiv.org\/abs\/2002.08155\"><u>\u0441\u0442\u0430\u0442\u044c\u0438<\/u><\/a> \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f Microsoft. \u0412 \u044d\u0442\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u043d\u0430\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 CodeSearchNet, \u043d\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0434\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 RoBERTa \u0443\u0434\u043e\u0431\u043d\u043e\u043c\u0443 \u0434\u043b\u044f \u0432\u043e\u0441\u043f\u0440\u0438\u044f\u0442\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u043a\u043e\u0434\u0430 \u0438 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430 \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0432 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e\u0439, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438 \u0441\u0432\u043e\u044e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0437\u0430\u0434\u0430\u0447.&nbsp;<\/p>\n<h3>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a<\/h3>\n<pre><code class=\"python\">!pip install transformers !git clone -q https:\/\/github.com\/microsoft\/CodeXGLUE.git   import json from dataclasses import dataclass import numpy as np import pandas as pd from transformers import AutoTokenizer<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u044f \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e \u043f\u0443\u0442\u0438 \u0434\u043e \u0444\u0430\u0439\u043b\u043e\u0432 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438 \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u044e \u0438\u0445 \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<pre><code class=\"python\">PATH_TO_TRAIN_DATA = '\/content\/train.csv' PATH_TO_TEST_DATA = '\/content\/test.csv' PATH_TO_VALIDATION_DATA = '\/content\/validation.csv' #validation, test and train data_struct = { 'train' : pd.read_csv(PATH_TO_TRAIN_DATA), 'test' : pd.read_csv(PATH_TO_TEST_DATA), 'valid' : pd.read_csv(PATH_TO_VALIDATION_DATA) }<\/code><\/pre>\n<p>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e \u0434\u0432\u0435 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438: \u0442\u043e\u043a\u0435\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u0437\u0430\u043f\u0438\u0441\u0438 DataFrame \u0432 JSON-\u0444\u0430\u0439\u043b, \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u0442\u0430\u043a\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<pre><code class=\"python\">} def write_into_json_file(json_file_name: str, data: pd.DataFrame): ''' json_file_name - name output json file data - pandas data frame write your pandas data to json file ''' with open(json_file_name, 'w') as current_file: for index, current_row in data.iterrows(): current_file.write(json.dumps(current_row.to_dict()) + '\\n')   def split_data(split_column: str, new_column: str, data: pd.DataFrame)-&gt; pd.DataFrame: ''' split items in column data - your pandas data frame split_column - column in your pd.df ''' data[new_column] = data[split_column].apply(lambda current_item: current_item.split()) return data<\/code><\/pre>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0443\u044e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043f\u0440\u0435\u0434\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0432\u044b\u0448\u0435:<\/p>\n<pre><code class=\"python\">#preproc data for type_data, value in data_struct.items(): #split target colums code_tokens_step = split_data('code', 'code_tokens', value) docs_tokens_step = split_data('comment', 'docstring_tokens', code_tokens_step) data_struct[type_data] = docs_tokens_step #create json file write_into_json_file(f'\/content\/{type_data}.jsonl', data_struct[type_data])<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u043d\u0430 \u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e \u0432\u0441\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e:<\/p>\n<pre><code class=\"python\">@dataclass class ConfigurationModel: learning_rate : float  batch_size : int  beam : int test_file : str source_size : int target_size : int path_to_data_directory : str path_to_output_data_directory : str train_file : str dev_file : str count_epochs : int pretrained_model : str   configuration_codetext_model = ConfigurationModel( learning_rate = 5e-5, batch_size = 8, beam = 10, source_size = 256, target_size = 512, path_to_data_directory = '.', path_to_output_data_directory = 'model_for_java', train_file = '\/content\/train.jsonl', dev_file = '\/content\/valid.jsonl', test_file = '\/content\/test.jsonl', count_epochs = 10, pretrained_model = 'microsoft\/codebert-base', ) configuration_codetext_model <\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d5c\/494\/e88\/d5c494e882e9eb1002bccd2bb37c54ed.png\" width=\"1287\" height=\"141\"><\/figure>\n<h3>\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0443\u0434\u043e\u0431\u043d\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044e. \u0421\u0434\u0435\u043b\u0430\u044e \u044d\u0442\u043e\u041e\u0431\u0443\u0447\u0443 \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0430 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0435\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0435. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e BLEU-4 (\u0447\u0435\u0442\u0432\u0451\u0440\u043a\u0430 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043b\u043e\u0432\u0435\u0441\u043d\u044b\u0445 n-gram = 4), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430 \u043e\u0442 0 \u0434\u043e 1, \u043d\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f BLEU-4 * 100%. \u042d\u0442\u0430 \u043c\u0435\u0442\u0440\u0438\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0437\u0430\u0434\u0430\u0447\u0430\u0445 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430, \u043d\u043e \u0438 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u0435\u043a\u0441\u0442\u0430 \u043e\u043d\u0430 \u0442\u0430\u043a\u0436\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442. \u0415\u0441\u043b\u0438 \u0431\u0440\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430, \u0442\u043e \u0434\u0430\u0436\u0435 \u0434\u043b\u044f \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 bleu = [0.6:0.7] \u2014 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u043c\u043e\u0436\u0435\u0442 \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0442\u0435\u043a\u0441\u0442 \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443. \u0422\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0432 \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442\u044c \u043f\u043e\u0447\u0442\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.&nbsp;<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443, \u0442\u043e, \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u043e\u043b\u0436\u043d\u0430 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442, \u0430 \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0435\u043a\u0441\u0442, \u0430 \u043e\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u043a \u043a\u043e\u0434\u0443. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0436\u0438\u0434\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 bleu \u043d\u0435 \u0441\u0442\u043e\u0438\u0442.&nbsp;<\/p>\n<pre><code class=\"python\">#run train model !python \/content\/CodeXGLUE\/Code-Text\/code-to-text\/code\/run.py \\ --do_train \\ --do_eval \\ --do_lower_case \\ --model_type roberta \\ --model_name_or_path {configuration_codetext_model.pretrained_model} \\ --train_filename {configuration_codetext_model.train_file} \\ --dev_filename {configuration_codetext_model.dev_file} \\ --output_dir {configuration_codetext_model.path_to_output_data_directory} \\ --max_source_length {configuration_codetext_model.source_size} \\ --max_target_length {configuration_codetext_model.target_size} \\ --beam_size {configuration_codetext_model.beam} \\ --train_batch_size {configuration_codetext_model.batch_size} \\ --eval_batch_size {configuration_codetext_model.batch_size} \\ --learning_rate {configuration_codetext_model.learning_rate} \\ --num_train_epochs {configuration_codetext_model.count_epochs}<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/aa8\/3cf\/c52\/aa83cfc525ad9614f05a5c43108e671a.png\" width=\"502\" height=\"578\"><\/figure>\n<h3>\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0435\u0451 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0435:<\/p>\n<pre><code class=\"python\">binary_model_file = '\/content\/model_for_java\/checkpoint-best-bleu\/pytorch_model.bin' !python  \/content\/CodeXGLUE\/Code-Text\/code-to-text\/code\/run.py \\     --do_test \\     --model_type roberta \\     --model_name_or_path microsoft\/codebert-base \\     --load_model_path {binary_model_file} \\     --dev_filename {configuration_codetext_model.dev_file} \\     --test_filename {configuration_codetext_model.test_file} \\     --output_dir {configuration_codetext_model.path_to_output_data_directory} \\     --max_source_length {configuration_codetext_model.source_size} \\     --max_target_length {configuration_codetext_model.target_size} \\     --beam_size {configuration_codetext_model.beam} \\     --eval_batch_size {configuration_codetext_model.batch_size}<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/30a\/ba9\/63b\/30aba963bc90719ce9846072a884b12d.png\" width=\"562\" height=\"71\"><\/figure>\n<p>\u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, bleu-4 = 11, \u0438 \u044d\u0442\u043e \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438, \u0434\u0430\u0436\u0435 \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e bleu \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430 \u043e\u0442 0 \u0434\u043e 100.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u0447\u0438\u0442\u0430\u044e \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0435\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b:<\/p>\n<pre><code class=\"python\">path_to_gold = '\/content\/model_for_java\/test_1.gold' path_to_output = '\/content\/model_for_java\/test_1.output'<\/code><\/pre>\n<p>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0438\u0437 txt-\u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code class=\"python\">def read_result_txt_file(txt_file: str)-&gt; list: with open(txt_file) as file:return [' '.join(line.rstrip().replace('\\t', ' ').split(' ')[1:]) for line in file]<\/code><\/pre>\n<p>\u0418 \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0441\u0447\u0438\u0442\u0430\u044e \u0432\u0441\u0451 \u0432 DataFrame:<\/p>\n<pre><code class=\"python\">def read_result_txt_file(txt_file: str)-&gt; list: #true comments and predicted true_sent = read_result_txt_file(path_to_gold) pred_sent = read_result_txt_file(path_to_output) result_data_frame = pd.DataFrame( { 'code' : data_struct['test']['code'], 'true' : true_sent, 'pred' : pred_sent } )   result_data_frame.head(10)<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ef8\/eda\/5ba\/ef8eda5bae8a28ae1578a89b0843ff58.png\" width=\"994\" height=\"352\"><\/figure>\n<p>\u0412\u044b\u0432\u043e\u0434 10 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043a\u043e\u0434\u0430, \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u044c\u044e.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u0441\u0443\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0441\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u043f\u043e \u0448\u043a\u0430\u043b\u0435 \u043e\u0442 1 \u0434\u043e 5. <strong>Code<\/strong> \u2014 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434, <strong>true<\/strong> \u2014 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439, <strong>pred<\/strong> \u2014 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 1:<\/p>\n<blockquote>\n<p><strong>Code<\/strong>: public t includeas(final class template) { blacklist = false; string[] properties = getallbeanpropertynames(template, false); include(properties); return _this(); }<\/p>\n<p><strong>True<\/strong>: defines included property names as public properties of given template class. sets to black list mode.<\/p>\n<p><strong>Pred<\/strong>: create a new resource<\/p>\n<\/blockquote>\n<p>\u041e\u0446\u0435\u043d\u043a\u0430: 1 \u2014 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043e \u0447\u0451\u043c \u0438\u0434\u0451\u0442 \u0440\u0435\u0447\u044c.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 2:<\/p>\n<blockquote>\n<p><strong>Code<\/strong>: int setdirect(int v0, int v1, int v2, int v3, int v4) { return offset + v0*stride0 + v1*stride1 + v2*stride2 + v3*stride3 + v4*stride4; }<\/p>\n<p><strong>True<\/strong>: experimental : should be package private<\/p>\n<p><strong>Pred<\/strong>: sets the value for the specified point.<\/p>\n<\/blockquote>\n<p>\u041e\u0446\u0435\u043d\u043a\u0430: 4 \u2014 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043e\u0442\u0440\u0430\u0436\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e.&nbsp;<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 3:<\/p>\n<blockquote>\n<p><strong>Code<\/strong>: static private servicetype checkifdap4(string location) throws ioexception { \/\/ strip off any trailing dap4 prefix if (location.endswith(&#171;.dap&#187;)) location = location.substring(0, location.length() &#8212; &#171;.dap&#187;.length()); else if (location.endswith(&#171;.dmr&#187;)) location = location.substring(0, location.length() &#8212; &#171;.dmr&#187;.length()); else if (location.endswith(&#171;.dmr.xml&#187;)) location = location.substring(0, location.length() &#8212; &#171;.dmr.xml&#187;.length()); else if (location.endswith(&#171;.dsr&#187;)) location = location.substring(0, location.length() &#8212; &#171;.dsr&#187;.length()); try (httpmethod method = httpfactory.get(location + &#171;.dmr.xml&#187;)) { int status = method.execute(); if (status == 200) { header h = method.getresponseheader(&#171;content-type&#187;); if ((h != null) &amp;&amp; (h.getvalue() != null)) { string v = h.getvalue(); if (v.startswith(&#171;application\/vnd.opendap.org&#187;)) return servicetype.dap4; } } if (status == httpstatus.sc_unauthorized || status == httpstatus.sc_forbidden) throw new ioexception(&#171;unauthorized to open dataset &#187; + location); \/\/ not dods return null; } }<\/p>\n<p><strong>True<\/strong>: check for dmr<\/p>\n<p><strong>Pred<\/strong>: returns true if the given name is valid.<\/p>\n<\/blockquote>\n<p>\u041e\u0446\u0435\u043d\u043a\u0430: 5 \u2014 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0435 \u0432 \u0442\u043e\u0447\u043a\u0443.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 4:<\/p>\n<blockquote>\n<p><strong>Code<\/strong>: public void setsize(dimension newsize) { if ( newsize != null ) { size.setsize( newsize ); firepropertychange( size_prop, null, size ); } }<\/p>\n<p><strong>True<\/strong>: set the size of this vertex. will not update the size if newsize is null.<\/p>\n<p><strong>Pred<\/strong>: sets the initializes the size of the shape.<\/p>\n<\/blockquote>\n<p>\u041e\u0446\u0435\u043d\u043a\u0430: 3 \u2014 \u0432 \u0446\u0435\u043b\u043e\u043c, \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0441\u0445\u043e\u0436\u0438, \u043d\u043e \u0432\u043c\u0435\u0441\u0442\u043e vertex \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f shape, \u0438 \u0432 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043d\u0435 \u043e\u0442\u0440\u0430\u0436\u0435\u043d\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 5:<\/p>\n<blockquote>\n<p><strong>Code<\/strong>: protected bufferedimage createbufferedimage(int w, int h, int imgtype) { bufferedimage bi = null; if (imgtype == 0) { bi = (bufferedimage) createimage(w, h); } else if ((imgtype &gt; 0) &amp;&amp; (imgtype &lt; 14)) { bi = new bufferedimage(w, h, imgtype); } else if (imgtype == 14) { bi = createbinaryimage(w, h, 2); } else if (imgtype == 15) { bi = createbinaryimage(w, h, 4); } else if (imgtype == 16) { bi = createsgisurface(w, h, 32); } else if (imgtype == 17) { bi = createsgisurface(w, h, 16); } \/\/ store the buffered image size biw = w; bih = h; return bi; }<\/p>\n<p><strong>True<\/strong>: generates a fresh buffered image of the appropriate type.<\/p>\n<p><strong>Pred<\/strong>: creates a new image.<\/p>\n<\/blockquote>\n<p>\u041e\u0446\u0435\u043d\u043a\u0430: 2 \u2014 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0441\u043a\u0430\u0437\u0430\u043d\u043e, \u0447\u0442\u043e \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u043e\u0435 \u0431\u0443\u0444\u0435\u0440\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430, \u0432 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0442\u0430\u043a\u0438\u0435 \u0443\u0442\u043e\u0447\u043d\u0435\u043d\u0438\u044f \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 6:<\/p>\n<blockquote>\n<p><strong>Code<\/strong>: public orientgraph gettx() { final orientgraph g; if (pool == null) { g = (orientgraph) gettxgraphimplfactory().getgraph(getdatabase(), user, password, settings); } else { \/\/ use the pool g = (orientgraph) gettxgraphimplfactory().getgraph(pool, settings); } initgraph(g); return g; }<\/p>\n<p><strong>True<\/strong>: gets transactional graph with the database from pool if pool is configured. otherwise creates a graph with new db instance. the graph instance inherits the factory&#8217;s configuration.<\/p>\n<p><strong>Pred<\/strong>: get the graph for the graph.<\/p>\n<\/blockquote>\n<p>\u041e\u0446\u0435\u043d\u043a\u0430: 1 \u2014 \u043e\u0447\u0435\u043d\u044c \u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u0438 \u0432 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0435\u0432\u0435\u0440\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 7:<\/p>\n<blockquote>\n<p><strong>Code<\/strong>: public boundingbox getboundingbox(long geopackageid, string tablename) { boundingbox boundingbox = null; cursor result = db.rawquery(&#171;select min(&#187; + geometrymetadata.column_min_x + &#171;), min(&#187; + geometrymetadata.column_min_y + &#171;), max(&#187; + geometrymetadata.column_max_x + &#171;), max(&#187; + geometrymetadata.column_max_y + &#171;) from &#187; + geometrymetadata.table_name + &#187; where &#187; + geometrymetadata.column_geopackage_id + &#187; = ? and &#187; + geometrymetadata.column_table_name + &#187; = ?&#187;, new string[]{string.valueof(geopackageid), tablename}); try { if (result.movetonext()) { boundingbox = new boundingbox(result.getdouble(0), result.getdouble(1), result.getdouble(2), result.getdouble(3)); } } finally { result.close(); } return boundingbox; }<\/p>\n<p><strong>True<\/strong>: query for the bounds of the feature table index<\/p>\n<p><strong>Pred<\/strong>: get the bounding box.<\/p>\n<\/blockquote>\n<p>\u041e\u0446\u0435\u043d\u043a\u0430: 3 \u2014 \u0432 \u0446\u0435\u043b\u043e\u043c, \u0441\u0443\u0442\u044c \u043f\u043e\u0445\u043e\u0436\u0430.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 8:<\/p>\n<blockquote>\n<p><strong>Code<\/strong>: public static list&lt;element&gt; getelements(stage stage, iterable&lt;? extends module&gt; modules) { recordingbinder binder = new recordingbinder(stage); for (module module : modules) { binder.install(module); } binder.scanforannotatedmethods(); for (recordingbinder child : binder.privatebinders) { child.scanforannotatedmethods(); } \/\/ free the memory consumed by the stack trace elements cache stacktraceelements.clearcache(); return collections.unmodifiablelist(binder.elements); }<\/p>\n<p><strong>True<\/strong>: records the elements executed by<\/p>\n<p><strong>Pred<\/strong>: returns the list of the given<\/p>\n<\/blockquote>\n<p>\u041e\u0446\u0435\u043d\u043a\u0430: 3 \u2014 \u0432 \u0446\u0435\u043b\u043e\u043c, \u0441\u0443\u0442\u044c \u043f\u043e\u0445\u043e\u0436\u0430.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 9:&nbsp;<\/p>\n<blockquote>\n<p><strong>Code<\/strong>: static proofnode&lt;owlaxiom&gt; canconvertstep(proofstep&lt;owlaxiom&gt; step) { if (step.getname() != elkclassinclusionexistentialcomposition.name) { return null; } list&lt;? extends proofnode&lt;owlaxiom&gt;&gt; premises = step.getpremises(); proofnode&lt;owlaxiom&gt; lastpremise = premises.get(premises.size() &#8212; 1); collection&lt;? extends proofstep&lt;owlaxiom&gt;&gt; lastpremisesteps = lastpremise .getinferences(); if (lastpremisesteps.size() != 1) { return null; } \/\/ else for (proofstep&lt;owlaxiom&gt; lastpremisestep : lastpremisesteps) { if (lastpremisestep .getname() == elkpropertyinclusionoftransitiveobjectproperty.name) { return lastpremisestep.getpremises().get(0); } } \/\/ else return null; }<\/p>\n<p><strong>True<\/strong>: checks if is derived by inference where the last premise is derived from<\/p>\n<p><strong>Pred<\/strong>: determine if the expression has been cleared.<\/p>\n<\/blockquote>\n<p>\u041e\u0446\u0435\u043d\u043a\u0430: 2 \u2014 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u043f\u0440\u0430\u0432\u0434\u0443, \u043d\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0432\u043f\u043e\u043b\u043d\u0435 \u043e\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u0439.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 10:<\/p>\n<blockquote>\n<p><strong>Code<\/strong>: public string asjsonstring(object o) { if ( getcoderspecific() instanceof jsonfactory == false ) { return &#171;can be called on jsonconfiguration only&#187;; } else { return new string(asbytearray(o), standardcharsets.utf_8); } }<\/p>\n<p><strong>True<\/strong>: utility\/debug method. use &#171;asbytearray&#187; for programmatic use as the byte array will already by utf-8 and ready to be sent on network.<\/p>\n<p><strong>Pred<\/strong>: convert a json string to a json string.<\/p>\n<p>========================================<\/p>\n<p><strong>Code<\/strong>: private void notifylisteners(string str) { writerlistener[] writerlisteners = null; synchronized (listeners) { writerlisteners = new writerlistener[listeners.size()]; listeners.toarray(writerlisteners); } for (int i = 0; i &lt; writerlisteners.length; i++) { writerlisteners[i].write(str); } }<\/p>\n<p><strong>True<\/strong>: notify that a new string has been written.<\/p>\n<p><strong>Pred<\/strong>: notifies all listeners.<\/p>\n<\/blockquote>\n<p>\u041e\u0446\u0435\u043d\u043a\u0430: 1 \u2014 \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0435 \u0441\u043c\u043e\u0433\u043b\u0430 \u0443\u043b\u043e\u0432\u0438\u0442\u044c \u0441\u0443\u0442\u044c.<\/p>\n<p>\u0421\u0440\u0435\u0434\u043d\u044f\u044f \u0441\u0443\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u043e\u0446\u0435\u043d\u043a\u0430: (1+4+5+3+2+1+3+3+2+1)\/10 = 2,5 \u2014 \u0432\u043f\u043e\u043b\u043d\u0435 \u043d\u0435\u043f\u043b\u043e\u0445\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u0447\u0438\u043b\u0430\u0441\u044c \u043d\u0430 1 % \u043e\u0442 \u043e\u0431\u0449\u0435\u0433\u043e \u043e\u0431\u044a\u0451\u043c\u0430 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412 \u0446\u0435\u043b\u043e\u043c, \u0441\u0443\u0442\u044c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u043f\u043e\u043d\u044f\u0442\u043d\u0430, \u043d\u043e \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u043d\u0430 1 % \u043d\u0430\u0431\u043e\u0440\u0430, \u0442\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u042f \u043f\u043e\u043a\u0430\u0437\u0430\u043b, \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u0430\u0436\u0435 \u043d\u0430 1 % \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u0432\u043e\u044e \u0446\u0435\u043b\u044c \u0438 \u043c\u043e\u0436\u0435\u0442 \u0432\u043f\u043e\u043b\u043d\u0435 \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u043e \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043a \u043a\u043e\u0434\u0443. \u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0442\u0435\u043a\u0441\u0442\u0430 \u0434\u043b\u044f \u044f\u0437\u044b\u043a\u0430 Java. \u0415\u0441\u043b\u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0438 \u0446\u0435\u043b\u043e\u0439 \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u044b, \u0442\u043e \u043b\u0443\u0447\u0448\u0435 \u0435\u0451 \u0432\u0441\u0451 \u0436\u0435 \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u043d\u0430 \u0432\u0441\u0435\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.&nbsp;<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0435\u043c \u043e\u0431\u044a\u0451\u043c\u0435, \u0442\u043e \u0435\u0451 \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432 IDE (VisualStudio, PyCharm \u0438 \u0442.\u0434.) \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/www.youtube.com\/watch?time_continue=282&amp;v=SYjgPjQ-vbc&amp;embeds_euri=https%3A%2F%2Fnathancooper.io%2F&amp;feature=emb_logo\"><u>\u0437\u0434\u0435\u0441\u044c<\/u><\/a>.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/companies\/sberbank\/articles\/737730\/\"> https:\/\/habr.com\/ru\/companies\/sberbank\/articles\/737730\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<figure class=\"full-width\"><\/figure>\n<p>\u041a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 \u0438\u0437-\u0437\u0430 \u0435\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043c\u0430 \u0438 \u0441\u0442\u0440\u043e\u0433\u043e\u0441\u0442\u0438, \u043e\u0434\u043d\u0430\u043a\u043e \u043d\u0438\u0447\u0442\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0435\u0433\u043e \u043a\u0430\u043a \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0438\u043c, \u043a\u0430\u043a \u0441 \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u044f\u0437\u044b\u043a\u043e\u043c. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438, \u0447\u0442\u043e \u043c\u043e\u0434\u0435\u043b\u044c BERT, \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u0430\u044f \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c\u0438 \u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u044f \u0431\u0443\u0434\u0443 \u0440\u0435\u0448\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u0430\u0432\u0442\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u043a \u043d\u0435\u043c\u0443. \u0412\u044b \u0443\u0437\u043d\u0430\u0435\u0442\u0435, \u043a\u0430\u043a \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<h3>\u0414\u0430\u043d\u043d\u044b\u0435<\/h3>\n<p>\u0414\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0432\u0438\u0434\u0435 \u043d\u0430\u0431\u043e\u0440\u0430 \u043f\u0430\u0440 [\u0444\u0443\u043d\u043a\u0446\u0438\u044f \u2014 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439] \u0434\u043b\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (<a href=\"https:\/\/s3.amazonaws.com\/code-search-net\/CodeSearchNet\/v2\/java.zip\"><u>awesome Code Search Net Challenge dataset<\/u><\/a>). \u041a\u0441\u0442\u0430\u0442\u0438 \u0433\u043e\u0432\u043e\u0440\u044f, \u044d\u0442\u043e\u0442 \u043d\u0430\u0431\u043e\u0440 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u043d\u0435 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438, \u043e\u0434\u043d\u0430\u043a\u043e \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043f\u0435\u0440\u0435\u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434 \u0441\u0432\u043e\u0438 \u043d\u0443\u0436\u0434\u044b.&nbsp;<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"center\"><strong>\u0414\u0430\u043d\u043d\u044b\u0435<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>\u0426\u0435\u043b\u044c<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">public string getlhsbindingtype(final string var)<\/p>\n<p align=\"left\">&nbsp;{ if (this.lhs == null) { return null; } for (int i = 0; i &lt; this.lhs.length; i++) { string type = getlhsbindingtype(this.lhs[i], var); if (type != null) { return type; } } return null; }<\/p>\n<\/td>\n<td>\n<p align=\"left\">get the data-type associated with the binding<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u042f \u043d\u0435 \u0441\u0442\u0430\u043d\u0443 \u043e\u0447\u0438\u0449\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u044d\u0442\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e <a href=\"https:\/\/nathancooper.io\/i-am-a-nerd\/code\/summarization\/deep-learning\/seq2seq\/2020\/12\/26\/Improved_Code_Commenter.html\"><u>\u0437\u0434\u0435\u0441\u044c<\/u><\/a>. \u042f \u0436\u0435 \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0436\u0435 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043e\u0431\u044a\u0435\u043c\u0435 1 % \u043e\u0442 \u043e\u0431\u0449\u0435\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043e\u0431\u0440\u0430\u0437\u0446\u043e\u0432 \u0432 \u043d\u0430\u0431\u043e\u0440\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u041d\u043e, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c, \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u0434\u0430\u0436\u0435 \u043d\u0430 1 % \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435\u043f\u043b\u043e\u0445\u043e. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0430 \u0432\u0441\u0451\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u043e\u043b\u0443\u0447\u0448\u0435.<\/p>\n<h3>CodeBERT<\/h3>\n<p>\u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0432\u0437\u044f\u0442\u0430 \u0438\u0437 <a href=\"https:\/\/arxiv.org\/abs\/2002.08155\"><u>\u0441\u0442\u0430\u0442\u044c\u0438<\/u><\/a> \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f Microsoft. \u0412 \u044d\u0442\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u043d\u0430\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 CodeSearchNet, \u043d\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0434\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 RoBERTa \u0443\u0434\u043e\u0431\u043d\u043e\u043c\u0443 \u0434\u043b\u044f \u0432\u043e\u0441\u043f\u0440\u0438\u044f\u0442\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u043a\u043e\u0434\u0430 \u0438 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430 \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0432 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e\u0439, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438 \u0441\u0432\u043e\u044e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0437\u0430\u0434\u0430\u0447.&nbsp;<\/p>\n<h3>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a<\/h3>\n<pre><code class=\"python\">!pip install transformers !git clone -q https:\/\/github.com\/microsoft\/CodeXGLUE.git   import json from dataclasses import dataclass import numpy as np import pandas as pd from transformers import AutoTokenizer<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u044f \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e \u043f\u0443\u0442\u0438 \u0434\u043e \u0444\u0430\u0439\u043b\u043e\u0432 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438 \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u044e \u0438\u0445 \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<pre><code class=\"python\">PATH_TO_TRAIN_DATA = '\/content\/train.csv' PATH_TO_TEST_DATA = '\/content\/test.csv' PATH_TO_VALIDATION_DATA = '\/content\/validation.csv' #validation, test and train data_struct = { 'train' : pd.read_csv(PATH_TO_TRAIN_DATA), 'test' : pd.read_csv(PATH_TO_TEST_DATA), 'valid' : pd.read_csv(PATH_TO_VALIDATION_DATA) }<\/code><\/pre>\n<p>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e \u0434\u0432\u0435 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438: \u0442\u043e\u043a\u0435\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u0437\u0430\u043f\u0438\u0441\u0438 DataFrame \u0432 JSON-\u0444\u0430\u0439\u043b, \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u0442\u0430\u043a\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<pre><code class=\"python\">} def write_into_json_file(json_file_name: str, data: pd.DataFrame): ''' json_file_name - name output json file data - pandas data frame write your pandas data to json file ''' with open(json_file_name, 'w') as current_file: for index, current_row in data.iterrows(): current_file.write(json.dumps(current_row.to_dict()) + '\\n')   def split_data(split_column: str, new_column: str, data: pd.DataFrame)-&gt; pd.DataFrame: ''' split items in column data - your pandas data frame split_column - column in your pd.df ''' data[new_column] = data[split_column].apply(lambda current_item: current_item.split()) return data<\/code><\/pre>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0443\u044e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043f\u0440\u0435\u0434\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0432\u044b\u0448\u0435:<\/p>\n<pre><code class=\"python\">#preproc data for type_data, value in data_struct.items(): #split target colums code_tokens_step = split_data('code', 'code_tokens', value) docs_tokens_step = split_data('comment', 'docstring_tokens', code_tokens_step) data_struct[type_data] = docs_tokens_step #create json file write_into_json_file(f'\/content\/{type_data}.jsonl', data_struct[type_data])<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u043d\u0430 \u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e \u0432\u0441\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e:<\/p>\n<pre><code class=\"python\">@dataclass class ConfigurationModel: learning_rate : float  batch_size : int  beam : int test_file : str source_size : int target_size : int path_to_data_directory : str path_to_output_data_directory : str train_file : str dev_file : str count_epochs : int pretrained_model : str   configuration_codetext_model = ConfigurationModel( learning_rate = 5e-5, batch_size = 8, beam = 10, source_size = 256, target_size = 512, path_to_data_directory = '.', path_to_output_data_directory = 'model_for_java', train_file = '\/content\/train.jsonl', dev_file = '\/content\/valid.jsonl', test_file = '\/content\/test.jsonl', count_epochs = 10, pretrained_model = 'microsoft\/codebert-base', ) configuration_codetext_model <\/code><\/pre>\n<figure class=\"full-width\"><\/figure>\n<h3>\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0443\u0434\u043e\u0431\u043d\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044e. \u0421\u0434\u0435\u043b\u0430\u044e \u044d\u0442\u043e\u041e\u0431\u0443\u0447\u0443 \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0430 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0435\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0435. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e BLEU-4 (\u0447\u0435\u0442\u0432\u0451\u0440\u043a\u0430 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043b\u043e\u0432\u0435\u0441\u043d\u044b\u0445 n-gram = 4), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430 \u043e\u0442 0 \u0434\u043e 1, \u043d\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f BLEU-4 * 100%. \u042d\u0442\u0430 \u043c\u0435\u0442\u0440\u0438\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0437\u0430\u0434\u0430\u0447\u0430\u0445 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430, \u043d\u043e \u0438 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u0435\u043a\u0441\u0442\u0430 \u043e\u043d\u0430 \u0442\u0430\u043a\u0436\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442. \u0415\u0441\u043b\u0438 \u0431\u0440\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430, \u0442\u043e \u0434\u0430\u0436\u0435 \u0434\u043b\u044f \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 bleu = [0.6:0.7] \u2014 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u043c\u043e\u0436\u0435\u0442 \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0442\u0435\u043a\u0441\u0442 \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443. \u0422\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0432 \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442\u044c \u043f\u043e\u0447\u0442\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.&nbsp;<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443, \u0442\u043e, \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u043e\u043b\u0436\u043d\u0430 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442, \u0430 \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0435\u043a\u0441\u0442, \u0430 \u043e\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u043a \u043a\u043e\u0434\u0443. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0436\u0438\u0434\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 bleu \u043d\u0435 \u0441\u0442\u043e\u0438\u0442.&nbsp;<\/p>\n<pre><code class=\"python\">#run train model !python \/content\/CodeXGLUE\/Code-Text\/code-to-text\/code\/run.py \\ --do_train \\ --do_eval \\ --do_lower_case \\ --model_type roberta \\ --model_name_or_path {configuration_codetext_model.pretrained_model} \\ --train_filename {configuration_codetext_model.train_file} \\ --dev_filename {configuration_codetext_model.dev_file} \\ --output_dir {configuration_codetext_model.path_to_output_data_directory} \\ --max_source_length {configuration_codetext_model.source_size} \\ --max_target_length {configuration_codetext_model.target_size} \\ --beam_size {configuration_codetext_model.beam} \\ --train_batch_size {configuration_codetext_model.batch_size} \\ --eval_batch_size {configuration_codetext_model.batch_size} \\ --learning_rate {configuration_codetext_model.learning_rate} \\ --num_train_epochs {configuration_codetext_model.count_epochs}<\/code><\/pre>\n<figure class=\"\"><\/figure>\n<h3>\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0435\u0451 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0435:<\/p>\n<pre><code class=\"python\">binary_model_file = '\/content\/model_for_java\/checkpoint-best-bleu\/pytorch_model.bin' !python  \/content\/CodeXGLUE\/Code-Text\/code-to-text\/code\/run.py \\     --do_test \\     --model_type roberta \\     --model_name_or_path microsoft\/codebert-base \\     --load_model_path {binary_model_file} \\     --dev_filename {configuration_codetext_model.dev_file} \\     --test_filename {configuration_codetext_model.test_file} \\     --output_dir {configuration_codetext_model.path_to_output_data_directory} \\     --max_source_length {configuration_codetext_model.source_size} \\     --max_target_length {configuration_codetext_model.target_size} \\     --beam_size {configuration_codetext_model.beam} \\     --eval_batch_size {configuration_codetext_model.batch_size}<\/code><\/pre>\n<figure class=\"full-width\"><\/figure>\n<p>\u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, bleu-4 = 11, \u0438 \u044d\u0442\u043e \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438, \u0434\u0430\u0436\u0435 \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e bleu \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430 \u043e\u0442 0 \u0434\u043e 100.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u0447\u0438\u0442\u0430\u044e \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0435\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b:<\/p>\n<pre><code class=\"python\">path_to_gold = '\/content\/model_for_java\/test_1.gold' path_to_output = '\/content\/model_for_java\/test_1.output'<\/code><\/pre>\n<p>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0438\u0437 txt-\u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code class=\"python\">def read_result_txt_file(txt_file: str)-&gt; list: with open(txt_file) as file:return [' '.join(line.rstrip().replace('\\t', ' ').split(' ')[1:]) for line in file]<\/code><\/pre>\n<p>\u0418 \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0441\u0447\u0438\u0442\u0430\u044e \u0432\u0441\u0451 \u0432 DataFrame:<\/p>\n<pre><code class=\"python\">def read_result_txt_file(txt_file: str)-&gt; list: #true comments and predicted true_sent = read_result_txt_file(path_to_gold) pred_sent = read_result_txt_file(path_to_output) result_data_frame = pd.DataFrame( { 'code' : data_struct['test']['code'], 'true' : true_sent, 'pred' : pred_sent } )   result_data_frame.head(10)<\/code><\/pre>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412\u044b\u0432\u043e\u0434 10 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043a\u043e\u0434\u0430, \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u044c\u044e.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u0441\u0443\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0441\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u043f\u043e \u0448\u043a\u0430\u043b\u0435 \u043e\u0442 1 \u0434\u043e 5. <strong>Code<\/strong> \u2014 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434, <strong>true<\/strong> \u2014 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439, <strong>pred<\/strong> \u2014 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 1:<\/p>\n<blockquote>\n<p><strong>Code<\/strong>: public t includeas(final class template) { blacklist = false; string[] properties = getallbeanpropertynames(template, false); include(properties); return _this(); }<\/p>\n<p><strong>True<\/strong>: defines included property names as public properties of given template class. sets to black list mode.<\/p>\n<p><strong>Pred<\/strong>: create a new resource<\/p>\n<\/blockquote>\n<p>\u041e\u0446\u0435\u043d\u043a\u0430: 1 \u2014 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043e \u0447\u0451\u043c \u0438\u0434\u0451\u0442 \u0440\u0435\u0447\u044c.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 2:<\/p>\n<blockquote>\n<p><strong>Code<\/strong>: int setdirect(int v0, int v1, int v2, int v3, int v4) { return offset + v0*stride0 + v1*stride1 + v2*stride2 + v3*stride3 + v4*stride4; }<\/p>\n<p><strong>True<\/strong>: experimental : should be package private<\/p>\n<p><strong>Pred<\/strong>: sets the value for the specified point.<\/p>\n<\/blockquote>\n<p>\u041e\u0446\u0435\u043d\u043a\u0430: 4 \u2014 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043e\u0442\u0440\u0430\u0436\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e.&nbsp;<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 3:<\/p>\n<blockquote>\n<p><strong>Code<\/strong>: static private servicetype checkifdap4(string location) throws ioexception { \/\/ strip off any trailing dap4 prefix if (location.endswith(&#171;.dap&#187;)) location = location.substring(0, location.length() &#8212; &#171;.dap&#187;.length()); else if (location.endswith(&#171;.dmr&#187;)) location = location.substring(0, location.length() &#8212; &#171;.dmr&#187;.length()); else if (location.endswith(&#171;.dmr.xml&#187;)) location = location.substring(0, location.length() &#8212; &#171;.dmr.xml&#187;.length()); else if (location.endswith(&#171;.dsr&#187;)) location = location.substring(0, location.length() &#8212; &#171;.dsr&#187;.length()); try (httpmethod method = httpfactory.get(location + &#171;.dmr.xml&#187;)) { int status = method.execute(); if (status == 200) { header h = method.getresponseheader(&#171;content-type&#187;); if ((h != null) &amp;&amp; (h.getvalue() != null)) { string v = h.getvalue(); if (v.startswith(&#171;application\/vnd.opendap.org&#187;)) return servicetype.dap4; } } if (status == httpstatus.sc_unauthorized || <\/p>\n<\/blockquote>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-347933","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/347933","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=347933"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/347933\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=347933"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=347933"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=347933"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}