{"id":353483,"date":"2024-05-20T22:28:54","date_gmt":"2024-05-20T22:28:54","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=353483"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=353483","title":{"rendered":"<span>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u043e\u043a\u0441\u0438\u0447\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0433\u043b\u0443\u0431\u043e\u043a\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f<\/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 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u043b\u0443\u0431\u043e\u043a\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043e\u0446\u0435\u043d\u043a\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u043e\u043a\u0440\u0430\u0441\u043e\u043a \u0442\u0435\u043a\u0441\u0442\u0430, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u0443\u0433\u0440\u043e\u0437\u044b, \u043d\u0435\u043f\u0440\u0438\u0441\u0442\u043e\u0439\u043d\u043e\u0441\u0442\u0438, \u043e\u0441\u043a\u043e\u0440\u0431\u043b\u0435\u043d\u0438\u044f.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0b0\/f58\/dad\/0b0f58dadf9fe16d33bacf79ce757ea5.png\" width=\"1200\" height=\"676\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0b0\/f58\/dad\/0b0f58dadf9fe16d33bacf79ce757ea5.png\"\/><\/figure>\n<h3>\u0414\u0430\u043d\u043d\u044b\u0435<\/h3>\n<p>\u041d\u0430\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 Conversation AI. \u0422\u0435\u043a\u0441\u0442\u044b \u0432\u0437\u044f\u0442\u044b \u0438\u0437 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u043a \u043f\u0440\u0430\u0432\u043a\u0430\u043c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044f \u0412\u0438\u043a\u0438\u043f\u0435\u0434\u0438\u0438. \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u0442 223 549 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0441 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u043e\u0439.<\/p>\n<p>\u041d\u0443\u0436\u043d\u043e \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0442\u0435\u043a\u0441\u0442\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f (comment_text) \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0442\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c (\u043a\u043e\u043b\u043e\u043d\u043a\u0438 toxic, severe_toxic, obscene, threat, insult, identity_hate). \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 1 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u0439:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"222\" width=\"222\">\n<p align=\"left\"><strong>comment_text<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\"><strong>toxic<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"109\" width=\"109\">\n<p align=\"left\"><strong>severe_toxic<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"left\"><strong>obscene<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"56\" width=\"56\">\n<p align=\"left\"><strong>threat<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"73\" width=\"73\">\n<p align=\"left\"><strong>insult<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong> identity_hate<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"222\" width=\"222\">\n<p align=\"left\">&#171;You should be fired, you&#8217;re a moronic wimp who is too lazy to do research. It makes me sick that people like you exist in this world.&#187;  <\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">1<\/p>\n<\/td>\n<td data-colwidth=\"109\" width=\"109\">\n<p align=\"left\">0<\/p>\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"left\">0<\/p>\n<\/td>\n<td data-colwidth=\"56\" width=\"56\">\n<p align=\"left\">0<\/p>\n<\/td>\n<td data-colwidth=\"73\" width=\"73\">\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"222\" width=\"222\">\n<p align=\"left\">&#171;Oh, I didn&#8217;t know, thanks.&#187;  <\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">0<\/p>\n<\/td>\n<td data-colwidth=\"109\" width=\"109\">\n<p align=\"left\">0<\/p>\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"left\">0<\/p>\n<\/td>\n<td data-colwidth=\"56\" width=\"56\">\n<p align=\"left\">0<\/p>\n<\/td>\n<td data-colwidth=\"73\" width=\"73\">\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h3>\u041c\u043e\u0434\u0435\u043b\u0438<\/h3>\n<p>\u0413\u043b\u0443\u0431\u043e\u043a\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u044d\u043c\u043e\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u043a\u0440\u0430\u0441\u043a\u0438 \u0442\u0435\u043a\u0441\u0442\u0430:<\/p>\n<ul>\n<li>\n<p><strong>\u0441\u0432\u0435\u0440\u0442\u043e\u0447\u043d\u044b\u0435 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0435 \u0441\u0435\u0442\u0438<\/strong> (CNN, convolutional neural network):\u00a0\u043a\u043b\u0430\u0441\u0441 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439, \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0445 \u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0442\u0435\u043a\u0441\u0442\u043e\u0432. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0435\u043d\u0442\u0438\u043c\u0435\u043d\u0442-\u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0442\u0435\u043a\u0441\u0442\u0430, \u0441\u0432\u0435\u0440\u0442\u043e\u0447\u043d\u044b\u0435 \u0441\u043b\u043e\u0438 CNN \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0438\u0437 \u0442\u0435\u043a\u0441\u0442\u0430, \u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0432\u044f\u0437\u043d\u044b\u0435 \u0441\u043b\u043e\u0438 \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0442\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438;<\/p>\n<\/li>\n<li>\n<p><strong>\u0440\u0435\u043a\u0443\u0440\u0440\u0435\u043d\u0442\u043d\u044b\u0435 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0435 \u0441\u0435\u0442\u0438<\/strong> (RNN, Recurrent neural network): \u043a\u043b\u0430\u0441\u0441 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439, \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u0421\u0435\u0442\u0438 \u0441 \u0434\u043e\u043b\u0433\u043e\u0439 \u043a\u0440\u0430\u0442\u043a\u043e\u0441\u0440\u043e\u0447\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u044c\u044e (LSTM, long short-term memory) \u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u043c\u0438 \u0440\u0435\u043a\u0443\u0440\u0440\u0435\u043d\u0442\u043d\u044b\u043c\u0438 \u0431\u043b\u043e\u043a\u0430\u043c\u0438 (GRU, Gated Recurrent Unit) \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\u043c\u0438 RNN, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u043c\u0438 \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0434\u043e\u043b\u0433\u043e\u0441\u0440\u043e\u0447\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u0442\u0435\u043a\u0441\u0442\u0435;<\/p>\n<\/li>\n<li>\n<p><strong>Transformer<\/strong>: \u043c\u043e\u0434\u0435\u043b\u044c \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u0430 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u0432 \u0442\u0435\u043a\u0441\u0442\u0435 \u0438 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0438\u0445 \u0432\u0430\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043e \u0442\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u041f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u0442\u0430\u043a\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f BERT (Bidirectional Encoder Representations from Transformers).<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u043c CNN, LSTM \u0438 GRU.<\/p>\n<h3>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>\u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0442\u0435\u043a\u0441\u0442\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u0431\u0438\u0442\u044b \u043d\u0430 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u043b\u043e\u043a\u043e\u0432. \u0414\u0430\u043b\u0435\u0435 \u0438\u0437 \u043d\u0438\u0445 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0441\u043b\u043e\u0432\u0430\u0440\u044c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0443 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0435 \u0447\u0438\u0441\u043b\u043e, \u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d \u0432 \u0432\u0435\u043a\u0442\u043e\u0440 \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438. \u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a\u043e\u0435 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u043b\u043e\u043a\u043e\u0432 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e (\u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0435 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0439, \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u2014\u00a0 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442 \u0432\u0440\u0435\u043c\u044f \u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439). \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0438\u0437 \u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0441\u043b\u043e\u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432 \u0442\u0435\u043a\u0441\u0442\u0435:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c24\/93f\/937\/c2493f9371a40caa851626860d78b9fe.png\" alt=\"\" title=\"\" width=\"1362\" height=\"584\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c24\/93f\/937\/c2493f9371a40caa851626860d78b9fe.png\"\/><\/figure>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c \u0442\u0435\u043a\u0441\u0442\u044b \u0441\u043e\u0441\u0442\u043e\u044f\u0442 \u0438\u0437 68 \u0441\u043b\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0438\u0437 \u043d\u0438\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043c\u0435\u043d\u0435\u0435 76 \u0441\u043b\u043e\u0432, \u043d\u043e \u0435\u0441\u0442\u044c \u0438 \u0442\u0435\u043a\u0441\u0442\u044b \u0441 2834 \u0441\u043b\u043e\u0432\u0430\u043c\u0438.<\/p>\n<p>\u041f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0431\u043b\u043e\u043a\u043e\u0432 \u0441\u0442\u043e\u0438\u0442 \u0432\u0437\u044f\u0442\u044c \u0442\u0430\u043a\u043e\u0435 \u0447\u0438\u0441\u043b\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u043a\u0440\u043e\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0442\u0435\u043a\u0441\u0442\u043e\u0432. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0433\u0440\u0430\u0444\u0438\u043a \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u0430 (count plot) \u0434\u043b\u044f \u0434\u043b\u0438\u043d\u044b \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8b7\/daa\/566\/8b7daa56616abd33a9823359b2114cc6.png\" width=\"864\" height=\"852\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8b7\/daa\/566\/8b7daa56616abd33a9823359b2114cc6.png\"\/><\/figure>\n<p>\u041f\u043e \u0433\u0440\u0430\u0444\u0438\u043a\u0443 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0442\u0435\u043a\u0441\u0442\u043e\u0432 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0434\u043e 250-300 \u0441\u043b\u043e\u0432, \u0442\u0430\u043a\u0436\u0435 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u043a\u043e\u043b\u043e 500. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0443\u0437\u043d\u0430\u0442\u044c, \u043a\u0430\u043a\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0442\u0435\u043a\u0441\u0442\u043e\u0432 \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u0434\u043e 250 \u0438 \u0434\u043e 500 \u0441\u043b\u043e\u0432.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/22e\/0f8\/482\/22e0f8482d8321e7c6787a12944be4f2.png\" alt=\"\" title=\"\" width=\"701\" height=\"194\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/22e\/0f8\/482\/22e0f8482d8321e7c6787a12944be4f2.png\"\/><\/figure>\n<p>250 \u0441\u043b\u043e\u0432 \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u044e\u0442 95,65% \u0441\u043b\u043e\u0432, \u0430 500 \u2014 98,63%. \u041d\u043e \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u043d\u0435\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u0439 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u043e\u0439 \u0441\u0435\u0442\u0438, \u0432\u043e\u0437\u044c\u043c\u0451\u043c \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435 \u043d\u0430 250 \u0441\u043b\u043e\u0432.<\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0435\u0431\u043e\u0439 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0438\u043c\u0435\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 1000 \u0441\u043b\u043e\u0432 \u0432 \u0441\u0432\u043e\u0435\u043c \u0441\u043e\u0441\u0442\u0430\u0432\u0435<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/441\/fa7\/ce4\/441fa7ce4d87ab48a6af8257c9f14c00.png\" alt=\"\" title=\"\" width=\"1354\" height=\"411\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/441\/fa7\/ce4\/441fa7ce4d87ab48a6af8257c9f14c00.png\"\/><\/figure>\n<p>\u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0442\u0430\u043a\u0438\u0445 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0438\u043b\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0435 \u0441\u043b\u043e\u0432\u0430, \u0438\u043b\u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0431\u043e\u0447\u043d\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u043d\u0430\u043a\u0438 \u043f\u0440\u0435\u043f\u0438\u043d\u0430\u043d\u0438\u044f \u0438\u043b\u0438 \u0438\u0435\u0440\u043e\u0433\u043b\u0438\u0444\u044b). \u0412\u0441\u0435 \u043b\u0438\u0448\u043d\u0435\u0435 \u0441\u0442\u043e\u0438\u0442 \u0443\u0431\u0440\u0430\u0442\u044c. \u0422\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u043a\u0441\u0442\u0430 \u0432\u0441\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0443. \u0424\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430 \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u0443:<\/p>\n<pre><code class=\"python\">def custom_standardization(sentence):     # \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043c \u0432 \u043d\u0438\u0436\u043d\u0438\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440     sample = tensorflow.strings.lower(sentence)     # \u0443\u0431\u0438\u0440\u0430\u0435\u043c \u043d\u0435 \u0441\u043b\u043e\u0432\u0435\u0441\u043d\u044b\u0435 \u0437\u043d\u0430\u043a\u0438 (\u043a \u0441\u043b\u043e\u0432\u0435\u0441\u043d\u044b\u043c \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u0431\u0443\u043a\u0432\u044b, \u0446\u0438\u0444\u0440\u044b \u0438 \u0442.\u0434.)     sample = tensorflow.strings.regex_replace(sample, '\\W', ' ')     # \u0443\u0431\u0438\u0440\u0430\u0435\u043c \u0446\u0438\u0444\u0440\u044b     sample = tensorflow.strings.regex_replace(sample, '\\d', ' ')     # \u0443\u0431\u0438\u0440\u0430\u0435\u043c \u0437\u043d\u0430\u043a\u0438 \u043f\u0440\u0435\u043f\u0438\u043d\u0430\u043d\u0438\u044f     return tensorflow.strings.regex_replace(sample,                          '[%s]'%re.escape(string.punctuation), '')<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0432\u0441\u0435\u0433\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u043e\u0439 \u0432\u0435\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043a \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u0443:<\/p>\n<pre><code class=\"python\">vectorize_layer = tensorflow.keras.layers.TextVectorization(                         standardize=custom_standardization,                         split='whitespace',                         max_tokens=max_features,                         output_mode='int',                         output_sequence_length=sequence_length,                         encoding='utf-8') vectorize_layer.adapt(train['comment_text'])<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043e\u0447\u043d\u0443\u044e \u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0432\u044b\u0431\u043e\u0440\u043a\u0438, \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043b\u043e\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<pre><code class=\"python\">X = train[\"comment_text\"]  Y = train[train.columns[2:-1]] X = np.array(vectorize_layer(X))  X_train, X_test, y_train, y_test = train_test_split(X, Y, test_size=0.2)<\/code><\/pre>\n<h3>\u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439<\/h3>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0441\u0432\u0451\u0440\u0442\u043e\u0447\u043d\u043e\u0439 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u043e\u0439 \u0441\u0435\u0442\u0438:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/dc8\/bd6\/8e5\/dc8bd68e574deaae3708e0d051fc407e.png\" width=\"1198\" height=\"416\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dc8\/bd6\/8e5\/dc8bd68e574deaae3708e0d051fc407e.png\"\/><\/figure>\n<pre><code class=\"python\">embedding_dim = 9  cnn_model = Sequential() # \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0435\u043c\u0431\u0435\u0434\u0438\u043d\u0433 cnn_model.add(Embedding(max_features+1, embedding_dim)) cnn_model.add(Dropout(0.2)) # \u0434\u0430\u043b\u0435\u0435 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c cnn_model.add(GlobalAveragePooling1D()) cnn_model.add(Dropout(0.2)) cnn_model.add(Dense(16, activation='relu')) # \u0441\u043b\u043e\u0439 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430. \u0441\u0438\u0433\u043c\u043e\u0438\u0434\u0430 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u0432 \u0440\u0430\u043c\u043a\u0438 [0, 1] # \u0432 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u044f\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u0441\u043b\u043e\u0435\u043c \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u0438\u0433\u043c\u043e\u0438\u0434\u0430 cnn_model.add(Dense(6, activation='sigmoid'))  cnn_model.compile(loss='binary_crossentropy',              optimizer='Adam',              metrics=['accuracy'])<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u043a\u0430\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0439:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/57f\/67d\/8d7\/57f67d8d7c6923e97c474197cbe15e3c.png\" width=\"1340\" height=\"513\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/57f\/67d\/8d7\/57f67d8d7c6923e97c474197cbe15e3c.png\"\/><\/figure>\n<p>\u041e\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e (\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0439 \u044d\u043f\u043e\u0445\u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 3-5 \u0441\u0435\u043a\u0443\u043d\u0434), \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e.<\/p>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043c \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u0441 \u0434\u043e\u043b\u0433\u043e\u0439 \u043a\u0440\u0430\u0442\u043a\u043e\u0441\u0440\u043e\u0447\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u044c\u044e (long short-term memory; LSTM) \u0438 \u043e\u0446\u0435\u043d\u0438\u043c \u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0438 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c:<\/p>\n<pre><code class=\"python\">lstm_epochs = 5  lstm_model = Sequential() lstm_model.add(Embedding(max_features+1, embedding_dim)) lstm_model.add(LSTM(16)) lstm_model.add(Dropout(0.2)) lstm_model.add(Dense(16, activation='relu')) lstm_model.add(Dense(6, activation='sigmoid'))  lstm_model.compile(loss='binary_crossentropy',              optimizer='Adam',              metrics=['accuracy'])<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e5d\/c9f\/c25\/e5dc9fc253f61248dafceb7ffb1a7820.png\" width=\"1366\" height=\"450\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e5d\/c9f\/c25\/e5dc9fc253f61248dafceb7ffb1a7820.png\"\/><\/figure>\n<p>\u041d\u0435\u0439\u0440\u043e\u043d\u043d\u0430\u044f \u0441\u0435\u0442\u044c \u0441 \u0434\u043e\u043b\u0433\u043e\u0439 \u043a\u0440\u0430\u0442\u043a\u043e\u0441\u0440\u043e\u0447\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 \u0441\u0432\u0451\u0440\u0442\u043e\u0447\u043d\u043e\u0439 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u043e\u0439 \u0441\u0435\u0442\u0438, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u043e\u0431\u043b\u0430\u0434\u0430\u044f \u0441\u0438\u043b\u044c\u043d\u044b\u043c \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u043e \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043c \u0438 \u043e\u0446\u0435\u043d\u0438\u043c \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u043c\u0438 \u0440\u0435\u043a\u0443\u0440\u0440\u0435\u043d\u0442\u043d\u044b\u043c\u0438 \u0431\u043b\u043e\u043a\u0430\u043c\u0438 (gated recurrent units, GRU)<\/p>\n<pre><code class=\"python\">gru_epochs = 5  gru_model = Sequential() gru_model.add(Embedding(max_features+1, embedding_dim)) gru_model.add(GRU(16)) gru_model.add(Dropout(0.2)) gru_model.add(Dense(16, activation='relu')) gru_model.add(Dense(6, activation='sigmoid'))  gru_model.compile(loss='binary_crossentropy',              optimizer='Adam',              metrics=['accuracy'])  gru_model.summary()<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5b1\/5e1\/f9f\/5b15e1f9f484a5379a8f4ac5e54f142b.png\" width=\"1372\" height=\"457\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5b1\/5e1\/f9f\/5b15e1f9f484a5379a8f4ac5e54f142b.png\"\/><\/figure>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0439, \u0447\u0435\u043c \u0441\u0432\u0451\u0440\u0442\u043e\u0447\u043d\u0430\u044f \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u0430\u044f \u0441\u0435\u0442\u044c, \u043d\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0447\u0435\u043c \u0441\u0435\u0442\u044c \u0441 \u0434\u043e\u043b\u0433\u043e\u0439 \u043a\u0440\u0430\u0442\u043a\u043e\u0441\u0440\u043e\u0447\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u044c\u044e, \u043d\u0435 \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u044b\u043c \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u043c \u0432 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p><strong>\u0412\u044b\u0432\u043e\u0434\u044b<\/strong>: \u0438\u0437 \u0432\u0441\u0435\u0445 \u0442\u0440\u0451\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441\u0435\u0431\u044f \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430 \u0441\u0432\u0451\u0440\u0442\u043e\u0447\u043d\u0430\u044f \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u0430\u044f \u0441\u0435\u0442\u044c.<\/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\/757688\/\"> https:\/\/habr.com\/ru\/articles\/757688\/<\/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 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u043b\u0443\u0431\u043e\u043a\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043e\u0446\u0435\u043d\u043a\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u043e\u043a\u0440\u0430\u0441\u043e\u043a \u0442\u0435\u043a\u0441\u0442\u0430, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u0443\u0433\u0440\u043e\u0437\u044b, \u043d\u0435\u043f\u0440\u0438\u0441\u0442\u043e\u0439\u043d\u043e\u0441\u0442\u0438, \u043e\u0441\u043a\u043e\u0440\u0431\u043b\u0435\u043d\u0438\u044f.<\/p>\n<figure class=\"full-width\"><\/figure>\n<h3>\u0414\u0430\u043d\u043d\u044b\u0435<\/h3>\n<p>\u041d\u0430\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 Conversation AI. \u0422\u0435\u043a\u0441\u0442\u044b \u0432\u0437\u044f\u0442\u044b \u0438\u0437 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u043a \u043f\u0440\u0430\u0432\u043a\u0430\u043c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044f \u0412\u0438\u043a\u0438\u043f\u0435\u0434\u0438\u0438. \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u0442 223 549 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0441 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u043e\u0439.<\/p>\n<p>\u041d\u0443\u0436\u043d\u043e \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0442\u0435\u043a\u0441\u0442\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f (comment_text) \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0442\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c (\u043a\u043e\u043b\u043e\u043d\u043a\u0438 toxic, severe_toxic, obscene, threat, insult, identity_hate). \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 1 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u0439:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"222\" width=\"222\">\n<p align=\"left\"><strong>comment_text<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\"><strong>toxic<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"109\" width=\"109\">\n<p align=\"left\"><strong>severe_toxic<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"left\"><strong>obscene<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"56\" width=\"56\">\n<p align=\"left\"><strong>threat<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"73\" width=\"73\">\n<p align=\"left\"><strong>insult<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong> identity_hate<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"222\" width=\"222\">\n<p align=\"left\">&#171;You should be fired, you&#8217;re a moronic wimp who is too lazy to do research. It makes me sick that people like you exist in this world.&#187;  <\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">1<\/p>\n<\/td>\n<td data-colwidth=\"109\" width=\"109\">\n<p align=\"left\">0<\/p>\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"left\">0<\/p>\n<\/td>\n<td data-colwidth=\"56\" width=\"56\">\n<p align=\"left\">0<\/p>\n<\/td>\n<td data-colwidth=\"73\" width=\"73\">\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"222\" width=\"222\">\n<p align=\"left\">&#171;Oh, I didn&#8217;t know, thanks.&#187;  <\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">0<\/p>\n<\/td>\n<td data-colwidth=\"109\" width=\"109\">\n<p align=\"left\">0<\/p>\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"left\">0<\/p>\n<\/td>\n<td data-colwidth=\"56\" width=\"56\">\n<p align=\"left\">0<\/p>\n<\/td>\n<td data-colwidth=\"73\" width=\"73\">\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h3>\u041c\u043e\u0434\u0435\u043b\u0438<\/h3>\n<p>\u0413\u043b\u0443\u0431\u043e\u043a\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u044d\u043c\u043e\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u043a\u0440\u0430\u0441\u043a\u0438 \u0442\u0435\u043a\u0441\u0442\u0430:<\/p>\n<ul>\n<li>\n<p><strong>\u0441\u0432\u0435\u0440\u0442\u043e\u0447\u043d\u044b\u0435 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0435 \u0441\u0435\u0442\u0438<\/strong> (CNN, convolutional neural network):\u00a0\u043a\u043b\u0430\u0441\u0441 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439, \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0445 \u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0442\u0435\u043a\u0441\u0442\u043e\u0432. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0435\u043d\u0442\u0438\u043c\u0435\u043d\u0442-\u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0442\u0435\u043a\u0441\u0442\u0430, \u0441\u0432\u0435\u0440\u0442\u043e\u0447\u043d\u044b\u0435 \u0441\u043b\u043e\u0438 CNN \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0438\u0437 \u0442\u0435\u043a\u0441\u0442\u0430, \u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0432\u044f\u0437\u043d\u044b\u0435 \u0441\u043b\u043e\u0438 \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0442\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438;<\/p>\n<\/li>\n<li>\n<p><strong>\u0440\u0435\u043a\u0443\u0440\u0440\u0435\u043d\u0442\u043d\u044b\u0435 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0435 \u0441\u0435\u0442\u0438<\/strong> (RNN, Recurrent neural network): \u043a\u043b\u0430\u0441\u0441 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439, \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u0421\u0435\u0442\u0438 \u0441 \u0434\u043e\u043b\u0433\u043e\u0439 \u043a\u0440\u0430\u0442\u043a\u043e\u0441\u0440\u043e\u0447\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u044c\u044e (LSTM, long short-term memory) \u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u043c\u0438 \u0440\u0435\u043a\u0443\u0440\u0440\u0435\u043d\u0442\u043d\u044b\u043c\u0438 \u0431\u043b\u043e\u043a\u0430\u043c\u0438 (GRU, Gated Recurrent Unit) \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\u043c\u0438 RNN, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u043c\u0438 \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0434\u043e\u043b\u0433\u043e\u0441\u0440\u043e\u0447\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u0442\u0435\u043a\u0441\u0442\u0435;<\/p>\n<\/li>\n<li>\n<p><strong>Transformer<\/strong>: \u043c\u043e\u0434\u0435\u043b\u044c \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u0430 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u0432 \u0442\u0435\u043a\u0441\u0442\u0435 \u0438 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0438\u0445 \u0432\u0430\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043e \u0442\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u041f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u0442\u0430\u043a\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f BERT (Bidirectional Encoder Representations from Transformers).<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u043c CNN, LSTM \u0438 GRU.<\/p>\n<h3>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>\u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0442\u0435\u043a\u0441\u0442\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u0431\u0438\u0442\u044b \u043d\u0430 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u043b\u043e\u043a\u043e\u0432. \u0414\u0430\u043b\u0435\u0435 \u0438\u0437 \u043d\u0438\u0445 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0441\u043b\u043e\u0432\u0430\u0440\u044c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0443 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0435 \u0447\u0438\u0441\u043b\u043e, \u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d \u0432 \u0432\u0435\u043a\u0442\u043e\u0440 \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438. \u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a\u043e\u0435 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u043b\u043e\u043a\u043e\u0432 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e (\u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0435 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0439, \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u2014\u00a0 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442 \u0432\u0440\u0435\u043c\u044f \u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439). \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0438\u0437 \u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0441\u043b\u043e\u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432 \u0442\u0435\u043a\u0441\u0442\u0435:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c \u0442\u0435\u043a\u0441\u0442\u044b \u0441\u043e\u0441\u0442\u043e\u044f\u0442 \u0438\u0437 68 \u0441\u043b\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0438\u0437 \u043d\u0438\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043c\u0435\u043d\u0435\u0435 76 \u0441\u043b\u043e\u0432, \u043d\u043e \u0435\u0441\u0442\u044c \u0438 \u0442\u0435\u043a\u0441\u0442\u044b \u0441 2834 \u0441\u043b\u043e\u0432\u0430\u043c\u0438.<\/p>\n<p>\u041f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0431\u043b\u043e\u043a\u043e\u0432 \u0441\u0442\u043e\u0438\u0442 \u0432\u0437\u044f\u0442\u044c \u0442\u0430\u043a\u043e\u0435 \u0447\u0438\u0441\u043b\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u043a\u0440\u043e\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0442\u0435\u043a\u0441\u0442\u043e\u0432. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0433\u0440\u0430\u0444\u0438\u043a \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u0430 (count plot) \u0434\u043b\u044f \u0434\u043b\u0438\u043d\u044b \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041f\u043e \u0433\u0440\u0430\u0444\u0438\u043a\u0443 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0442\u0435\u043a\u0441\u0442\u043e\u0432 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0434\u043e 250-300 \u0441\u043b\u043e\u0432, \u0442\u0430\u043a\u0436\u0435 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u043a\u043e\u043b\u043e 500. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0443\u0437\u043d\u0430\u0442\u044c, \u043a\u0430\u043a\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0442\u0435\u043a\u0441\u0442\u043e\u0432 \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u0434\u043e 250 \u0438 \u0434\u043e 500 \u0441\u043b\u043e\u0432.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>250 \u0441\u043b\u043e\u0432 \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u044e\u0442 95,65% \u0441\u043b\u043e\u0432, \u0430 500 \u2014 98,63%. \u041d\u043e \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u043d\u0435\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u0439 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u043e\u0439 \u0441\u0435\u0442\u0438, \u0432\u043e\u0437\u044c\u043c\u0451\u043c \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435 \u043d\u0430 250 \u0441\u043b\u043e\u0432.<\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0435\u0431\u043e\u0439 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0438\u043c\u0435\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 1000 \u0441\u043b\u043e\u0432 \u0432 \u0441\u0432\u043e\u0435\u043c \u0441\u043e\u0441\u0442\u0430\u0432\u0435<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0442\u0430\u043a\u0438\u0445 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0438\u043b\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0435 \u0441\u043b\u043e\u0432\u0430, \u0438\u043b\u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0431\u043e\u0447\u043d\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u043d\u0430\u043a\u0438 \u043f\u0440\u0435\u043f\u0438\u043d\u0430\u043d\u0438\u044f \u0438\u043b\u0438 \u0438\u0435\u0440\u043e\u0433\u043b\u0438\u0444\u044b). \u0412\u0441\u0435 \u043b\u0438\u0448\u043d\u0435\u0435 \u0441\u0442\u043e\u0438\u0442 \u0443\u0431\u0440\u0430\u0442\u044c. \u0422\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u043a\u0441\u0442\u0430 \u0432\u0441\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0443. \u0424\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430 \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u0443:<\/p>\n<pre><code class=\"python\">def custom_standardization(sentence):     # \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043c \u0432 \u043d\u0438\u0436\u043d\u0438\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440     sample = tensorflow.strings.lower(sentence)     # \u0443\u0431\u0438\u0440\u0430\u0435\u043c \u043d\u0435 \u0441\u043b\u043e\u0432\u0435\u0441\u043d\u044b\u0435 \u0437\u043d\u0430\u043a\u0438 (\u043a \u0441\u043b\u043e\u0432\u0435\u0441\u043d\u044b\u043c \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u0431\u0443\u043a\u0432\u044b, \u0446\u0438\u0444\u0440\u044b \u0438 \u0442.\u0434.)     sample = tensorflow.strings.regex_replace(sample, '\\W', ' ')     # \u0443\u0431\u0438\u0440\u0430\u0435\u043c \u0446\u0438\u0444\u0440\u044b     sample = tensorflow.strings.regex_replace(sample, '\\d', ' ')     # \u0443\u0431\u0438\u0440\u0430\u0435\u043c \u0437\u043d\u0430\u043a\u0438 \u043f\u0440\u0435\u043f\u0438\u043d\u0430\u043d\u0438\u044f     return tensorflow.strings.regex_replace(sample,                          '[%s]'%re.escape(string.punctuation), '')<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0432\u0441\u0435\u0433\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u043e\u0439 \u0432\u0435\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043a \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u0443:<\/p>\n<pre><code class=\"python\">vectorize_layer = tensorflow.keras.layers.TextVectorization(                         standardize=custom_standardization,                         split='whitespace',                         max_tokens=max_features,                         output_mode='int',                         output_sequence_length=sequence_length,                         encoding='utf-8') vectorize_layer.adapt(train['comment_text'])<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043e\u0447\u043d\u0443\u044e \u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0432\u044b\u0431\u043e\u0440\u043a\u0438, \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043b\u043e\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<pre><code class=\"python\">X = train[\"comment_text\"]  Y = train[train.columns[2:-1]] X = np.array(vectorize_layer(X))  X_train, X_test, y_train, y_test = train_test_split(X, Y, test_size=0.2)<\/code><\/pre>\n<h3>\u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439<\/h3>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0441\u0432\u0451\u0440\u0442\u043e\u0447\u043d\u043e\u0439 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u043e\u0439 \u0441\u0435\u0442\u0438:<\/p>\n<figure class=\"full-width\"><\/figure>\n<pre><code class=\"python\">embedding_dim = 9  cnn_model = Sequential() # \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0435\u043c\u0431\u0435\u0434\u0438\u043d\u0433 cnn_model.add(Embedding(max_features+1, embedding_dim)) cnn_model.add(Dropout(0.2)) # \u0434\u0430\u043b\u0435\u0435 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c cnn_model.add(GlobalAveragePooling1D()) cnn_model.add(Dropout(0.2)) cnn_model.add(Dense(16, activation='relu')) # \u0441\u043b\u043e\u0439 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430. \u0441\u0438\u0433\u043c\u043e\u0438\u0434\u0430 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u0432 \u0440\u0430\u043c\u043a\u0438 [0, 1] # \u0432 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u044f\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u0441\u043b\u043e\u0435\u043c \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u0438\u0433\u043c\u043e\u0438\u0434\u0430 cnn_model.add(Dense(6, activation='sigmoid'))  cnn_model.compile(loss='binary_crossentropy',              optimizer='Adam',              metrics=['accuracy'])<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u043a\u0430\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0439:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041e\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e (\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0439 \u044d\u043f\u043e\u0445\u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 3-5 \u0441\u0435\u043a\u0443\u043d\u0434), \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e.<\/p>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043c \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u0441 \u0434\u043e\u043b\u0433\u043e\u0439 \u043a\u0440\u0430\u0442\u043a\u043e\u0441\u0440\u043e\u0447\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u044c\u044e (long short-term memory; LSTM) \u0438 \u043e\u0446\u0435\u043d\u0438\u043c \u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0438 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c:<\/p>\n<pre><code class=\"python\">lstm_epochs = 5  lstm_model = Sequential() lstm_model.add(Embedding(max_features+1, embedding_dim)) lstm_model.add(LSTM(16)) lstm_model.add(Dropout(0.2)) lstm_model.add(Dense(16, activation='relu')) lstm_model.add(Dense(6, activation='sigmoid'))  lstm_model.compile(loss='binary_crossentropy',              optimizer='Adam',              metrics=['accuracy'])<\/code><\/pre>\n<figure class=\"full-width\"><\/figure>\n<p>\u041d\u0435\u0439\u0440\u043e\u043d\u043d\u0430\u044f \u0441\u0435\u0442\u044c \u0441 \u0434\u043e\u043b\u0433\u043e\u0439 \u043a\u0440\u0430\u0442\u043a\u043e\u0441\u0440\u043e\u0447\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 \u0441\u0432\u0451\u0440\u0442\u043e\u0447\u043d\u043e\u0439 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u043e\u0439 \u0441\u0435\u0442\u0438, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u043e\u0431\u043b\u0430\u0434\u0430\u044f \u0441\u0438\u043b\u044c\u043d\u044b\u043c \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u043e \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043c \u0438 \u043e\u0446\u0435\u043d\u0438\u043c \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u043c\u0438 \u0440\u0435\u043a\u0443\u0440\u0440\u0435\u043d\u0442\u043d\u044b\u043c\u0438 \u0431\u043b\u043e\u043a\u0430\u043c\u0438 (gated recurrent units, GRU)<\/p>\n<pre><code class=\"python\">gru_epochs = 5  gru_model = Sequential() gru_model.add(Embedding(max_features+1, embedding_dim)) gru_model.add(GRU(16)) gru_model.add(Dropout(0.2)) gru_model.add(Dense(16, activation='relu')) gru_model.add(Dense(6, activation='sigmoid'))  gru_model.compile(loss='binary_crossentropy',              optimizer='Adam',              metrics=['accuracy'])  gru_model.summary()<\/code><\/pre>\n<figure class=\"full-width\"><\/figure>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0439, \u0447\u0435\u043c \u0441\u0432\u0451\u0440\u0442\u043e\u0447\u043d\u0430\u044f \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u0430\u044f \u0441\u0435\u0442\u044c, \u043d\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0447\u0435\u043c \u0441\u0435\u0442\u044c \u0441 \u0434\u043e\u043b\u0433\u043e\u0439 \u043a\u0440\u0430\u0442\u043a\u043e\u0441\u0440\u043e\u0447\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u044c\u044e, \u043d\u0435 \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u044b\u043c \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u043c \u0432 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p><strong>\u0412\u044b\u0432\u043e\u0434\u044b<\/strong>: \u0438\u0437 \u0432\u0441\u0435\u0445 \u0442\u0440\u0451\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441\u0435\u0431\u044f \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430 \u0441\u0432\u0451\u0440\u0442\u043e\u0447\u043d\u0430\u044f \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u0430\u044f \u0441\u0435\u0442\u044c.<\/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\/757688\/\"> https:\/\/habr.com\/ru\/articles\/757688\/<\/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-353483","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/353483","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=353483"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/353483\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=353483"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=353483"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=353483"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}