{"id":407431,"date":"2024-06-29T19:33:22","date_gmt":"2024-06-29T19:33:22","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=407431"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=407431","title":{"rendered":"<span>\u0420\u0430\u0441\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Natasha \u0438 Spacy<\/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>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0441\u0435\u0431\u044f \u043d\u0430 \u043c\u0435\u0441\u0442\u0435 \u0438\u0437\u0443\u0447\u0430\u044e\u0449\u0435\u0433\u043e \u0440\u0443\u0441\u0441\u043a\u0438\u0439 \u044f\u0437\u044b\u043a \u0438\u043d\u043e\u0441\u0442\u0440\u0430\u043d\u0446\u0430. \u0423\u0434\u0430\u0440\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u043d\u0435\u0442 \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0432\u0430\u0448\u0438\u0445 \u0441\u0430\u043c\u044b\u0445 \u0441\u0442\u0440\u0430\u0448\u043d\u044b\u0445 \u043d\u043e\u0447\u043d\u044b\u0445 \u043a\u043e\u0448\u043c\u0430\u0440\u043e\u0432. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043e\u043d\u043e \u043d\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u043f\u0440\u0430\u0432\u0438\u043b, \u0438 \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u043e\u0438\u0437\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c. \u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043e\u043d\u043e \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0435 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u0435\u043a\u0441\u0442\u0430\u0445, \u0447\u0442\u043e \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0432\u043e\u0434\u0438\u0442 \u043d\u0430 \u043d\u0435\u0442 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0431\u043b\u0438\u0437\u043e\u0441\u0442\u044c \u0440\u0443\u0441\u0441\u043a\u043e\u0439 \u043e\u0440\u0444\u043e\u0433\u0440\u0430\u0444\u0438\u0438 \u043a \u043f\u0440\u043e\u0438\u0437\u043d\u043e\u0448\u0435\u043d\u0438\u044e &#8212; \u0431\u0435\u0437 \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u0439 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u0441 \u043d\u0435\u0437\u043d\u0430\u043a\u043e\u043c\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u0438\u043d\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u0446 \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442. \u0412-\u0442\u0440\u0435\u0442\u044c\u0438\u0445, \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043c\u0435\u043d\u044f\u0435\u0442 \u0444\u043e\u043d\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043e\u0431\u0440\u0430\u0437 \u0441\u043b\u043e\u0432\u0430 \u0434\u043b\u044f \u0440\u0443\u0441\u0441\u043a\u043e\u0433\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430, \u0438 \u0438\u0437-\u0437\u0430 \u043e\u0434\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432\u0430\u0441 \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u043f\u043e\u043d\u044f\u0442\u044c.<\/p>\n<h2>\u041c\u043e\u0439 \u043e\u043f\u044b\u0442<\/h2>\n<p>\u042f \u0437\u043d\u0430\u043a\u043e\u043c \u0441 \u043e\u0434\u043d\u043e\u0439 \u0434\u0435\u0432\u0443\u0448\u043a\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0437\u0443\u0447\u0430\u0435\u0442 \u0440\u0443\u0441\u0441\u043a\u0438\u0439 \u044f\u0437\u044b\u043a \u0432 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442\u0435 \u041b\u0435\u0439\u0434\u0435\u043d\u0430. \u041e\u0434\u043d\u0430\u0436\u0434\u044b \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u0440\u0443\u0441\u0441\u043a\u043e\u0433\u043e, \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u044b\u043b\u0430 \u0440\u0430\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u0439. \u042f \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b \u043a\u0430\u0436\u0434\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \u043f\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044e. \u041e\u0434\u043d\u0430\u043a\u043e, \u044d\u0442\u043e \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043b\u043e \u043a \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0433\u0434\u0430 \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: &#171;\u0434\u0432\u0430 \u0441\u043b\u043e\u0301\u0432\u0430&#187;, \u043d\u043e &#171;\u0434\u043b\u0438\u043d\u043d\u044b\u0435 \u0441\u043b\u043e\u0432\u0430\u0301&#187;. \u0412 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445 \u043c\u043d\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u043e\u0441\u044c \u0434\u0435\u043b\u0430\u0442\u044c, \u043a\u0440\u043e\u043c\u0435 \u043a\u0430\u043a \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043b\u043e\u0432\u043e \u0431\u0435\u0437 \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u044f.<\/p>\n<h2>\u0418\u0434\u0435\u044f<\/h2>\n<p>\u041d\u043e \u0432\u0435\u0434\u044c \u043d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e\u0441\u0442\u044c \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0442\u043e\u0433\u043e, \u0432 \u043a\u0430\u043a\u043e\u0439 \u0444\u043e\u0440\u043c\u0435 \u0443\u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u043e \u0441\u043b\u043e\u0432\u043e, \u043e\u0442 \u0435\u0433\u043e \u043c\u043e\u0440\u0444\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439. \u0415\u0441\u043b\u0438 \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0439\u0442\u0438 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u0439 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0444\u043e\u0440\u043c\u044b \u0441\u043b\u043e\u0432\u0430 + \u043d\u0430\u0443\u0447\u0438\u043c\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0444\u043e\u0440\u043c\u0443 \u0441\u043b\u043e\u0432\u0430 \u043f\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0443, \u0442\u043e \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u043d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e\u0441\u0442\u044c. \u041c\u043e\u0440\u0444\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 &#8212; \u043e\u0434\u043d\u0430 \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 NLP, \u0434\u043b\u044f \u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 Spacy.<\/p>\n<h2>\u0414\u0430\u043d\u043d\u044b\u0435<\/h2>\n<p>\u0413\u0434\u0435 \u0436\u0435 \u043d\u0430\u043c \u043d\u0430\u0439\u0442\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u0439? \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0430\u044f \u043d\u0430\u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0435\u0441\u0442\u044c \u0432 <a href=\"https:\/\/en.wiktionary.org\" rel=\"noopener noreferrer nofollow\">wiktionary<\/a>. <\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9fa\/a30\/9a8\/9faa309a84d29c3293d8c292e0060404.png\" alt=\"Wiktionary\" title=\"Wiktionary\" width=\"315\" height=\"247\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9fa\/a30\/9a8\/9faa309a84d29c3293d8c292e0060404.png\"\/><figcaption>Wiktionary<\/figcaption><\/figure>\n<p>\u0414\u043b\u044f \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 wiktionary \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043b\u0438\u0431\u0430 <a href=\"https:\/\/pypi.org\/project\/wiktionaryparser\/\" rel=\"noopener noreferrer nofollow\">wiktionaryparser<\/a>. \u0412\u043f\u0440\u043e\u0447\u0435\u043c, \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442 <a href=\"https:\/\/kaikki.org\/dictionary\/Russian\/index.html\" rel=\"noopener noreferrer nofollow\">\u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0435\u0451 \u0440\u0430\u0431\u043e\u0442\u044b<\/a>. Json-\u0444\u0430\u0439\u043b \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0430\u0431\u043e\u0440 \u0441\u043b\u043e\u0432\u043e\u0444\u043e\u0440\u043c, \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u0435\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441 \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u0435\u043c, \u043d\u0430\u0431\u043e\u0440 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043c\u0430\u0440\u043a\u0435\u0440 \u0447\u0430\u0441\u0442\u0438 \u0440\u0435\u0447\u0438. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u044f \u0440\u0430\u0441\u043f\u0430\u0440\u0441\u0438\u043b \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0417\u0430\u043b\u0438\u0437\u043d\u044f\u043a\u0430 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0442\u0435 \u0444\u043e\u0440\u043c\u044b \u043e\u0442\u0442\u0443\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435 \u043d\u0430\u0448\u043b\u043e\u0441\u044c \u0432 wiktionary.<\/p>\n<p>\u0414\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0442\u043e\u043a\u0435\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432-\u0441\u043b\u043e\u0432\u043e\u0444\u043e\u0440\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u0440\u0435\u0447\u0438 (\u0432\u043e\u0435\u043d\u043d\u044b\u0439 \u043a\u0430\u043a \u043f\u0440\u0438\u043b\u0430\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0438 \u0432\u043e\u0435\u043d\u043d\u044b\u0439 \u043a\u0430\u043a \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435) \u0438\u043b\u0438 \u0441\u043c\u044b\u0441\u043b\u043e\u043c (\u043f\u0438\u0441\u0430\u0301\u0442\u044c \u0438 \u043f\u0438\u0301\u0441\u0430\u0442\u044c).<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0e8\/6dd\/65d\/0e86dd65dc435ef3687ed1636b6bc4ed.png\" alt=\"\u041d\u043e\u0432\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0441\u043b\u043e\u0432\u0430\u0440\u044f\" title=\"\u041d\u043e\u0432\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0441\u043b\u043e\u0432\u0430\u0440\u044f\" width=\"1685\" height=\"630\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0e8\/6dd\/65d\/0e86dd65dc435ef3687ed1636b6bc4ed.png\"\/><figcaption>\u041d\u043e\u0432\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0441\u043b\u043e\u0432\u0430\u0440\u044f<\/figcaption><\/figure>\n<p>\u042f \u043f\u0435\u0440\u0435\u0432\u0435\u043b \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0432 \u043d\u043e\u0432\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442: \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0442\u043e\u043a\u0435\u043d\u0443 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u043b\u043e\u0432\u043e\u0444\u043e\u0440\u043c, \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u043b\u043e\u0432\u043e\u0444\u043e\u0440\u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u043f\u043e\u043b\u044f accentuated (\u0432\u0438\u0434 \u0441\u043b\u043e\u0432\u043e\u0444\u043e\u0440\u043c\u044b \u0441 \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u0435\u043c), form (\u043c\u043e\u0440\u0444\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438) \u0438 lemma (\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043b\u0435\u043c\u043c\u0443). \u0421\u043b\u043e\u0432\u0430\u0440\u044c \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e pickle \u0432 wordforms.dat.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4a4\/fea\/676\/4a4fea676e1c33a167da3454612a8761.png\" alt=\"\u0421\u043b\u043e\u0432\u0430\u0440\u044c \u043b\u0435\u043c\u043c\" title=\"\u0421\u043b\u043e\u0432\u0430\u0440\u044c \u043b\u0435\u043c\u043c\" width=\"1569\" height=\"638\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4a4\/fea\/676\/4a4fea676e1c33a167da3454612a8761.png\"\/><figcaption>\u0421\u043b\u043e\u0432\u0430\u0440\u044c \u043b\u0435\u043c\u043c<\/figcaption><\/figure>\n<p>\u041a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e, \u044f \u0441\u043e\u0437\u0434\u0430\u043b \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u043b\u0435\u043c\u043c. \u041b\u0435\u043c\u043c\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u0440\u0435\u0447\u0438 + \u0447\u0430\u0441\u0442\u043e\u0442\u043d\u044b\u0439 \u0440\u0430\u043d\u0433. \u0421\u043b\u043e\u0432\u0430\u0440\u044c \u043b\u0435\u043c\u043c \u0442\u0430\u043a\u0436\u0435 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/docs.python.org\/3\/library\/pickle.html\" rel=\"noopener noreferrer nofollow\">pickle<\/a>, \u0432 lemmas.dat.<\/p>\n<h2>Spacy<\/h2>\n<p><a href=\"https:\/\/spacy.io\" rel=\"noopener noreferrer nofollow\">Spacy <\/a>&#8212; \u044d\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f NLP. \u041e\u043d\u0430 \u0443\u043c\u0435\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0432\u0435\u0449\u0438 \u043a\u0430\u043a \u0442\u043e\u043a\u0435\u043d\u0438\u0437\u0430\u0446\u0438\u044f, \u043c\u043e\u0440\u0444\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437, \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437, Named Entity Recognition. \u041d\u0430\u0441  \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0442 \u043f\u0435\u0440\u0432\u044b\u0435 \u0434\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>\u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c natasha-spacy, \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0440\u0443\u0441\u0441\u043a\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 \u0434\u043b\u044f spacy \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 natasha, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u043c\u043e\u0440\u0444\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 (\u043f\u0430\u0434\u0435\u0436\u0438, \u0432\u0440\u0435\u043c\u0435\u043d\u0430), \u0447\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f. \u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 <a href=\"https:\/\/github.com\/natasha\/natasha-spacy\" rel=\"noopener noreferrer nofollow\">\u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<h2>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h2>\n<pre><code class=\"python\">import spacy import pickle ru_nlp = spacy.load('ru_core_news_md')  def load():     with open(file=\"lemmas.dat\", mode='rb') as f:         lemmas = pickle.loads(f.read())     with open(file=\"wordforms.dat\", mode='rb') as f:         wordforms = pickle.loads(f.read())     return lemmas, wordforms       def introduce_special_cases_from_dictionary(dictionary):     for word in dictionary:         if (\" \" in word) or (\"-\" in word):             if len(dictionary[word]) == 1:                 ru_nlp.tokenizer.add_special_case(word, [{\"ORTH\": dictionary[word][0][\"accentuated\"]}])                 ru_nlp.tokenizer.add_special_case(word.capitalize(), [{\"ORTH\": dictionary[word][0][\"accentuated\"].capitalize()}])                  lemmas, wordforms = load() introduce_special_cases_from_dictionary(wordforms)  f = open(\"in.txt\", mode='r', encoding='utf-8') text = f.read() f.close()  res = accentuate(text, wordforms, lemmas)   f = open(\"out.txt\", mode='w', encoding='utf-8') f.write(res) f.close()<\/code><\/pre>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u043d\u0430\u0448\u0438 \u0441\u043b\u043e\u0432\u0430\u0440\u0438, \u0437\u0430\u0442\u0435\u043c \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u043c \u0442\u043e\u043a\u0435\u043d\u0438\u0437\u0430\u0442\u043e\u0440: \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 (\u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u0434\u0435\u0444\u0438\u0441 \u0438\u043b\u0438 \u043f\u0440\u043e\u0431\u0435\u043b) \u0442\u043e\u043a\u0435\u043d\u044b \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044f. \u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0438\u0437-\u0437\u0430 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043d\u0430\u043f\u043e\u0434\u043e\u0431\u0438\u0435 &#171;\u043f\u043e-\u043c\u043e\u0435\u043c\u0443&#187;: \u0438\u043d\u0430\u0447\u0435 \u0441\u043b\u043e\u0432\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043e \u043d\u0430 &#171;\u043f\u043e&#187;, &#171;-&#187; \u0438 &#171;\u043c\u043e\u0435\u043c\u0443&#187;, \u0441 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u0435\u043c \u0432 &#171;\u043c\u043e\u0435\u043c\u0443&#187;.<\/p>\n<h2>\u0422\u043e\u043a\u0435\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u043c\u043e\u0440\u0444\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437<\/h2>\n<pre><code class=\"python\">def tokenize(text, wordforms):     res = []     doc = ru_nlp(text)     for token in doc:         if token.pos_ != 'PUNCT':             word = {\"token\": token.text, \"tag\": token.tag_}             if word[\"token\"] in wordforms:                 word[\"interpretations\"] = wordforms[word[\"token\"]]             if word[\"token\"].lower() in wordforms:                 word[\"interpretations\"] = wordforms[word[\"token\"].lower()]             word[\"lemma\"] = token.lemma_             word[\"is_punctuation\"] = False             word[\"uppercase\"] = word[\"token\"].upper() == word[\"token\"]             word[\"starts_with_a_capital_letter\"] = word[\"token\"][0].upper() == word[\"token\"][0]         else:             word = {\"token\": token.text, \"is_punctuation\": True}         word[\"whitespace\"] = token.whitespace_         res.append(word)     return res<\/code><\/pre>\n<p>\u0414\u0435\u043b\u0430\u0435\u043c \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0442\u043e\u043a\u0435\u043d\u0438\u0437\u0430\u0446\u0438\u044e \u0438 \u043c\u043e\u0440\u0444\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437.<\/p>\n<p>\u041a\u0430\u0436\u0434\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0432\u0438\u0434\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u044f \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438:<\/p>\n<ul>\n<li>\n<p>token \u2014 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u044c \u0441\u043b\u043e\u0432\u043e\u0444\u043e\u0440\u043c\u044b (\u0432 \u043d\u0438\u0436\u043d\u0435\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0435)<\/p>\n<\/li>\n<li>\n<p>tag \u2014 \u043d\u0430\u0431\u043e\u0440 \u043c\u043e\u0440\u0444\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439. \u0421\u0442\u0440\u043e\u043a\u0430 tag \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a: &#171;NOUN__Animacy=Inan|Case=Gen|Gender=Masc|Number=Plur&#187; \u0438\u043b\u0438 &#171;&#8216;VERB__Aspect=Perf|Mood=Imp|Number=Plur|Person=Second|VerbForm=Fin|Voice=Act'&#187;<\/p>\n<\/li>\n<li>\n<p>interpretations \u2014 \u043d\u0430\u0431\u043e\u0440 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438\u0437 \u0441\u043b\u043e\u0432\u0430\u0440\u044f (\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u044f\u043c\u0438), \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0430\u0448 \u0442\u043e\u043a\u0435\u043d<\/p>\n<\/li>\n<li>\n<p>lemma \u2014 \u0438\u0441\u0445\u043e\u0434\u043d\u0430\u044f \u043b\u0435\u043c\u043c\u0430 \u0442\u043e\u043a\u0435\u043d\u0430 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f spacy<\/p>\n<\/li>\n<li>\n<p>is_punctuation \u2014 \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 True \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0437\u043d\u0430\u043a\u043e\u0432 \u043f\u0443\u043d\u043a\u0442\u0443\u0430\u0446\u0438\u0438, \u043d\u043e \u0438 \u0434\u043b\u044f &#171;\u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432&#187; (\u0441\u043c. \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u0440\u0430\u0437\u0434\u0435\u043b \u043f\u0440\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e spacy).<\/p>\n<\/li>\n<li>\n<p>starts_with_a_capital_letter \u2014 \u043c\u044b \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u043c \u0432\u0441\u0435 \u0442\u043e\u043a\u0435\u043d\u044b \u0432 \u043d\u0438\u0436\u043d\u0438\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440, \u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c, \u0430 \u0431\u044b\u043b\u043e \u043b\u0438 \u0441\u043b\u043e\u0432\u043e \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0441 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0431\u0443\u043a\u0432\u044b<\/p>\n<\/li>\n<li>\n<p>uppercase \u2014 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043b\u0438 \u0441\u043b\u043e\u0432\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0432 \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0435<\/p>\n<\/li>\n<li>\n<p>whitespace \u2014 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u0440\u043e\u0431\u0435\u043b, \u0435\u0441\u043b\u0438 \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u043a\u0435\u043d\u0430 \u0438\u0434\u0451\u0442 \u043f\u0440\u043e\u0431\u0435\u043b. \u041d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430<\/p>\n<\/li>\n<\/ul>\n<h2>\u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u043c\u043e\u0440\u0444\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439<\/h2>\n<p>\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0439 &#171;\u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u0438&#187; \u0442\u043e\u043a\u0435\u043d\u0430 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c, \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u0430 \u043b\u0438 \u043e\u043d\u0430 \u0441 \u043c\u043e\u0440\u0444\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0442\u0435\u0433\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u0434\u0430\u043b spacy.<\/p>\n<pre><code class=\"python\">def compatible(interpretation, lemma, tag, lemmas):     if lemma in lemmas:         pos_exists = False         possible_poses = lemmas[lemma][\"pos\"]         for i in range(len(possible_poses)):             if possible_poses[i] in tag:                 pos_exists = True                 break         if not (pos_exists):             return False      if interpretation == \"canonical\":         return True     if \"plural\" in interpretation and not (\"Number=Plur\" in tag):         return False     if \"singular\" in interpretation and not (\"Number=Sing\" in tag):         return False     if not (\"nominative\" in interpretation) and (\"Case=Nom\" in tag):         return False     if not (\"genitive\" in interpretation) and (\"Case=Gen\" in tag):         return False     if not (\"dative\" in interpretation) and (\"Case=Dat\" in tag):         return False     if not (\"accusative\" in interpretation) and (\"Case=Acc\" in tag):         adj = False         if \"ADJ\" in tag and \"Animacy=Inan\" in tag:             adj = True         if not adj:             return False     if not (\"instrumental\" in interpretation) and (\"Case=Ins\" in tag):         return False     if not (\"prepositional\" in interpretation) and not (\"locative\" in interpretation) and (\"Case=Loc\" in tag):         return False     if ((\"present\" in interpretation) or (\"future\" in interpretation)) and (\"Tense=Past\" in tag):         return False     if ((\"past\" in interpretation) or (\"future\" in interpretation)) and (\"Tense=Pres\" in tag):         return False     if ((\"past\" in interpretation) or (\"present\" in interpretation)) and (\"Tense=Fut\" in tag):         return False      return True<\/code><\/pre>\n<p>\u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b:<\/p>\n<ul>\n<li>\n<p>interpretation \u2014 \u0441\u0442\u0440\u043e\u043a\u0430 \u0441 \u043c\u043e\u0440\u0444\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u0438\u0437 \u0441\u043b\u043e\u0432\u0430\u0440\u044f wordforms. \u041f\u0440\u0438\u043c\u0435\u0440: &#171;genitive plural&#187;<\/p>\n<\/li>\n<li>\n<p>lemma \u2014 \u043b\u0435\u043c\u043c\u0430 \u0442\u043e\u043a\u0435\u043d\u0430 \u043f\u043e \u0432\u0435\u0440\u0441\u0438\u0438 natasha-spacy<\/p>\n<\/li>\n<li>\n<p>tag \u2014 \u043c\u043e\u0440\u0444\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0442\u0435\u0433 \u043e\u0442 spacy. \u041f\u0440\u0438\u043c\u0435\u0440: &#171;NOUN__Animacy=Inan|Case=Gen|Gender=Masc|Number=Plur&#187;<\/p>\n<\/li>\n<li>\n<p>lemmas \u2014 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u043b\u0435\u043c\u043c<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e \u043b\u0435\u043c\u043c\u0430 lemma \u0432\u043e\u043e\u0431\u0449\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0447\u0430\u0441\u0442\u044c\u044e \u0440\u0435\u0447\u0438, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0432 tag. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0438 \u0432\u0440\u043e\u0434\u0435 &#171;\u043f\u043e\u0442\u043e\u043c&#187; \u043a\u0430\u043a \u043d\u0430\u0440\u0435\u0447\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043a\u0430\u043a \u0444\u043e\u0440\u043c\u0443 \u0441\u043b\u043e\u0432\u0430 &#171;\u043f\u043e\u0442&#187;.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043d\u0435\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f (\u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 interpretation \u043d\u0435 &#8216;canonical&#8217;): <\/p>\n<ul>\n<li>\n<p>\u0412 interpretation \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0438 \u0432 tag \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0440\u0430\u0437\u043d\u043e\u0435 \u0433\u0440\u0430\u043c\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0447\u0438\u0441\u043b\u043e<\/p>\n<\/li>\n<li>\n<p>\u0412 tag \u0443\u043a\u0430\u0437\u0430\u043d \u043f\u0430\u0434\u0435\u0436, \u0430 \u0432 interpretation \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043f\u0430\u0434\u0435\u0436\u0430 \u043d\u0435\u0442<\/p>\n<\/li>\n<li>\n<p>\u042f\u0432\u043d\u043e\u0435 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0438\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0433\u043b\u0430\u0433\u043e\u043b\u0430<\/p>\n<\/li>\n<\/ul>\n<h2>\u041e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0432\u0441\u0435 \u0442\u043e\u043a\u0435\u043d\u044b<\/h2>\n<pre><code class=\"python\">def accentuate(text, wordforms, lemmas):     res = \"\"     words = tokenize(text, wordforms)     for i in range(len(words)):         accentuated = accentuate_word(words[i], lemmas)         if \"starts_with_a_capital_letter\" in words[i] and words[i][\"starts_with_a_capital_letter\"]:             accentuated = accentuated.capitalize()         if \"uppercase\" in words[i] and words[i][\"uppercase\"]:             accentuated = accentuated.upper()         res += accentuated         res += words[i][\"whitespace\"]     return res       def accentuate_word(word, lemmas):     if (\"tag\" in word) and (\"PROPN\" in word[\"tag\"]):         return word[\"token\"]      if word[\"is_punctuation\"] or (not \"interpretations\" in word):         return word[\"token\"]     else:         res = derive_single_accentuation(word[\"interpretations\"])         if not (res is None):             return res         else:             compatible_interpretations = []             for i in range(len(word[\"interpretations\"])):                 if compatible(word[\"interpretations\"][i][\"form\"], word[\"interpretations\"][i][\"lemma\"], word[\"tag\"], lemmas):                     compatible_interpretations.append(word[\"interpretations\"][i])             res = derive_single_accentuation(compatible_interpretations)              if not (res is None):                 return res             else:                 new_compatible_interpretations = []                 for i in range(len(compatible_interpretations)):                     if compatible_interpretations[i][\"lemma\"] == word[\"lemma\"]:                         new_compatible_interpretations.append(compatible_interpretations[i])                 res = derive_single_accentuation(new_compatible_interpretations)                 if not (res is None):                     return res                 else:                     return word[\"token\"]                     def derive_single_accentuation(interpretations):     if len(interpretations) == 0:         return None     res = interpretations[0][\"accentuated\"]     for i in range(1, len(interpretations)):         if interpretations[i][\"accentuated\"] != res:             return None     return res<\/code><\/pre>\n<p>\u0412 accentuate_word \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u0441\u043b\u043e\u0432\u043e \u0438\u043c\u0435\u043d\u0435\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c. \u0415\u0441\u043b\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u043d\u0438\u0447\u0435\u0433\u043e \u0441 \u043d\u0438\u043c \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u043c. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c, \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0438 \u0432\u0440\u043e\u0434\u0435 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u0438 &#171;\u0416\u0435\u0301\u043d\u0435&#187; \u043a\u0430\u043a &#171;\u0436\u0435\u043d\u0435\u0301&#187;.<\/p>\n<p>derive_single_interpretation \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043b\u0438 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u0434\u0430, \u043e\u043d\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431, \u0438\u043d\u0430\u0447\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f None.<\/p>\n<p>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 3 \u044d\u0442\u0430\u043f\u0430<\/p>\n<ul>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0442\u0430\u043a, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u0435, \u0442\u043e \u043c\u044b \u043d\u0438\u0447\u0435\u0433\u043e \u0434\u0430\u043b\u044c\u0448\u0435 \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u043c. \u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0441\u043b\u043e\u0432 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u043a\u0441\u0442\u0430\u0445 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u043f\u0430\u0434\u0430\u0442\u044c \u0432 \u044d\u0442\u0443 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u044f, \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u043c interpretations, \u043e\u0441\u0442\u0430\u0432\u0438\u0432 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 compatible. \u041f\u043e\u0441\u043b\u0435 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u044d\u0442\u0430\u043f\u0430 \u0441\u043d\u043e\u0432\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u043b\u0438 \u0443 \u043d\u0430\u0441 \u043b\u0438\u0448\u044c \u043e\u0434\u0438\u043d \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0434\u0430\u0436\u0435 \u044d\u0442\u043e \u043d\u0435 \u043f\u043e\u043c\u043e\u0433\u043b\u043e, \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 interpretations, \u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043b\u0435\u043c\u043c\u0430 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 \u0442\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0434\u0430\u0435\u0442 natasha-spacy (\u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u043b\u0435\u043c\u043c\u044b spacy \u043d\u0435\u0440\u0435\u0434\u043a\u043e \u043e\u0448\u0438\u0431\u0430\u0435\u0442\u0441\u044f).<\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u044b\u0440\u043e\u0439 \u0442\u043e\u043a\u0435\u043d \u0431\u0435\u0437 \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u044f, \u0435\u0441\u043b\u0438 \u0434\u0430\u0436\u0435 \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0443 \u043d\u0430\u0441 \u043d\u0435 \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430.<\/p>\n<\/li>\n<\/ul>\n<h2>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b<\/h2>\n<p>\u041a\u043e\u0434 \u0438 \u0434\u0430\u043d\u043d\u044b\u0435: <a href=\"https:\/\/github.com\/einhornus\/russian_accentuation\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/einhornus\/russian_accentuation<\/a><\/p>\n<p>\u0417\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435: \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 \u0451\u0444\u0438\u043a\u0430\u0446\u0438\u044e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0435\u043a\u0441\u0442 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0451\u0444\u0438\u043a\u0430\u0442\u043e\u0440.<\/p>\n<h3>\u041b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/h3>\n<blockquote>\n<p>\u0416\u0438\u043b \u043d\u0430 \u043e\u043f\u0443\u0301\u0448\u043a\u0435 \u0434\u0440\u0435\u043c\u0443\u0301\u0447\u0435\u0433\u043e \u043b\u0435\u0301\u0441\u0430 \u0431\u0435\u0301\u0434\u043d\u044b\u0439 \u0434\u0440\u043e\u0432\u043e\u0441\u0435\u0301\u043a \u0441\u043e \u0441\u0432\u043e\u0435\u0301\u0439 \u0436\u0435\u043d\u043e\u0301\u0439 \u0438 \u0434\u0432\u0443\u043c\u044f\u0301 \u0434\u0435\u0442\u044c\u043c\u0438\u0301; \u043c\u0430\u0301\u043b\u044c\u0447\u0438\u043a\u0430 \u0437\u0432\u0430\u0301\u043b\u0438 \u0413\u0435\u043d\u0437\u0435\u043b\u044c, \u0430 \u0434\u0435\u0301\u0432\u043e\u0447\u043a\u0443 &#8212; \u0413\u0440\u0435\u0442\u0435\u043b\u044c. \u0416\u0438\u043b \u0434\u0440\u043e\u0432\u043e\u0441\u0435\u0301\u043a \u0432\u043f\u0440\u043e\u0433\u043e\u043b\u043e\u0434\u044c; \u0432\u043e\u0442 \u043d\u0430\u0441\u0442\u0443\u043f\u0438\u0301\u043b\u0430 \u043e\u0434\u043d\u0430\u0301\u0436\u0434\u044b \u0432 \u0442\u043e\u0439 \u0437\u0435\u043c\u043b\u0435\u0301 \u0442\u0430\u043a\u0430\u0301\u044f \u0434\u043e\u0440\u043e\u0433\u043e\u0432\u0438\u0301\u0437\u043d\u0430, \u0447\u0442\u043e \u043d\u0435 \u043d\u0430 \u0447\u0442\u043e \u0431\u044b\u0301\u043b\u043e \u0435\u043c\u0443\u0301 \u043a\u0443\u043f\u0438\u0301\u0442\u044c \u0434\u0430\u0301\u0436\u0435 \u0445\u043b\u0435\u0431\u0430 \u043d\u0430 \u043f\u0440\u043e\u043f\u0438\u0442\u0430\u0301\u043d\u0438\u0435. \u0418 \u0432\u043e\u0442, \u043f\u043e\u0434 \u0432\u0435\u0301\u0447\u0435\u0440, \u043b\u0451\u0436\u0430 \u0432 \u043f\u043e\u0441\u0442\u0435\u0301\u043b\u0438, \u0441\u0442\u0430\u043b \u043e\u043d \u0440\u0430\u0437\u0434\u0443\u0301\u043c\u044b\u0432\u0430\u0442\u044c, \u0438 \u0432\u0441\u0451 \u043e\u0434\u043e\u043b\u0435\u0432\u0430\u0301\u043b\u0438 \u0435\u0433\u043e\u0301 \u0440\u0430\u0301\u0437\u043d\u044b\u0435 \u043c\u044b\u0301\u0441\u043b\u0438 \u0438 \u0437\u0430\u0431\u043e\u0301\u0442\u044b; \u043f\u043e\u0432\u0437\u0434\u044b\u0445\u0430\u043b \u043e\u043d \u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0301\u0442 \u0436\u0435\u043d\u0435\u0301: <\/p>\n<p>\u2014 \u0427\u0442\u043e \u0436\u0435 \u0442\u0435\u043f\u0435\u0301\u0440\u044c \u0431\u0443\u0301\u0434\u0435\u0442 \u0441 \u043d\u0430\u0301\u043c\u0438? \u041a\u0430\u043a \u043d\u0430\u043c \u043f\u0440\u043e\u043a\u043e\u0440\u043c\u0438\u0301\u0442\u044c \u0431\u0435\u0301\u0434\u043d\u044b\u0445 \u0434\u0435\u0442\u0435\u0301\u0439, \u043d\u0430\u043c-\u0442\u043e \u0432\u0435\u0434\u044c \u0438 \u0441\u0430\u043c\u0438\u0301\u043c \u0435\u0441\u0442\u044c \u043d\u0435\u0301\u0447\u0435\u0433\u043e!<\/p>\n<p>\u2014 \u0410 \u0437\u043d\u0430\u0301\u0435\u0448\u044c \u0447\u0442\u043e, \u2014 \u043e\u0442\u0432\u0435\u0447\u0430\u0301\u043b\u0430 \u0436\u0435\u043d\u0430\u0301, \u2014 \u0434\u0430\u0432\u0430\u0301\u0439-\u043a\u0430 \u043f\u043e\u0440\u0430\u043d\u044c\u0448\u0435 \u0443\u0301\u0442\u0440\u043e\u043c, \u0442\u043e\u0301\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u043d\u0451\u0442 \u0441\u0432\u0435\u0442\u0430\u0301\u0442\u044c, \u0437\u0430\u0432\u0435\u0434\u0451\u043c \u0434\u0435\u0442\u0435\u0301\u0439 \u0432 \u043b\u0435\u0441, \u0432 \u0441\u0430\u0301\u043c\u0443\u044e \u0433\u043b\u0443\u0445\u0443\u0301\u044e \u0447\u0430\u0301\u0449\u0443; \u0440\u0430\u0437\u0432\u0435\u0434\u0451\u043c \u0438\u043c \u043a\u043e\u0441\u0442\u0451\u0440, \u0434\u0430\u0434\u0438\u0301\u043c \u043a\u0430\u0301\u0436\u0434\u043e\u043c\u0443 \u043f\u043e \u043a\u0443\u0441\u043a\u0443\u0301 \u0445\u043b\u0435\u0431\u0430, \u0430 \u0441\u0430\u0301\u043c\u0438 \u0443\u0439\u0434\u0451\u043c \u043d\u0430 \u0440\u0430\u0431\u043e\u0301\u0442\u0443 \u0438 \u043e\u0441\u0442\u0430\u0301\u0432\u0438\u043c \u0438\u0445 \u043e\u0434\u043d\u0438\u0301\u0445. \u0414\u043e\u0440\u043e\u0301\u0433\u0438 \u0434\u043e\u043c\u043e\u0301\u0439 \u043e\u043d\u0438\u0301 \u043d\u0435 \u043d\u0430\u0439\u0434\u0443\u0301\u0442, \u0432\u043e\u0442 \u043c\u044b \u043e\u0442 \u043d\u0438\u0445 \u0438 \u0438\u0437\u0431\u0430\u0301\u0432\u0438\u043c\u0441\u044f.<\/p>\n<\/blockquote>\n<p>\u041e\u0448\u0438\u0431\u043e\u043a \u043d\u0435\u0442. \u041e\u0434\u043d\u0430\u043a\u043e, \u0441\u043b\u043e\u0432\u0430 &#171;\u0432\u043f\u0440\u043e\u0433\u043e\u043b\u043e\u0434\u044c&#187;, &#171;\u043f\u043e\u0432\u0437\u0434\u044b\u0445\u0430\u043b&#187; \u0438 &#171;\u043f\u043e\u0440\u0430\u043d\u044c\u0448\u0435&#187; \u043d\u0435 \u0431\u044b\u043b\u0438 \u043d\u0430\u0439\u0434\u0435\u043d\u044b \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u0435, \u0438 \u0434\u043b\u044f \u043d\u0438\u0445 \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u044f \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043d\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u0435 \u0432 \u0441\u043b\u043e\u0432\u0435 &#171;\u0445\u043b\u0435\u0431\u0430&#187;: \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u0435 \u043d\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043e, \u0447\u0442\u043e &#171;\u0445\u043b\u0435\u0431\u0430\u0301&#187; &#8212; \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e, \u0430 &#171;\u0445\u043b\u0435\u0301\u0431\u0430&#187; &#8212; \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0434\u0435\u0436 (\u043f\u0430\u0440\u0441\u0435\u0440 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0442\u0430\u043b\u0441\u044f \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0430 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 &#8212; &#171;\u0445\u043b\u0435\u0431\u044b&#187;). \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0441\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u043c \u0435\u0441\u0442\u044c, \u043d\u043e \u043e\u043d\u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0440\u0435\u0434\u043a\u0438.<\/p>\n<h3>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0441\u043b\u0443\u0447\u0430\u0438<\/h3>\n<blockquote>\n<p>\u042f \u0441\u0442\u043e\u044e \u0443 \u043e\u043a\u043d\u0430\u0301. \u0412 \u0434\u043e\u0301\u043c\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u0301\u0435 \u043e\u0301\u043a\u043d\u0430.<\/p>\n<\/blockquote>\n<p>\u041d\u0443, &#171;\u0441\u0442\u043e\u0438\u0442\u044c \u0443 \u043e\u043a\u043d\u0430&#187; \u0432 \u0442\u0435\u043e\u0440\u0438\u0438 \u0442\u043e\u0436\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e. \u0421\u043b\u043e\u0432\u043e &#171;\u0431\u043e\u043b\u044c\u0448\u0438\u0435&#187; \u0438\u043d\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u0435 \u043d\u0430 \u0438 (\u0440\u0430\u0431\u043e\u0442\u0430 spacy \u0441\u0442\u043e\u0445\u0430\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f), \u0438\u043d\u043e\u0433\u0434\u0430 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u043d\u0435\u0433\u043e. <\/p>\n<blockquote>\n<p>\u042f \u043a\u0443\u043f\u043b\u044e\u0301 \u043d\u0435\u043c\u043d\u043e\u0301\u0436\u043a\u043e \u0437\u0435\u043c\u043b\u0438\u0301. \u041d\u0435 \u0441\u043c\u0435\u0439 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u043e\u0432\u0430\u0301\u0442\u044c \u043d\u0430 \u043c\u043e\u0438\u0301 \u0437\u0435\u0301\u043c\u043b\u0438.<\/p>\n<\/blockquote>\n<p>\u0411\u0435\u0437 \u043e\u0448\u0438\u0431\u043e\u043a<\/p>\n<blockquote>\n<p>\u041d\u0430\u043c \u043d\u0443\u0436\u043d\u044b\u0301 \u0443\u0447\u0438\u0442\u0435\u043b\u044f\u0301. \u042f \u043f\u0440\u043e\u0446\u0438\u0442\u0438\u0301\u0440\u043e\u0432\u0430\u043b \u0441\u0432\u043e\u0435\u0433\u043e\u0301 \u0443\u0447\u0438\u0301\u0442\u0435\u043b\u044f.<\/p>\n<\/blockquote>\n<p>\u0411\u0435\u0437 \u043e\u0448\u0438\u0431\u043e\u043a<\/p>\n<blockquote>\n<p>\u041c\u044b \u0437\u0430\u043b\u0435\u0301\u0437\u043b\u0438 \u043d\u0430 \u0441\u0442\u0440\u043e\u0438\u0301\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043b\u0435\u0441\u0430\u0301.<\/p>\n<\/blockquote>\n<p>\u0411\u0435\u0437 \u043e\u0448\u0438\u0431\u043e\u043a<\/p>\n<blockquote>\n<p>\u0421\u0430\u043c\u043e\u043b\u0451\u0442 \u0436\u0434\u0430\u0301\u043b\u0438 \u0434\u0432\u0430 \u0434\u0438\u0440\u0435\u0301\u043a\u0442\u043e\u0440\u0430. \u0414\u0438\u0440\u0435\u0301\u043a\u0442\u043e\u0440\u0430 \u0431\u044b\u0301\u043b\u0438 \u043f\u043e\u0436\u0438\u043b\u043e\u0301\u0433\u043e \u0432\u043e\u0301\u0437\u0440\u0430\u0441\u0442\u0430.<\/p>\n<\/blockquote>\n<p>\u0423\u0432\u044b, \u043e\u0448\u0438\u0431\u043a\u0430 natasha-spacy \u0441\u043e \u0441\u043b\u043e\u0432\u043e\u043c &#171;\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0430&#187;<\/p>\n<blockquote>\n<p>\u041a\u043b\u044e\u0447 \u0441\u043d\u0430\u0447\u0430\u0301\u043b\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0301\u043b\u0441\u044f \u0432 \u0434\u0432\u0435\u0440\u0438, \u0430 \u043f\u043e\u0442\u043e\u0301\u043c \u043b\u0435\u0436\u0430\u0301\u043b \u043d\u0430 \u043f\u043e\u043b\u0443\u0301.<\/p>\n<\/blockquote>\n<p>\u041d\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0430 \u043d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e\u0441\u0442\u044c \u0441\u043e \u0441\u043b\u043e\u0432\u043e\u043c &#171;\u0434\u0432\u0435\u0440\u0438&#187;<\/p>\n<blockquote>\n<p>\u0421\u043e\u043b\u0434\u0430\u0301\u0442\u044b \u0432\u044b\u0301\u0441\u0442\u0440\u043e\u0438\u043b\u0438\u0441\u044c \u0432 \u043a\u0430\u0301\u0440\u0435.<\/p>\n<\/blockquote>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0441\u043b\u043e\u0432\u043e &#171;\u043a\u0430\u0440\u0435&#187; \u043d\u0435 \u043d\u0430\u0448\u043b\u043e\u0441\u044c \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u0435.<\/p>\n<blockquote>\n<p>\u041f\u043e-\u043c\u043e\u0301\u0435\u043c\u0443, \u041c\u0430\u0448\u0435 \u0441\u0442\u043e\u0438\u0442 \u043a\u0443\u043f\u0438\u0301\u0442\u044c \u043c\u0430\u0448\u0438\u0301\u043d\u0443.<\/p>\n<\/blockquote>\n<p>\u041d\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0430 \u043d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e\u0441\u0442\u044c \u0441\u043e \u0441\u043b\u043e\u0432\u043e\u043c &#171;\u0441\u0442\u043e\u0438\u0442&#187;<\/p>\n<blockquote>\n<p>\u041f\u043e \u043b\u0435\u0301\u0441\u0443 \u0431\u0440\u043e\u0434\u0438\u0301\u043b \u043c\u0435\u0434\u0432\u0435\u0301\u0434\u044c. \u041c\u044b \u043d\u0430\u0442\u043a\u043d\u0443\u0301\u043b\u0438\u0441\u044c \u043d\u0430 \u043d\u0435\u0433\u043e\u0301, \u043a\u043e\u0433\u0434\u0430\u0301 \u0433\u0443\u043b\u044f\u0301\u043b\u0438 \u0432 \u043b\u0435\u0441\u0443\u0301.<\/p>\n<\/blockquote>\n<p>\u0411\u0435\u0437 \u043e\u0448\u0438\u0431\u043e\u043a.<\/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\/575100\/\"> https:\/\/habr.com\/ru\/articles\/575100\/<\/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>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0441\u0435\u0431\u044f \u043d\u0430 \u043c\u0435\u0441\u0442\u0435 \u0438\u0437\u0443\u0447\u0430\u044e\u0449\u0435\u0433\u043e \u0440\u0443\u0441\u0441\u043a\u0438\u0439 \u044f\u0437\u044b\u043a \u0438\u043d\u043e\u0441\u0442\u0440\u0430\u043d\u0446\u0430. \u0423\u0434\u0430\u0440\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u043d\u0435\u0442 \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0432\u0430\u0448\u0438\u0445 \u0441\u0430\u043c\u044b\u0445 \u0441\u0442\u0440\u0430\u0448\u043d\u044b\u0445 \u043d\u043e\u0447\u043d\u044b\u0445 \u043a\u043e\u0448\u043c\u0430\u0440\u043e\u0432. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043e\u043d\u043e \u043d\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u043f\u0440\u0430\u0432\u0438\u043b, \u0438 \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u043e\u0438\u0437\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c. \u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043e\u043d\u043e \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0435 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u0435\u043a\u0441\u0442\u0430\u0445, \u0447\u0442\u043e \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0432\u043e\u0434\u0438\u0442 \u043d\u0430 \u043d\u0435\u0442 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0431\u043b\u0438\u0437\u043e\u0441\u0442\u044c \u0440\u0443\u0441\u0441\u043a\u043e\u0439 \u043e\u0440\u0444\u043e\u0433\u0440\u0430\u0444\u0438\u0438 \u043a \u043f\u0440\u043e\u0438\u0437\u043d\u043e\u0448\u0435\u043d\u0438\u044e &#8212; \u0431\u0435\u0437 \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u0439 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u0441 \u043d\u0435\u0437\u043d\u0430\u043a\u043e\u043c\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u0438\u043d\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u0446 \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442. \u0412-\u0442\u0440\u0435\u0442\u044c\u0438\u0445, \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043c\u0435\u043d\u044f\u0435\u0442 \u0444\u043e\u043d\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043e\u0431\u0440\u0430\u0437 \u0441\u043b\u043e\u0432\u0430 \u0434\u043b\u044f \u0440\u0443\u0441\u0441\u043a\u043e\u0433\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430, \u0438 \u0438\u0437-\u0437\u0430 \u043e\u0434\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432\u0430\u0441 \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u043f\u043e\u043d\u044f\u0442\u044c.<\/p>\n<h2>\u041c\u043e\u0439 \u043e\u043f\u044b\u0442<\/h2>\n<p>\u042f \u0437\u043d\u0430\u043a\u043e\u043c \u0441 \u043e\u0434\u043d\u043e\u0439 \u0434\u0435\u0432\u0443\u0448\u043a\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0437\u0443\u0447\u0430\u0435\u0442 \u0440\u0443\u0441\u0441\u043a\u0438\u0439 \u044f\u0437\u044b\u043a \u0432 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442\u0435 \u041b\u0435\u0439\u0434\u0435\u043d\u0430. \u041e\u0434\u043d\u0430\u0436\u0434\u044b \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u0440\u0443\u0441\u0441\u043a\u043e\u0433\u043e, \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u044b\u043b\u0430 \u0440\u0430\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u0439. \u042f \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b \u043a\u0430\u0436\u0434\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \u043f\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044e. \u041e\u0434\u043d\u0430\u043a\u043e, \u044d\u0442\u043e \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043b\u043e \u043a \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0433\u0434\u0430 \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: &#171;\u0434\u0432\u0430 \u0441\u043b\u043e\u0301\u0432\u0430&#187;, \u043d\u043e &#171;\u0434\u043b\u0438\u043d\u043d\u044b\u0435 \u0441\u043b\u043e\u0432\u0430\u0301&#187;. \u0412 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445 \u043c\u043d\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u043e\u0441\u044c \u0434\u0435\u043b\u0430\u0442\u044c, \u043a\u0440\u043e\u043c\u0435 \u043a\u0430\u043a \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043b\u043e\u0432\u043e \u0431\u0435\u0437 \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u044f.<\/p>\n<h2>\u0418\u0434\u0435\u044f<\/h2>\n<p>\u041d\u043e \u0432\u0435\u0434\u044c \u043d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e\u0441\u0442\u044c \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0442\u043e\u0433\u043e, \u0432 \u043a\u0430\u043a\u043e\u0439 \u0444\u043e\u0440\u043c\u0435 \u0443\u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u043e \u0441\u043b\u043e\u0432\u043e, \u043e\u0442 \u0435\u0433\u043e \u043c\u043e\u0440\u0444\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439. \u0415\u0441\u043b\u0438 \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0439\u0442\u0438 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u0439 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0444\u043e\u0440\u043c\u044b \u0441\u043b\u043e\u0432\u0430 + \u043d\u0430\u0443\u0447\u0438\u043c\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0444\u043e\u0440\u043c\u0443 \u0441\u043b\u043e\u0432\u0430 \u043f\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0443, \u0442\u043e \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u043d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e\u0441\u0442\u044c. \u041c\u043e\u0440\u0444\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 &#8212; \u043e\u0434\u043d\u0430 \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 NLP, \u0434\u043b\u044f \u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 Spacy.<\/p>\n<h2>\u0414\u0430\u043d\u043d\u044b\u0435<\/h2>\n<p>\u0413\u0434\u0435 \u0436\u0435 \u043d\u0430\u043c \u043d\u0430\u0439\u0442\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u0439? \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0430\u044f \u043d\u0430\u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0435\u0441\u0442\u044c \u0432 <a href=\"https:\/\/en.wiktionary.org\" rel=\"noopener noreferrer nofollow\">wiktionary<\/a>. <\/p>\n<figure class=\"\"><figcaption>Wiktionary<\/figcaption><\/figure>\n<p>\u0414\u043b\u044f \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 wiktionary \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043b\u0438\u0431\u0430 <a href=\"https:\/\/pypi.org\/project\/wiktionaryparser\/\" rel=\"noopener noreferrer nofollow\">wiktionaryparser<\/a>. \u0412\u043f\u0440\u043e\u0447\u0435\u043c, \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442 <a href=\"https:\/\/kaikki.org\/dictionary\/Russian\/index.html\" rel=\"noopener noreferrer nofollow\">\u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0435\u0451 \u0440\u0430\u0431\u043e\u0442\u044b<\/a>. Json-\u0444\u0430\u0439\u043b \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0430\u0431\u043e\u0440 \u0441\u043b\u043e\u0432\u043e\u0444\u043e\u0440\u043c, \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u0435\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441 \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u0435\u043c, \u043d\u0430\u0431\u043e\u0440 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043c\u0430\u0440\u043a\u0435\u0440 \u0447\u0430\u0441\u0442\u0438 \u0440\u0435\u0447\u0438. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u044f \u0440\u0430\u0441\u043f\u0430\u0440\u0441\u0438\u043b \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0417\u0430\u043b\u0438\u0437\u043d\u044f\u043a\u0430 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0442\u0435 \u0444\u043e\u0440\u043c\u044b \u043e\u0442\u0442\u0443\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435 \u043d\u0430\u0448\u043b\u043e\u0441\u044c \u0432 wiktionary.<\/p>\n<p>\u0414\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0442\u043e\u043a\u0435\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432-\u0441\u043b\u043e\u0432\u043e\u0444\u043e\u0440\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u0440\u0435\u0447\u0438 (\u0432\u043e\u0435\u043d\u043d\u044b\u0439 \u043a\u0430\u043a \u043f\u0440\u0438\u043b\u0430\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0438 \u0432\u043e\u0435\u043d\u043d\u044b\u0439 \u043a\u0430\u043a \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435) \u0438\u043b\u0438 \u0441\u043c\u044b\u0441\u043b\u043e\u043c (\u043f\u0438\u0441\u0430\u0301\u0442\u044c \u0438 \u043f\u0438\u0301\u0441\u0430\u0442\u044c).<\/p>\n<figure class=\"full-width\"><figcaption>\u041d\u043e\u0432\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0441\u043b\u043e\u0432\u0430\u0440\u044f<\/figcaption><\/figure>\n<p>\u042f \u043f\u0435\u0440\u0435\u0432\u0435\u043b \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0432 \u043d\u043e\u0432\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442: \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0442\u043e\u043a\u0435\u043d\u0443 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u043b\u043e\u0432\u043e\u0444\u043e\u0440\u043c, \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u043b\u043e\u0432\u043e\u0444\u043e\u0440\u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u043f\u043e\u043b\u044f accentuated (\u0432\u0438\u0434 \u0441\u043b\u043e\u0432\u043e\u0444\u043e\u0440\u043c\u044b \u0441 \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u0435\u043c), form (\u043c\u043e\u0440\u0444\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438) \u0438 lemma (\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043b\u0435\u043c\u043c\u0443). \u0421\u043b\u043e\u0432\u0430\u0440\u044c \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e pickle \u0432 wordforms.dat.<\/p>\n<figure class=\"full-width\"><figcaption>\u0421\u043b\u043e\u0432\u0430\u0440\u044c \u043b\u0435\u043c\u043c<\/figcaption><\/figure>\n<p>\u041a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e, \u044f \u0441\u043e\u0437\u0434\u0430\u043b \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u043b\u0435\u043c\u043c. \u041b\u0435\u043c\u043c\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u0440\u0435\u0447\u0438 + \u0447\u0430\u0441\u0442\u043e\u0442\u043d\u044b\u0439 \u0440\u0430\u043d\u0433. \u0421\u043b\u043e\u0432\u0430\u0440\u044c \u043b\u0435\u043c\u043c \u0442\u0430\u043a\u0436\u0435 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/docs.python.org\/3\/library\/pickle.html\" rel=\"noopener noreferrer nofollow\">pickle<\/a>, \u0432 lemmas.dat.<\/p>\n<h2>Spacy<\/h2>\n<p><a href=\"https:\/\/spacy.io\" rel=\"noopener noreferrer nofollow\">Spacy <\/a>&#8212; \u044d\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f NLP. \u041e\u043d\u0430 \u0443\u043c\u0435\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0432\u0435\u0449\u0438 \u043a\u0430\u043a \u0442\u043e\u043a\u0435\u043d\u0438\u0437\u0430\u0446\u0438\u044f, \u043c\u043e\u0440\u0444\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437, \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437, Named Entity Recognition. \u041d\u0430\u0441  \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0442 \u043f\u0435\u0440\u0432\u044b\u0435 \u0434\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>\u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c natasha-spacy, \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0440\u0443\u0441\u0441\u043a\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 \u0434\u043b\u044f spacy \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 natasha, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u043c\u043e\u0440\u0444\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 (\u043f\u0430\u0434\u0435\u0436\u0438, \u0432\u0440\u0435\u043c\u0435\u043d\u0430), \u0447\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f. \u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 <a href=\"https:\/\/github.com\/natasha\/natasha-spacy\" rel=\"noopener noreferrer nofollow\">\u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<h2>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h2>\n<pre><code class=\"python\">import spacy import pickle ru_nlp = spacy.load('ru_core_news_md')  def load():     with open(file=\"lemmas.dat\", mode='rb') as f:         lemmas = pickle.loads(f.read())     with open(file=\"wordforms.dat\", mode='rb') as f:         wordforms = pickle.loads(f.read())     return lemmas, wordforms       def introduce_special_cases_from_dictionary(dictionary):     for word in dictionary:         if (\" \" in word) or (\"-\" in word):             if len(dictionary[word]) == 1:                 ru_nlp.tokenizer.add_special_case(word, [{\"ORTH\": dictionary[word][0][\"accentuated\"]}])                 ru_nlp.tokenizer.add_special_case(word.capitalize(), [{\"ORTH\": dictionary[word][0][\"accentuated\"].capitalize()}])                  lemmas, wordforms = load() introduce_special_cases_from_dictionary(wordforms)  f = open(\"in.txt\", mode='r', encoding='utf-8') text = f.read() f.close()  res = accentuate(text, wordforms, lemmas)   f = open(\"out.txt\", mode='w', encoding='utf-8') f.write(res) f.close()<\/code><\/pre>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u043d\u0430\u0448\u0438 \u0441\u043b\u043e\u0432\u0430\u0440\u0438, \u0437\u0430\u0442\u0435\u043c \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u043c \u0442\u043e\u043a\u0435\u043d\u0438\u0437\u0430\u0442\u043e\u0440: \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 (\u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u0434\u0435\u0444\u0438\u0441 \u0438\u043b\u0438 \u043f\u0440\u043e\u0431\u0435\u043b) \u0442\u043e\u043a\u0435\u043d\u044b \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044f. \u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0438\u0437-\u0437\u0430 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043d\u0430\u043f\u043e\u0434\u043e\u0431\u0438\u0435 &#171;\u043f\u043e-\u043c\u043e\u0435\u043c\u0443&#187;: \u0438\u043d\u0430\u0447\u0435 \u0441\u043b\u043e\u0432\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043e \u043d\u0430 &#171;\u043f\u043e&#187;, &#171;-&#187; \u0438 &#171;\u043c\u043e\u0435\u043c\u0443&#187;, \u0441 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u0435\u043c \u0432 &#171;\u043c\u043e\u0435\u043c\u0443&#187;.<\/p>\n<h2>\u0422\u043e\u043a\u0435\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u043c\u043e\u0440\u0444\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437<\/h2>\n<pre><code class=\"python\">def tokenize(text, wordforms):     res = []     doc = ru_nlp(text)     for token in doc:         if token.pos_ != 'PUNCT':             word = {\"token\": token.text, \"tag\": token.tag_}             if word[\"token\"] in wordforms:                 word[\"interpretations\"] = wordforms[word[\"token\"]]             if word[\"token\"].lower() in wordforms:                 word[\"interpretations\"] = wordforms[word[\"token\"].lower()]             word[\"lemma\"] = token.lemma_             word[\"is_punctuation\"] = False             word[\"uppercase\"] = word[\"token\"].upper() == word[\"token\"]             word[\"starts_with_a_capital_letter\"] = word[\"token\"][0].upper() == word[\"token\"][0]         else:             word = {\"token\": token.text, \"is_punctuation\": True}         word[\"whitespace\"] = token.whitespace_         res.append(word)     return res<\/code><\/pre>\n<p>\u0414\u0435\u043b\u0430\u0435\u043c \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0442\u043e\u043a\u0435\u043d\u0438\u0437\u0430\u0446\u0438\u044e \u0438 \u043c\u043e\u0440\u0444\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437.<\/p>\n<p>\u041a\u0430\u0436\u0434\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0432\u0438\u0434\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u044f \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438:<\/p>\n<ul>\n<li>\n<p>token \u2014 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u044c \u0441\u043b\u043e\u0432\u043e\u0444\u043e\u0440\u043c\u044b (\u0432 \u043d\u0438\u0436\u043d\u0435\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0435)<\/p>\n<\/li>\n<li>\n<p>tag \u2014 \u043d\u0430\u0431\u043e\u0440 \u043c\u043e\u0440\u0444\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439. \u0421\u0442\u0440\u043e\u043a\u0430 tag \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a: &#171;NOUN__Animacy=Inan|Case=Gen|Gender=Masc|Number=Plur&#187; \u0438\u043b\u0438 &#171;&#8216;VERB__Aspect=Perf|Mood=Imp|Number=Plur|Person=Second|VerbForm=Fin|Voice=Act'&#187;<\/p>\n<\/li>\n<li>\n<p>interpretations \u2014 \u043d\u0430\u0431\u043e\u0440 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438\u0437 \u0441\u043b\u043e\u0432\u0430\u0440\u044f (\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0443\u0434\u0430\u0440\u0435\u043d\u0438\u044f\u043c\u0438), \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0430\u0448 \u0442\u043e\u043a\u0435\u043d<\/p>\n<\/li>\n<li>\n<p>lemma \u2014 \u0438\u0441\u0445\u043e\u0434\u043d\u0430\u044f \u043b\u0435\u043c\u043c\u0430 \u0442\u043e\u043a\u0435\u043d\u0430 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f spacy<\/p>\n<\/li>\n<li>\n<p>is_punctuation \u2014 \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 True \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0437\u043d\u0430\u043a\u043e\u0432 \u043f\u0443\u043d\u043a\u0442\u0443\u0430\u0446\u0438\u0438, \u043d\u043e \u0438 \u0434\u043b\u044f &#171;\u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432&#187; (\u0441\u043c. \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u0440\u0430\u0437\u0434\u0435\u043b \u043f\u0440\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e spacy).<\/p>\n<\/li>\n<li>\n<p>starts_with_a_capital_letter \u2014 \u043c\u044b \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u043c \u0432\u0441\u0435 \u0442\u043e\u043a\u0435\u043d\u044b \u0432 \u043d\u0438\u0436\u043d\u0438\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440, \u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c, \u0430 \u0431\u044b\u043b\u043e \u043b\u0438 \u0441\u043b\u043e\u0432\u043e \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0441 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0431\u0443\u043a\u0432\u044b<\/p>\n<\/li>\n<li>\n<p>uppercase \u2014 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043b\u0438 \u0441\u043b\u043e\u0432\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0432 \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0435<\/p>\n<\/li>\n<li>\n<p>whitespace \u2014 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u0440\u043e\u0431\u0435\u043b, \u0435\u0441\u043b\u0438 \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u043a\u0435\u043d\u0430 \u0438\u0434\u0451\u0442 \u043f\u0440\u043e\u0431\u0435\u043b. \u041d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430<\/p>\n<\/li>\n<\/ul>\n<h2>\u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u043c\u043e\u0440\u0444\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439<\/h2>\n<p>\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0439 &#171;\u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u0438&#187; \u0442\u043e\u043a\u0435\u043d\u0430 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c, \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u0430 \u043b\u0438 \u043e\u043d\u0430 \u0441 \u043c\u043e\u0440\u0444\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0442\u0435\u0433\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u0434\u0430\u043b spacy.<\/p>\n<pre><code class=\"python\">def compatible(interpretation, lemma, tag, lemmas):     if lemma in lemmas:         pos_exists = False         possible_poses = lemmas[lemma][\"pos\"]         for i in range(len(possible_poses)):             if possible_poses[i] in tag:                 pos_exists = True                 break         if not (pos_exists):             return False      if interpretation == \"canonical\":         return True     if \"plural\" in interpretation and not (\"Number=Plur\" in tag):         return False     if \"singular\" in interpretation and not (\"Number=Sing\" in tag):         return False     if not (\"nominative\" in interpretation) and (\"Case=Nom\" in tag):         return False     if not (\"genitive\" in interpretation) and (\"Case=Gen\" in tag):         return False     if not (\"dative\" in interpretation) and (\"Case=Dat\" in tag):         return False     if not (\"accusative\" in interpretation) and (\"Case=Acc\" in tag):         adj = False         if \"ADJ\" in tag and \"Animacy=Inan\" in tag:             adj = True         if not adj:             return False     if not (\"instrumental\" in interpretation) and (\"Case=Ins\" in tag):         return False     if not (\"prepositional\" in interpretation) and not (\"locative\" in interpretation) and (\"Case=Loc\" in tag):         return False     if ((\"present\" in interpretation) or (\"future\" in interpretation)) and (\"Tense=Past\" in tag):         return False     if ((\"past\" in interpretation) or (\"future\" in interpretation)) and (\"Tense=Pres\" in tag):         return False     if ((\"past\" in interpretation) or (\"present\" in interpretation)) and (\"Tense=Fut\" in tag):         return False      return True<\/code><\/pre>\n<p>\u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b:<\/p>\n<ul>\n<li>\n<p>interpretation \u2014 \u0441\u0442\u0440\u043e\u043a\u0430 \u0441 \u043c\u043e\u0440\u0444\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u0438\u0437 \u0441\u043b\u043e\u0432\u0430\u0440\u044f wordforms. \u041f\u0440\u0438\u043c\u0435\u0440: &#171;genitive plural&#187;<\/p>\n<\/li>\n<li>\n<p>lemma \u2014 \u043b\u0435\u043c\u043c\u0430 \u0442\u043e\u043a\u0435\u043d\u0430 \u043f\u043e \u0432\u0435\u0440\u0441\u0438\u0438 natasha-spacy<\/p>\n<\/li>\n<li>\n<p>tag \u2014 \u043c\u043e\u0440\u0444\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0442\u0435\u0433 \u043e\u0442 spacy. \u041f\u0440\u0438\u043c\u0435\u0440: &#171;NOUN__Animacy=Inan|Case=Gen|Gender=Masc|Number=Plur&#187;<\/p>\n<\/li>\n<li>\n<p>lemmas \u2014 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u043b\u0435\u043c\u043c<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e \u043b\u0435\u043c\u043c\u0430 lemma \u0432\u043e\u043e\u0431\u0449\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0447\u0430\u0441\u0442\u044c\u044e \u0440\u0435\u0447\u0438, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0432 tag. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0438 \u0432\u0440\u043e\u0434\u0435 &#171;\u043f\u043e\u0442\u043e\u043c&#187; \u043a\u0430\u043a \u043d\u0430\u0440\u0435\u0447\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043a\u0430\u043a \u0444\u043e\u0440\u043c\u0443 \u0441\u043b\u043e\u0432\u0430 &#171;\u043f\u043e\u0442&#187;.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043d\u0435\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f (\u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 interpretation \u043d\u0435 &#8216;canonical&#8217;): <\/p>\n<ul>\n<li>\n<p>\u0412 interpretation \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0438 \u0432 tag \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0440\u0430\u0437\u043d\u043e\u0435 \u0433\u0440\u0430\u043c\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0447\u0438\u0441\u043b\u043e<\/p>\n<\/li>\n<li>\n<p>\u0412 tag \u0443\u043a\u0430\u0437\u0430\u043d \u043f\u0430\u0434\u0435\u0436, \u0430 \u0432 interpretation \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043f\u0430\u0434\u0435\u0436\u0430 \u043d\u0435\u0442<\/p>\n<\/li>\n<li>\n<p>\u042f\u0432\u043d\u043e\u0435 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0438\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0433\u043b\u0430\u0433\u043e\u043b\u0430<\/p>\n<\/li>\n<\/ul>\n<h2>\u041e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0432\u0441\u0435 \u0442\u043e\u043a\u0435\u043d\u044b<\/h2>\n<pre><code class=\"python\">def accentuate(text, wordforms, lemmas):     res = \"\"     words = tokenize(text, wordforms)     for i in range(len(words)):         accentuated = accentuate_word(words[i], lemmas)         if \"starts_with_a_capital_letter\" in words[i] and words[i][\"starts_with_a_capital_letter\"]:             accentuated = accentuated.capitalize()         if \"uppercase\" in words[i] and words[i][\"uppercase\"]:             accentuated = accentuated.upper()         res += accentuated         res += words[i][\"whitespace\"]     return res       def accentuate_word(word, lemmas):     if (\"tag\" in word) and (\"PROPN\" in word[\"tag\"]):         return word[\"token\"]      if word[\"is_punctuation\"] or (not \"interpretations\" in word):         return word[\"token\"]     else:         res = derive_single_accentuation(word[\"interpretations\"])         if not (res is None):             return res         else:             compatible_interpretations = []             for i in range(len(word[\"interpretations\"])):                 if compatible(word[\"interpretations\"][i][\"form\"], word[\"interpretations\"][i][\"lemma\"], word[\"tag\"], lemmas):                     compatible_interpretations.append(word[\"interpretations\"][i])   <\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-407431","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/407431","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=407431"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/407431\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=407431"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=407431"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=407431"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}