{"id":297920,"date":"2020-01-29T21:00:24","date_gmt":"2020-01-29T21:00:24","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=297920"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=297920","title":{"rendered":"\u041f\u0440\u043e\u0441\u0442\u043e\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e \u0434\u0438\u0441\u0442\u0438\u043b\u043b\u044f\u0446\u0438\u0438 BERT"},"content":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/avito\/blog\/485290\/\">\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442\u0435\u0441\u044c \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435\u043c, \u0442\u043e \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0441\u043b\u044b\u0448\u0430\u043b\u0438 \u043f\u0440\u043e BERT \u0438 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0435\u0440\u044b.<\/p>\n<p>  <\/p>\n<p>BERT \u2014 \u044d\u0442\u043e \u044f\u0437\u044b\u043a\u043e\u0432\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0442&nbsp;Google, \u043f\u043e\u043a\u0430\u0437\u0430\u0432\u0448\u0430\u044f state-of-the-art \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0441&nbsp;\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043e\u0442\u0440\u044b\u0432\u043e\u043c \u043d\u0430&nbsp;\u0446\u0435\u043b\u043e\u043c \u0440\u044f\u0434\u0435 \u0437\u0430\u0434\u0430\u0447. BERT, \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0435\u0440\u044b, \u0441\u0442\u0430\u043b\u0438 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043d\u043e\u0432\u044b\u043c \u0448\u0430\u0433\u043e\u043c \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 (NLP). \u0421\u0442\u0430\u0442\u044c\u044e \u043e&nbsp;\u043d\u0438\u0445 \u0438 \u00ab\u0442\u0443\u0440\u043d\u0438\u0440\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443\u00bb \u043f\u043e \u0440\u0430\u0437\u043d\u044b\u043c \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0430\u043c \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/paperswithcode.com\/paper\/bert-pre-training-of-deep-bidirectional\">\u043d\u0430&nbsp;\u0441\u0430\u0439\u0442\u0435 Papers With Code<\/a>. <\/p>\n<p>  <\/p>\n<p>\u0421&nbsp;BERT \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430: \u0435\u0451 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432&nbsp;\u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445. BERT-base \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 110\u041c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, BERT-large \u2014 340\u041c. \u0418\u0437-\u0437\u0430&nbsp;\u0442\u0430\u043a\u043e\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u044d\u0442\u0443 \u043c\u043e\u0434\u0435\u043b\u044c \u0441\u043b\u043e\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u043d\u0430&nbsp;\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0441&nbsp;\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u044b. \u041a&nbsp;\u0442\u043e\u043c\u0443 \u0436\u0435, \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441\u0430 \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u0443 \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0435\u043f\u0440\u0438\u0433\u043e\u0434\u043d\u043e\u0439 \u0442\u0430\u043c, \u0433\u0434\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u0430 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0438\u0441\u043a \u043f\u0443\u0442\u0435\u0439 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f BERT \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0433\u043e\u0440\u044f\u0447\u0435\u0439 \u0442\u0435\u043c\u043e\u0439.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u043c \u0432&nbsp;\u0410\u0432\u0438\u0442\u043e \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0440\u0435\u0448\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u042d\u0442\u043e \u0442\u0438\u043f\u0438\u0447\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0433\u043e \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0445\u043e\u0440\u043e\u0448\u043e \u0438\u0437\u0443\u0447\u0435\u043d\u0430. \u041d\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0435\u0441\u0442\u044c \u0441\u043e\u0431\u043b\u0430\u0437\u043d \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043d\u043e\u0432\u043e\u0435. \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0440\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u0438\u0437&nbsp;\u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c BERT \u0432&nbsp;\u043f\u043e\u0432\u0441\u0435\u0434\u043d\u0435\u0432\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447\u0430\u0445 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f. \u0412&nbsp;\u043d\u0435\u0439 \u044f \u043f\u043e\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441&nbsp;\u043f\u043e\u043c\u043e\u0449\u044c\u044e BERT, \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u043d\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043d\u0435 \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u044f \u043c\u043e\u0434\u0435\u043b\u044c.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/c_\/po\/z2\/c_poz2e3dkggx7ekt3gn_9wva3g.png\"><\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"knowledge-distillation-kak-metod-uskoreniya-neyronnyh-setey\">Knowledge distillation \u043a\u0430\u043a \u043c\u0435\u0442\u043e\u0434 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439<\/h2>\n<p>  <\/p>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f\/\u043e\u0431\u043b\u0435\u0433\u0447\u0435\u043d\u0438\u044f \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439. \u0421\u0430\u043c\u044b\u0439 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0439 \u0438\u0445 \u043e\u0431\u0437\u043e\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b, \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d <a href=\"https:\/\/blog.inten.to\/speeding-up-bert-5528e18bb4ea\">\u0432&nbsp;\u0431\u043b\u043e\u0433\u0435 Intento \u043d\u0430 \u041c\u0435\u0434\u0438\u0443\u043c\u0435<\/a>. <\/p>\n<p>  <\/p>\n<p>\u0421\u043f\u043e\u0441\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0433\u0440\u0443\u0431\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430 \u0442\u0440\u0438 \u0433\u0440\u0443\u043f\u043f\u044b:<\/p>\n<p>  <\/p>\n<ol>\n<li>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0441\u0435\u0442\u0438.<\/li>\n<li>\u0421\u0436\u0430\u0442\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 (quantization, pruning).<\/li>\n<li>Knowledge distillation.<\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0435\u0440\u0432\u044b\u0435 \u0434\u0432\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u044b, \u0442\u043e&nbsp;\u0442\u0440\u0435\u0442\u0438\u0439 \u043c\u0435\u043d\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d. \u0412\u043f\u0435\u0440\u0432\u044b\u0435 \u0438\u0434\u0435\u044e \u0434\u0438\u0441\u0442\u0438\u043b\u043b\u044f\u0446\u0438\u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b \u0420\u0438\u0447 \u041a\u0430\u0440\u0443\u0430\u043d\u0430 <a href=\"https:\/\/www.cs.cornell.edu\/~caruana\/compression.kdd06.pdf\">\u0432&nbsp;\u0441\u0442\u0430\u0442\u044c\u0435 \u201cModel Compression\u201d<\/a>. \u0415\u0451 \u0441\u0443\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0430: \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u043b\u0435\u0433\u043a\u043e\u0432\u0435\u0441\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0438\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438-\u0443\u0447\u0438\u0442\u0435\u043b\u044f \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u0430\u043d\u0441\u0430\u043c\u0431\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439. \u0412&nbsp;\u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u0447\u0438\u0442\u0435\u043b\u0435\u043c \u0431\u0443\u0434\u0435\u0442 BERT, \u0443\u0447\u0435\u043d\u0438\u043a\u043e\u043c \u2014 \u043b\u044e\u0431\u0430\u044f \u043b\u0435\u0433\u043a\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c.<\/p>\n<p>  <\/p>\n<h2 id=\"zadacha\">\u0417\u0430\u0434\u0430\u0447\u0430<\/h2>\n<p>  <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u0434\u0438\u0441\u0442\u0438\u043b\u043b\u044f\u0446\u0438\u044e \u043d\u0430&nbsp;\u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u0412\u043e\u0437\u044c\u043c\u0451\u043c \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0434\u0430\u0442\u0430\u0441\u0435\u0442 SST-2 \u0438\u0437&nbsp;\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0437\u0430\u0434\u0430\u0447, \u043d\u0430&nbsp;\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u044e\u0442 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u043b\u044f&nbsp;NLP.<\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u043e\u0442 \u0434\u0430\u0442\u0430\u0441\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u043e\u0431\u0437\u043e\u0440\u043e\u0432 \u0444\u0438\u043b\u044c\u043c\u043e\u0432 \u0441&nbsp;IMDb \u0441&nbsp;\u0440\u0430\u0437\u0431\u0438\u0432\u043a\u043e\u0439 \u043d\u0430&nbsp;\u044d\u043c\u043e\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u043a\u0440\u0430\u0441 \u2014 \u043f\u043e\u0437\u0438\u0442\u0438\u0432\u043d\u044b\u0439 \u0438\u043b\u0438 \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u044b\u0439. \u0412&nbsp;\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u043d\u0430 \u044d\u0442\u043e\u043c \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 accuracy.<\/p>\n<p>  <\/p>\n<h2 id=\"obuchenie-bert-based-modeli-ili-uchitelya\">\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 BERT-based \u043c\u043e\u0434\u0435\u043b\u0438 \u0438\u043b\u0438 \u00ab\u0443\u0447\u0438\u0442\u0435\u043b\u044f\u00bb<\/h2>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u00ab\u0431\u043e\u043b\u044c\u0448\u0443\u044e\u00bb BERT-based \u043c\u043e\u0434\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0430\u043d\u0435\u0442 \u0443\u0447\u0438\u0442\u0435\u043b\u0435\u043c. \u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u2014 \u0432\u0437\u044f\u0442\u044c \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0438 \u0438\u0437&nbsp;BERT \u0438 \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043f\u043e\u0432\u0435\u0440\u0445 \u043d\u0438\u0445, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u043e\u0434\u0438\u043d \u0441\u043b\u043e\u0439 \u0432&nbsp;\u0441\u0435\u0442\u044c.<\/p>\n<p>  <\/p>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f <a href=\"https:\/\/github.com\/huggingface\/transformers\">\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 tranformers<\/a> \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043b\u0435\u0433\u043a\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0442\u0430\u043c \u0435\u0441\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u043c\u043e\u0434\u0435\u043b\u0438 BertForSequenceClassification. \u041d\u0430&nbsp;\u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0441\u0430\u043c\u043e\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044e \u044d\u0442\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 <a href=\"https:\/\/towardsdatascience.com\/https-medium-com-chaturangarajapakshe-text-classification-with-transformer-models-d370944b50ca\">\u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043b\u0438 Towards Data Science<\/a>. <\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c BertForSequenceClassification. \u0412&nbsp;\u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 num_labels=2, \u0442\u0430\u043a \u043a\u0430\u043a \u0443&nbsp;\u043d\u0430\u0441 \u0431\u0438\u043d\u0430\u0440\u043d\u0430\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f. \u042d\u0442\u0443 \u043c\u043e\u0434\u0435\u043b\u044c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432&nbsp;\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u00ab\u0443\u0447\u0438\u0442\u0435\u043b\u044f\u00bb.<\/p>\n<p>  <\/p>\n<h2 id=\"obuchenie-uchenika\">\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u00ab\u0443\u0447\u0435\u043d\u0438\u043a\u0430\u00bb<\/h2>\n<p>  <\/p>\n<p>\u0412&nbsp;\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0443\u0447\u0435\u043d\u0438\u043a\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u043b\u044e\u0431\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443: \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u0443\u044e \u0441\u0435\u0442\u044c, \u043b\u0438\u043d\u0435\u0439\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c, \u0434\u0435\u0440\u0435\u0432\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0439. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u043b\u044f&nbsp;\u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043e\u0431\u0443\u0447\u0438\u0442\u044c BiLSTM. \u0414\u043b\u044f&nbsp;\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0431\u0443\u0447\u0438\u043c BiLSTM \u0431\u0435\u0437 BERT. <\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0430&nbsp;\u0432\u0445\u043e\u0434 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u0442\u0435\u043a\u0441\u0442, \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u0432&nbsp;\u0432\u0438\u0434\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u0430. \u041e\u0434\u0438\u043d \u0438\u0437&nbsp;\u0441\u0430\u043c\u044b\u0445 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u2014 \u044d\u0442\u043e \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0441\u043b\u043e\u0432\u0443 \u0435\u0433\u043e \u0438\u043d\u0434\u0435\u043a\u0441 \u0432&nbsp;\u0441\u043b\u043e\u0432\u0430\u0440\u0435. \u0421\u043b\u043e\u0432\u0430\u0440\u044c \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u0442\u044c \u0438\u0437&nbsp;\u0442\u043e\u043f-n \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0441\u043b\u043e\u0432 \u0432&nbsp;\u043d\u0430\u0448\u0435\u043c \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0435 \u043f\u043b\u044e\u0441 \u0434\u0432\u0430 \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0445 \u0441\u043b\u043e\u0432\u0430: \u201cpad\u201d \u2014 \u00ab\u0441\u043b\u043e\u0432\u043e-\u043f\u0443\u0441\u0442\u044b\u0448\u043a\u0430\u00bb, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0431\u044b\u043b\u0438 \u043e\u0434\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b, \u0438 \u201cunk\u201d \u2014 \u0434\u043b\u044f&nbsp;\u0441\u043b\u043e\u0432 \u0437\u0430&nbsp;\u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u0440\u044f. \u041f\u043e\u0441\u0442\u0440\u043e\u0438\u043c \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0441&nbsp;\u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438\u0437&nbsp;torchtext. \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u044f \u043d\u0435&nbsp;\u0441\u0442\u0430\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u043e\u0431\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0438 \u0441\u043b\u043e\u0432.<br \/>  &nbsp;<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">import torch from torchtext import data  def get_vocab(X):     X_split = [t.split() for t in X]     text_field = data.Field()     text_field.build_vocab(X_split, max_size=10000)     return text_field  def pad(seq, max_len):     if len(seq) &lt; max_len:         seq = seq + ['&lt;pad&gt;'] * (max_len - len(seq))     return seq[0:max_len]  def to_indexes(vocab, words):     return [vocab.stoi[w] for w in words]  def to_dataset(x, y, y_real):     torch_x = torch.tensor(x, dtype=torch.long)     torch_y = torch.tensor(y, dtype=torch.float)     torch_real_y = torch.tensor(y_real, dtype=torch.long)     return TensorDataset(torch_x, torch_y, torch_real_y)<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"model-bilstm\">\u041c\u043e\u0434\u0435\u043b\u044c BiLSTM<\/h3>\n<p>  <\/p>\n<p>\u041a\u043e\u0434 \u0434\u043b\u044f&nbsp;\u043c\u043e\u0434\u0435\u043b\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">import torch from torch import nn from torch.autograd import Variable  class SimpleLSTM(nn.Module):      def __init__(self, input_dim, embedding_dim, hidden_dim, output_dim, n_layers,                  bidirectional, dropout, batch_size, device=None):         super(SimpleLSTM, self).__init__()         self.batch_size = batch_size         self.hidden_dim = hidden_dim         self.n_layers = n_layers         self.embedding = nn.Embedding(input_dim, embedding_dim)          self.rnn = nn.LSTM(embedding_dim,                            hidden_dim,                            num_layers=n_layers,                            bidirectional=bidirectional,                            dropout=dropout)          self.fc = nn.Linear(hidden_dim * 2, output_dim)         self.dropout = nn.Dropout(dropout)         self.device = self.init_device(device)         self.hidden = self.init_hidden()      @staticmethod     def init_device(device):         if device is None:             return torch.device('cuda')         return device      def init_hidden(self):         return (Variable(torch.zeros(2 * self.n_layers, self.batch_size, self.hidden_dim).to(self.device)),                 Variable(torch.zeros(2 * self.n_layers, self.batch_size, self.hidden_dim).to(self.device)))      def forward(self, text, text_lengths=None):         self.hidden = self.init_hidden()         x = self.embedding(text)         x, self.hidden = self.rnn(x, self.hidden)         hidden, cell = self.hidden         hidden = self.dropout(torch.cat((hidden[-2, :, :], hidden[-1, :, :]), dim=1))         x = self.fc(hidden)          return x<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"obuchenie\">\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>  <\/p>\n<p>\u0414\u043b\u044f&nbsp;\u044d\u0442\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 (batch_size, output_dim). \u041f\u0440\u0438&nbsp;\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044b\u0447\u043d\u044b\u0439 logloss. \u0412&nbsp;PyTorch \u0435\u0441\u0442\u044c \u043a\u043b\u0430\u0441\u0441 BCEWithLogitsLoss, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u0443\u0435\u0442 \u0441\u0438\u0433\u043c\u043e\u0438\u0434\u0443 \u0438 \u043a\u0440\u043e\u0441\u0441-\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044e. \u0422\u043e, \u0447\u0442\u043e \u043d\u0430\u0434\u043e.<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">def loss(self, output, bert_prob, real_label):     criterion = torch.nn.BCEWithLogitsLoss()     return criterion(output, real_label.float())<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u043e\u0434 \u0434\u043b\u044f&nbsp;\u043e\u0434\u043d\u043e\u0439 \u044d\u043f\u043e\u0445\u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">def get_optimizer(model):     optimizer = torch.optim.Adam(model.parameters())     scheduler = torch.optim.lr_scheduler.StepLR(optimizer, 2, gamma=0.9)     return optimizer, scheduler  def epoch_train_func(model, dataset, loss_func, batch_size):     train_loss = 0     train_sampler = RandomSampler(dataset)     data_loader = DataLoader(dataset, sampler=train_sampler,                              batch_size=batch_size,                              drop_last=True)     model.train()     optimizer, scheduler = get_optimizer(model)     for i, (text, bert_prob, real_label) in enumerate(tqdm(data_loader, desc='Train')):         text, bert_prob, real_label = to_device(text, bert_prob, real_label)         model.zero_grad()         output = model(text.t(), None).squeeze(1)         loss = loss_func(output, bert_prob, real_label)         loss.backward()         optimizer.step()         train_loss += loss.item()     scheduler.step()     return train_loss \/ len(data_loader)<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u043e\u0434 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u043e\u0441\u043b\u0435 \u044d\u043f\u043e\u0445\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">def epoch_evaluate_func(model, eval_dataset, loss_func, batch_size):     eval_sampler = SequentialSampler(eval_dataset)     data_loader = DataLoader(eval_dataset, sampler=eval_sampler,                              batch_size=batch_size,                              drop_last=True)      eval_loss = 0.0     model.eval()     for i, (text, bert_prob, real_label) in enumerate(tqdm(data_loader, desc='Val')):         text, bert_prob, real_label = to_device(text, bert_prob, real_label)         output = model(text.t(), None).squeeze(1)         loss = loss_func(output, bert_prob, real_label)         eval_loss += loss.item()      return eval_loss \/ len(data_loader)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u0432\u0441\u0451 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432\u043e\u0435\u0434\u0438\u043d\u043e, \u0442\u043e&nbsp;\u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f&nbsp;\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">import os import torch from torch.utils.data import (TensorDataset, random_split,                               RandomSampler, DataLoader,                               SequentialSampler) from torchtext import data from tqdm import tqdm  def device():     return torch.device(&quot;cuda&quot; if torch.cuda.is_available() else &quot;cpu&quot;)  def to_device(text, bert_prob, real_label):     text = text.to(device())     bert_prob = bert_prob.to(device())     real_label = real_label.to(device())     return text, bert_prob, real_label  class LSTMBaseline(object):     vocab_name = 'text_vocab.pt'     weights_name = 'simple_lstm.pt'      def __init__(self, settings):         self.settings = settings         self.criterion = torch.nn.BCEWithLogitsLoss().to(device())      def loss(self, output, bert_prob, real_label):         return self.criterion(output, real_label.float())      def model(self, text_field):         model = SimpleLSTM(             input_dim=len(text_field.vocab),             embedding_dim=64,             hidden_dim=128,             output_dim=1,             n_layers=1,             bidirectional=True,             dropout=0.5,             batch_size=self.settings['train_batch_size'])         return model      def train(self, X, y, y_real, output_dir):         max_len = self.settings['max_seq_length']         text_field = get_vocab(X)          X_split = [t.split() for t in X]         X_pad = [pad(s, max_len) for s in tqdm(X_split, desc='pad')]         X_index = [to_indexes(text_field.vocab, s) for s in tqdm(X_pad, desc='to index')]          dataset = to_dataset(X_index, y, y_real)         val_len = int(len(dataset) * 0.1)         train_dataset, val_dataset = random_split(dataset, (len(dataset) - val_len, val_len))          model = self.model(text_field)         model.to(device())          self.full_train(model, train_dataset, val_dataset, output_dir)         torch.save(text_field, os.path.join(output_dir, self.vocab_name))      def full_train(self, model, train_dataset, val_dataset, output_dir):         train_settings = self.settings         num_train_epochs = train_settings['num_train_epochs']         best_eval_loss = 100000         for epoch in range(num_train_epochs):             train_loss = epoch_train_func(model, train_dataset, self.loss, self.settings['train_batch_size'])             eval_loss = epoch_evaluate_func(model, val_dataset, self.loss, self.settings['eval_batch_size'])              if eval_loss &lt; best_eval_loss:                 best_eval_loss = eval_loss                 torch.save(model.state_dict(), os.path.join(output_dir, self.weights_name))<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"distillyaciya\">\u0414\u0438\u0441\u0442\u0438\u043b\u043b\u044f\u0446\u0438\u044f<\/h3>\n<p>  <\/p>\n<p>\u0418\u0434\u0435\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0434\u0438\u0441\u0442\u0438\u043b\u043b\u044f\u0446\u0438\u0438 \u0432\u0437\u044f\u0442\u0430 <a href=\"https:\/\/arxiv.org\/abs\/1903.12136\">\u0438\u0437&nbsp;\u0441\u0442\u0430\u0442\u044c\u0438 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438\u0437 \u0423\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442\u0430 \u0412\u0430\u0442\u0435\u0440\u043b\u043e\u043e<\/a>. \u041a\u0430\u043a \u044f \u0433\u043e\u0432\u043e\u0440\u0438\u043b \u0432\u044b\u0448\u0435, \u00ab\u0443\u0447\u0435\u043d\u0438\u043a\u00bb \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0438\u043c\u0438\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u00ab\u0443\u0447\u0438\u0442\u0435\u043b\u044f\u00bb. \u0427\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c? \u0412&nbsp;\u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438-\u0443\u0447\u0438\u0442\u0435\u043b\u044f \u043d\u0430&nbsp;\u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0435\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0435. \u041f\u0440\u0438\u0447\u0451\u043c \u043a\u043b\u044e\u0447\u0435\u0432\u0430\u044f \u0438\u0434\u0435\u044f \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0445\u043e\u0434 \u0441\u0435\u0442\u0438 \u0434\u043e&nbsp;\u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0442\u0430\u043a \u043c\u043e\u0434\u0435\u043b\u044c \u0441\u043c\u043e\u0436\u0435\u0442 \u043b\u0443\u0447\u0448\u0435 \u0432\u044b\u0443\u0447\u0438\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435, \u0447\u0435\u043c \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441&nbsp;\u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044f\u043c\u0438. <\/p>\n<p>  <\/p>\n<p>\u0412&nbsp;\u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0432&nbsp;\u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u043e\u0442\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u0437\u0430&nbsp;\u043e\u0448\u0438\u0431\u043a\u0443 \u00ab\u043f\u043e\u0434\u0440\u0430\u0436\u0430\u043d\u0438\u044f\u00bb \u2014 MSE \u043c\u0435\u0436\u0434\u0443 \u043b\u043e\u0433\u0438\u0442\u0430\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/hx\/_d\/w9\/hx_dw9ypkcwc_fhgui_jcappoo4.png\"><\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0434\u0432\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f: \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u044b\u0445\u043e\u0434\u043e\u0432 \u0441\u0435\u0442\u0438 \u0441&nbsp;1 \u0434\u043e&nbsp;2 \u0438 \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u043e\u0442\u0435\u0440\u044c.<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">def loss(self, output, bert_prob, real_label):     a = 0.5     criterion_mse = torch.nn.MSELoss()     criterion_ce = torch.nn.CrossEntropyLoss()     return a*criterion_ce(output, real_label) + (1-a)*criterion_mse(output, bert_prob)<\/code><\/pre>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0441\u044c \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438, \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0432 \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0434\u0435\u043b\u044c \u0438 loss: <\/p>\n<p>  <\/p>\n<pre><code class=\"python\"> class LSTMDistilled(LSTMBaseline):     vocab_name = 'distil_text_vocab.pt'     weights_name = 'distil_lstm.pt'      def __init__(self, settings):         super(LSTMDistilled, self).__init__(settings)         self.criterion_mse = torch.nn.MSELoss()         self.criterion_ce = torch.nn.CrossEntropyLoss()         self.a = 0.5      def loss(self, output, bert_prob, real_label):         return self.a * self.criterion_ce(output, real_label) + (1 - self.a) * self.criterion_mse(output, bert_prob)      def model(self, text_field):         model = SimpleLSTM(             input_dim=len(text_field.vocab),             embedding_dim=64,             hidden_dim=128,             output_dim=2,             n_layers=1,             bidirectional=True,             dropout=0.5,             batch_size=self.settings['train_batch_size'])         return model<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u0438 \u0432\u0441\u0451, \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0443\u0447\u0438\u0442\u0441\u044f \u00ab\u043f\u043e\u0434\u0440\u0430\u0436\u0430\u0442\u044c\u00bb. <\/p>\n<p>  <\/p>\n<h3 id=\"sravnenie-modeley\">\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439<\/h3>\n<p>  <\/p>\n<p>\u0412&nbsp;\u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043d\u0430&nbsp;SST-2 \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0438&nbsp;a=0, \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0443\u0447\u0438\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434\u0440\u0430\u0436\u0430\u0442\u044c, \u043d\u0435&nbsp;\u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u043b\u0435\u0439\u0431\u043b\u044b. Accuracy \u0432\u0441\u0451 \u0435\u0449\u0451 \u043c\u0435\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u0443&nbsp;BERT, \u043d\u043e \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043b\u0443\u0447\u0448\u0435 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 BiLSTM.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/0m\/y6\/g7\/0my6g7eahypj6eq3o52arxxldxq.png\"><\/p>\n<p>  <\/p>\n<p>\u042f \u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0438\u0437&nbsp;\u0441\u0442\u0430\u0442\u044c\u0438, \u043d\u043e \u0432&nbsp;\u043c\u043e\u0438\u0445 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u0445 \u043b\u0443\u0447\u0448\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u043b\u0441\u044f \u043f\u0440\u0438&nbsp;a=0,5.<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0433\u0440\u0430\u0444\u0438\u043a\u0438 loss \u0438 accuracy \u043f\u0440\u0438&nbsp;\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438 LSTM \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c. \u0421\u0443\u0434\u044f \u043f\u043e&nbsp;\u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e loss, \u043c\u043e\u0434\u0435\u043b\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u043e\u0431\u0443\u0447\u0438\u043b\u0430\u0441\u044c, \u0430&nbsp;\u0433\u0434\u0435-\u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u0448\u0435\u0441\u0442\u043e\u0439 \u044d\u043f\u043e\u0445\u0438 \u043f\u043e\u0448\u043b\u043e \u043f\u0435\u0440\u0435\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435. <\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/lk\/bg\/rn\/lkbgrnank6obtu7pewsoalba9yk.png\"><\/p>\n<p>  <\/p>\n<p>\u0413\u0440\u0430\u0444\u0438\u043a\u0438 \u043f\u0440\u0438&nbsp;\u0434\u0438\u0441\u0442\u0438\u043b\u043b\u044f\u0446\u0438\u0438:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/gl\/u5\/7g\/glu57giappdlhkc31wlpdulsdkc.png\"><\/p>\n<p>  <\/p>\n<p>\u0414\u0438\u0441\u0442\u0438\u043b\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f BiLSTM \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e \u043b\u0443\u0447\u0448\u0435 \u043e\u0431\u044b\u0447\u043d\u043e\u0439. \u0412\u0430\u0436\u043d\u043e, \u0447\u0442\u043e \u043f\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u043e\u043d\u0438 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b, \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u043f\u043e\u0441\u043e\u0431\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f. \u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f <a href=\"https:\/\/github.com\/pvgladkov\/knowledge-distillation\/tree\/master\/experiments\/sst2\">\u044f \u0432\u044b\u043b\u043e\u0436\u0438\u043b \u043d\u0430 \u0413\u0438\u0442\u0425\u0430\u0431<\/a>.<\/p>\n<p>  <\/p>\n<h2 id=\"zaklyuchenie\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u0412&nbsp;\u044d\u0442\u043e\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435 \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u0443\u044e \u0438\u0434\u0435\u044e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0434\u0438\u0441\u0442\u0438\u043b\u043b\u044f\u0446\u0438\u0438. \u041a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0443\u0447\u0435\u043d\u0438\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442&nbsp;\u0440\u0435\u0448\u0430\u0435\u043c\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438. \u041d\u043e \u0432&nbsp;\u0446\u0435\u043b\u043e\u043c \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u0432&nbsp;\u043b\u044e\u0431\u043e\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435. \u0417\u0430&nbsp;\u0441\u0447\u0451\u0442 \u0443\u0441\u043b\u043e\u0436\u043d\u0435\u043d\u0438\u044f \u043d\u0430&nbsp;\u044d\u0442\u0430\u043f\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0438\u0440\u043e\u0441\u0442 \u0435\u0451&nbsp;\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0432 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0443 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b.<\/p>\n<\/div>\n<p> \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\/company\/avito\/blog\/485290\/\"> https:\/\/habr.com\/ru\/company\/avito\/blog\/485290\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/avito\/blog\/485290\/\">\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442\u0435\u0441\u044c \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435\u043c, \u0442\u043e \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0441\u043b\u044b\u0448\u0430\u043b\u0438 \u043f\u0440\u043e BERT \u0438 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0435\u0440\u044b.<\/p>\n<p>  <\/p>\n<p>BERT \u2014 \u044d\u0442\u043e \u044f\u0437\u044b\u043a\u043e\u0432\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0442&nbsp;Google, \u043f\u043e\u043a\u0430\u0437\u0430\u0432\u0448\u0430\u044f state-of-the-art \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0441&nbsp;\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043e\u0442\u0440\u044b\u0432\u043e\u043c \u043d\u0430&nbsp;\u0446\u0435\u043b\u043e\u043c \u0440\u044f\u0434\u0435 \u0437\u0430\u0434\u0430\u0447. BERT, \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0435\u0440\u044b, \u0441\u0442\u0430\u043b\u0438 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043d\u043e\u0432\u044b\u043c \u0448\u0430\u0433\u043e\u043c \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 (NLP). \u0421\u0442\u0430\u0442\u044c\u044e \u043e&nbsp;\u043d\u0438\u0445 \u0438 \u00ab\u0442\u0443\u0440\u043d\u0438\u0440\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443\u00bb \u043f\u043e \u0440\u0430\u0437\u043d\u044b\u043c \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0430\u043c \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/paperswithcode.com\/paper\/bert-pre-training-of-deep-bidirectional\">\u043d\u0430&nbsp;\u0441\u0430\u0439\u0442\u0435 Papers With Code<\/a>. <\/p>\n<p>  <\/p>\n<p>\u0421&nbsp;BERT \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430: \u0435\u0451 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432&nbsp;\u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445. BERT-base \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 110\u041c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, BERT-large \u2014 340\u041c. \u0418\u0437-\u0437\u0430&nbsp;\u0442\u0430\u043a\u043e\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u044d\u0442\u0443 \u043c\u043e\u0434\u0435\u043b\u044c \u0441\u043b\u043e\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u043d\u0430&nbsp;\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0441&nbsp;\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u044b. \u041a&nbsp;\u0442\u043e\u043c\u0443 \u0436\u0435, \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441\u0430 \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u0443 \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0435\u043f\u0440\u0438\u0433\u043e\u0434\u043d\u043e\u0439 \u0442\u0430\u043c, \u0433\u0434\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u0430 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0438\u0441\u043a \u043f\u0443\u0442\u0435\u0439 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f BERT \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0433\u043e\u0440\u044f\u0447\u0435\u0439 \u0442\u0435\u043c\u043e\u0439.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u043c \u0432&nbsp;\u0410\u0432\u0438\u0442\u043e \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0440\u0435\u0448\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u042d\u0442\u043e \u0442\u0438\u043f\u0438\u0447\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0433\u043e \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0445\u043e\u0440\u043e\u0448\u043e \u0438\u0437\u0443\u0447\u0435\u043d\u0430. \u041d\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0435\u0441\u0442\u044c \u0441\u043e\u0431\u043b\u0430\u0437\u043d \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043d\u043e\u0432\u043e\u0435. \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0440\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u0438\u0437&nbsp;\u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c BERT \u0432&nbsp;\u043f\u043e\u0432\u0441\u0435\u0434\u043d\u0435\u0432\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447\u0430\u0445 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f. \u0412&nbsp;\u043d\u0435\u0439 \u044f \u043f\u043e\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441&nbsp;\u043f\u043e\u043c\u043e\u0449\u044c\u044e BERT, \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u043d\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043d\u0435 \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u044f \u043c\u043e\u0434\u0435\u043b\u044c.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/c_\/po\/z2\/c_poz2e3dkggx7ekt3gn_9wva3g.png\"><\/p>\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-297920","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/297920","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=297920"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/297920\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=297920"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=297920"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=297920"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}