{"id":293263,"date":"2019-08-12T15:00:36","date_gmt":"2019-08-12T15:00:36","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=293263"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=293263","title":{"rendered":"\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u044d\u043c\u043e\u0446\u0438\u0439 \u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0431\u0435\u0441\u0435\u0434\u0430\u0445 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/t6\/sr\/jr\/t6srjrmjjmm6qn8gpld9emy4txu.gif\"><\/div>\n<p>  \u041e\u0434\u043d\u0430 \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043d\u0443\u0436\u043d\u043e\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u043d\u043e \u0438 \u0432 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u0442\u0432\u0435\u0442\u043e\u0432. \u0410 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043d\u0438\u0435 \u044d\u043c\u043e\u0446\u0438\u0439 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043d\u0438\u043a\u0430 \u2013 \u0443\u0436\u0435 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u0440\u0443\u0442\u0430\u044f \u0444\u0438\u0447\u0430, \u044d\u0442\u043e \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u0430\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c <b>\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0440\u0435\u043a\u0443\u0440\u0440\u0435\u043d\u0442\u043d\u043e\u0439 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u044d\u043c\u043e\u0446\u0438\u0439 \u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0431\u0435\u0441\u0435\u0434\u0430\u0445<\/b>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u043b\u0430 \u0443\u0447\u0430\u0441\u0442\u0438\u0435 \u0432 <a href=\"http:\/\/alt.qcri.org\/semeval2019\/index.php?id=tasks\">SemEval-2019 Task 3 \u201cEmoContext\u201d<\/a>, \u0435\u0436\u0435\u0433\u043e\u0434\u043d\u043e\u043c \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u043e \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u043e\u0439 \u043b\u0438\u043d\u0433\u0432\u0438\u0441\u0442\u0438\u043a\u0435. \u0417\u0430\u0434\u0430\u0447\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043b\u0430 \u0432 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u044d\u043c\u043e\u0446\u0438\u0439 (\u201chappy\u201d, \u201csad\u201d, \u201cangry\u201d \u0438 \u201cothers\u201d) \u0432 \u0431\u0435\u0441\u0435\u0434\u0435 \u0438\u0437 \u0442\u0440\u0435\u0445 \u0440\u0435\u043f\u043b\u0438\u043a, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0438 \u0447\u0430\u0442-\u0431\u043e\u0442 \u0438 \u0447\u0435\u043b\u043e\u0432\u0435\u043a.<\/p>\n<p>  \u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0432 EmoContext \u0437\u0430\u0434\u0430\u0447\u0443 \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0435. \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0438 \u0442\u0440\u0435\u0442\u044c\u0435\u0439 \u0447\u0430\u0441\u0442\u044f\u0445 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043b\u043e\u0432. \u0412 \u0447\u0435\u0442\u0432\u0451\u0440\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u043e\u043f\u0438\u0448\u0435\u043c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 LSTM, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0432 \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u043d\u0438\u0438. \u041a\u043e\u0434 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Python \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Keras. <br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>1. \u041e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h2>\n<p>  \u0422\u0440\u0435\u043a \u201cEmoContext\u201d \u043d\u0430 SemEval-2019 \u0431\u044b\u043b \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u044d\u043c\u043e\u0446\u0438\u0439 \u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0431\u0435\u0441\u0435\u0434\u0430\u0445 \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u043a\u0438. \u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2013 \u044d\u0442\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u043f\u043b\u0438\u043a \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432 \u0434\u0438\u0430\u043b\u043e\u0433\u0430. \u0412 \u0431\u0435\u0441\u0435\u0434\u0435 \u0434\u0432\u0430 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u0430: \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c (\u0435\u043c\u0443 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u043f\u0435\u0440\u0432\u0430\u044f \u0438 \u0442\u0440\u0435\u0442\u044c\u044f \u0440\u0435\u043f\u043b\u0438\u043a\u0430) \u0438 \u0447\u0430\u0442-\u0431\u043e\u0442 <a href=\"https:\/\/www.ruuh.ai\/\">Ruuh<\/a> (\u0435\u043c\u0443 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u0432\u0442\u043e\u0440\u0430\u044f \u0440\u0435\u043f\u043b\u0438\u043a\u0430). \u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0442\u0440\u0435\u0445 \u0440\u0435\u043f\u043b\u0438\u043a \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u043a\u0430\u043a\u0443\u044e \u044d\u043c\u043e\u0446\u0438\u044e \u0438\u0441\u043f\u044b\u0442\u044b\u0432\u0430\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043e\u0442\u0432\u0435\u0442\u0430 \u0447\u0430\u0442-\u0431\u043e\u0442\u0443 (\u0422\u0430\u0431\u043b\u0438\u0446\u0430 1). \u0412\u0441\u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043b\u0430 \u0447\u0435\u0442\u044b\u0440\u0435 \u044d\u043c\u043e\u0446\u0438\u0438: \u00abhappy\u00bb, \u00absad\u00bb, \u00abangry\u00bb \u0438\u043b\u0438 \u00abothers\u00bb (\u0422\u0430\u0431\u043b\u0438\u0446\u0430 1). \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u0437\u0434\u0435\u0441\u044c: (<a href=\"https:\/\/www.aclweb.org\/anthology\/papers\/S\/S19\/S19-2005\/\">Chatterjee et al., 2019<\/a>).<\/p>\n<p>  <i>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 1. \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0437 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430 EmoContext (<a href=\"https:\/\/www.aclweb.org\/anthology\/papers\/S\/S19\/S19-2005\/\">Chatterjee et al., 2019<\/a>)<\/i>  <\/p>\n<div class=\"scrollable-table\">\n<table>\n<tr>\n<th>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c (\u042d\u0442\u0430\u043f-1)<\/th>\n<th>\u0414\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u044b\u0439 \u0440\u043e\u0431\u043e\u0442 (\u042d\u0442\u0430\u043f-1)<\/th>\n<th>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c (\u042d\u0442\u0430\u043f-2)<\/th>\n<th>True Class<\/th>\n<\/tr>\n<tr>\n<td>I just qualified for the Nabard internship<\/td>\n<td>WOOT! That\u2019s great news. Congratulations!<\/td>\n<td>I started crying<\/td>\n<td>\u0421\u0447\u0430\u0441\u0442\u044c\u0435<\/td>\n<\/tr>\n<tr>\n<td>How dare you to slap my child<\/td>\n<td>If you spoil my car, I will do that to you too<\/td>\n<td>Just try to do that once<\/td>\n<td>\u0417\u043b\u043e\u0441\u0442\u044c<\/td>\n<\/tr>\n<tr>\n<td>I was hurt by u more<\/td>\n<td>You didn\u2019t mean it.<\/td>\n<td>say u love me<\/td>\n<td>\u0413\u0440\u0443\u0441\u0442\u044c<\/td>\n<\/tr>\n<tr>\n<td>I will do night.<\/td>\n<td>Alright. Keep me in loop.<\/td>\n<td>Not giving WhatsApp no.<\/td>\n<td>\u0414\u0440\u0443\u0433\u043e\u0435<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>  \u0412 \u0445\u043e\u0434\u0435 \u0441\u043e\u0441\u0442\u044f\u0437\u0430\u043d\u0438\u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u044b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0431\u043e\u0440\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445. \u041e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0439 \u0434\u0430\u0442\u0430\u0441\u0435\u0442 (Train) \u0441\u043e\u0441\u0442\u043e\u044f\u043b \u0438\u0437 30 160 \u0440\u0430\u0437\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0445 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0442\u0435\u043a\u0441\u0442\u043e\u0432. \u0412 \u044d\u0442\u0438\u0445 \u0442\u0435\u043a\u0441\u0442\u0430\u0445 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043f\u043e 5000 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0438\u0445\u0441\u044f \u043a \u043a\u043b\u0430\u0441\u0441\u0430\u043c \u00abhappy\u00bb, \u00absad\u00bb \u0438 \u00abangry\u00bb, \u0430 \u0442\u0430\u043a\u0436\u0435 15000 \u0442\u0435\u043a\u0441\u0442\u043e\u0432 \u0438\u0437 \u043a\u043b\u0430\u0441\u0441\u0430 \u00abothers\u00bb (\u0422\u0430\u0431\u043b\u0438\u0446\u0430 2). <\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u044b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u043d\u0430\u0431\u043e\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 (Dev) \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (Test), \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0435\u0433\u043e \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430, \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u043e \u043a\u043b\u0430\u0441\u0441\u0430\u043c \u044d\u043c\u043e\u0446\u0438\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0436\u0438\u0437\u043d\u0438: \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043f\u043e 4 % \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u00abhappy\u00bb, \u00absad\u00bb \u0438 \u00abangry\u00bb, \u0430 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u2014 \u043a\u043b\u0430\u0441\u0441 \u00abothers\u00bb. \u0414\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b Microsoft, \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0432 <a href=\"https:\/\/www.linkedin.com\/feed\/update\/urn:li:activity:6439879151053836288\/\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0435 \u0432 LinkedIn<\/a>.<\/p>\n<p>  <i>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 2. \u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u043a \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u044d\u043c\u043e\u0446\u0438\u0439 \u0432 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0435 (<a href=\"https:\/\/www.aclweb.org\/anthology\/papers\/S\/S19\/S19-2005\/\">Chatterjee et al., 2019<\/a>).<\/i>  <\/p>\n<div class=\"scrollable-table\">\n<table>\n<tr>\n<th>\u0414\u0430\u0442\u0430\u0441\u0435\u0442<\/th>\n<th>\u0421\u0447\u0430\u0441\u0442\u044c\u0435<\/th>\n<th>\u0413\u0440\u0443\u0441\u0442\u044c<\/th>\n<th>\u0417\u043b\u043e\u0441\u0442\u044c<\/th>\n<th>\u0414\u0440\u0443\u0433\u043e\u0435<\/th>\n<th>\u0418\u0442\u043e\u0433\u043e<\/th>\n<\/tr>\n<tr>\n<td>\u0423\u0447\u0435\u0431\u043d\u044b\u0439  <\/td>\n<td>14,07 %  <\/td>\n<td>18,11 %  <\/td>\n<td>18,26 %  <\/td>\n<td>49,56 %  <\/td>\n<td>30 160  <\/td>\n<\/tr>\n<tr>\n<td>\u0414\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438  <\/td>\n<td>5,15 %  <\/td>\n<td>4,54 %  <\/td>\n<td> 5,45 %  <\/td>\n<td>84,86 %  <\/td>\n<td>2755  <\/td>\n<\/tr>\n<tr>\n<td>\u0422\u0435\u0441\u0442\u043e\u0432\u044b\u0439  <\/td>\n<td>5,16 %  <\/td>\n<td>4,54 %  <\/td>\n<td>5,41 %  <\/td>\n<td> 84,90 %  <\/td>\n<td>5509  <\/td>\n<\/tr>\n<tr>\n<td>\u0414\u0438\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439  <\/td>\n<td>33,33 %  <\/td>\n<td>33,33 %  <\/td>\n<td>33,33 %  <\/td>\n<td>0 %  <\/td>\n<td>900 \u0442\u044b\u0441.  <\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>  \u0412 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a \u044d\u0442\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u043c \u043c\u044b \u0441\u043e\u0431\u0440\u0430\u043b\u0438 900 \u0442\u044b\u0441. \u0430\u043d\u0433\u043b\u043e\u044f\u0437\u044b\u0447\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0438\u0437 Twitter, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c Distant-\u0434\u0430\u0442\u0430\u0441\u0435\u0442 (300 \u0442\u044b\u0441. \u0442\u0432\u0438\u0442\u043e\u0432 \u043d\u0430 \u043a\u0430\u0436\u0434\u0443\u044e \u044d\u043c\u043e\u0446\u0438\u044e). \u041f\u0440\u0438 \u0435\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043c\u044b \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 Go et al. (2009), \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e \u0430\u0441\u0441\u043e\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441 \u043d\u0430\u043b\u0438\u0447\u0438\u0435\u043c \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0438\u0445\u0441\u044f \u043a \u044d\u043c\u043e\u0446\u0438\u044f\u043c \u0441\u043b\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a #angry, #annoyed, #happy, #sad, #surprised \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u0421\u043f\u0438\u0441\u043e\u043a \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u0432 \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445 \u0438\u0437 SemEval-2018 AIT DISC (<a href=\"https:\/\/aclweb.org\/anthology\/papers\/S\/S18\/S18-1002\/\">Duppada et al., 2018<\/a>). <\/p>\n<p>  \u0413\u043b\u0430\u0432\u043d\u043e\u0439 \u043c\u0435\u0442\u0440\u0438\u043a\u043e\u0439 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0432 \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u043d\u0438\u0438 EmoContext \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u043d\u0430\u044f F1-\u043c\u0435\u0440\u0430 \u0434\u043b\u044f \u0442\u0440\u0451\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u044d\u043c\u043e\u0446\u0438\u0439, \u0442\u043e \u0435\u0441\u0442\u044c \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u00abhappy\u00bb, \u00absad\u00bb \u0438 \u00abangry\u00bb.<\/p>\n<pre><code class=\"python\">def preprocessData(dataFilePath, mode): \tconversations = [] \tlabels = [] \twith io.open(dataFilePath, encoding=\"utf8\") as finput:     \tfinput.readline()     \tfor line in finput:         \tline = line.strip().split('\\t')         \tfor i in range(1, 4):             \tline[i] = tokenize(line[i])         \tif mode == \"train\":             \tlabels.append(emotion2label[line[4]])         \tconv = line[1:4]         \tconversations.append(conv) \tif mode == \"train\":     \treturn np.array(conversations), np.array(labels) \telse:     \treturn np.array(conversations)  texts_train, labels_train = preprocessData('.\/starterkitdata\/train.txt', mode=\"train\") texts_dev, labels_dev = preprocessData('.\/starterkitdata\/dev.txt', mode=\"train\") texts_test, labels_test = preprocessData('.\/starterkitdata\/test.txt', mode=\"train\") <\/code><\/pre>\n<p>  <\/p>\n<h2>2. \u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0442\u0435\u043a\u0441\u0442\u0430<\/h2>\n<p>  \u041f\u0435\u0440\u0435\u0434 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u043c\u044b \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0442\u0435\u043a\u0441\u0442\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 Ekphrasis (Baziotis et al., 2017). \u041e\u043d \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0440\u0444\u043e\u0433\u0440\u0430\u0444\u0438\u044e, \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0432\u0430, \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0442\u043e\u043a\u0435\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0442\u0431\u0440\u043e\u0441\u0438\u0442\u044c, \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043b\u0438 \u0430\u043d\u043d\u043e\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0433\u043e\u0432. \u041d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<ul>\n<li>\u0410\u0434\u0440\u0435\u0441\u0430 URL \u0438 \u043f\u043e\u0447\u0442\u0443, \u0434\u0430\u0442\u0443 \u0438 \u0432\u0440\u0435\u043c\u044f, \u043d\u0438\u043a\u0438, \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u044b, \u0432\u0430\u043b\u044e\u0442\u044b \u0438 \u0447\u0438\u0441\u043b\u0430 \u0437\u0430\u043c\u0435\u043d\u0438\u043b\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 \u0442\u0435\u0433\u0430\u043c\u0438.<\/li>\n<li>\u041f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0435\u0441\u044f, \u0446\u0435\u043d\u0437\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435, \u0443\u0434\u043b\u0438\u043d\u0451\u043d\u043d\u044b\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u043f\u0438\u0441\u043d\u044b\u043c\u0438 \u0431\u0443\u043a\u0432\u0430\u043c\u0438 \u0442\u0435\u0440\u043c\u0438\u043d\u044b \u043c\u044b \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 \u043c\u0435\u0442\u043a\u0430\u043c\u0438.<\/li>\n<li>\u0423\u0434\u043b\u0438\u043d\u0451\u043d\u043d\u044b\u0435 \u0441\u043b\u043e\u0432\u0430 \u0431\u044b\u043b\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b.<\/li>\n<\/ul>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, Emphasis \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u043e\u043a\u0435\u043d\u0438\u0437\u0430\u0442\u043e\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u044d\u043c\u043e\u0434\u0437\u0438, \u044d\u043c\u043e\u0442\u0438\u043a\u043e\u043d\u043e\u0432 \u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u0430\u0442\u044b, \u0432\u0440\u0435\u043c\u044f, \u0432\u0430\u043b\u044e\u0442\u044b \u0438 \u0430\u043a\u0440\u043e\u043d\u0438\u043c\u044b.<\/p>\n<p>  <i>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 3. \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0442\u0435\u043a\u0441\u0442\u0430.<\/i>  <\/p>\n<div class=\"scrollable-table\">\n<table>\n<tr>\n<th>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/th>\n<th>\u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/th>\n<\/tr>\n<tr>\n<td>I FEEL YOU\u2026 I&#8217;m breaking into million pieces <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/2n\/p4\/l5\/2np4l5uym3fkohcwlijjcma8eaw.png\" width=\"100\"><\/td>\n<td>&lt;allcaps&gt; i feel you &lt;\/allcaps&gt;. &lt;repeated&gt; i am breaking into million pieces <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/2n\/p4\/l5\/2np4l5uym3fkohcwlijjcma8eaw.png\" width=\"100\"><\/td>\n<\/tr>\n<tr>\n<td>tired and I missed you too :\u2011(<\/td>\n<td>tired and i missed you too &lt;sad&gt;<\/td>\n<\/tr>\n<tr>\n<td>you should liiiiiiisten to this: <a href=\"https:\/\/www.youtube.com\/watch?v=99myH1orbs4\">www.youtube.com\/watch?v=99myH1orbs4<\/a><\/td>\n<td>you should listen &lt;elongated&gt; to this: &lt;url&gt;<\/td>\n<\/tr>\n<tr>\n<td>My apartment takes care of it. My rent is around $650.<\/td>\n<td>my apartment takes care of it. my rent is around &lt;money&gt; .<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>  <\/p>\n<pre><code class=\"python\">from ekphrasis.classes.preprocessor import TextPreProcessor from ekphrasis.classes.tokenizer import SocialTokenizer from ekphrasis.dicts.emoticons import emoticons import numpy as np  import re import io  label2emotion = {0: \"others\", 1: \"happy\", 2: \"sad\", 3: \"angry\"} emotion2label = {\"others\": 0, \"happy\": 1, \"sad\": 2, \"angry\": 3}  emoticons_additional = { \t'(^\u30fb^)': '&lt;happy&gt;', ':\u2011c': '&lt;sad&gt;', '=\u2011d': '&lt;happy&gt;', \":'\u2011)\": '&lt;happy&gt;', ':\u2011d': '&lt;laugh&gt;', \t':\u2011(': '&lt;sad&gt;', ';\u2011)': '&lt;happy&gt;', ':\u2011)': '&lt;happy&gt;', ':\\\\\/': '&lt;sad&gt;', 'd=&lt;': '&lt;annoyed&gt;', \t':\u2011\/': '&lt;annoyed&gt;', ';\u2011]': '&lt;happy&gt;', '(^\ufffd^)': '&lt;happy&gt;', 'angru': 'angry', \"d\u2011':\":     \t'&lt;annoyed&gt;', \":'\u2011(\": '&lt;sad&gt;', \":\u2011[\": '&lt;annoyed&gt;', '(\ufffd?\ufffd)': '&lt;happy&gt;', 'x\u2011d': '&lt;laugh&gt;', }  text_processor = TextPreProcessor( \t# terms that will be normalized \tnormalize=['url', 'email', 'percent', 'money', 'phone', 'user',            \t'time', 'url', 'date', 'number'], \t# terms that will be annotated \tannotate={\"hashtag\", \"allcaps\", \"elongated\", \"repeated\",           \t'emphasis', 'censored'}, \tfix_html=True,  # fix HTML tokens \t# corpus from which the word statistics are going to be used \t# for word segmentation \tsegmenter=\"twitter\", \t# corpus from which the word statistics are going to be used \t# for spell correction \tcorrector=\"twitter\", \tunpack_hashtags=True,  # perform word segmentation on hashtags \tunpack_contractions=True,  # Unpack contractions (can't -&gt; can not) \tspell_correct_elong=True,  # spell correction for elongated words \t# select a tokenizer. You can use SocialTokenizer, or pass your own \t# the tokenizer, should take as input a string and return a list of tokens \ttokenizer=SocialTokenizer(lowercase=True).tokenize, \t# list of dictionaries, for replacing tokens extracted from the text, \t# with other expressions. You can pass more than one dictionaries. \tdicts=[emoticons, emoticons_additional] )   def tokenize(text): \ttext = \" \".join(text_processor.pre_process_doc(text)) \treturn text     <\/code><\/pre>\n<p>  <\/p>\n<h2>3. \u0412\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043b\u043e\u0432<\/h2>\n<p>  \u0412\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u043b\u043e \u043d\u0435\u043e\u0442\u044a\u0435\u043c\u043b\u0435\u043c\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432 \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e NLP-\u0441\u0438\u0441\u0442\u0435\u043c \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u0433\u043b\u0443\u0431\u043e\u043a\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f. \u0427\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u043c\u044b \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0438 Word2Vec (<a href=\"https:\/\/arxiv.org\/abs\/1310.4546\">Mikolov et al., 2013<\/a>), GloVe (<a href=\"https:\/\/aclweb.org\/anthology\/papers\/D\/D14\/D14-1162\/\">Pennington et al., 2014<\/a>) \u0438 FastText (<a href=\"https:\/\/www.aclweb.org\/anthology\/papers\/E\/E17\/E17-2068\/\">Joulin et al., 2017<\/a>), \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u044b DataStories (<a href=\"https:\/\/aclweb.org\/anthology\/S17-2094\">Baziotis et al., 2017<\/a>). Word2Vec \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0441\u0432\u044f\u0437\u0438 \u043c\u0435\u0436\u0434\u0443 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044e, \u0447\u0442\u043e \u0432 \u043f\u043e\u0445\u043e\u0436\u0438\u0445 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430\u0445 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0431\u043b\u0438\u0437\u043a\u0438\u0435 \u0441\u043b\u043e\u0432\u0430. Word2Vec \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0446\u0435\u043b\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e (\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 CBOW) \u0438\u043b\u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 (\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 Skip-Gram), \u0442\u043e \u0435\u0441\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u043e\u0442\u0435\u0440\u044c, \u0430 GloVe \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0441\u043b\u043e\u0432, \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438. \u041b\u043e\u0433\u0438\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b FastText \u043f\u043e\u0445\u043e\u0436\u0430 \u043d\u0430 \u043b\u043e\u0433\u0438\u043a\u0443 Word2Vec, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0441\u043b\u043e\u0432 \u043e\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u044b\u0435 n-\u0433\u0440\u0430\u043c\u043c\u044b, \u0438 \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u043c\u043e\u0436\u0435\u0442 \u0440\u0435\u0448\u0430\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u0441\u043b\u043e\u0432.<\/p>\n<p>  \u0414\u043b\u044f \u0432\u0441\u0435\u0445 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0430\u0432\u0442\u043e\u0440\u0430\u043c\u0438. \u041c\u044b \u043e\u0431\u0443\u0447\u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u0443\u044e LSTM-\u043c\u043e\u0434\u0435\u043b\u044c (dim=64) \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u044d\u0442\u0438\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439 \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u043b\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u0440\u043e\u0441\u0441-\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438. \u041d\u0430\u0438\u043b\u0443\u0447\u0448\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 F1-\u043c\u0435\u0440\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 DataStories.<\/p>\n<p>  \u0414\u043b\u044f \u043e\u0431\u043e\u0433\u0430\u0449\u0435\u043d\u0438\u044f \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u044d\u043c\u043e\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u043a\u0440\u0430\u0441\u043a\u043e\u0439 \u0441\u043b\u043e\u0432 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u0442\u043e\u043d\u043a\u0443\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0430\u0437\u043c\u0435\u0447\u0435\u043d\u043d\u043e\u0433\u043e Distant-\u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430 (<a href=\"https:\/\/dl.acm.org\/citation.cfm?id=3038912.3052611\">Deriu et al., 2017<\/a>). \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 Distant-\u0434\u0430\u0442\u0430\u0441\u0435\u0442 \u0434\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0439 LSTM-\u0441\u0435\u0442\u0438, \u0447\u0442\u043e\u0431\u044b \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u00ab\u0437\u043b\u044b\u0435\u00bb, \u00ab\u0433\u0440\u0443\u0441\u0442\u043d\u044b\u0435\u00bb \u0438 \u00ab\u0441\u0447\u0430\u0441\u0442\u043b\u0438\u0432\u044b\u0435\u00bb \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. \u042d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433 \u0441\u043b\u043e\u0439 \u0431\u044b\u043b \u0437\u0430\u043c\u043e\u0440\u043e\u0436\u0435\u043d \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0432\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0441\u0438\u043b\u044c\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0443 \u0432\u0435\u0441\u043e\u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432, \u0430 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043f\u044f\u0442\u0438 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439 \u0441\u043b\u043e\u0439 \u0431\u044b\u043b \u0440\u0430\u0437\u043c\u043e\u0440\u043e\u0436\u0435\u043d. \u041f\u043e\u0441\u043b\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u00ab\u043e\u0442\u0442\u044e\u043d\u0435\u043d\u043d\u044b\u0435\u00bb \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u0431\u044b\u043b\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u044b \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u043e\u0439 \u0441\u0435\u0442\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 <a href=\"https:\/\/github.com\/sismetanin\/emosense-semeval2019-task3-emocontext\">\u0432\u044b\u043b\u043e\u0436\u0435\u043d\u044b \u0432 \u043e\u0431\u0449\u0438\u0439 \u0434\u043e\u0441\u0442\u0443\u043f<\/a>.<\/p>\n<pre><code class=\"python\">def getEmbeddings(file): \tembeddingsIndex = {} \tdim = 0 \twith io.open(file, encoding=\"utf8\") as f:     \tfor line in f:         \tvalues = line.split()         \tword = values[0]         \tembeddingVector = np.asarray(values[1:], dtype='float32')         \tembeddingsIndex[word] = embeddingVector         \tdim = len(embeddingVector) \treturn embeddingsIndex, dim   def getEmbeddingMatrix(wordIndex, embeddings, dim): \tembeddingMatrix = np.zeros((len(wordIndex) + 1, dim)) \tfor word, i in wordIndex.items():     \tembeddingMatrix[i] = embeddings.get(word) \treturn embeddingMatrix   from keras.preprocessing.text import Tokenizer  embeddings, dim = getEmbeddings('emosense.300d.txt') tokenizer = Tokenizer(filters='') tokenizer.fit_on_texts([' '.join(list(embeddings.keys()))])  wordIndex = tokenizer.word_index print(\"Found %s unique tokens.\" % len(wordIndex))  embeddings_matrix = getEmbeddingMatrix(wordIndex, embeddings, dim) <\/code><\/pre>\n<p>  <\/p>\n<h2>4. \u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438<\/h2>\n<p>  \u0420\u0435\u043a\u0443\u0440\u0440\u0435\u043d\u0442\u043d\u044b\u0435 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438 (RNN) \u2014 \u044d\u0442\u043e \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u043e \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0435\u0439, \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0449\u0438\u0445\u0441\u044f \u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0441\u0435\u0440\u0438\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439. \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0435\u0439, RRN \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043f\u0443\u0442\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0432\u0435\u0441\u043e\u0432. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0433\u0440\u0430\u0444 RNN \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0446\u0438\u043a\u043b\u044b, \u043e\u0442\u0440\u0430\u0436\u0430\u044e\u0449\u0438\u0435 \u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438\u0437 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0443\u044e. LSTM-\u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438 (Long Short-Term Memory) \u0431\u044b\u043b\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f RNN \u0432 1997-\u043c (<a href=\"https:\/\/www.mitpressjournals.org\/doi\/abs\/10.1162\/neco.1997.9.8.1735\">Hochreiter and Schmidhuber, 1997<\/a>). \u0420\u0435\u043a\u0443\u0440\u0440\u0435\u043d\u0442\u043d\u044b\u0435 \u044f\u0447\u0435\u0439\u043a\u0438 LSTM \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u044b \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0433\u0430\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0432\u0437\u0440\u044b\u0432\u043e\u043c \u0438 \u0437\u0430\u0442\u0443\u0445\u0430\u043d\u0438\u0435\u043c \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043e\u0432. \u0422\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0435 LSTM \u043b\u0438\u0448\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0442 \u043f\u0440\u043e\u0448\u043b\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432 \u043e\u0434\u043d\u043e\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438. \u0414\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 LSTM, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0435 \u0432 \u043e\u0431\u043e\u0438\u0445 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u0445, \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u0443\u044e\u0442 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u0432\u0443\u0445 \u0441\u043a\u0440\u044b\u0442\u044b\u0445 LSTM-\u0441\u043b\u043e\u0451\u0432, \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0449\u0438\u0445 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u044b\u0445 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u0445 \u2014 \u043e\u0434\u0438\u043d \u043f\u043e \u0445\u043e\u0434\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0440\u043e\u0442\u0438\u0432, \u2014 \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043f\u0440\u043e\u0448\u043b\u043e\u0433\u043e \u0438 \u0431\u0443\u0434\u0443\u0449\u0435\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 (<a href=\"https:\/\/ieeexplore.ieee.org\/document\/650093\">Schuster and Paliwal, 1997<\/a>).<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/bdf\/d46\/a41\/bdfd46a41a20ba916382a57bb7c17e19.png\"><br \/>  <i>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 1: \u0423\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b. LSTM-\u043c\u043e\u0434\u0443\u043b\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u0432\u0435\u0441\u0430 \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0438 \u0442\u0440\u0435\u0442\u044c\u0435\u0433\u043e \u044d\u0442\u0430\u043f\u043e\u0432.<\/i><\/p>\n<p>  \u0423\u043f\u0440\u043e\u0449\u0451\u043d\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 1. \u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433-\u0441\u043b\u043e\u044f \u0438 \u0434\u0432\u0443\u0445 \u0434\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 LTSM-\u043c\u043e\u0434\u0443\u043b\u0435\u0439 (dim = 64). \u041f\u0435\u0440\u0432\u044b\u0439 LTSM-\u043c\u043e\u0434\u0443\u043b\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0441\u043b\u043e\u0432\u0430 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f (\u0442\u043e \u0435\u0441\u0442\u044c \u043f\u0435\u0440\u0432\u0443\u044e \u0438 \u0442\u0440\u0435\u0442\u044c\u044e \u0440\u0435\u043f\u043b\u0438\u043a\u0443 \u0431\u0435\u0441\u0435\u0434\u044b), \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0441\u043b\u043e\u0432\u0430 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f (\u0432\u0442\u043e\u0440\u0443\u044e \u0440\u0435\u043f\u043b\u0438\u043a\u0443). \u041d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0441\u043b\u043e\u0432\u0430 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439 \u043f\u043e\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0434\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 LTSM-\u043c\u043e\u0434\u0443\u043b\u044c. \u0417\u0430\u0442\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0435\u0441\u044f \u0442\u0440\u0438 \u043a\u0430\u0440\u0442\u044b \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u044e\u0442\u0441\u044f \u0432 \u043f\u043b\u043e\u0441\u043a\u0438\u0439 \u0432\u0435\u043a\u0442\u043e\u0440 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u043f\u043e\u043b\u043d\u043e\u0441\u0432\u044f\u0437\u043d\u044b\u0439 \u0441\u043a\u0440\u044b\u0442\u044b\u0439 \u0441\u043b\u043e\u0439 (dim=30), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0438\u0437\u0432\u043b\u0435\u0447\u0451\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c\u0438. \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u044d\u0442\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u043c \u0441\u043b\u043e\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 softmax-\u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0435\u0442\u043a\u0443 \u043a\u043b\u0430\u0441\u0441\u0430. \u0414\u043b\u044f \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u043b\u0435 \u0441\u043b\u043e\u0451\u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u044b\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0441\u043b\u043e\u0438 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0441 \u0433\u0430\u0443\u0441\u0441\u043e\u0432\u0441\u043a\u0438\u043c \u0448\u0443\u043c\u043e\u043c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432 \u043a\u0430\u0436\u0434\u044b\u0439 LTSM-\u043c\u043e\u0434\u0443\u043b\u044c (p = 0.2) \u0438 \u043f\u0435\u0440\u0435\u0434 \u0441\u043a\u0440\u044b\u0442\u044b\u043c \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u0432\u044f\u0437\u043d\u044b\u043c \u0441\u043b\u043e\u0435\u043c (p = 0.1) \u0431\u044b\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b dropout-\u0441\u043b\u043e\u0438 (<a href=\"http:\/\/jmlr.org\/papers\/v15\/srivastava14a.html\">Srivastava et al., 2014<\/a>).<\/p>\n<pre><code class=\"python\">from keras.layers import Input, Dense, Embedding, Concatenate, Activation, \\ \tDropout, LSTM, Bidirectional, GlobalMaxPooling1D, GaussianNoise from keras.models import Model  def buildModel(embeddings_matrix, sequence_length, lstm_dim, hidden_layer_dim, num_classes,            \tnoise=0.1, dropout_lstm=0.2, dropout=0.2): \tturn1_input = Input(shape=(sequence_length,), dtype='int32') \tturn2_input = Input(shape=(sequence_length,), dtype='int32') \tturn3_input = Input(shape=(sequence_length,), dtype='int32') \tembedding_dim = embeddings_matrix.shape[1] \tembeddingLayer = Embedding(embeddings_matrix.shape[0],                             \tembedding_dim,                             \tweights=[embeddings_matrix],                             \tinput_length=sequence_length,                             \ttrainable=False)      \tturn1_branch = embeddingLayer(turn1_input) \tturn2_branch = embeddingLayer(turn2_input) \tturn3_branch = embeddingLayer(turn3_input)      \tturn1_branch = GaussianNoise(noise, input_shape=(None, sequence_length, embedding_dim))(turn1_branch) \tturn2_branch = GaussianNoise(noise, input_shape=(None, sequence_length, embedding_dim))(turn2_branch) \tturn3_branch = GaussianNoise(noise, input_shape=(None, sequence_length, embedding_dim))(turn3_branch)  \tlstm1 = Bidirectional(LSTM(lstm_dim, dropout=dropout_lstm)) \tlstm2 = Bidirectional(LSTM(lstm_dim, dropout=dropout_lstm))      \tturn1_branch = lstm1(turn1_branch) \tturn2_branch = lstm2(turn2_branch) \tturn3_branch = lstm1(turn3_branch)      \tx = Concatenate(axis=-1)([turn1_branch, turn2_branch, turn3_branch])      \tx = Dropout(dropout)(x)      \tx = Dense(hidden_layer_dim, activation='relu')(x)      \toutput = Dense(num_classes, activation='softmax')(x)      \tmodel = Model(inputs=[turn1_input, turn2_input, turn3_input], outputs=output)      \tmodel.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['acc'])      \treturn model  model = buildModel(embeddings_matrix, MAX_SEQUENCE_LENGTH, lstm_dim=64, hidden_layer_dim=30, num_classes=4)<\/code><\/pre>\n<p>  <\/p>\n<h2>5. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b<\/h2>\n<p>  \u0412 \u0445\u043e\u0434\u0435 \u043f\u043e\u0438\u0441\u043a\u0430 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043c\u044b \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043d\u0435\u0439\u0440\u043e\u043d\u043e\u0432 \u0432 \u0441\u043b\u043e\u044f\u0445, \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u043d\u043e \u0438 \u0441 \u0441\u0430\u043c\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043e\u0439 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f \u0432 <a href=\"https:\/\/www.aclweb.org\/anthology\/papers\/S\/S19\/S19-2034\/\">\u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435<\/a>.<\/p>\n<p>  \u041e\u043f\u0438\u0441\u0430\u043d\u043d\u0430\u044f \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0430 \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0440\u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438 \u043d\u0430 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0435 Train \u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u043d\u0430 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0435 Dev, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u043d\u0430 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0434\u0438\u0438 \u0441\u043e\u0441\u0442\u044f\u0437\u0430\u043d\u0438\u044f. \u041d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0435 \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430 \u043c\u0438\u043a\u0440\u043e-\u0443\u0441\u0440\u0435\u0434\u0436\u043d\u0435\u043d\u043d\u0443\u044e F1-\u043c\u0435\u0440\u0443 72,59 %, \u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u0440\u0435\u0434\u0438 \u0432\u0441\u0435\u0445 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u043b 79,59 %. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u043d\u0430\u0448 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0432\u044b\u0448\u0435 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 58,68 %, \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u0430\u043c\u0438.<\/p>\n<p>  <a href=\"https:\/\/github.com\/sismetanin\/emosense-semeval2019-task3-emocontext\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043b\u043e\u0432<\/a> \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 GitHub.<br \/>  <a href=\"https:\/\/www.aclweb.org\/anthology\/papers\/S\/S19\/S19-2034\/\">\u041f\u043e\u043b\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438<\/a> \u0438 <a href=\"https:\/\/www.aclweb.org\/anthology\/papers\/S\/S19\/S19-2005\/\">\u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0438<\/a> \u043b\u0435\u0436\u0430\u0442 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 ACL Anthology.<br \/>  <a href=\"https:\/\/www.linkedin.com\/feed\/update\/urn:li:activity:6439879151053836288\/\">\u0423\u0447\u0435\u0431\u043d\u044b\u0439 \u0434\u0430\u0442\u0430\u0441\u0435\u0442<\/a> \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0435 \u043d\u0430 LinkedIn.<\/p>\n<p>  \u0426\u0438\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435:<\/p>\n<pre><code class=\"python\">@inproceedings{smetanin-2019-emosense, \ttitle = \"{E}mo{S}ense at {S}em{E}val-2019 Task 3: Bidirectional {LSTM} Network for Contextual Emotion Detection in Textual Conversations\", \tauthor = \"Smetanin, Sergey\", \tbooktitle = \"Proceedings of the 13th International Workshop on Semantic Evaluation\", \tyear = \"2019\", \taddress = \"Minneapolis, Minnesota, USA\", \tpublisher = \"Association for Computational Linguistics\", \turl = \"https:\/\/www.aclweb.org\/anthology\/S19-2034\", \tpages = \"210--214\", }<\/code><\/pre>\n<\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <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\/company\/mailru\/blog\/463045\/\"> https:\/\/habr.com\/ru\/company\/mailru\/blog\/463045\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/t6\/sr\/jr\/t6srjrmjjmm6qn8gpld9emy4txu.gif\"><\/div>\n<p>  \u041e\u0434\u043d\u0430 \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043d\u0443\u0436\u043d\u043e\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u043d\u043e \u0438 \u0432 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u0442\u0432\u0435\u0442\u043e\u0432. \u0410 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043d\u0438\u0435 \u044d\u043c\u043e\u0446\u0438\u0439 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043d\u0438\u043a\u0430 \u2013 \u0443\u0436\u0435 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u0440\u0443\u0442\u0430\u044f \u0444\u0438\u0447\u0430, \u044d\u0442\u043e \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u0430\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c <b>\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0440\u0435\u043a\u0443\u0440\u0440\u0435\u043d\u0442\u043d\u043e\u0439 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u044d\u043c\u043e\u0446\u0438\u0439 \u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0431\u0435\u0441\u0435\u0434\u0430\u0445<\/b>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u043b\u0430 \u0443\u0447\u0430\u0441\u0442\u0438\u0435 \u0432 <a href=\"http:\/\/alt.qcri.org\/semeval2019\/index.php?id=tasks\">SemEval-2019 Task 3 \u201cEmoContext\u201d<\/a>, \u0435\u0436\u0435\u0433\u043e\u0434\u043d\u043e\u043c \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u043e \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u043e\u0439 \u043b\u0438\u043d\u0433\u0432\u0438\u0441\u0442\u0438\u043a\u0435. \u0417\u0430\u0434\u0430\u0447\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043b\u0430 \u0432 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u044d\u043c\u043e\u0446\u0438\u0439 (\u201chappy\u201d, \u201csad\u201d, \u201cangry\u201d \u0438 \u201cothers\u201d) \u0432 \u0431\u0435\u0441\u0435\u0434\u0435 \u0438\u0437 \u0442\u0440\u0435\u0445 \u0440\u0435\u043f\u043b\u0438\u043a, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0438 \u0447\u0430\u0442-\u0431\u043e\u0442 \u0438 \u0447\u0435\u043b\u043e\u0432\u0435\u043a.<\/p>\n<p>  \u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0432 EmoContext \u0437\u0430\u0434\u0430\u0447\u0443 \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0435. \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0438 \u0442\u0440\u0435\u0442\u044c\u0435\u0439 \u0447\u0430\u0441\u0442\u044f\u0445 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043b\u043e\u0432. \u0412 \u0447\u0435\u0442\u0432\u0451\u0440\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u043e\u043f\u0438\u0448\u0435\u043c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 LSTM, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0432 \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u043d\u0438\u0438. \u041a\u043e\u0434 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Python \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Keras.   <\/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-293263","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/293263","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=293263"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/293263\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=293263"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=293263"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=293263"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}