{"id":395980,"date":"2024-06-29T12:33:34","date_gmt":"2024-06-29T12:33:34","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=395980"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=395980","title":{"rendered":"<span>\u041a\u0430\u043a \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0430 \u0447\u0430\u0442-\u0431\u043e\u0442 \u0434\u043b\u044f \u0442\u0435\u043b\u0435\u0433\u0438 \u043d\u0430 \u043f\u0438\u0442\u043e\u043d\u0435 \u0438 \u0437\u0430\u0434\u0435\u043f\u043b\u043e\u0438\u043b\u0430 \u0435\u0433\u043e \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443 \u0437\u0430 \u043e\u0434\u0438\u043d \u0434\u0435\u043d\u044c<\/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<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u041a\u0430\u0442\u044f \u0438 \u044f backend \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a. \u041f\u0438\u0448\u0443 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043d\u0430 java, \u0438\u043d\u043e\u0433\u0434\u0430 \u043d\u0430 kotlin. \u0412 \u043e\u0434\u0438\u043d \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u0434\u0435\u043d\u044c \u043c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u0430 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 \u043c\u044b\u0441\u043b\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0430\u0442-\u0431\u043e\u0442\u0430 \u0434\u043b\u044f \u0442\u0435\u043b\u0435\u0433\u0438. \u0412 \u0441\u0438\u043b\u0443 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0438 \u0441\u0432\u043e\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f spring boot \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 java, \u043f\u043e\u0442\u043e\u043c \u043c\u0435\u043d\u044f \u043f\u043e\u043d\u0435\u0441\u043b\u043e \u0432 \u043f\u0440\u0438\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u0411\u0414, \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u0442\u0435\u043a\u043b\u043e \u0432 \u0442\u0435\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043a\u0430\u043a \u0442\u0430\u043a\u043e\u0432\u043e\u0433\u043e \u0438 \u0434\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u0440\u0435\u0441\u0442\u043e\u0432 \u0431\u043e\u0442\u043e\u043c \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u043c \u043d\u0435 \u0434\u043e\u0448\u043b\u043e ?.<\/p>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u044f \u043f\u043e\u0434\u0443\u043c\u0430\u043b\u0430: \u0430 \u043f\u043e\u0447\u0435\u043c\u0443 java, \u0434\u0430\u0432\u0430\u0439 \u0432\u043e\u0437\u044c\u043c\u0435\u043c python. \u0423 \u043c\u0435\u043d\u044f \u0431\u044b\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u043f\u044b\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043d\u0430 \u044d\u0442\u043e\u043c \u044f\u0437\u044b\u043a\u0435 &#8212; \u0438 \u044f \u0440\u0435\u0448\u0438\u043b\u0430\u0441\u044c &#8212; \u043d\u0430\u0447\u043d\u0443 \u0441\u043d\u043e\u0432\u0430 \u0441 &#171;\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435, \u043c\u0438\u0440!&#187; \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0440\u0430\u0437\u0443 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0447\u0430\u0442-\u0431\u043e\u0442 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u043c. \u041d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0440\u0430\u0445 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430 \u043d\u0430\u0448\u043b\u0430 \u043a\u0440\u0443\u0442\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0441 \u0437\u0432\u0443\u0447\u043d\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c <a href=\"https:\/\/github.com\/natasha\/natasha\" rel=\"noopener noreferrer nofollow\">natasha<\/a>. \u0418\u0434\u0435\u044f \u0431\u043e\u0442\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f: \u0432\u044b \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0435 \u0441\u0432\u043e\u0439 \u0447\u0430\u0442\u0438\u043a \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u043d\u044b\u043d\u0435 \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440\u0430 \u0438 \u044d\u0442\u043e\u0442 <code>.txt<\/code> \u0444\u0430\u0439\u043b \u043e\u0442\u0434\u0430\u0435\u0442\u0435 \u0431\u043e\u0442\u0443. \u041e\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0422\u041e\u041f 10 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438 \u0433\u043b\u0430\u0433\u043e\u043b\u043e\u0432 \u0438\u0437 \u0432\u0430\u0448\u0435\u0433\u043e \u0447\u0430\u0442\u0430 ?. \u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u043f\u043e \u0448\u0430\u0433\u0430\u043c.<\/p>\n<h2>\u041e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c<\/h2>\n<ol>\n<li>\n<p>\u041d\u0430\u0439\u0442\u0438 \u0432 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f <a href=\"https:\/\/t.me\/BotFather\" rel=\"noopener noreferrer nofollow\">https:\/\/t.me\/BotFather<\/a> &#8212; \u043e\u043d \u0431\u043e\u0433 \u0432\u0441\u0435\u0445 \u0431\u043e\u0442\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0435\u043c\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>\/newbot<\/code> \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u0431\u043e\u0442\u0430. \u041d\u0430\u0437\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0435\u0433\u043e \u0431\u043e\u0442\u0430 \u0438 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u043e\u043d\u0446\u043e\u0432\u043a\u0430 \u0438\u043c\u0435\u043d\u0438 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c Bot. \u0418\u043c\u044f \u043c\u043e\u0435\u0433\u043e &#8212; <code>analyzeYourChatBot<\/code><\/p>\n<\/li>\n<li>\n<p>\u0412 \u043e\u0442\u0432\u0435\u0442\u043d\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u043e\u0442\u0435\u0446 \u0431\u043e\u0442\u043e\u0432 \u0432\u044b\u0448\u043b\u0435\u0442 \u0432\u0430\u043c \u0442\u043e\u043a\u0435\u043d \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a API.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0430\u043a \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u0437\u0430\u0434\u0430\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0432\u0430\u0448\u0435\u043c\u0443 \u0431\u043e\u0442\u0443 \u043f\u0443\u0442\u0435\u043c \u0432\u044b\u0437\u043e\u0432\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>\/setdescription<\/code> \u0430 \u0442\u0430\u043a \u0436\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0430\u0432\u0430\u0442\u0430\u0440 <code>\/setuserpic<\/code><\/p>\n<\/li>\n<\/ol>\n<h2>\u0424\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0431\u043e\u0442\u0430<\/h2>\n<p>\u0412\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u0438\u0434\u0435\u0435 \u0431\u043e\u0442\u0430: \u0432\u0437\u044f\u0442\u044c <code>.txt<\/code>-\u0444\u0430\u0439\u043b, \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435, \u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u043e\u0442 \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0445 \u0448\u0442\u0443\u043a, \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u043d\u0430 \u0441\u043b\u043e\u0432\u0430, \u043f\u043e\u043d\u044f\u0442\u044c \u0447\u0442\u043e \u0438\u0437 \u043d\u0438\u0445 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435, \u0430 \u0447\u0442\u043e \u0433\u043b\u0430\u0433\u043e\u043b\u044b, \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u0430\u0436\u0434\u044b\u0445 \u0438 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0422\u041e\u041f 10.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 &#8212; \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>analyze<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043c\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0444\u0430\u0439\u043b\u0430. \u0414\u0430\u043b\u0435\u0435 \u043f\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e: <br \/><code>46<\/code> &#8212; \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043c \u0432\u0441\u0435 \u0441\u043b\u043e\u0432\u0430 \u0432 \u043d\u0438\u0436\u043d\u0438\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440<br \/><code>47<\/code> &#8212; \u0438\u0437\u0431\u0430\u0432\u0438\u043c\u0441\u044f \u043e\u0442 \u0442\u0435\u043a\u0441\u0442\u0430 \u0441 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u043c \u0434\u0430\u0442\u044b \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0435\u043b\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432\u0438\u0434\u0430 <code>[16.09.2021, 17:10:20] Katerina: \u0410 \u0447\u0442\u043e \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u0435\u0433\u043e\u0434\u043d\u044f?<\/code> \u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0430 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u0432 \u0443\u0434\u043e\u0431\u043d\u043e\u043c \u043e\u043d\u043b\u0430\u0439\u043d-\u0441\u0435\u0440\u0432\u0438\u0441\u0435 <a href=\"https:\/\/regex101.com\/\" rel=\"noopener noreferrer nofollow\">regex101<\/a><br \/><code>48<\/code> &#8212; \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0432 \u0442\u0435\u043a\u0441\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0443\u0441\u0441\u043a\u0438\u0435 \u0441\u043b\u043e\u0432\u0430 \u0438 \u043f\u0440\u043e\u0431\u0435\u043b\u044b<br \/><code>49<\/code> &#8212; \u0441\u0445\u043b\u043e\u043f\u043d\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0431\u0435\u043b\u043e\u0432 \u043e\u0434\u0438\u043d<br \/><code>51-61<\/code> &#8212; \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442 \u043a\u043e\u0434\u0430 \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <a href=\"https:\/\/github.com\/natasha\/natasha\" rel=\"noopener noreferrer nofollow\">natasha<\/a>. \u0415\u0441\u043b\u0438 \u043e\u0447\u0435\u043d\u044c \u0432\u043a\u0440\u0430\u0442\u0446\u0435, \u0442\u043e \u043c\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043b\u0438 \u0442\u0435\u043a\u0441\u0442 \u043d\u0430 \u0441\u043b\u043e\u0432\u0430 \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438 \u043a\u0430\u043a\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435, \u0430 \u043a\u0430\u043a\u043e\u0435 &#8212; \u0433\u043b\u0430\u0433\u043e\u043b.<br \/>\u0414\u0430\u043b\u0435\u0435 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0438 \u0433\u043b\u0430\u0433\u043e\u043b\u0430\u043c\u0438, \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f, \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0438 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0422\u041e\u041f 10.<\/p>\n<pre><code class=\"python\"> #!\/usr\/bin\/env python3  import re from string import whitespace from collections import defaultdict from natasha import (     Segmenter,     MorphVocab,     NewsEmbedding,     NewsMorphTagger,     NewsSyntaxParser,     Doc )  CYRILLIC_LETTERS = u\"\u0430\u0431\u0432\u0433\u0434\u0435\u0451\u0436\u0437\u0438\u0439\u043a\u043b\u043c\u043d\u043e\u043f\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044a\u044b\u044c\u044d\u044e\u044f\" TOP_COUNT = 10  def strip(text):     allowed_chars = CYRILLIC_LETTERS + whitespace     return \"\".join([c for c in text if c in allowed_chars])  def sort(data): result_dict = defaultdict(int) for key in data: result_dict[key]+=1 return sorted(result_dict.items(), key=lambda kv: kv[1], reverse=True)  def make_str(data): result = \"\" top_data = data[:TOP_COUNT] for key, value in top_data: result += key result += \": \" result += str(value) result += \"\\n\" return result  def find(data, type): result = [] for item in data: if (item.pos == type): result.append(item) return result  def analyze(data): text = data.lower() text = re.sub(r'\\[\\d{2}\\.\\d{2}\\.\\d{4}\\, \\d{2}:\\d{2}:\\d{2}\\] .+?:', '', text, flags=re.MULTILINE) text = strip(text) text = re.sub(' +', ' ', text)  segmenter = Segmenter() morph_vocab = MorphVocab() emb = NewsEmbedding() morph_tagger = NewsMorphTagger(emb)  doc = Doc(text) doc.segment(segmenter) doc.tag_morph(morph_tagger)  for token in doc.tokens: token.lemmatize(morph_vocab)  nouns_dict = find(doc.tokens, 'NOUN') verbs_dict = find(doc.tokens, 'VERB')  nouns_lemmas = [_.lemma for _ in nouns_dict] verbs_lemmas = [_.lemma for _ in verbs_dict]  sorted_nouns_dict = sort(nouns_lemmas) sorted_verbs_dict = sort(verbs_lemmas)  res_nouns = make_str(sorted_nouns_dict) res_verbs = make_str(sorted_verbs_dict)  result = \"\u0422\u041e\u041f \" + str(TOP_COUNT) + \" \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0432 \u0432\u0430\u0448\u0435\u043c \u0447\u0430\u0442\u0435:\\n\" result += res_nouns result += \"\\n\" result += \"\u0422\u041e\u041f \" + str(TOP_COUNT) + \" \u0433\u043b\u0430\u0433\u043e\u043b\u043e\u0432 \u0432 \u0432\u0430\u0448\u0435\u043c \u0447\u0430\u0442\u0435:\\n\" result += res_verbs return result <\/code><\/pre>\n<h2>\u0412\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u0431\u043e\u0442\u0430<\/h2>\n<p>\u0412 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0430\u043f\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0431\u0440\u0430\u043d\u044b \u043c\u0435\u0442\u043e\u0434\u044b-\u0445\u0435\u043d\u0434\u043b\u0435\u0440\u044b (\u043f\u0440\u0438\u0435\u043c\u0449\u0438\u043a\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434). \u042f \u0432\u044b\u0431\u0440\u0430\u043b\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <a href=\"https:\/\/github.com\/eternnoir\/pyTelegramBotAPI\" rel=\"noopener noreferrer nofollow\">pyTelegramBotAPI<\/a> \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 API \u0442\u0435\u043b\u0435\u0433\u0438.<\/p>\n<p><code>9<\/code> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 \u0441 \u0442\u043e\u043a\u0435\u043d\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u043c \u043f\u0440\u0438\u0441\u043b\u0430\u043b \u043e\u0442\u0435\u0446 \u0431\u043e\u0442\u043e\u0432<br \/><code>11<\/code> \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0438\u043d\u0441\u0442\u0430\u043d\u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <code>Telebot<\/code><br \/><code>64<\/code> \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u044d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0430\u043d\u0441 \u0432 \u0440\u0430\u0431\u043e\u0442\u0443<br \/>\u041f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>\/start<\/code> \u0438 <code>\/help<\/code> \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u043f\u0440\u043e\u0441\u0442\u044b\u043d\u0435\u0439 \u0442\u0435\u043a\u0441\u0442\u0430. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a \u0442\u0443\u0442 &#8212; <code>get_document<\/code>. \u0412 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442, \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0447\u0442\u043e \u043e\u043d \u0444\u043e\u0440\u043c\u0430\u0442\u0430 .txt, \u0434\u0430\u043b\u0435\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0438\u0437 \u043d\u0435\u0433\u043e \u0438 \u0432\u044b\u0437\u043e\u0432\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438\u0437 \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0448\u0430\u0433\u0430.<\/p>\n<pre><code class=\"python\">#!\/usr\/bin\/env python3  import telebot import requests import analyze_chat import uuid import os   TOKEN = \"blablabla\"  bot = telebot.TeleBot(TOKEN)  @bot.message_handler(commands=['start']) def send_welcome(message):    bot.send_message(        message.chat.id,        '\u041f\u0440\u0438\u0432\u0435\u0442!\u270c\ufe0f \u042f \u0431\u043e\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0442\u0432\u043e\u0439 \u0434\u0438\u0430\u043b\u043e\u0433 \u0438\u0437 WhatsApp \\n' +        '(\u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u043f\u0440\u0438\u0437\u043d\u0430\u043d\u043d\u043e\u0439 \u043d\u0430 \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u0438 \u0420\u0424 \u044d\u043a\u0441\u0442\u0440\u0435\u043c\u0438\u0441\u0442\u043a\u043e\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 Meta). \\n' +        '\u0421\u043a\u0430\u0447\u0430\u0439 \u0434\u0438\u0430\u043b\u043e\u0433 (\u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435 ??) \u0438 \u043f\u0440\u0438\u0448\u043b\u0438 \u0431\u043e\u0442\u0443 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 .txt.\\n' +        '\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u0430\u043a \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0432\u0435\u0441\u044c \u0434\u0438\u0430\u043b\u043e\u0433 \u043f\u0440\u043e\u0439\u0434\u0438 \u043d\u0430 \u043a\u043e\u043c\u043c\u0430\u043d\u0434\u0443 \/help.\\n' +        '\u26a1\ufe0f \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435! \u0412\u0430\u0448\u0438 \u0434\u0438\u0430\u043b\u043e\u0433\u0438 \u043d\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, ' +        '\u043e\u0434\u043d\u0430\u043a\u043e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0447\u0435\u043d\u044b \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u0430\u043c\u0438 \u043f\u043e \u0441\u0435\u0442\u0438!'        )  @bot.message_handler(commands=['help']) def get_help(message):    bot.send_message(        message.chat.id,        '1) \u041f\u0440\u043e\u0439\u0434\u0438\u0442\u0435 \u0432 \u0447\u0430\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0438\u0437 WhatsApp ' +        '(\u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u043f\u0440\u0438\u0437\u043d\u0430\u043d\u043d\u043e\u0439 \u043d\u0430 \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u0438 \u0420\u0424 \u044d\u043a\u0441\u0442\u0440\u0435\u043c\u0438\u0441\u0442\u043a\u043e\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 Meta). \\n' +        '2) \u041f\u0440\u043e\u0432\u0430\u043b\u0438\u0442\u0435\u0441\u044c \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0447\u0430\u0442\u0430 \\n' +        '3) \u041d\u0430\u0436\u043c\u0438\u0442\u0435 \"\u042d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0447\u0430\u0442 (Export chat)\" -> \u0411\u0435\u0437 \u043c\u0435\u0434\u0438\u0430 -> \u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\\n' +        '4) \u0420\u0430\u0437\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u0443\u0439\u0442\u0435 \u0438 \u043f\u0440\u0438\u0448\u043b\u0438\u0442\u0435 \u0431\u043e\u0442\u0443 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0430\u0440\u0445\u0438\u0432\u0430 (\u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443 \u0435\u0441\u043b\u0438 \u0438\u0445 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e)'        )  @bot.message_handler(content_types=['document']) def get_document(message):    if (message.document.mime_type != 'text\/plain'):       bot.reply_to(message, \"\u0412\u044b \u043f\u0440\u0438\u0441\u043b\u0430\u043b\u0438 \u0444\u0430\u0439\u043b, \u043d\u043e \u043e\u043d \u043d\u0435 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 .txt ? \u0418\u0441\u043f\u0440\u0430\u0432\u044c\u0442\u0435 \u044d\u0442\u043e \u043d\u0435\u0434\u043e\u0440\u0430\u0437\u0443\u043c\u0435\u043d\u0438\u0435, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430\")    else:       return analyze(message)        def analyze(message):    file_info = bot.get_file(message.document.file_id)    response = requests.get('https:\/\/api.telegram.org\/file\/bot{0}\/{1}'.format(TOKEN, file_info.file_path))    random_file_name = \"response_\" + str(uuid.uuid4()) + \".txt\"    with open(random_file_name, \"wb\") as f:       f.write(response.content)    text = get_text_from_file(random_file_name)    result = analyze_chat.analyze(text)    os.remove(random_file_name)    bot.reply_to(message, result)  def get_text_from_file(file_name):    f = open(file_name, \"r\", encoding=\"utf-8\")    text = f.read()    return text  @bot.message_handler(func=lambda message: True) def echo_all(message):    bot.reply_to(message, \"\u042f \u043c\u043e\u0433\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0444\u0430\u0439\u043b \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 .txt ? \u041a\u0430\u0436\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u043d\u0435 \u043e\u043d\")   bot.infinity_polling()<\/code><\/pre>\n<h2>\u0414\u0435\u043f\u043b\u043e\u0439 \u044d\u0442\u043e\u0433\u043e \u0432\u0441\u0435\u0433\u043e \u0434\u0435\u043b\u0430<\/h2>\n<p>\u0418\u0442\u0430\u043a, \u0443 \u043d\u0430\u0441 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043a\u043e\u0434, \u043d\u043e \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u0443 \u0432\u0430\u0441 \u043e\u0442\u043a\u0440\u044b\u0442 \u043d\u043e\u0443\u0442 (\u043b\u043e\u043b). \u0412\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043d\u0430 \u0448\u0430\u0433 \u043d\u0430\u0437\u0430\u0434 \u0438 \u044f \u0441\u043a\u0430\u0436\u0443 \u0432\u0430\u043c, \u0447\u0442\u043e \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0430\u043b &#8212; \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0434\u0432\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438:<\/p>\n<pre><code class=\"bash\">pip install pyTelegramBotAPI pip install natasha<\/code><\/pre>\n<p>\u041d\u0443 \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d python ?. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0447\u0442\u043e \u0432\u0441\u0435 \u044d\u0442\u043e \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435. \u0412\u0441\u043f\u043e\u043c\u043d\u0438\u043c \u043f\u0440\u043e \u0434\u043e\u043a\u0435\u0440. \u0418 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0438\u043b\u0443 \u0434\u043e\u043a\u0435\u0440-\u0444\u0430\u0439\u043b\u0430. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u044e \u0432\u043d\u0443\u0442\u0440\u044c \u043f\u0430\u043f\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <code>Dockerfile<\/code> \u0438 \u043f\u0438\u0448\u0443 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<br \/><code>1<\/code> \u0434\u0435\u043b\u0430\u044e \u043e\u0431\u0440\u0430\u0437 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0442 <a href=\"https:\/\/registry.hub.docker.com\/_\/python\" rel=\"noopener noreferrer nofollow\">\u043f\u0438\u0442\u043e\u043d\u0430<\/a><br \/><code>2,3<\/code> \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e \u0444\u0430\u0439\u043b\u044b \u0441 \u0434\u0432\u0443\u043c\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c\u0438 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0448\u0430\u0433\u0430\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u043c\u0438<br \/><code>4,5<\/code> \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<br \/><code>6<\/code> \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e \u043a\u043e\u0434<\/p>\n<pre><code>FROM python:3 ADD chatbot.py . ADD analyze_chat.py . RUN pip install pyTelegramBotAPI RUN pip install natasha CMD python3 .\/chatbot.py<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0434\u043e\u043a\u0435\u0440-\u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code>docker build -t vrestles\/analyze-chat-bot:latest -f Dockerfile .<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u043e\u0431\u0440\u0430\u0437 \u044f \u043f\u0435\u0440\u0435\u043d\u043e\u0448\u0443 \u0432 <a href=\"https:\/\/hub.docker.com\/\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0435\u0440-\u0445\u0430\u0431<\/a> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0430:<\/p>\n<pre><code>docker login -u vrestles -p ***** docker push vrestles\/analyze-chat-bot:latest<\/code><\/pre>\n<p>\u0417\u0430\u043c\u0435\u0442\u044c\u0442\u0435, \u0447\u0442\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u0437\u0430\u043b\u043e\u0433\u0438\u043d\u0438\u043b\u0430\u0441\u044c \u0438 \u043f\u043e\u0442\u043e\u043c \u0437\u0430\u043f\u0443\u0448\u0438\u043b\u0430 \u043e\u0431\u0440\u0430\u0437.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u043e\u0445\u043e\u0436\u0443 \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443 &#8212; \u0442\u0430\u043c \u0443\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0434\u043e\u043a\u0435\u0440. \u0418 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043d \u043e\u0434\u0438\u043d \u043a\u0441\u0442\u0430\u0442\u0438 \u0433\u043e\u0432\u043e\u0440\u044f. \u0418 \u0432\u0441\u0435 \u0447\u0442\u043e \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u043f\u044f\u0442\u044c \u0437\u0430\u043b\u043e\u0433\u0438\u043d\u0438\u0442\u044c\u0441\u044f \u0432 \u0434\u043e\u043a\u0435\u0440 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437:<\/p>\n<pre><code>docker run -d vrestles\/analyze-chat-bot:latest<\/code><\/pre>\n<p>\u041a \u0441\u043b\u043e\u0432\u0443 \u0433\u043e\u0432\u043e\u0440\u044f, \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043e\u043d \u0441\u0430\u043c \u043f\u043e\u0439\u043c\u0435\u0442, \u0447\u0442\u043e \u043e\u0431\u0440\u0430\u0437 \u043d\u0435 \u0441\u043a\u0430\u0447\u0430\u043d \u0438 \u043f\u043e\u0439\u0434\u0435\u0442 \u0441\u0430\u043c \u0437\u0430 \u043d\u0438\u043c. \u0417\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d \u0432 \u0434\u0438\u0442\u0430\u0447-\u0440\u0435\u0436\u0438\u043c\u0435, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u0447\u0442\u043e \u043e\u043d \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a \u0432 \u0444\u043e\u043d\u0435 \u0438 \u043e\u0442\u0434\u0430\u0441\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u0439\u0434\u0438\u0448\u043d\u0438\u043a \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>docker ps<\/code><\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0441\u043b\u043e\u0432\u043e<\/h2>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c \u043c\u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u043e\u0441\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 \u043f\u0438\u0442\u043e\u043d\u0435 &#8212; \u044d\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u043e\u0447\u0435\u043d\u044c \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u043e. \u0414\u043e\u043a\u0435\u0440 \u043a\u0430\u043a \u0432\u0441\u0435\u0433\u0434\u0430 \u0440\u0443\u043b\u0438\u0442. \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0438 \u043c\u043e\u0436\u043d\u043e \u043a\u0438\u0434\u0430\u0442\u044c \u0432 \u043c\u0435\u043d\u044f \u043f\u043e\u043c\u0438\u0434\u043e\u0440\u0430\u043c\u0438 \u0432 \u043a\u043e\u043c\u0435\u043d\u0442\u0430\u0445 ?.<\/p>\n<\/p>\n<\/div>\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\/articles\/689812\/\"> https:\/\/habr.com\/ru\/articles\/689812\/<\/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<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u041a\u0430\u0442\u044f \u0438 \u044f backend \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a. \u041f\u0438\u0448\u0443 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043d\u0430 java, \u0438\u043d\u043e\u0433\u0434\u0430 \u043d\u0430 kotlin. \u0412 \u043e\u0434\u0438\u043d \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u0434\u0435\u043d\u044c \u043c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u0430 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 \u043c\u044b\u0441\u043b\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0430\u0442-\u0431\u043e\u0442\u0430 \u0434\u043b\u044f \u0442\u0435\u043b\u0435\u0433\u0438. \u0412 \u0441\u0438\u043b\u0443 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0438 \u0441\u0432\u043e\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f spring boot \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 java, \u043f\u043e\u0442\u043e\u043c \u043c\u0435\u043d\u044f \u043f\u043e\u043d\u0435\u0441\u043b\u043e \u0432 \u043f\u0440\u0438\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u0411\u0414, \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u0442\u0435\u043a\u043b\u043e \u0432 \u0442\u0435\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043a\u0430\u043a \u0442\u0430\u043a\u043e\u0432\u043e\u0433\u043e \u0438 \u0434\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u0440\u0435\u0441\u0442\u043e\u0432 \u0431\u043e\u0442\u043e\u043c \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u043c \u043d\u0435 \u0434\u043e\u0448\u043b\u043e ?.<\/p>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u044f \u043f\u043e\u0434\u0443\u043c\u0430\u043b\u0430: \u0430 \u043f\u043e\u0447\u0435\u043c\u0443 java, \u0434\u0430\u0432\u0430\u0439 \u0432\u043e\u0437\u044c\u043c\u0435\u043c python. \u0423 \u043c\u0435\u043d\u044f \u0431\u044b\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u043f\u044b\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043d\u0430 \u044d\u0442\u043e\u043c \u044f\u0437\u044b\u043a\u0435 &#8212; \u0438 \u044f \u0440\u0435\u0448\u0438\u043b\u0430\u0441\u044c &#8212; \u043d\u0430\u0447\u043d\u0443 \u0441\u043d\u043e\u0432\u0430 \u0441 &#171;\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435, \u043c\u0438\u0440!&#187; \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0440\u0430\u0437\u0443 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0447\u0430\u0442-\u0431\u043e\u0442 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u043c. \u041d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0440\u0430\u0445 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430 \u043d\u0430\u0448\u043b\u0430 \u043a\u0440\u0443\u0442\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0441 \u0437\u0432\u0443\u0447\u043d\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c <a href=\"https:\/\/github.com\/natasha\/natasha\" rel=\"noopener noreferrer nofollow\">natasha<\/a>. \u0418\u0434\u0435\u044f \u0431\u043e\u0442\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f: \u0432\u044b \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0435 \u0441\u0432\u043e\u0439 \u0447\u0430\u0442\u0438\u043a \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u043d\u044b\u043d\u0435 \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440\u0430 \u0438 \u044d\u0442\u043e\u0442 <code>.txt<\/code> \u0444\u0430\u0439\u043b \u043e\u0442\u0434\u0430\u0435\u0442\u0435 \u0431\u043e\u0442\u0443. \u041e\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0422\u041e\u041f 10 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438 \u0433\u043b\u0430\u0433\u043e\u043b\u043e\u0432 \u0438\u0437 \u0432\u0430\u0448\u0435\u0433\u043e \u0447\u0430\u0442\u0430 ?. \u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u043f\u043e \u0448\u0430\u0433\u0430\u043c.<\/p>\n<h2>\u041e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c<\/h2>\n<ol>\n<li>\n<p>\u041d\u0430\u0439\u0442\u0438 \u0432 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f <a href=\"https:\/\/t.me\/BotFather\" rel=\"noopener noreferrer nofollow\">https:\/\/t.me\/BotFather<\/a> &#8212; \u043e\u043d \u0431\u043e\u0433 \u0432\u0441\u0435\u0445 \u0431\u043e\u0442\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0435\u043c\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>\/newbot<\/code> \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u0431\u043e\u0442\u0430. \u041d\u0430\u0437\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0435\u0433\u043e \u0431\u043e\u0442\u0430 \u0438 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u043e\u043d\u0446\u043e\u0432\u043a\u0430 \u0438\u043c\u0435\u043d\u0438 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c Bot. \u0418\u043c\u044f \u043c\u043e\u0435\u0433\u043e &#8212; <code>analyzeYourChatBot<\/code><\/p>\n<\/li>\n<li>\n<p>\u0412 \u043e\u0442\u0432\u0435\u0442\u043d\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u043e\u0442\u0435\u0446 \u0431\u043e\u0442\u043e\u0432 \u0432\u044b\u0448\u043b\u0435\u0442 \u0432\u0430\u043c \u0442\u043e\u043a\u0435\u043d \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a API.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0430\u043a \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u0437\u0430\u0434\u0430\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0432\u0430\u0448\u0435\u043c\u0443 \u0431\u043e\u0442\u0443 \u043f\u0443\u0442\u0435\u043c \u0432\u044b\u0437\u043e\u0432\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>\/setdescription<\/code> \u0430 \u0442\u0430\u043a \u0436\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0430\u0432\u0430\u0442\u0430\u0440 <code>\/setuserpic<\/code><\/p>\n<\/li>\n<\/ol>\n<h2>\u0424\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0431\u043e\u0442\u0430<\/h2>\n<p>\u0412\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u0438\u0434\u0435\u0435 \u0431\u043e\u0442\u0430: \u0432\u0437\u044f\u0442\u044c <code>.txt<\/code>-\u0444\u0430\u0439\u043b, \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435, \u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u043e\u0442 \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0445 \u0448\u0442\u0443\u043a, \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u043d\u0430 \u0441\u043b\u043e\u0432\u0430, \u043f\u043e\u043d\u044f\u0442\u044c \u0447\u0442\u043e \u0438\u0437 \u043d\u0438\u0445 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435, \u0430 \u0447\u0442\u043e \u0433\u043b\u0430\u0433\u043e\u043b\u044b, \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u0430\u0436\u0434\u044b\u0445 \u0438 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0422\u041e\u041f 10.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 &#8212; \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>analyze<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043c\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0444\u0430\u0439\u043b\u0430. \u0414\u0430\u043b\u0435\u0435 \u043f\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e: <br \/><code>46<\/code> &#8212; \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043c \u0432\u0441\u0435 \u0441\u043b\u043e\u0432\u0430 \u0432 \u043d\u0438\u0436\u043d\u0438\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440<br \/><code>47<\/code> &#8212; \u0438\u0437\u0431\u0430\u0432\u0438\u043c\u0441\u044f \u043e\u0442 \u0442\u0435\u043a\u0441\u0442\u0430 \u0441 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u043c \u0434\u0430\u0442\u044b \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0435\u043b\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432\u0438\u0434\u0430 <code>[16.09.2021, 17:10:20] Katerina: \u0410 \u0447\u0442\u043e \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u0435\u0433\u043e\u0434\u043d\u044f?<\/code> \u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0430 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u0432 \u0443\u0434\u043e\u0431\u043d\u043e\u043c \u043e\u043d\u043b\u0430\u0439\u043d-\u0441\u0435\u0440\u0432\u0438\u0441\u0435 <a href=\"https:\/\/regex101.com\/\" rel=\"noopener noreferrer nofollow\">regex101<\/a><br \/><code>48<\/code> &#8212; \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0432 \u0442\u0435\u043a\u0441\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0443\u0441\u0441\u043a\u0438\u0435 \u0441\u043b\u043e\u0432\u0430 \u0438 \u043f\u0440\u043e\u0431\u0435\u043b\u044b<br \/><code>49<\/code> &#8212; \u0441\u0445\u043b\u043e\u043f\u043d\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0431\u0435\u043b\u043e\u0432 \u043e\u0434\u0438\u043d<br \/><code>51-61<\/code> &#8212; \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442 \u043a\u043e\u0434\u0430 \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <a href=\"https:\/\/github.com\/natasha\/natasha\" rel=\"noopener noreferrer nofollow\">natasha<\/a>. \u0415\u0441\u043b\u0438 \u043e\u0447\u0435\u043d\u044c \u0432\u043a\u0440\u0430\u0442\u0446\u0435, \u0442\u043e \u043c\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043b\u0438 \u0442\u0435\u043a\u0441\u0442 \u043d\u0430 \u0441\u043b\u043e\u0432\u0430 \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438 \u043a\u0430\u043a\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435, \u0430 \u043a\u0430\u043a\u043e\u0435 &#8212; \u0433\u043b\u0430\u0433\u043e\u043b.<br \/>\u0414\u0430\u043b\u0435\u0435 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0438 \u0433\u043b\u0430\u0433\u043e\u043b\u0430\u043c\u0438, \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f, \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0438 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0422\u041e\u041f 10.<\/p>\n<pre><code class=\"python\"> #!\/usr\/bin\/env python3  import re from string import whitespace from collections import defaultdict from natasha import (     Segmenter,     MorphVocab,     NewsEmbedding,     NewsMorphTagger,     NewsSyntaxParser,     Doc )  CYRILLIC_LETTERS = u\"\u0430\u0431\u0432\u0433\u0434\u0435\u0451\u0436\u0437\u0438\u0439\u043a\u043b\u043c\u043d\u043e\u043f\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044a\u044b\u044c\u044d\u044e\u044f\" TOP_COUNT = 10  def strip(text):     allowed_chars = CYRILLIC_LETTERS + whitespace     return \"\".join([c for c in text if c in allowed_chars])  def sort(data): result_dict = defaultdict(int) for key in data: result_dict[key]+=1 return sorted(result_dict.items(), key=lambda kv: kv[1], reverse=True)  def make_str(data): result = \"\" top_data = data[:TOP_COUNT] for key, value in top_data: result += key result += \": \" result += str(value) result += \"\\n\" return result  def find(data, type): result = [] for item in data: if (item.pos == type): result.append(item) return result  def analyze(data): text = data.lower() text = re.sub(r'\\[\\d{2}\\.\\d{2}\\.\\d{4}\\, \\d{2}:\\d{2}:\\d{2}\\] .+?:', '', text, flags=re.MULTILINE) text = strip(text) text = re.sub(' +', ' ', text)  segmenter = Segmenter() morph_vocab = MorphVocab() emb = NewsEmbedding() morph_tagger = NewsMorphTagger(emb)  doc = Doc(text) doc.segment(segmenter) doc.tag_morph(morph_tagger)  for token in doc.tokens: token.lemmatize(morph_vocab)  nouns_dict = find(doc.tokens, 'NOUN') verbs_dict = find(doc.tokens, 'VERB')  nouns_lemmas = [_.lemma for _ in nouns_dict] verbs_lemmas = [_.lemma for _ in verbs_dict]  sorted_nouns_dict = sort(nouns_lemmas) sorted_verbs_dict = sort(verbs_lemmas)  res_nouns = make_str(sorted_nouns_dict) res_verbs = make_str(sorted_verbs_dict)  result = \"\u0422\u041e\u041f \" + str(TOP_COUNT) + \" \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0432 \u0432\u0430\u0448\u0435\u043c \u0447\u0430\u0442\u0435:\\n\" result += res_nouns result += \"\\n\" result += \"\u0422\u041e\u041f \" + str(TOP_COUNT) + \" \u0433\u043b\u0430\u0433\u043e\u043b\u043e\u0432 \u0432 \u0432\u0430\u0448\u0435\u043c \u0447\u0430\u0442\u0435:\\n\" result += res_verbs return result <\/code><\/pre>\n<h2>\u0412\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u0431\u043e\u0442\u0430<\/h2>\n<p>\u0412 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0430\u043f\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0431\u0440\u0430\u043d\u044b \u043c\u0435\u0442\u043e\u0434\u044b-\u0445\u0435\u043d\u0434\u043b\u0435\u0440\u044b (\u043f\u0440\u0438\u0435\u043c\u0449\u0438\u043a\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434). \u042f \u0432\u044b\u0431\u0440\u0430\u043b\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <a href=\"https:\/\/github.com\/eternnoir\/pyTelegramBotAPI\" rel=\"noopener noreferrer nofollow\">pyTelegramBotAPI<\/a> \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 API \u0442\u0435\u043b\u0435\u0433\u0438.<\/p>\n<p><code>9<\/code> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 \u0441 \u0442\u043e\u043a\u0435\u043d\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u043c \u043f\u0440\u0438\u0441\u043b\u0430\u043b \u043e\u0442\u0435\u0446 \u0431\u043e\u0442\u043e\u0432<br \/><code>11<\/code> \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0438\u043d\u0441\u0442\u0430\u043d\u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <code>Telebot<\/code><br \/><code>64<\/code> \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u044d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0430\u043d\u0441 \u0432 \u0440\u0430\u0431\u043e\u0442\u0443<br \/>\u041f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>\/start<\/code> \u0438 <code>\/help<\/code> \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u043f\u0440\u043e\u0441\u0442\u044b\u043d\u0435\u0439 \u0442\u0435\u043a\u0441\u0442\u0430. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a \u0442\u0443\u0442 &#8212; <code>get_document<\/code>. \u0412 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442, \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0447\u0442\u043e \u043e\u043d \u0444\u043e\u0440\u043c\u0430\u0442\u0430 .txt, \u0434\u0430\u043b\u0435\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0438\u0437 \u043d\u0435\u0433\u043e \u0438 \u0432\u044b\u0437\u043e\u0432\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438\u0437 \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0448\u0430\u0433\u0430.<\/p>\n<pre><code class=\"python\">#!\/usr\/bin\/env python3  import telebot import requests import analyze_chat import uuid import os   TOKEN = \"blablabla\"  bot = telebot.TeleBot(TOKEN)  @bot.message_handler(commands=['start']) def send_welcome(message):    bot.send_message(        message.chat.id,        '\u041f\u0440\u0438\u0432\u0435\u0442!\u270c\ufe0f \u042f \u0431\u043e\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0442\u0432\u043e\u0439 \u0434\u0438\u0430\u043b\u043e\u0433 \u0438\u0437 WhatsApp \\n' +        '(\u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u043f\u0440\u0438\u0437\u043d\u0430\u043d\u043d\u043e\u0439 \u043d\u0430 \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u0438 \u0420\u0424 \u044d\u043a\u0441\u0442\u0440\u0435\u043c\u0438\u0441\u0442\u043a\u043e\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 Meta). \\n' +        '\u0421\u043a\u0430\u0447\u0430\u0439 \u0434\u0438\u0430\u043b\u043e\u0433 (\u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435 ??) \u0438 \u043f\u0440\u0438\u0448\u043b\u0438 \u0431\u043e\u0442\u0443 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 .txt.\\n' +        '\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u0430\u043a \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0432\u0435\u0441\u044c \u0434\u0438\u0430\u043b\u043e\u0433 \u043f\u0440\u043e\u0439\u0434\u0438 \u043d\u0430 \u043a\u043e\u043c\u043c\u0430\u043d\u0434\u0443 \/help.\\n' +        '\u26a1\ufe0f \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435! \u0412\u0430\u0448\u0438 \u0434\u0438\u0430\u043b\u043e\u0433\u0438 \u043d\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, ' +        '\u043e\u0434\u043d\u0430\u043a\u043e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0447\u0435\u043d\u044b \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u0430\u043c\u0438 \u043f\u043e \u0441\u0435\u0442\u0438!'        )  @bot.message_handler(commands=['help']) def get_help(message):    bot.send_message(        message.chat.id,        '1) \u041f\u0440\u043e\u0439\u0434\u0438\u0442\u0435 \u0432 \u0447\u0430\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0438\u0437 WhatsApp ' +        '(\u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u043f\u0440\u0438\u0437\u043d\u0430\u043d\u043d\u043e\u0439 \u043d\u0430 \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u0438 \u0420\u0424 \u044d\u043a\u0441\u0442\u0440\u0435\u043c\u0438\u0441\u0442\u043a\u043e\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 Meta). \\n' +        '2) \u041f\u0440\u043e\u0432\u0430\u043b\u0438\u0442\u0435\u0441\u044c \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0447\u0430\u0442\u0430 \\n' +        '3) \u041d\u0430\u0436\u043c\u0438\u0442\u0435 \"\u042d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0447\u0430\u0442 (Export chat)\" -> \u0411\u0435\u0437 \u043c\u0435\u0434\u0438\u0430 -> \u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\\n' +        '4) \u0420\u0430\u0437\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u0443\u0439\u0442\u0435 \u0438 \u043f\u0440\u0438\u0448\u043b\u0438\u0442\u0435 \u0431\u043e\u0442\u0443 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0430\u0440\u0445\u0438\u0432\u0430 (\u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443 \u0435\u0441\u043b\u0438 \u0438\u0445 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e)'        )  @bot.message_handler(content_types=['document']) def get_document(message):    if (message.document.mime_type != 'text\/plain'):       bot.reply_to(message, \"\u0412\u044b \u043f\u0440\u0438\u0441\u043b\u0430\u043b\u0438 \u0444\u0430\u0439\u043b, \u043d\u043e \u043e\u043d \u043d\u0435 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 .txt ? \u0418\u0441\u043f\u0440\u0430\u0432\u044c\u0442\u0435 \u044d\u0442\u043e \u043d\u0435\u0434\u043e\u0440\u0430\u0437\u0443\u043c\u0435\u043d\u0438\u0435, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430\")    else:       return analyze(message)        def analyze(message):    file_info = bot.get_file(message.document.file_id)    response = requests.get('https:\/\/api.telegram.org\/file\/bot{0}\/{1}'.format(TOKEN, file_info.file_path))    random_file_name = \"response_\" + str(uuid.uuid4()) + \".txt\"    with open(random_file_name, \"wb\") as f:       f.write(response.content)    text = get_text_from_file(random_file_name)    result = analyze_chat.analyze(text)    os.remove(random_file_name)    bot.reply_to(message, result)  def get_text_from_file(file_name):    f = open(file_name, \"r\", encoding=\"utf-8\")    text = f.read()    return text  @bot.message_handler(func=lambda message: True) def echo_all(message):    bot.reply_to(message, \"\u042f \u043c\u043e\u0433\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0444\u0430\u0439\u043b \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 .txt ? \u041a\u0430\u0436\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u043d\u0435 \u043e\u043d\")   bot.infinity_polling()<\/code><\/pre>\n<h2>\u0414\u0435\u043f\u043b\u043e\u0439 \u044d\u0442\u043e\u0433\u043e \u0432\u0441\u0435\u0433\u043e \u0434\u0435\u043b\u0430<\/h2>\n<p>\u0418\u0442\u0430\u043a, \u0443 \u043d\u0430\u0441 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043a\u043e\u0434, \u043d\u043e \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u0443 \u0432\u0430\u0441 \u043e\u0442\u043a\u0440\u044b\u0442 \u043d\u043e\u0443\u0442 (\u043b\u043e\u043b). \u0412\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043d\u0430 \u0448\u0430\u0433 \u043d\u0430\u0437\u0430\u0434 \u0438 \u044f \u0441\u043a\u0430\u0436\u0443 \u0432\u0430\u043c, \u0447\u0442\u043e \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0430\u043b &#8212; \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0434\u0432\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438:<\/p>\n<pre><code class=\"bash\">pip install pyTelegramBotAPI pip install natasha<\/code><\/pre>\n<p>\u041d\u0443 \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d python ?. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0447\u0442\u043e \u0432\u0441\u0435 \u044d\u0442\u043e \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435. \u0412\u0441\u043f\u043e\u043c\u043d\u0438\u043c \u043f\u0440\u043e \u0434\u043e\u043a\u0435\u0440. \u0418 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0438\u043b\u0443 \u0434\u043e\u043a\u0435\u0440-\u0444\u0430\u0439\u043b\u0430. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u044e \u0432\u043d\u0443\u0442\u0440\u044c \u043f\u0430\u043f\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <code>Dockerfile<\/code> \u0438 \u043f\u0438\u0448\u0443 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<br \/><code>1<\/code> \u0434\u0435\u043b\u0430\u044e \u043e\u0431\u0440\u0430\u0437 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0442 <a href=\"https:\/\/registry.hub.docker.com\/_\/python\" rel=\"noopener noreferrer nofollow\">\u043f\u0438\u0442\u043e\u043d\u0430<\/a><br \/><code>2,3<\/code> \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e \u0444\u0430\u0439\u043b\u044b \u0441 \u0434\u0432\u0443\u043c\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c\u0438 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0448\u0430\u0433\u0430\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u043c\u0438<br \/><code>4,5<\/code> \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<br \/><code>6<\/code> \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e \u043a\u043e\u0434<\/p>\n<pre><code>FROM python:3 ADD chatbot.py . ADD analyze_chat.py . RUN pip install pyTelegramBotAPI RUN pip install natasha CMD python3 .\/chatbot.py<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0434\u043e\u043a\u0435\u0440-\u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code>docker build -t vrestles\/analyze-chat-bot:latest -f Dockerfile .<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u043e\u0431\u0440\u0430\u0437 \u044f \u043f\u0435\u0440\u0435\u043d\u043e\u0448\u0443 \u0432 <a href=\"https:\/\/hub.docker.com\/\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0435\u0440-\u0445\u0430\u0431<\/a> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0430:<\/p>\n<pre><code>docker login -u vrestles -p ***** docker push vrestles\/analyze-chat-bot:latest<\/code><\/pre>\n<p>\u0417\u0430\u043c\u0435\u0442\u044c\u0442\u0435, \u0447\u0442\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u0437\u0430\u043b\u043e\u0433\u0438\u043d\u0438\u043b\u0430\u0441\u044c \u0438 \u043f\u043e\u0442\u043e\u043c \u0437\u0430\u043f\u0443\u0448\u0438\u043b\u0430 \u043e\u0431\u0440\u0430\u0437.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u043e\u0445\u043e\u0436\u0443 \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443 &#8212; \u0442\u0430\u043c \u0443\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0434\u043e\u043a\u0435\u0440. \u0418 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043d \u043e\u0434\u0438\u043d \u043a\u0441\u0442\u0430\u0442\u0438 \u0433\u043e\u0432\u043e\u0440\u044f. \u0418 \u0432\u0441\u0435 \u0447\u0442\u043e \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u043f\u044f\u0442\u044c \u0437\u0430\u043b\u043e\u0433\u0438\u043d\u0438\u0442\u044c\u0441\u044f \u0432 \u0434\u043e\u043a\u0435\u0440 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437:<\/p>\n<pre><code>docker run -d vrestles\/analyze-chat-bot:latest<\/code><\/pre>\n<p>\u041a \u0441\u043b\u043e\u0432\u0443 \u0433\u043e\u0432\u043e\u0440\u044f, \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043e\u043d \u0441\u0430\u043c \u043f\u043e\u0439\u043c\u0435\u0442, \u0447\u0442\u043e \u043e\u0431\u0440\u0430\u0437 \u043d\u0435 \u0441\u043a\u0430\u0447\u0430\u043d \u0438 \u043f\u043e\u0439\u0434\u0435\u0442 \u0441\u0430\u043c \u0437\u0430 \u043d\u0438\u043c. \u0417\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d \u0432 \u0434\u0438\u0442\u0430\u0447-\u0440\u0435\u0436\u0438\u043c\u0435, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u0447\u0442\u043e \u043e\u043d \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a \u0432 \u0444\u043e\u043d\u0435 \u0438 \u043e\u0442\u0434\u0430\u0441\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u0439\u0434\u0438\u0448\u043d\u0438\u043a \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>docker ps<\/code><\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0441\u043b\u043e\u0432\u043e<\/h2>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c \u043c\u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u043e\u0441\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 \u043f\u0438\u0442\u043e\u043d\u0435 &#8212; \u044d\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u043e\u0447\u0435\u043d\u044c \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u043e. \u0414\u043e\u043a\u0435\u0440 \u043a\u0430\u043a \u0432\u0441\u0435\u0433\u0434\u0430 \u0440\u0443\u043b\u0438\u0442. \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0438 \u043c\u043e\u0436\u043d\u043e \u043a\u0438\u0434\u0430\u0442\u044c \u0432 \u043c\u0435\u043d\u044f \u043f\u043e\u043c\u0438\u0434\u043e\u0440\u0430\u043c\u0438 \u0432 \u043a\u043e\u043c\u0435\u043d\u0442\u0430\u0445 ?.<\/p>\n<\/p>\n<\/div>\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\/articles\/689812\/\"> https:\/\/habr.com\/ru\/articles\/689812\/<\/a><br \/><\/br><\/br><\/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-395980","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/395980","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=395980"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/395980\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=395980"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=395980"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=395980"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}