{"id":326065,"date":"2021-07-06T21:00:23","date_gmt":"2021-07-06T21:00:23","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=326065"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=326065","title":{"rendered":"\u0421\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043e\u0438\u0441\u043a: \u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0430 \u0416\u0430\u043a\u043a\u0430\u0440\u0430 \u043a \u0441\u043b\u043e\u0436\u043d\u043e\u043c\u0443 SBERT"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3b8\/5bb\/e52\/3b85bbe5298a63d26a3ae9e966e48ea2.png\" width=\"1600\" height=\"1267\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0435, \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u043c \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043a \u0441\u0442\u0430\u0440\u0442\u0443 \u043a\u0443\u0440\u0441\u0430 \u043e <a href=\"https:\/\/skillfactory.ru\/ml-and-dl?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_MLDL&amp;utm_term=regular&amp;utm_content=060721\">\u043c\u0430\u0448\u0438\u043d\u043d\u043e\u043c \u0438 \u0433\u043b\u0443\u0431\u043e\u043a\u043e\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438<\/a>, \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u044f\u0437\u044b\u043a\u043e\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043f\u043e\u0438\u0441\u043a\u0435, \u0441\u0442\u0430\u0442\u044c\u044f \u043e\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0448\u0435\u0441\u0442\u044c \u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u043e\u0432; \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0430 \u043f\u043e \u0416\u0430\u043a\u043a\u0430\u0440\u0443, \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0448\u0438\u043d\u0433\u043b\u043e\u0432 \u0438 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u041b\u0435\u0432\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u0430, \u0430\u0432\u0442\u043e\u0440 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u043a \u043f\u043e\u0438\u0441\u043a\u0443 \u0441 \u0440\u0430\u0437\u0440\u0435\u0436\u0435\u043d\u043d\u044b\u043c\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438 \u2014 TF-IDF \u0438 BM25 \u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u043b\u043e\u0442\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0438 Sentence-BERT. \u041f\u0440\u043e\u0441\u0442\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u044e\u0442\u0441\u044f \u043a\u043e\u0434\u043e\u043c \u0438 \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f\u043c\u0438, \u0430 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0432\u044b \u043d\u0430\u0439\u0434\u0451\u0442\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0431\u043b\u043e\u043a\u043d\u043e\u0442\u044b Jupyter.<\/p>\n<hr>\n<p>\u041f\u043e\u0438\u0441\u043a \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0430 \u2014 \u043e\u0434\u043d\u0430 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0431\u044b\u0441\u0442\u0440\u043e\u0440\u0430\u0441\u0442\u0443\u0449\u0438\u0445 \u043e\u0431\u043b\u0430\u0441\u0442\u0435\u0439 \u0432 \u0418\u0418 \u0438 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438. \u041f\u043e \u0441\u0432\u043e\u0435\u0439 \u0441\u0443\u0442\u0438, \u044d\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c. \u0412\u0435\u043b\u0438\u043a\u0430 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c, \u0447\u0442\u043e \u0432\u044b \u043d\u0430\u0448\u043b\u0438 \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u2014 \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, Google. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u044b \u0438\u0441\u043a\u0430\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 &#171;what is semantic similarity search?&#187; \u0438\u043b\u0438 &#171;traditional vs vector similarity search&#187;. Google \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0432\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043c\u043d\u043e\u0433\u0438\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0443, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435.&nbsp;<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u0438\u0441\u043a \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0430 \u043b\u0435\u0436\u0438\u0442 \u0432 \u043e\u0441\u043d\u043e\u0432\u0435 \u0443\u0441\u043f\u0435\u0445\u0430 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c\u044e $ 1,65 \u0422 \u2014 \u043f\u044f\u0442\u043e\u0439 \u043f\u043e \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u043c\u0438\u0440\u0435<sup>[1]<\/sup>, \u0435\u0441\u0442\u044c <em>\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0448\u0430\u043d\u0441<\/em>, \u0447\u0442\u043e \u043e \u043d\u0451\u043c \u0441\u0442\u043e\u0438\u0442 \u0443\u0437\u043d\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435. <a href=\"https:\/\/www.pinecone.io\/learn\/what-is-similarity-search\/\">\u041f\u043e\u0438\u0441\u043a \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0430<\/a> \u2014 \u0441\u043b\u043e\u0436\u043d\u0430\u044f \u0442\u0435\u043c\u0430, \u0435\u0441\u0442\u044c \u0431\u0435\u0441\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043c\u0435\u0442\u043e\u0434\u0438\u043a \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0438 \u043c\u043e\u0449\u043d\u044b\u0445 \u0438\u0437 \u044d\u0442\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u0443\u0434\u0435\u043b\u044f\u044f \u043e\u0441\u043e\u0431\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u043f\u043e\u0438\u0441\u043a\u0443. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442, \u0447\u0435\u043c \u043e\u043d\u0438 \u0445\u043e\u0440\u043e\u0448\u0438 \u0438 \u043a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0445 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e. \u041c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u044d\u0442\u043e \u0432\u0438\u0434\u0435\u043e \u0438\u043b\u0438 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e.<\/p>\n<details class=\"spoiler\">\n<summary>\u0414\u0432\u0430 \u0432\u0438\u0434\u0435\u043e \u043e \u0434\u0432\u0443\u0445 \u043a\u043b\u0430\u0441\u0441\u0430\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432<\/summary>\n<div class=\"spoiler__content\"><iframe id=\"60e45dcef2fa57a26f179f60\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60e45dcef2fa57a26f179f60\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><iframe id=\"60e46f3f12b0d58fd6dde610\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60e46f3f12b0d58fd6dde610\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/div>\n<\/details>\n<h3>\u0422\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a<\/h3>\n<p>\u041c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0441 \u043b\u0430\u0433\u0435\u0440\u044f \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u0439 \u0438 \u0442\u0430\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u0438\u0433\u0440\u043e\u043a\u043e\u0432:<\/p>\n<ul>\n<li>\n<p><strong>\u0421\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u0416\u0430\u043a\u043a\u0430\u0440\u0430.<\/strong><\/p>\n<\/li>\n<li>\n<p><strong>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0448\u0438\u043d\u0433\u043b\u043e\u0432.<\/strong><\/p>\n<\/li>\n<li>\n<p><strong>\u0420\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u041b\u0435\u0432\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u0430.<\/strong><\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u0441\u0435 \u044d\u0442\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043f\u0440\u0438 \u043f\u043e\u0438\u0441\u043a\u0435 \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0430, \u0438\u0437 \u043d\u0438\u0445 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0442\u0440\u0438 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445: \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e \u0416\u0430\u043a\u043a\u0430\u0440\u0443, \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0448\u0438\u043d\u0433\u043b\u043e\u0432 \u0438 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u041b\u0435\u0432\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u0430.<\/p>\n<h3>\u0421\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u0416\u0430\u043a\u043a\u0430\u0440\u0430<\/h3>\n<p>\u0421\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u0416\u0430\u043a\u043a\u0430\u0440\u0430 \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u0430\u044f, \u043d\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u043c\u043e\u0449\u043d\u0430\u044f \u043c\u0435\u0442\u0440\u0438\u043a\u0430 \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0430. \u0414\u0430\u043d\u044b \u0434\u0432\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 <strong>A<\/strong> \u0438 <strong>B<\/strong>: \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0447\u0438\u0441\u043b\u043e \u043e\u0431\u0449\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043d\u0438\u0445 \u0438 \u0434\u0435\u043b\u0438\u043c \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043d\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043e\u0431\u0435\u0438\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/af8\/dd7\/ca6\/af8dd7ca67bf35fe0e7c045f37b92aa0.jpeg\" alt=\"\u0421\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u0416\u0430\u043a\u043a\u0430\u0440\u0430 \u0438\u0437\u043c\u0435\u0440\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435\u043c \u0434\u0432\u0443\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439\" title=\"\u0421\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u0416\u0430\u043a\u043a\u0430\u0440\u0430 \u0438\u0437\u043c\u0435\u0440\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435\u043c \u0434\u0432\u0443\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439\" width=\"700\" height=\"504\"><figcaption>\u0421\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u0416\u0430\u043a\u043a\u0430\u0440\u0430 \u0438\u0437\u043c\u0435\u0440\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435\u043c \u0434\u0432\u0443\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439<\/figcaption><\/figure>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440: \u0434\u0430\u043d\u044b \u0434\u0432\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b, \u0437\u0430\u043f\u0438\u0448\u0435\u043c:<\/p>\n<p><iframe id=\"60e46f74da3d598f9a4a513c\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60e46f74da3d598f9a4a513c\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438 <strong>\u0434\u0432\u0430<\/strong> \u043e\u0431\u0449\u0438\u0445 <em>\u043d\u0435\u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445<\/em> \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u043b\u0430, 3 \u0438 4 \u2014 \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0441 \u043e\u0431\u0449\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0434\u0435\u0441\u044f\u0442\u0438 \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u0432 \u043e\u0431\u0435\u0438\u0445, \u0433\u0434\u0435 <strong>\u0432\u043e\u0441\u0435\u043c\u044c<\/strong> \u0447\u0438\u0441\u0435\u043b&nbsp; \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u2014 2\/8 \u0434\u0430\u0451\u0442 \u043d\u0430\u043c \u043e\u0446\u0435\u043d\u043a\u0443 \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0430 \u043f\u043e \u0416\u0430\u043a\u043a\u0430\u0440\u0434\u0443 0,25. \u0422\u0443 \u0436\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0438 \u0434\u043b\u044f \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445: \u0432\u0441\u0451, \u0447\u0442\u043e \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c, \u2014 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c <em>\u0446\u0435\u043b\u044b\u0435 \u0447\u0438\u0441\u043b\u0430<\/em> \u043d\u0430 <em>\u0442\u043e\u043a\u0435\u043d\u044b<\/em>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6ee\/6e7\/e3b\/6ee6e7e3bccc63f3ccb2138f6d7cfd08.png\" alt=\"\u0421\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e \u0416\u0430\u043a\u043a\u0430\u0440\u0443, \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u043e\u0435 \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438 a \u0438 b\" title=\"\u0421\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e \u0416\u0430\u043a\u043a\u0430\u0440\u0443, \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u043e\u0435 \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438 a \u0438 b\" width=\"1600\" height=\"900\"><figcaption>\u0421\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e \u0416\u0430\u043a\u043a\u0430\u0440\u0443, \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u043e\u0435 \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438 a \u0438 b<\/figcaption><\/figure>\n<p><iframe id=\"60e46f97da3d598f9a4a513d\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60e46f97da3d598f9a4a513d\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p>\u041c\u044b \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u0438, \u0447\u0442\u043e, \u043a\u0430\u043a \u0438 \u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c, \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f b \u0438 c \u043d\u0430\u0431\u0440\u0430\u043b\u0438 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0431\u0430\u043b\u043b\u043e\u0432. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u044d\u0442\u043e \u043d\u0435 \u043b\u0443\u0447\u0448\u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u2014 \u0434\u0432\u0430 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u043e\u0431\u0449\u0435\u0433\u043e, \u043a\u0440\u043e\u043c\u0435 \u0441\u043b\u043e\u0432 <em>&#8216;the&#8217;<\/em>, <em>&#8216;a&#8217;<\/em>, <em>&#8216;is&#8217;<\/em> \u0438 \u0442. \u0434., \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u044b\u0441\u043e\u043a\u0438\u0435 \u043e\u0446\u0435\u043d\u043a\u0438 \u0416\u0430\u043a\u043a\u0430\u0440\u0430, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043e\u043d\u0438 \u043d\u0435\u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b \u043f\u043e \u0441\u043c\u044b\u0441\u043b\u0443. \u042d\u0442\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \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\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u043e\u043f-\u0441\u043b\u043e\u0432, \u0441\u0442\u0435\u043c\u043c\u0438\u043d\u0433\/\u043b\u0435\u043c\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u0442. \u0434. \u041e\u0434\u043d\u0430\u043a\u043e, \u043a\u0430\u043a \u043c\u044b \u0441\u043a\u043e\u0440\u043e \u0443\u0432\u0438\u0434\u0438\u043c, \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u044d\u0442\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c.<\/p>\n<h3>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0448\u0438\u043d\u0433\u043b\u043e\u0432<\/h3>\n<p>\u0414\u0440\u0443\u0433\u0430\u044f \u043f\u043e\u0445\u043e\u0436\u0430\u044f \u0442\u0435\u0445\u043d\u0438\u043a\u0430 \u2014 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0443\u044e \u0436\u0435 \u043b\u043e\u0433\u0438\u043a\u0443 <em>\u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u044f\/\u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f<\/em> \u2014 \u043d\u043e \u0441 &#171;\u0448\u0438\u043d\u0433\u043b\u043e\u043c&#187;. 2-\u0448\u0438\u043d\u0433\u043b\u043e\u0432\u043e\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 <strong>a<\/strong> \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"javascript\">a = {'his thought', 'thought process', 'process is', ...}<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u043e\u0442 \u0436\u0435 \u0440\u0430\u0441\u0447\u0451\u0442 \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u044f\/\u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u0431\u0438\u0442\u044b\u043c\u0438 \u043d\u0430 \u0448\u0438\u043d\u0433\u043b\u044b \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438:<\/p>\n<p><iframe id=\"60e46fc62077cda25f846ac6\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60e46fc62077cda25f846ac6\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p>\u041f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0434\u0432\u0443\u0445 \u0448\u0438\u043d\u0433\u043b\u043e\u0432 \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0442\u0440\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0445 \u0448\u0438\u043d\u0433\u043b\u0430 \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438 <strong>b<\/strong> \u0438 <strong>c<\/strong>, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 <strong>0,125<\/strong>.<\/p>\n<h3>\u0420\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u041b\u0435\u0432\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u0430<\/h3>\n<p>\u0414\u0440\u0443\u0433\u0430\u044f \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0430\u044f \u043c\u0435\u0442\u0440\u0438\u043a\u0430 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0434\u0432\u0443\u0445 \u0441\u0442\u0440\u043e\u043a \u2014 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u041b\u0435\u0432\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u0430 \u2014 \u044d\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u043b\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0434\u0440\u0443\u0433\u0443\u044e, \u0432\u043e\u0442 \u0435\u0433\u043e \u0444\u043e\u0440\u043c\u0443\u043b\u0430:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/44b\/d65\/766\/44bd65766e6abb18d6d9c6c7d9d2c8c2.png\" alt=\"\u0424\u043e\u0440\u043c\u0443\u043b\u0430 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u041b\u0435\u0432\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u0430\" title=\"\u0424\u043e\u0440\u043c\u0443\u043b\u0430 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u041b\u0435\u0432\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u0430\" width=\"1600\" height=\"421\"><figcaption>\u0424\u043e\u0440\u043c\u0443\u043b\u0430 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u041b\u0435\u0432\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u0430<\/figcaption><\/figure>\n<p>\u041d\u0430 \u0432\u0438\u0434 \u043e\u043d\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u0430; \u0435\u0441\u043b\u0438 \u0432\u044b \u0435\u0451 \u043f\u043e\u043d\u044f\u043b\u0438, \u044d\u0442\u043e \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e! \u0415\u0441\u043b\u0438 \u043d\u0435\u0442, \u043d\u0435 \u0432\u043e\u043b\u043d\u0443\u0439\u0442\u0435\u0441\u044c \u2014 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u0435\u0451. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 a \u0438 b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0434\u0432\u0435 \u043d\u0430\u0448\u0438 \u0441\u0442\u0440\u043e\u043a\u0438, i \u0438 j \u2014 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432 a \u0438 b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e. \u0418\u0442\u0430\u043a, \u0434\u0430\u043d\u044b \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/409\/1fe\/c71\/4091fec716c376141290db8f7dd8c78c.png\" alt=\"&quot;Levenshtein&quot; \u0438 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 &quot;Livinshten&quot;\" title=\"&quot;Levenshtein&quot; \u0438 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 &quot;Livinshten&quot;\" width=\"1600\" height=\"107\"><figcaption>&#171;Levenshtein&#187; \u0438 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 &#171;Livinshten&#187;<\/figcaption><\/figure>\n<p>\u041c\u044b \u043d\u0430\u0439\u0434\u0451\u043c, \u0447\u0442\u043e:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/596\/573\/90c\/59657390cda83a12d33bfc2346a922fe.png\" alt=\"\u0418\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u0443\u0435\u043c \u0441\u0430\u043c\u043e \u0441\u043b\u043e\u0432\u043e, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 1 \u0434\u043e \u0435\u0433\u043e \u0434\u043b\u0438\u043d\u044b, \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 &quot;\u043d\u0438\u0447\u0435\u0433\u043e&quot; (\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u2014 \u0434\u0430\u043b\u0435\u0435).\" title=\"\u0418\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u0443\u0435\u043c \u0441\u0430\u043c\u043e \u0441\u043b\u043e\u0432\u043e, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 1 \u0434\u043e \u0435\u0433\u043e \u0434\u043b\u0438\u043d\u044b, \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 &quot;\u043d\u0438\u0447\u0435\u0433\u043e&quot; (\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u2014 \u0434\u0430\u043b\u0435\u0435).\" width=\"1600\" height=\"444\"><figcaption>\u0418\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u0443\u0435\u043c \u0441\u0430\u043c\u043e \u0441\u043b\u043e\u0432\u043e, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 1 \u0434\u043e \u0435\u0433\u043e \u0434\u043b\u0438\u043d\u044b, \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 &#171;\u043d\u0438\u0447\u0435\u0433\u043e&#187; (\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u2014 \u0434\u0430\u043b\u0435\u0435).<\/figcaption><\/figure>\n<p>\u042d\u0442\u043e \u043b\u0435\u0433\u043a\u043e! \u041f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u043d\u044f\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u044d\u0442\u043e\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u044b \u2014 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0412\u0430\u0433\u043d\u0435\u0440\u0430 \u2014 \u0424\u0438\u0448\u0435\u0440\u0430, \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u041b\u0435\u0432\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u0430 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b.&nbsp;\u041c\u044b \u0431\u0435\u0440\u0451\u043c \u0434\u0432\u0430 \u0441\u043b\u043e\u0432\u0430 a \u0438 b \u0438 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u043c \u0438\u0445 \u043f\u043e \u043e\u0431\u0435\u0438\u043c \u043e\u0441\u044f\u043c \u043d\u0430\u0448\u0435\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0441\u0438\u043c\u0432\u043e\u043b <em>\u043d\u0438\u0447\u0435\u0433\u043e<\/em> \u043a\u0430\u043a \u043f\u0443\u0441\u0442\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3d6\/e60\/91c\/3d6e6091c63dd636a1c69a2be1c9fd76.png\" alt=\"\u041f\u0443\u0441\u0442\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u0412\u0430\u0433\u043d\u0435\u0440\u0430-\u0424\u0438\u0448\u0435\u0440\u0430 \u2014 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0435\u0439 \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u041b\u0435\u0432\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u0430 \u043c\u0435\u0436\u0434\u0443 'Levenshtein' \u0438 'Livinshten'.\" title=\"\u041f\u0443\u0441\u0442\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u0412\u0430\u0433\u043d\u0435\u0440\u0430-\u0424\u0438\u0448\u0435\u0440\u0430 \u2014 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0435\u0439 \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u041b\u0435\u0432\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u0430 \u043c\u0435\u0436\u0434\u0443 'Levenshtein' \u0438 'Livinshten'.\" width=\"1480\" height=\"1520\"><figcaption>\u041f\u0443\u0441\u0442\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u0412\u0430\u0433\u043d\u0435\u0440\u0430-\u0424\u0438\u0448\u0435\u0440\u0430 \u2014 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0435\u0439 \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u041b\u0435\u0432\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u0430 \u043c\u0435\u0436\u0434\u0443 &#8216;Levenshtein&#8217; \u0438 &#8216;Livinshten&#8217;.<\/figcaption><\/figure>\n<p><iframe id=\"60e46a0ff2fa57a26f179f65\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60e46a0ff2fa57a26f179f65\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p><em>\u041a\u043e\u0434 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0443\u0441\u0442\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0412\u0430\u0433\u043d\u0435\u0440\u0430 \u2014 \u0424\u0438\u0448\u0435\u0440\u0430:<\/em><\/p>\n<p>\u041f\u0435\u0440\u0435\u0431\u0435\u0440\u0451\u043c \u0432\u0441\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0432 \u043c\u0430\u0442\u0440\u0438\u0446\u0435 \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u0442\u0443 \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443\u043b\u0443, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u0438\u0434\u0435\u043b\u0438 \u0440\u0430\u043d\u0435\u0435. \u041f\u0435\u0440\u0432\u044b\u0439 \u0448\u0430\u0433 \u0432 \u043d\u0430\u0448\u0435\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u0435 if min(i, j) = 0 \u2014 \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u0443\u0442\u043e\u0447\u043d\u044f\u0435\u043c, \u043d\u0435 \u0440\u0430\u0432\u043d\u044b \u043b\u0438 i \u0438 j \u043d\u0443\u043b\u044e? \u0415\u0441\u043b\u0438 \u0434\u0430, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438 max(i, j), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0432 \u043d\u0430\u0448\u0435\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u2014 i \u0438 j:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9e6\/47f\/cd1\/9e647fcd105fa44ef0d5d50ad954b943.png\" alt=\"\u041d\u0430\u0447\u043d\u0451\u043c \u0441\u043f\u0440\u0430\u0432\u0430, \u0432\u0434\u043e\u043b\u044c \u0440\u0451\u0431\u0435\u0440, \u0433\u0434\u0435 i \u0438\/\u0438\u043b\u0438 j \u0440\u0430\u0432\u043d\u043e 0, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u043c\u0430\u0442\u0440\u0438\u0446\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043e max(i, j)\" title=\"\u041d\u0430\u0447\u043d\u0451\u043c \u0441\u043f\u0440\u0430\u0432\u0430, \u0432\u0434\u043e\u043b\u044c \u0440\u0451\u0431\u0435\u0440, \u0433\u0434\u0435 i \u0438\/\u0438\u043b\u0438 j \u0440\u0430\u0432\u043d\u043e 0, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u043c\u0430\u0442\u0440\u0438\u0446\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043e max(i, j)\" width=\"1600\" height=\"1267\"><figcaption>\u041d\u0430\u0447\u043d\u0451\u043c \u0441\u043f\u0440\u0430\u0432\u0430, \u0432\u0434\u043e\u043b\u044c \u0440\u0451\u0431\u0435\u0440, \u0433\u0434\u0435 i \u0438\/\u0438\u043b\u0438 j \u0440\u0430\u0432\u043d\u043e 0, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u043c\u0430\u0442\u0440\u0438\u0446\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043e max(i, j)<\/figcaption><\/figure>\n<p><iframe id=\"60e4703b8ff4968fafa2a89d\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60e4703b8ff4968fafa2a89d\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p><em>\u041a\u043e\u0434 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 min(i, j) == 0, \u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0432\u044b\u0448\u0435 max(i, j).<\/em><\/p>\n<p>\u0421 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u043a\u0440\u0430\u044f\u043c\u0438 \u043d\u0430\u0448\u0435\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u043c\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c, \u043d\u043e \u043d\u0430\u043c \u0432\u0441\u0451 \u0435\u0449\u0451 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u2014 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c. \u0412\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a if min(i, j) = 0 \u2014 \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u043d\u0438 \u043e\u0434\u043d\u043e \u0438\u0437 \u043d\u0438\u0445 \u043d\u0435 \u0440\u0430\u0432\u043d\u043e 0? \u0417\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 min {. \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u0430 \u043f\u043e\u0441\u043b\u0435 \u0432\u0437\u044f\u0442\u044c <strong>\u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435<\/strong> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u0421\u0435\u0439\u0447\u0430\u0441 \u044d\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b \u2014 \u043e\u043d\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u043d\u0430\u0448\u0435\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u0435:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a62\/e81\/0e1\/a62e810e108bb8101ac70ae9ffa656a3.png\" alt=\"\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043d\u043e\u0432\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0431\u0435\u0440\u0451\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u0442\u0440\u0451\u0445 \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0445 \u043f\u043e\u0437\u0438\u0446\u0438\u0439 (\u043e\u0431\u0432\u0435\u0434\u0435\u043d\u043e \u043a\u0440\u0443\u0436\u043a\u043e\u043c \u0432\u0432\u0435\u0440\u0445\u0443 \u0441\u043b\u0435\u0432\u0430)\" title=\"\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043d\u043e\u0432\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0431\u0435\u0440\u0451\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u0442\u0440\u0451\u0445 \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0445 \u043f\u043e\u0437\u0438\u0446\u0438\u0439 (\u043e\u0431\u0432\u0435\u0434\u0435\u043d\u043e \u043a\u0440\u0443\u0436\u043a\u043e\u043c \u0432\u0432\u0435\u0440\u0445\u0443 \u0441\u043b\u0435\u0432\u0430)\" width=\"1600\" height=\"1267\"><figcaption>\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043d\u043e\u0432\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0431\u0435\u0440\u0451\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u0442\u0440\u0451\u0445 \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0445 \u043f\u043e\u0437\u0438\u0446\u0438\u0439 (\u043e\u0431\u0432\u0435\u0434\u0435\u043d\u043e \u043a\u0440\u0443\u0436\u043a\u043e\u043c \u0432\u0432\u0435\u0440\u0445\u0443 \u0441\u043b\u0435\u0432\u0430)<\/figcaption><\/figure>\n<p>lev(i-1, j), \u0430 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u2014 \u044d\u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438. \u0417\u0430\u0442\u0435\u043c \u0431\u0435\u0440\u0451\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u0442\u0440\u0451\u0445. \u041e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f. +1 \u0441\u043b\u0435\u0432\u0430 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 a[i] != b[i] \u2014 \u044d\u0442\u043e \u0448\u0442\u0440\u0430\u0444 \u0437\u0430 \u043d\u0435\u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/12c\/fbc\/914\/12cfbc914c84442521dd0be415c77d46.png\" alt=\"\u0415\u0441\u043b\u0438 a[i] != b[j], \u043f\u0440\u0438\u0431\u0430\u0432\u043b\u044f\u0435\u043c 1 \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u2014 \u044d\u0442\u043e \u0448\u0442\u0440\u0430\u0444 \u0437\u0430 \u043d\u0435\u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432\" title=\"\u0415\u0441\u043b\u0438 a[i] != b[j], \u043f\u0440\u0438\u0431\u0430\u0432\u043b\u044f\u0435\u043c 1 \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u2014 \u044d\u0442\u043e \u0448\u0442\u0440\u0430\u0444 \u0437\u0430 \u043d\u0435\u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432\" width=\"1600\" height=\"1267\"><figcaption>\u0415\u0441\u043b\u0438 a[i] != b[j], \u043f\u0440\u0438\u0431\u0430\u0432\u043b\u044f\u0435\u043c 1 \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u2014 \u044d\u0442\u043e \u0448\u0442\u0440\u0430\u0444 \u0437\u0430 \u043d\u0435\u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432<\/figcaption><\/figure>\n<p>\u042d\u0442\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0432 \u0446\u0438\u043a\u043b\u0435 \u043f\u043e \u0432\u0441\u0435\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<p><iframe id=\"60e4706d12b0d58fd6dde611\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60e4706d12b0d58fd6dde611\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p><em>\u041f\u043e\u043b\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0430\u0441\u0447\u0451\u0442\u0430 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u041b\u0435\u0432\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u0430 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0412\u0430\u0433\u043d\u0435\u0440\u0430 \u2014 \u0424\u0438\u0448\u0435\u0440\u0430.<\/em><\/p>\n<p>\u0418\u0442\u0430\u043a, \u043c\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u043b\u0438 \u043a\u0430\u0436\u0434\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u043c\u0430\u0442\u0440\u0438\u0446\u0435 \u2014 \u044d\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u043b\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438 a \u0434\u043e \u043f\u043e\u0437\u0438\u0446\u0438\u0438 i \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 b \u0434\u043e \u043f\u043e\u0437\u0438\u0446\u0438\u0438 j. \u041c\u044b \u0438\u0449\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0434\u043b\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f a \u0432 b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0431\u0435\u0440\u0451\u043c \u043f\u0440\u0430\u0432\u043e\u0435 \u043d\u0438\u0436\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 lev[-1, -1].<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c9d\/56c\/572\/c9d56c5721de0206c637ddecac7be442.png\" alt=\"\u041e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043f\u043e \u043c\u0430\u0442\u0440\u0438\u0446\u0435 \u2014 \u0432 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 [-1, -1] \u0432\u043d\u0438\u0437\u0443 \u2014 \u0441\u043f\u0440\u0430\u0432\u0430 \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u041b\u0435\u0432\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u0430 \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438\" title=\"\u041e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043f\u043e \u043c\u0430\u0442\u0440\u0438\u0446\u0435 \u2014 \u0432 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 [-1, -1] \u0432\u043d\u0438\u0437\u0443 \u2014 \u0441\u043f\u0440\u0430\u0432\u0430 \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u041b\u0435\u0432\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u0430 \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438\" width=\"1430\" height=\"1520\"><figcaption>\u041e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043f\u043e \u043c\u0430\u0442\u0440\u0438\u0446\u0435 \u2014 \u0432 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 [-1, -1] \u0432\u043d\u0438\u0437\u0443 \u2014 \u0441\u043f\u0440\u0430\u0432\u0430 \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u041b\u0435\u0432\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u0430 \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438<\/figcaption><\/figure>\n<p><iframe id=\"60e4709fda3d598f9a4a513e\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60e4709fda3d598f9a4a513e\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<h3>\u0412\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0435 \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e<\/h3>\n<p>\u0414\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u043c\u044b \u043e\u0431\u044b\u0447\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432:<\/p>\n<ul>\n<li>\n<p>TF-IDF.<\/p>\n<\/li>\n<li>\n<p>BM25.<\/p>\n<\/li>\n<li>\n<p>word2vec\/doc2vec.<\/p>\n<\/li>\n<li>\n<p>BERT.<\/p>\n<\/li>\n<li>\n<p>USE.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0442\u0430\u043d\u0434\u0435\u043c\u0435 \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f\u043c\u0438 <em>\u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445<\/em> \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0445 \u0441\u043e\u0441\u0435\u0434\u0435\u0439 (ANN) \u044d\u0442\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0432 \u043c\u0438\u0440\u0435 \u043f\u043e\u0438\u0441\u043a\u0430 \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0430, \u0435\u0441\u043b\u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043c\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u2014 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0436\u0438\u0437\u043d\u0435\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b\u0435 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u044b. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 TF-IDF, BM25 \u0438 BERT, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u043c\u0438 \u0438 \u043e\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u044e\u0442 \u043a\u0430\u043a \u0440\u0430\u0437\u0440\u0435\u0436\u0435\u043d\u043d\u044b\u0435, \u0442\u0430\u043a \u0438 \u043f\u043b\u043e\u0442\u043d\u044b\u0435 <a href=\"https:\/\/www.pinecone.io\/learn\/vector-embeddings\/\">\u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f<\/a>.<\/p>\n<h3>1. TF-IDF<\/h3>\n<p>\u041f\u043e\u0447\u0442\u0435\u043d\u043d\u044b\u0439 \u0434\u0435\u0434\u0443\u0448\u043a\u0430 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0430, \u0440\u043e\u0434\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u0435\u0449\u0451 \u0432 1970-\u0445 \u0433\u043e\u0434\u0430\u0445. \u041e\u043d \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0447\u0430\u0441\u0442\u0435\u0439: <strong>T<\/strong>erm <strong>F<\/strong>requency (TF) \u0438 <strong>I<\/strong>nverse <strong>D<\/strong>ocument <strong>F<\/strong>requency (IDF). \u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 TF \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0442\u0435\u0440\u043c\u0438\u043d \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0435, \u0438 \u0434\u0435\u043b\u0438\u0442 \u0435\u0433\u043e \u043d\u0430 \u043e\u0431\u0449\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u0432 \u044d\u0442\u043e\u0433\u043e \u0436\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3ef\/3a5\/fe9\/3ef3a5fe92592af098b263885c77d1b9.png\" alt=\"\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u0442\u0435\u0440\u043c\u0438\u043d\u0430 (TF) TF-IDF \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 (&quot;bananas&quot;) \u0438 \u0434\u0435\u043b\u0438\u0442 \u0435\u0451 \u043d\u0430 \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u0432\u0441\u0435\u0445 \u043b\u0435\u043a\u0441\u0435\u043c\" title=\"\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u0442\u0435\u0440\u043c\u0438\u043d\u0430 (TF) TF-IDF \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 (&quot;bananas&quot;) \u0438 \u0434\u0435\u043b\u0438\u0442 \u0435\u0451 \u043d\u0430 \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u0432\u0441\u0435\u0445 \u043b\u0435\u043a\u0441\u0435\u043c\" width=\"1600\" height=\"633\"><figcaption>\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u0442\u0435\u0440\u043c\u0438\u043d\u0430 (TF) TF-IDF \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 (&#171;bananas&#187;) \u0438 \u0434\u0435\u043b\u0438\u0442 \u0435\u0451 \u043d\u0430 \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u0432\u0441\u0435\u0445 \u043b\u0435\u043a\u0441\u0435\u043c<\/figcaption><\/figure>\n<p>\u042d\u0442\u043e \u043f\u0435\u0440\u0432\u0430\u044f \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0430 \u043d\u0430\u0448\u0435\u0433\u043e \u0440\u0430\u0441\u0447\u0451\u0442\u0430, \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 f(q, D) \u0432 \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u0435 \u0438 \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u0432\u0441\u0435\u0445 \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u0432 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 f(t, D) \u0432 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u0438 \u0434\u0440\u043e\u0431\u0438. TF \u2014 \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c, \u043d\u043e \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u043c\u0438 \u0438 \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438. \u0415\u0441\u043b\u0438 \u0431\u044b \u043c\u044b \u0438\u0441\u043a\u0430\u043b\u0438 \u0441\u043b\u043e\u0432\u043e &#171;the&#187;, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0442\u043e\u043b\u044c\u043a\u043e TF, \u043c\u044b \u0431\u044b \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u043b\u0438 \u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u0442\u0443 \u0436\u0435 \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u044c, \u0447\u0442\u043e \u0438 \u043f\u0440\u0438 \u043f\u043e\u0438\u0441\u043a\u0435 &#171;bananas&#187;. \u042d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e, \u043f\u043e\u043a\u0430 \u043c\u044b \u043d\u0435 \u043d\u0430\u0447\u043d\u0451\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0438\u043b\u0438 \u0438\u0441\u043a\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u043b\u0438\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u041c\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u0442\u0430\u043a\u0438\u0435 \u0441\u043b\u043e\u0432\u0430, \u043a\u0430\u043a <em>&#8216;the&#8217;<\/em>, &#8216;is&#8217; \u0438\u043b\u0438 <em>&#8216;it&#8217;<\/em>, \u0431\u044b\u043b\u0438 \u043e\u0446\u0435\u043d\u0435\u043d\u044b \u0442\u0430\u043a \u0436\u0435 \u0432\u044b\u0441\u043e\u043a\u043e, \u043a\u0430\u043a <em>&#8216;bananas&#8217;<\/em> \u0438\u043b\u0438 <em>&#8216;street&#8217;<\/em>.<\/p>\n<p>\u0412 \u0438\u0434\u0435\u0430\u043b\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0431\u043e\u043b\u0435\u0435 \u0440\u0435\u0434\u043a\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0432\u044b\u0448\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u043c\u043d\u043e\u0436\u0438\u0442\u044c TF \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u043b\u0435\u043d \u2014 IDF. \u041e\u0431\u0440\u0430\u0442\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u0438\u0437\u043c\u0435\u0440\u044f\u0435\u0442, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u0442\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u043e\u0432\u043e \u0432\u043e <em>\u0432\u0441\u0435\u0445<\/em> \u043d\u0430\u0448\u0438\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0445.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fc3\/d39\/82c\/fc3d3982c335725347d6e76000ee0289.png\" alt=\"\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 (IDF) TF-IDF \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0445 \u043d\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441.\" title=\"\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 (IDF) TF-IDF \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0445 \u043d\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441.\" width=\"1600\" height=\"1117\"><figcaption>\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 (IDF) TF-IDF \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0445 \u043d\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441.<\/figcaption><\/figure>\n<p>\u0417\u0434\u0435\u0441\u044c \u0442\u0440\u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412\u044b\u0447\u0438\u0441\u043b\u0438\u0432 IDF \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 <em>&#8216;is&#8217;<\/em>, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u0447\u0438\u0441\u043b\u043e, \u0447\u0435\u043c \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u043e\u043b\u0435\u0435 \u0440\u0435\u0434\u043a\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 <em>&#8216;forest&#8217;<\/em>. \u0415\u0441\u043b\u0438 \u0431\u044b \u043f\u043e\u0441\u043b\u0435 \u043c\u044b \u0438\u0441\u043a\u0430\u043b\u0438 \u043e\u0431\u0430 \u0441\u043b\u043e\u0432\u0430 <em>&#8216;is&#8217;<\/em> \u0438 <em>&#8216;forest&#8217;<\/em>, \u0442\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u043b\u0438 \u0431\u044b TF \u0438 IDF \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5c6\/a6c\/6c2\/5c6a6c6c22d51784873f290904cfb61e.png\" alt=\"\" title=\"\" width=\"1600\" height=\"875\"><figcaption><\/figcaption><\/figure>\n<p>\u041c\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u043e\u0446\u0435\u043d\u043a\u0438 TF(&#8216;is&#8217;, D) \u0438 TF(&#8216;forest&#8217;, D) \u0434\u043b\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 a, b \u0438 c. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 IDF \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a\u043e \u0432\u0441\u0435\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 IDF(&#8216;is&#8217;) \u0438 IDF(&#8216;forest&#8217;) \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437. \u0417\u0430\u0442\u0435\u043c \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f TF-IDF \u0434\u043b\u044f \u043e\u0431\u043e\u0438\u0445 \u0441\u043b\u043e\u0432 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0435 \u043f\u0443\u0442\u0451\u043c \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 TF \u0438 IDF. \u041f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 a \u043d\u0430\u0431\u0438\u0440\u0430\u0435\u0442 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u043b\u043b\u043e\u0432 \u0434\u043b\u044f &#8216;forest&#8217;, \u0430 &#8216;is&#8217; \u0432\u0441\u0435\u0433\u0434\u0430 \u043d\u0430\u0431\u0438\u0440\u0430\u0435\u0442 0, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 IDF(&#8216;is&#8217;) \u0440\u0430\u0432\u043d\u043e 0.<\/p>\n<p><iframe id=\"60e470d812b0d58fd6dde612\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60e470d812b0d58fd6dde612\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p>\u042d\u0442\u043e \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u043e \u0433\u0434\u0435 \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f <em>\u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0435<\/em> \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0430? \u0418\u0442\u0430\u043a, \u043c\u044b \u0431\u0435\u0440\u0451\u043c \u043d\u0430\u0448 \u0441\u043b\u043e\u0432\u0430\u0440\u043d\u044b\u0439 \u0437\u0430\u043f\u0430\u0441 (\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u0441\u043b\u043e\u0432 \u0432 \u043d\u0430\u0448\u0435\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445) \u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c TF-IDF \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/262\/569\/f6e\/262569f6e23f70a66e8182dbb381e8f6.png\" alt=\"\u041c\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 TF-IDF \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 \u0441\u043b\u043e\u0432\u0430\u0440\u044f, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u0435\u043a\u0442\u043e\u0440 TF-IDF. \u042d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0435\" title=\"\u041c\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 TF-IDF \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 \u0441\u043b\u043e\u0432\u0430\u0440\u044f, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u0435\u043a\u0442\u043e\u0440 TF-IDF. \u042d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0435\" width=\"1600\" height=\"875\"><figcaption>\u041c\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 TF-IDF \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 \u0441\u043b\u043e\u0432\u0430\u0440\u044f, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u0435\u043a\u0442\u043e\u0440 TF-IDF. \u042d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0435<\/figcaption><\/figure>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u043a\u0442\u043e\u0440\u044b TF-IDF, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u044d\u0442\u043e \u0432\u043e\u0435\u0434\u0438\u043d\u043e:<\/p>\n<p><iframe id=\"60e470f7dc7e91a24fcac3d1\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60e470f7dc7e91a24fcac3d1\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p>\u041e\u0442\u0441\u044e\u0434\u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u0435\u043a\u0442\u043e\u0440 TF-IDF. \u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u043b\u0435\u0433\u043a\u043e \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0431\u043e\u043b\u0435\u0435 20 000 \u0441\u043b\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u044d\u0442\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u043d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u0440\u0430\u0437\u0440\u0435\u0436\u0435\u043d\u044b, \u0430 \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u043c\u044b\u0441\u043b \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c.<\/p>\n<h3>2. BM25<\/h3>\n<p>\u041f\u0440\u0435\u0435\u043c\u043d\u0438\u043a TF-IDF, Okapi BM25, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 TF-IDF \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0434\u043b\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0434\u043b\u0438\u043d\u044b \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430. TF-IDF \u2014 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043d\u043e \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043e\u043c\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u0439. \u0415\u0441\u043b\u0438 \u043c\u044b \u0432\u043e\u0437\u044c\u043c\u0451\u043c \u0434\u0432\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e 500 \u0441\u043b\u043e\u0432 \u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043c, \u0447\u0442\u043e&nbsp; &#171;\u0427\u0435\u0440\u0447\u0438\u043b\u043b\u044c&#187; \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0410 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442\u0441\u044f 6 \u0440\u0430\u0437, \u0430 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0411 \u2014 12 \u0440\u0430\u0437, \u0434\u043e\u043b\u0436\u043d\u044b \u043b\u0438 \u043c\u044b \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e \u0410 \u0432 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 \u043c\u0435\u043d\u0435\u0435 \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u043e\u0439? \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043d\u0435\u0442. BM25 \u0440\u0435\u0448\u0430\u0435\u0442 \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043f\u0443\u0442\u0451\u043c \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 TF-IDF:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e95\/0b8\/be2\/e950b8be25647e6fbe1c3b90a8d0b007.png\" alt=\"\u0424\u043e\u0440\u043c\u0443\u043b\u0430 BM25\" title=\"\u0424\u043e\u0440\u043c\u0443\u043b\u0430 BM25\" width=\"1600\" height=\"251\"><figcaption>\u0424\u043e\u0440\u043c\u0443\u043b\u0430 BM25<\/figcaption><\/figure>\n<p>\u0423\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0447\u0442\u043e \u0438\u043d\u043e\u0435, \u043a\u0430\u043a \u043d\u0430\u0448\u0430 \u0444\u043e\u0440\u043c\u0443\u043b\u0430 TF-IDF \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043d\u043e\u0432\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438! \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0440\u0430\u0432\u043d\u0438\u043c \u0434\u0432\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 TF:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/22e\/2dd\/6c0\/22e2dd6c030ef41b00e3333abf45f831.png\" alt=\"TF-\u0447\u0430\u0441\u0442\u044c BM25 (\u0441\u043b\u0435\u0432\u0430) \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 TF-\u0447\u0430\u0441\u0442\u044c\u044e TF-IDF (\u0441\u043f\u0440\u0430\u0432\u0430)\" title=\"TF-\u0447\u0430\u0441\u0442\u044c BM25 (\u0441\u043b\u0435\u0432\u0430) \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 TF-\u0447\u0430\u0441\u0442\u044c\u044e TF-IDF (\u0441\u043f\u0440\u0430\u0432\u0430)\" width=\"1600\" height=\"369\"><figcaption>TF-\u0447\u0430\u0441\u0442\u044c BM25 (\u0441\u043b\u0435\u0432\u0430) \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 TF-\u0447\u0430\u0441\u0442\u044c\u044e TF-IDF (\u0441\u043f\u0440\u0430\u0432\u0430)<\/figcaption><\/figure>\n<p>\u0418 \u0437\u0430\u0442\u0435\u043c \u0447\u0430\u0441\u0442\u044c IDF, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u0430\u0436\u0435 \u043d\u0435 \u0432\u0432\u043e\u0434\u0438\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043d\u043e\u0432\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u2014 \u043e\u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 IDF \u0438\u0437 TF-IDF.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dee\/ac2\/6dd\/deeac26dd5e6d14ce85b35eb14277bee.png\" alt=\"IDF \u0447\u0430\u0441\u0442\u044c BM25 (\u0441\u043b\u0435\u0432\u0430) \u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441 IDF TF-IDF (\u0441\u043f\u0440\u0430\u0432\u0430)\" title=\"IDF \u0447\u0430\u0441\u0442\u044c BM25 (\u0441\u043b\u0435\u0432\u0430) \u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441 IDF TF-IDF (\u0441\u043f\u0440\u0430\u0432\u0430)\" width=\"1600\" height=\"368\"><figcaption>IDF \u0447\u0430\u0441\u0442\u044c BM25 (\u0441\u043b\u0435\u0432\u0430) \u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441 IDF TF-IDF (\u0441\u043f\u0440\u0430\u0432\u0430)<\/figcaption><\/figure>\n<p>\u0418\u0442\u0430\u043a, \u043a\u0430\u043a\u043e\u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u044d\u0442\u043e\u0439 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438? \u0415\u0441\u043b\u0438 \u0432\u0437\u044f\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438\u0437 12 \u043b\u0435\u043a\u0441\u0435\u043c \u0438 \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u043f\u043e\u0434\u0430\u0432\u0430\u0442\u044c \u0432 \u043d\u0435\u0451 \u0432\u0441\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u0438 \u0431\u043e\u043b\u044c\u0448\u0435 &#171;\u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0445&#187; \u043b\u0435\u043a\u0441\u0435\u043c, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/71a\/6c4\/0b6\/71a6c40b6f37bc9442012a664469a15c.png\" width=\"1600\" height=\"1106\"><figcaption><\/figcaption><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e73\/553\/9ae\/e735539ae0b946804f32237abcf65f95.png\" alt=\"\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 TF-IDF (\u0432\u0432\u0435\u0440\u0445\u0443) \u0438 BM25 (\u0432\u043d\u0438\u0437\u0443) \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u0437 12 \u043b\u0435\u043a\u0441\u0435\u043c \u0438 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u044e\u0449\u0435\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0445 \u043b\u0435\u043a\u0441\u0435\u043c (\u043e\u0441\u044c x)\" title=\"\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 TF-IDF (\u0432\u0432\u0435\u0440\u0445\u0443) \u0438 BM25 (\u0432\u043d\u0438\u0437\u0443) \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u0437 12 \u043b\u0435\u043a\u0441\u0435\u043c \u0438 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u044e\u0449\u0435\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0445 \u043b\u0435\u043a\u0441\u0435\u043c (\u043e\u0441\u044c x)\" width=\"1600\" height=\"1106\"><figcaption>\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 TF-IDF (\u0432\u0432\u0435\u0440\u0445\u0443) \u0438 BM25 (\u0432\u043d\u0438\u0437\u0443) \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u0437 12 \u043b\u0435\u043a\u0441\u0435\u043c \u0438 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u044e\u0449\u0435\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0445 \u043b\u0435\u043a\u0441\u0435\u043c (\u043e\u0441\u044c x)<\/figcaption><\/figure>\n<p>\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c TF-IDF \u043b\u0438\u043d\u0435\u0439\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u0440\u043e\u0441\u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0430 \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0445 \u043b\u0435\u043a\u0441\u0435\u043c. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0435\u0441\u043b\u0438 \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u0443\u0434\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u2014 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c TF-IDF. \u0417\u0432\u0443\u0447\u0438\u0442 \u043a\u0440\u0443\u0442\u043e! \u041d\u043e \u043a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0430 Python? \u041e\u043f\u044f\u0442\u044c \u0436\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e, \u043a\u0430\u043a \u0441 TF-IDF.<\/p>\n<p><iframe id=\"60e47136abf7c98fe8a333a3\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60e47136abf7c98fe8a333a3\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p>\u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043b\u044f k \u0438 b, \u0438 \u043d\u0430\u0448\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u043c\u043d\u043e\u0433\u043e\u043e\u0431\u0435\u0449\u0430\u044e\u0449\u0435. \u0417\u0430\u043f\u0440\u043e\u0441 &#8216;purple&#8217; \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044e a, \u0430 &#8216;bananas&#8217; \u043d\u0430\u0431\u0438\u0440\u0430\u0435\u0442 \u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u044b\u0435 \u0431\u0430\u043b\u043b\u044b \u0438 \u0434\u043b\u044f b, \u0438 \u0434\u043b\u044f c, \u043d\u043e \u0434\u043b\u044f c \u2014 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0432\u044b\u0448\u0435 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043c\u0435\u043d\u044c\u0448\u0435\u043c\u0443 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0441\u043b\u043e\u0432. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u044d\u0442\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u0447\u0442\u043e \u0438 \u0441 TF-IDF.<\/p>\n<p><iframe id=\"60e4714412b0d58fd6dde613\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60e4714412b0d58fd6dde613\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p>\u041e\u043f\u044f\u0442\u044c \u0436\u0435, \u043a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438 TF-IDF, \u044d\u0442\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u0440\u0430\u0437\u0440\u0435\u0436\u0435\u043d\u044b. \u041c\u044b \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u043c \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 [\u0441\u043c\u044b\u0441\u043b\u043e\u0432\u043e\u0435] \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u043c\u0441\u044f \u043d\u0430 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0435.&nbsp;<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0443.<\/p>\n<h3>3. BERT<\/h3>\n<p>BERT (<abbr title=\"\u0414\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u0434\u0438\u0440\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u0437 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0440\u043e\u0432\">Bidirectional Encoder Representations from Transformers<\/abbr>) \u2014 \u044d\u0442\u043e \u0447\u0440\u0435\u0437\u0432\u044b\u0447\u0430\u0439\u043d\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0440\u0430, \u0432 NLP \u043e\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <em>\u043f\u043e\u0447\u0442\u0438<\/em> \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e. \u041f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c 12 (\u0438\u043b\u0438 \u043e\u043a\u043e\u043b\u043e \u0442\u043e\u0433\u043e) \u0443\u0440\u043e\u0432\u043d\u0435\u0439 \u043a\u043e\u0434\u0435\u0440\u0430 BERT \u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0432 \u043d\u0430\u0431\u043e\u0440 <em>\u043f\u043b\u043e\u0442\u043d\u044b\u0445<\/em> \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432.&nbsp;<\/p>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u043f\u043b\u043e\u0442\u043d\u044b\u0439 \u0432\u0435\u043a\u0442\u043e\u0440 \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 768 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0438 \u043c\u044b \u043e\u0431\u044b\u0447\u043d\u043e \u0438\u043c\u0435\u0435\u043c 512 \u0442\u0430\u043a\u0438\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e BERT \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u042d\u0442\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u044f\u0437\u044b\u043a\u0430. \u042d\u0442\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u0442\u0430\u043a\u0436\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438\u0437\u0432\u043b\u0435\u0447\u044c (\u0435\u0441\u043b\u0438 \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u0445\u043e\u0447\u0435\u0442\u0441\u044f) \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u043b\u043e\u0451\u0432, \u043d\u043e \u043e\u0431\u044b\u0447\u043d\u043e \u0438\u0437 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0441\u043b\u043e\u044f. \u0422\u0435\u043f\u0435\u0440\u044c, \u0438\u043c\u0435\u044f \u0434\u0432\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u043b\u043e\u0442\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u0430, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u0440\u0438\u043a\u0443 \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0430, \u0442\u0430\u043a\u0443\u044e \u043a\u0430\u043a \u043a\u043e\u0441\u0438\u043d\u0443\u0441\u043d\u043e\u0435 \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u0435\u043f\u0435\u0440\u044c \u0443\u0436\u0435 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e. \u0411\u043e\u043b\u0435\u0435 \u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d\u043d\u044b\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0445\u043e\u0436\u0438, \u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d56\/ed8\/35b\/d56ed835b8dd8df92046b31a8630d26f.png\" alt=\"\u041c\u0435\u043d\u044c\u0448\u0438\u0439 \u0443\u0433\u043e\u043b \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438 (\u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0441\u0438\u043d\u0443\u0441\u043d\u043e\u0433\u043e \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0430) \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043e\u043d\u0438 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d\u044b. \u0414\u043b\u044f \u043f\u043b\u043e\u0442\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u044d\u0442\u043e \u043a\u043e\u0440\u0440\u0435\u043b\u0438\u0440\u0443\u0435\u0442 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e\u043c\" title=\"\u041c\u0435\u043d\u044c\u0448\u0438\u0439 \u0443\u0433\u043e\u043b \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438 (\u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0441\u0438\u043d\u0443\u0441\u043d\u043e\u0433\u043e \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0430) \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043e\u043d\u0438 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d\u044b. \u0414\u043b\u044f \u043f\u043b\u043e\u0442\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u044d\u0442\u043e \u043a\u043e\u0440\u0440\u0435\u043b\u0438\u0440\u0443\u0435\u0442 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e\u043c\" width=\"1200\" height=\"820\"><figcaption>\u041c\u0435\u043d\u044c\u0448\u0438\u0439 \u0443\u0433\u043e\u043b \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438 (\u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0441\u0438\u043d\u0443\u0441\u043d\u043e\u0433\u043e \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0430) \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043e\u043d\u0438 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d\u044b. \u0414\u043b\u044f \u043f\u043b\u043e\u0442\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u044d\u0442\u043e \u043a\u043e\u0440\u0440\u0435\u043b\u0438\u0440\u0443\u0435\u0442 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e\u043c<\/figcaption><\/figure>\n<p>\u041d\u043e \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430: \u043a\u0430\u0436\u0434\u0430\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 512 \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438 \u2014 \u043d\u0435 \u043e\u0434\u043d\u0438\u043c \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u043c. \u0412\u043e\u0442 \u0437\u0434\u0435\u0441\u044c-\u0442\u043e \u0438 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0435\u0449\u0451 \u043e\u0434\u043d\u0430 \u2014 \u0431\u043b\u0435\u0441\u0442\u044f\u0449\u0430\u044f \u2014 \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u044f BERT. Sentence-BERT \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0432\u0435\u043a\u0442\u043e\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u0448\u0443 \u043f\u043e\u043b\u043d\u0443\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0438\u043d\u0430\u0447\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0443\u044e \u043a\u0430\u043a <em>\u0432\u0435\u043a\u0442\u043e\u0440 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0439<\/em><sup>[2]<\/sup>. \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 SBERT: \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \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 sentence-transformers \u0438\u043b\u0438 \u0443\u0436\u0435 \u043d\u0435 \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c transformers <em>\u0438<\/em> PyTorch.&nbsp;<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0431\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0447\u0435\u0440\u0435\u0437 transformers \u0438 PyTorch, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432. \u0415\u0441\u043b\u0438 \u0432\u044b \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0440\u043e\u0432 HF, \u043f\u0435\u0440\u0432\u044b\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0448\u0430\u0433\u043e\u0432 \u043f\u043e\u043a\u0430\u0436\u0443\u0442\u0441\u044f \u0432\u0430\u043c \u043e\u0447\u0435\u043d\u044c \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u043c\u0438: \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c SBERT \u0438 \u0442\u043e\u043a\u0435\u043d\u0438\u0437\u0430\u0442\u043e\u0440, \u0442\u043e\u043a\u0435\u043d\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0448 \u0442\u0435\u043a\u0441\u0442 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0442\u043e\u043a\u0435\u043d\u044b \u043c\u043e\u0434\u0435\u043b\u044c\u044e.<\/p>\n<p><iframe id=\"60e4716c8ff4968fafa2a89e\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60e4716c8ff4968fafa2a89e\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p>\u041c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0441\u044e\u0434\u0430 \u043d\u043e\u0432\u043e\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 <strong>g<\/strong> \u043d\u0435\u0441\u0451\u0442 \u0442\u043e\u0442 \u0436\u0435 <em>\u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439<\/em> \u0441\u043c\u044b\u0441\u043b, \u0447\u0442\u043e \u0438 <strong>b<\/strong>, \u2014 \u0431\u0435\u0437 \u0442\u0435\u0445 \u0436\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u0441\u043b\u043e\u0432. \u0418\u0437-\u0437\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u043e\u0431\u0449\u0438\u0445 \u0441\u043b\u043e\u0432 \u0432\u0441\u0435 \u043d\u0430\u0448\u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043d\u0435 \u0441\u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0438\u043c\u0438 \u0434\u0432\u0443\u043c\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u2014 \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u0435 \u044d\u0442\u043e \u043d\u0430 \u0431\u0443\u0434\u0443\u0449\u0435\u0435.<\/p>\n<p><iframe id=\"60e471776f06c2a29f4b4590\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60e471776f06c2a29f4b4590\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p>\u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u0434\u043b\u0438\u043d\u044b 768, \u043d\u043e \u044d\u0442\u043e <strong>\u043d\u0435<\/strong> <em>\u0432\u0435\u043a\u0442\u043e\u0440\u044b \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0439<\/em>, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u043b\u0435\u043a\u0441\u0435\u043c\u044b \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 (\u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c SBERT, \u0438\u0445 \u0437\u0434\u0435\u0441\u044c 128, \u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 BERT \u0438\u0445 512). \u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<\/p>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c, \u2014 \u0443\u043c\u043d\u043e\u0436\u0430\u0435\u043c \u043a\u0430\u0436\u0434\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u0442\u0435\u043d\u0437\u043e\u0440\u0435 embeddings \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 attention_mask. \u041c\u0430\u0441\u043a\u0430 attention_mask \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 <strong>\u0435\u0434\u0438\u043d\u0438\u0446\u044b<\/strong> \u0442\u0430\u043c, \u0433\u0434\u0435 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c &#171;\u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0435 \u0442\u043e\u043a\u0435\u043d\u044b&#187; (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0435 \u0442\u043e\u043a\u0435\u043d \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f), \u0438 <strong>\u043d\u0443\u043b\u0438<\/strong> \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u0435\u0441\u0442\u0430\u0445 \u2014 \u044d\u0442\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0435 \u0442\u043e\u043a\u0435\u043d\u044b.<\/p>\n<p><iframe id=\"60e47185dc7e91a24fcac3d3\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60e47185dc7e91a24fcac3d3\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p>\u0418 \u0432\u043e\u0442 \u043d\u0430\u0448\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0437\u043c\u0435\u0440\u0438\u0442\u044c \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e, \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0432 \u043a\u043e\u0441\u0438\u043d\u0443\u0441\u043d\u043e\u0435 \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u043c\u0435\u0436\u0434\u0443 \u0432\u0441\u0435\u043c\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438.<\/p>\n<p><iframe id=\"60e4719b8ff4968fafa2a89f\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60e4719b8ff4968fafa2a89f\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0432 \u043c\u0430\u0441\u0441\u0438\u0432, \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u0438\u043c \u0443\u0440\u043e\u0432\u043d\u0435\u043c \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0430:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3fa\/2b9\/afd\/3fa2b9afd260b72a048b63bc7e7b305b.png\" alt=\"\u0422\u0435\u043f\u043b\u043e\u0432\u0430\u044f \u043a\u0430\u0440\u0442\u0430, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0430\u044f \u043a\u043e\u0441\u0438\u043d\u0443\u0441\u043d\u043e\u0435 \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u043c\u0435\u0436\u0434\u0443 \u043d\u0430\u0448\u0438\u043c\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0439 SBERT: \u043e\u0431\u0432\u0435\u0434\u0435\u043d\u0430 \u043e\u0446\u0435\u043d\u043a\u0430 \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438 b \u0438 g\" title=\"\u0422\u0435\u043f\u043b\u043e\u0432\u0430\u044f \u043a\u0430\u0440\u0442\u0430, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0430\u044f \u043a\u043e\u0441\u0438\u043d\u0443\u0441\u043d\u043e\u0435 \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u043c\u0435\u0436\u0434\u0443 \u043d\u0430\u0448\u0438\u043c\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0439 SBERT: \u043e\u0431\u0432\u0435\u0434\u0435\u043d\u0430 \u043e\u0446\u0435\u043d\u043a\u0430 \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438 b \u0438 g\" width=\"1600\" height=\"1490\"><figcaption>\u0422\u0435\u043f\u043b\u043e\u0432\u0430\u044f \u043a\u0430\u0440\u0442\u0430, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0430\u044f \u043a\u043e\u0441\u0438\u043d\u0443\u0441\u043d\u043e\u0435 \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u043c\u0435\u0436\u0434\u0443 \u043d\u0430\u0448\u0438\u043c\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0439 SBERT: \u043e\u0431\u0432\u0435\u0434\u0435\u043d\u0430 \u043e\u0446\u0435\u043d\u043a\u0430 \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438 b \u0438 g<\/figcaption><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f b \u0438 g \u0438\u043c\u0435\u044e\u0442 \u043f\u043e \u0441\u0443\u0442\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u0441\u043c\u044b\u0441\u043b, \u043d\u043e \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 <em>\u043d\u0438 \u043e\u0434\u043d\u043e\u0433\u043e<\/em> \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430. \u041c\u044b \u043d\u0430\u0434\u0435\u0435\u043c\u0441\u044f, \u0447\u0442\u043e SBERT \u0441 \u0435\u0433\u043e \u043f\u0440\u0435\u0432\u043e\u0441\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u044f\u0437\u044b\u043a\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442 \u044d\u0442\u0438 \u0434\u0432\u0430 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043a\u0430\u043a \u043f\u043e\u0445\u043e\u0436\u0438\u0435 \u2014 \u0438 \u0432\u043e\u0442, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 0,66 \u0431\u0430\u043b\u043b\u0430 (\u043e\u0431\u0432\u0435\u0434\u0435\u043d\u043e \u0432\u044b\u0448\u0435). \u0418\u0442\u0430\u043a, <strong>\u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 (\u043f\u0440\u043e\u0441\u0442\u043e\u0439) \u043f\u043e\u0434\u0445\u043e\u0434 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0438 SBERT<\/strong>. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u043a\u0430\u043a \u0432\u044b\u0448\u0435, \u043d\u0430\u043f\u0438\u0448\u0435\u043c:<\/p>\n<p><iframe id=\"60e471b0da3d598f9a4a513f\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60e471b0da3d598f9a4a513f\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p>\u0427\u0442\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435. \u041d\u0430 \u044d\u0442\u043e\u043c \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u043c \u043f\u0440\u043e\u0433\u0443\u043b\u043a\u0443 \u043f\u043e \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u0441 \u0416\u0430\u043a\u043a\u0430\u0440\u043e\u043c, \u041b\u0435\u0432\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u043e\u043c \u0438 Bert!<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u0441\u044b\u043b\u043a\u0438<\/summary>\n<div class=\"spoiler__content\">\n<ul>\n<li>\n<p><a href=\"https:\/\/companiesmarketcap.com\/alphabet-google\/marketcap\/\">[1]<\/a> Market Capitalization of Alphabet (GOOG), Companies Market Cap.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/arxiv.org\/abs\/1908.10084\">[2]<\/a> N. Reimers, I. Gurevych, Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks (2019), Proceedings of the 2019 Conference on Empirical Methods in 2019.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/pinecone-io\/examples\/tree\/master\/semantic_search_intro\">\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0431\u043b\u043e\u043a\u043d\u043e\u0442\u043e\u0432<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0411\u043b\u043e\u043a\u043d\u043e\u0442\u044b Colab<\/summary>\n<div class=\"spoiler__content\">\n<ul>\n<li>\n<p><a href=\"https:\/\/colab.research.google.com\/github\/pinecone-io\/examples\/blob\/master\/semantic_search_intro\/jaccard.ipynb\">Jaccard<\/a>, <\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/colab.research.google.com\/github\/pinecone-io\/examples\/blob\/master\/semantic_search_intro\/levenshtein.ipynb\">Levenshtein<\/a>, <\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/colab.research.google.com\/github\/pinecone-io\/examples\/blob\/master\/semantic_search_intro\/tfidf.ipynb\">TF-IDF<\/a>, <\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/colab.research.google.com\/github\/pinecone-io\/examples\/blob\/master\/semantic_search_intro\/bm25.ipynb\">BM25<\/a>, <\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/colab.research.google.com\/github\/pinecone-io\/examples\/blob\/master\/semantic_search_intro\/sbert.ipynb\">SBERT<\/a>.<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<p>\u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u2014 \u0436\u0438\u0432\u0430\u044f \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u0430. \u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u0442\u0435 \u043e\u0441\u0442\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043e\u0442 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0418\u0418, \u0442\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043d\u0430\u0448 \u043a\u0443\u0440\u0441 <a href=\"https:\/\/skillfactory.ru\/ml-and-dl?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_MLDL&amp;utm_term=regular&amp;utm_content=060721\">\u00abMachine Learning \u0438 Deep Learning\u00bb<\/a>. \u0418\u043b\u0438 \u0436\u0435 \u043f\u0440\u043e\u043a\u0430\u0442\u0430\u0439\u0442\u0435\u0441\u044c \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043d\u0430 \u043d\u0430\u0448\u0435\u043c <a href=\"https:\/\/skillfactory.ru\/dstpro?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_DSPR&amp;utm_term=regular&amp;utm_content=060721\">\u043a\u0443\u0440\u0441\u0435 \u043e Data Science<\/a>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/faf\/bb3\/6c2\/fafbb36c2e4b24cc55dcdc3c16bc63b3.png\" width=\"1000\" height=\"200\"><figcaption><\/figcaption><\/figure>\n<p><a href=\"https:\/\/skillfactory.ru\/courses\/?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_ALLCOURSES&amp;utm_term=regular&amp;utm_content=060721\">\u0423\u0437\u043d\u0430\u0439\u0442\u0435<\/a>, \u043a\u0430\u043a \u043f\u0440\u043e\u043a\u0430\u0447\u0430\u0442\u044c\u0441\u044f \u0438&nbsp;\u0432&nbsp;\u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044f\u0445 \u0438\u043b\u0438 \u043e\u0441\u0432\u043e\u0438\u0442\u044c \u0438\u0445&nbsp;\u0441&nbsp;\u043d\u0443\u043b\u044f:<\/p>\n<ul>\n<li>\n<p>  <a href=\"https:\/\/skillfactory.ru\/dstpro?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_DSPR&amp;utm_term=regular&amp;utm_content=060721\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Data Scientist<\/a><\/p>\n<\/li>\n<li>\n<p>  <a href=\"https:\/\/skillfactory.ru\/dataanalystpro?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_DAPR&amp;utm_term=regular&amp;utm_content=060721\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Data Analyst<\/a><\/p>\n<\/li>\n<li>\n<p>  <a href=\"https:\/\/skillfactory.ru\/dataengineer?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_DEA&amp;utm_term=regular&amp;utm_content=060721\">\u041a\u0443\u0440\u0441 \u043f\u043e&nbsp;Data Engineering<\/a><\/p>\n<\/li>\n<\/ul>\n<details class=\"spoiler\">\n<summary>\u0414\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u0438 \u0438 \u043a\u0443\u0440\u0441\u044b<\/summary>\n<div class=\"spoiler__content\">\n<p><strong>\u041f\u0420\u041e\u0424\u0415\u0421\u0421\u0418\u0418<\/strong><\/p>\n<ul>\n<li>\n<p>  <a href=\"https:\/\/skillfactory.ru\/python-fullstack-web-developer?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_FPW&amp;utm_term=regular&amp;utm_content=060721\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Fullstack-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0430&nbsp;Python<\/a><\/p>\n<\/li>\n<li>\n<p>  <a href=\"https:\/\/skillfactory.ru\/java?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_JAVA&amp;utm_term=regular&amp;utm_content=060721\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Java-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<li>\n<p>  <a href=\"https:\/\/skillfactory.ru\/java-qa-engineer?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_QAJA&amp;utm_term=regular&amp;utm_content=060721\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f QA-\u0438\u043d\u0436\u0435\u043d\u0435\u0440 \u043d\u0430&nbsp;JAVA<\/a><\/p>\n<\/li>\n<li>\n<p>  <a href=\"https:\/\/skillfactory.ru\/frontend?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_FR&amp;utm_term=regular&amp;utm_content=060721\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Frontend-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<li>\n<p>  <a href=\"https:\/\/skillfactory.ru\/cybersecurity?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_HACKER&amp;utm_term=regular&amp;utm_content=060721\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u042d\u0442\u0438\u0447\u043d\u044b\u0439 \u0445\u0430\u043a\u0435\u0440<\/a><\/p>\n<\/li>\n<li>\n<p>  <a href=\"https:\/\/skillfactory.ru\/cplus?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_CPLUS&amp;utm_term=regular&amp;utm_content=060721\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f C++ \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<li>\n<p>  <a href=\"https:\/\/skillfactory.ru\/game-dev?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_GAMEDEV&amp;utm_term=regular&amp;utm_content=060721\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u0433\u0440 \u043d\u0430&nbsp;Unity<\/a><\/p>\n<\/li>\n<li>\n<p>  <a href=\"https:\/\/skillfactory.ru\/webdev?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_WEBDEV&amp;utm_term=regular&amp;utm_content=060721\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u0412\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<li>\n<p>  <a href=\"https:\/\/skillfactory.ru\/iosdev?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_IOSDEV&amp;utm_term=regular&amp;utm_content=060721\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f iOS-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441&nbsp;\u043d\u0443\u043b\u044f<\/a><\/p>\n<\/li>\n<li>\n<p>  <a href=\"https:\/\/skillfactory.ru\/android?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_ANDR&amp;utm_term=regular&amp;utm_content=060721\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Android-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441&nbsp;\u043d\u0443\u043b\u044f<\/a><\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041a\u0423\u0420\u0421\u042b<\/strong><\/p>\n<ul>\n<li>\n<p>  <a href=\"https:\/\/skillfactory.ru\/ml-programma-machine-learning-online?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_ML&amp;utm_term=regular&amp;utm_content=060721\">\u041a\u0443\u0440\u0441 \u043f\u043e&nbsp;Machine Learning<\/a><\/p>\n<\/li>\n<li>\n<p>  <a href=\"https:\/\/skillfactory.ru\/ml-and-dl?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_MLDL&amp;utm_term=regular&amp;utm_content=060721\">\u041a\u0443\u0440\u0441 \u00abMachine Learning \u0438&nbsp;Deep Learning\u00bb<\/a><\/p>\n<\/li>\n<li>\n<p>  <a href=\"https:\/\/skillfactory.ru\/math-stat-for-ds#syllabus?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_MAT&amp;utm_term=regular&amp;utm_content=060721\">\u041a\u0443\u0440\u0441 \u00ab\u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u0434\u043b\u044f Data Science\u00bb<\/a><\/p>\n<\/li>\n<li>\n<p>  <a href=\"https:\/\/skillfactory.ru\/math_and_ml?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_MATML&amp;utm_term=regular&amp;utm_content=060721\">\u041a\u0443\u0440\u0441 \u00ab\u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u0438&nbsp;Machine Learning \u0434\u043b\u044f Data Science\u00bb<\/a><\/p>\n<\/li>\n<li>\n<p>  <a href=\"https:\/\/skillfactory.ru\/python-for-web-developers?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_PWS&amp;utm_term=regular&amp;utm_content=060721\">\u041a\u0443\u0440\u0441 \u00abPython \u0434\u043b\u044f \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438\u00bb<\/a><\/p>\n<\/li>\n<li>\n<p>  <a href=\"https:\/\/skillfactory.ru\/algo?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_algo&amp;utm_term=regular&amp;utm_content=060721\">\u041a\u0443\u0440\u0441 \u00ab\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0438&nbsp;\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445\u00bb<\/a><\/p>\n<\/li>\n<li>\n<p>  <a href=\"https:\/\/skillfactory.ru\/analytics?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_SDA&amp;utm_term=regular&amp;utm_content=060721\">\u041a\u0443\u0440\u0441 \u043f\u043e&nbsp;\u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/a><\/p>\n<\/li>\n<li>\n<p>  <a href=\"https:\/\/skillfactory.ru\/devops?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_DEVOPS&amp;utm_term=regular&amp;utm_content=060721\">\u041a\u0443\u0440\u0441 \u043f\u043e&nbsp;DevOps<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/skillfactory\/blog\/566414\/\"> https:\/\/habr.com\/ru\/company\/skillfactory\/blog\/566414\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0435, \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u043c \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043a \u0441\u0442\u0430\u0440\u0442\u0443 \u043a\u0443\u0440\u0441\u0430 \u043e <a href=\"https:\/\/skillfactory.ru\/ml-and-dl?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_MLDL&amp;utm_term=regular&amp;utm_content=060721\">\u043c\u0430\u0448\u0438\u043d\u043d\u043e\u043c \u0438 \u0433\u043b\u0443\u0431\u043e\u043a\u043e\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438<\/a>, \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u044f\u0437\u044b\u043a\u043e\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043f\u043e\u0438\u0441\u043a\u0435, \u0441\u0442\u0430\u0442\u044c\u044f \u043e\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0448\u0435\u0441\u0442\u044c \u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u043e\u0432; \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0430 \u043f\u043e \u0416\u0430\u043a\u043a\u0430\u0440\u0443, \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0448\u0438\u043d\u0433\u043b\u043e\u0432 \u0438 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u041b\u0435\u0432\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u0430, \u0430\u0432\u0442\u043e\u0440 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u043a \u043f\u043e\u0438\u0441\u043a\u0443 \u0441 \u0440\u0430\u0437\u0440\u0435\u0436\u0435\u043d\u043d\u044b\u043c\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438 \u2014 TF-IDF \u0438 BM25 \u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u043b\u043e\u0442\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0438 Sentence-BERT. \u041f\u0440\u043e\u0441\u0442\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u044e\u0442\u0441\u044f \u043a\u043e\u0434\u043e\u043c \u0438 \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f\u043c\u0438, \u0430 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0432\u044b \u043d\u0430\u0439\u0434\u0451\u0442\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0431\u043b\u043e\u043a\u043d\u043e\u0442\u044b Jupyter.<\/p>\n<hr>\n<p>\u041f\u043e\u0438\u0441\u043a \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0430 \u2014 \u043e\u0434\u043d\u0430 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0431\u044b\u0441\u0442\u0440\u043e\u0440\u0430\u0441\u0442\u0443\u0449\u0438\u0445 \u043e\u0431\u043b\u0430\u0441\u0442\u0435\u0439 \u0432 \u0418\u0418 \u0438 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438. \u041f\u043e \u0441\u0432\u043e\u0435\u0439 \u0441\u0443\u0442\u0438, \u044d\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c. \u0412\u0435\u043b\u0438\u043a\u0430 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c, \u0447\u0442\u043e \u0432\u044b \u043d\u0430\u0448\u043b\u0438 \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u2014 \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, Google. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u044b \u0438\u0441\u043a\u0430\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 &#171;what is semantic similarity search?&#187; \u0438\u043b\u0438 &#171;traditional vs vector similarity search&#187;. Google \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0432\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043c\u043d\u043e\u0433\u0438\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0443, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435.&nbsp;<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u0438\u0441\u043a \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0430 \u043b\u0435\u0436\u0438\u0442 \u0432 \u043e\u0441\u043d\u043e\u0432\u0435 \u0443\u0441\u043f\u0435\u0445\u0430 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c\u044e $ 1,65 \u0422 \u2014 \u043f\u044f\u0442\u043e\u0439 \u043f\u043e \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u043c\u0438\u0440\u0435<sup>[1]<\/sup>, \u0435\u0441\u0442\u044c <em>\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0448\u0430\u043d\u0441<\/em>, \u0447\u0442\u043e \u043e \u043d\u0451\u043c \u0441\u0442\u043e\u0438\u0442 \u0443\u0437\u043d\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435. <a href=\"https:\/\/www.pinecone.io\/learn\/what-is-similarity-search\/\">\u041f\u043e\u0438\u0441\u043a \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0430<\/a> \u2014 \u0441\u043b\u043e\u0436\u043d\u0430\u044f \u0442\u0435\u043c\u0430, \u0435\u0441\u0442\u044c \u0431\u0435\u0441\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043c\u0435\u0442\u043e\u0434\u0438\u043a \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0438 \u043c\u043e\u0449\u043d\u044b\u0445 \u0438\u0437 \u044d\u0442\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u0443\u0434\u0435\u043b\u044f\u044f \u043e\u0441\u043e\u0431\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u043f\u043e\u0438\u0441\u043a\u0443. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442, \u0447\u0435\u043c \u043e\u043d\u0438 \u0445\u043e\u0440\u043e\u0448\u0438 \u0438 \u043a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0445 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e. \u041c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u044d\u0442\u043e \u0432\u0438\u0434\u0435\u043e \u0438\u043b\u0438 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e.<\/p>\n<details class=\"spoiler\">\n<summary>\u0414\u0432\u0430 \u0432\u0438\u0434\u0435\u043e \u043e \u0434\u0432\u0443\u0445 \u043a\u043b\u0430\u0441\u0441\u0430\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432<\/summary>\n<div class=\"spoiler__content\"><iframe id=\"60e45dcef2fa57a26f179f60\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60e45dcef2fa57a26f179f60\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><iframe id=\"60e46f3f12b0d58fd6dde610\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60e46f3f12b0d58fd6dde610\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/div>\n<\/details>\n<h3>\u0422\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a<\/h3>\n<p>\u041c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0441 \u043b\u0430\u0433\u0435\u0440\u044f \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u0439 \u0438 \u0442\u0430\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u0438\u0433\u0440\u043e\u043a\u043e\u0432:<\/p>\n<ul>\n<li>\n<p><strong>\u0421\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u0416\u0430\u043a\u043a\u0430\u0440\u0430.<\/strong><\/p>\n<\/li>\n<li>\n<p><strong>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0448\u0438\u043d\u0433\u043b\u043e\u0432.<\/strong><\/p>\n<\/li>\n<li>\n<p><strong>\u0420\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u041b\u0435\u0432\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u0430.<\/strong><\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u0441\u0435 \u044d\u0442\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043f\u0440\u0438 \u043f\u043e\u0438\u0441\u043a\u0435 \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0430, \u0438\u0437 \u043d\u0438\u0445 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0442\u0440\u0438 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445: \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e \u0416\u0430\u043a\u043a\u0430\u0440\u0443, \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0448\u0438\u043d\u0433\u043b\u043e\u0432 \u0438 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u041b\u0435\u0432\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u0430.<\/p>\n<h3>\u0421\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u0416\u0430\u043a\u043a\u0430\u0440\u0430<\/h3>\n<p>\u0421\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u0416\u0430\u043a\u043a\u0430\u0440\u0430 \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u0430\u044f, \u043d\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u043c\u043e\u0449\u043d\u0430\u044f \u043c\u0435\u0442\u0440\u0438\u043a\u0430 \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0430. \u0414\u0430\u043d\u044b \u0434\u0432\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 <strong>A<\/strong> \u0438 <strong>B<\/strong>: \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0447\u0438\u0441\u043b\u043e \u043e\u0431\u0449\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043d\u0438\u0445 \u0438 \u0434\u0435\u043b\u0438\u043c \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043d\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043e\u0431\u0435\u0438\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439.<\/p>\n<figure class=\"full-width\"><figcaption>\u0421\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u0416\u0430\u043a\u043a\u0430\u0440\u0430 \u0438\u0437\u043c\u0435\u0440\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435\u043c \u0434\u0432\u0443\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439<\/figcaption><\/figure>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440: \u0434\u0430\u043d\u044b \u0434\u0432\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b, \u0437\u0430\u043f\u0438\u0448\u0435\u043c:<\/p>\n<p><iframe id=\"60e46f74da3d598f9a4a513c\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60e46f74da3d598f9a4a513c\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438 <strong>\u0434\u0432\u0430<\/strong> \u043e\u0431\u0449\u0438\u0445 <em>\u043d\u0435\u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445<\/em> \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u043b\u0430, 3 \u0438 4 \u2014 \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0441 \u043e\u0431\u0449\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0434\u0435\u0441\u044f\u0442\u0438 \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u0432 \u043e\u0431\u0435\u0438\u0445, \u0433\u0434\u0435 <strong>\u0432\u043e\u0441\u0435\u043c\u044c<\/strong> \u0447\u0438\u0441\u0435\u043b&nbsp; \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u2014 2\/8 \u0434\u0430\u0451\u0442 \u043d\u0430\u043c \u043e\u0446\u0435\u043d\u043a\u0443 \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0430 \u043f\u043e \u0416\u0430\u043a\u043a\u0430\u0440\u0434\u0443 0,25. \u0422\u0443 \u0436\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0438 \u0434\u043b\u044f \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445: \u0432\u0441\u0451, \u0447\u0442\u043e \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c, \u2014 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c <em>\u0446\u0435\u043b\u044b\u0435 \u0447\u0438\u0441\u043b\u0430<\/em> \u043d\u0430 <em>\u0442\u043e\u043a\u0435\u043d\u044b<\/em>.<\/p>\n<figure class=\"full-width\"><figcaption>\u0421\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e \u0416\u0430\u043a\u043a\u0430\u0440\u0443, \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u043e\u0435 \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438 a \u0438 b<\/figcaption><\/figure>\n<p><iframe id=\"60e46f97da3d598f9a4a513d\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60e46f97da3d598f9a4a513d\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p>\u041c\u044b \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u0438, \u0447\u0442\u043e, \u043a\u0430\u043a \u0438 \u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c, \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f b \u0438 c \u043d\u0430\u0431\u0440\u0430\u043b\u0438 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0431\u0430\u043b\u043b\u043e\u0432. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u044d\u0442\u043e \u043d\u0435 \u043b\u0443\u0447\u0448\u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u2014 \u0434\u0432\u0430 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u043e\u0431\u0449\u0435\u0433\u043e, \u043a\u0440\u043e\u043c\u0435 \u0441\u043b\u043e\u0432 <em>&#8216;the&#8217;<\/em>, <em>&#8216;a&#8217;<\/em>, <em>&#8216;is&#8217;<\/em> \u0438 \u0442. \u0434., \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u044b\u0441\u043e\u043a\u0438\u0435 \u043e\u0446\u0435\u043d\u043a\u0438 \u0416\u0430\u043a\u043a\u0430\u0440\u0430, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043e\u043d\u0438 \u043d\u0435\u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b \u043f\u043e \u0441\u043c\u044b\u0441\u043b\u0443. \u042d\u0442\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \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\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u043e\u043f-\u0441\u043b\u043e\u0432, \u0441\u0442\u0435\u043c\u043c\u0438\u043d\u0433\/\u043b\u0435\u043c\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u0442. \u0434. \u041e\u0434\u043d\u0430\u043a\u043e, \u043a\u0430\u043a \u043c\u044b \u0441\u043a\u043e\u0440\u043e \u0443\u0432\u0438\u0434\u0438\u043c, \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u044d\u0442\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c.<\/p>\n<h3>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0448\u0438\u043d\u0433\u043b\u043e\u0432<\/h3>\n<p>\u0414\u0440\u0443\u0433\u0430\u044f \u043f\u043e\u0445\u043e\u0436\u0430\u044f \u0442\u0435\u0445\u043d\u0438\u043a\u0430 \u2014 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0443\u044e \u0436\u0435 \u043b\u043e\u0433\u0438\u043a\u0443 <em>\u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u044f\/\u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f<\/em> \u2014 \u043d\u043e \u0441 &#171;\u0448\u0438\u043d\u0433\u043b\u043e\u043c&#187;. 2-\u0448\u0438\u043d\u0433\u043b\u043e\u0432\u043e\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 <strong>a<\/strong> \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"javascript\">a = {'his thought', 'thought process', 'process is', ...}<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u043e\u0442 \u0436\u0435 \u0440\u0430\u0441\u0447\u0451\u0442 \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u044f\/\u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u0431\u0438\u0442\u044b\u043c\u0438 \u043d\u0430 \u0448\u0438\u043d\u0433\u043b\u044b \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438:<\/p>\n<p><iframe id=\"60e46fc62077cda25f846ac6\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60e46fc62077cda25f846ac6\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p>\u041f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0434\u0432\u0443\u0445 \u0448\u0438\u043d\u0433\u043b\u043e\u0432 \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0442\u0440\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0445 \u0448\u0438\u043d\u0433\u043b\u0430 \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438 <strong>b<\/strong> \u0438 <strong>c<\/strong>, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 <strong>0,125<\/strong>.<\/p>\n<h3>\u0420\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u041b\u0435\u0432\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u0430<\/h3>\n<p>\u0414\u0440\u0443\u0433\u0430\u044f \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0430\u044f \u043c\u0435\u0442\u0440\u0438\u043a\u0430 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0434\u0432\u0443\u0445 \u0441\u0442\u0440\u043e\u043a \u2014 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u041b\u0435\u0432\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u0430 \u2014 \u044d\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u043b\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0434\u0440\u0443\u0433\u0443\u044e, \u0432\u043e\u0442 \u0435\u0433\u043e \u0444\u043e\u0440\u043c\u0443\u043b\u0430:<\/p>\n<figure class=\"full-width\"><figcaption>\u0424\u043e\u0440\u043c\u0443\u043b\u0430 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u041b\u0435\u0432\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u0430<\/figcaption><\/figure>\n<p>\u041d\u0430 \u0432\u0438\u0434 \u043e\u043d\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u0430; \u0435\u0441\u043b\u0438 \u0432\u044b \u0435\u0451 \u043f\u043e\u043d\u044f\u043b\u0438, \u044d\u0442\u043e \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e! \u0415\u0441\u043b\u0438 \u043d\u0435\u0442, \u043d\u0435 \u0432\u043e\u043b\u043d\u0443\u0439\u0442\u0435\u0441\u044c \u2014 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u0435\u0451. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 a \u0438 b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0434\u0432\u0435 \u043d\u0430\u0448\u0438 \u0441\u0442\u0440\u043e\u043a\u0438, i \u0438 j \u2014 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432 a \u0438 b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e. \u0418\u0442\u0430\u043a, \u0434\u0430\u043d\u044b \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<figure class=\"full-width\"><figcaption>&#171;Levenshtein&#187; \u0438 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 &#171;Livinshten&#187;<\/figcaption><\/figure>\n<p>\u041c\u044b \u043d\u0430\u0439\u0434\u0451\u043c, \u0447\u0442\u043e:<\/p>\n<figure class=\"full-width\"><figcaption>\u0418\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u0443\u0435\u043c \u0441\u0430\u043c\u043e \u0441\u043b\u043e\u0432\u043e, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 1 \u0434\u043e \u0435\u0433\u043e \u0434\u043b\u0438\u043d\u044b, \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 &#171;\u043d\u0438\u0447\u0435\u0433\u043e&#187; (\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u2014 \u0434\u0430\u043b\u0435\u0435).<\/figcaption><\/figure>\n<p>\u042d\u0442\u043e \u043b\u0435\u0433\u043a\u043e! \u041f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u043d\u044f\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u044d\u0442\u043e\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u044b \u2014 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0412\u0430\u0433\u043d\u0435\u0440\u0430 \u2014 \u0424\u0438\u0448\u0435\u0440\u0430, \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u041b\u0435\u0432\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u0430 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b.&nbsp;\u041c\u044b \u0431\u0435\u0440\u0451\u043c \u0434\u0432\u0430 \u0441\u043b\u043e\u0432\u0430 a \u0438 b \u0438 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u043c \u0438\u0445 \u043f\u043e \u043e\u0431\u0435\u0438\u043c \u043e\u0441\u044f\u043c \u043d\u0430\u0448\u0435\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0441\u0438\u043c\u0432\u043e\u043b <em>\u043d\u0438\u0447\u0435\u0433\u043e<\/em> \u043a\u0430\u043a \u043f\u0443\u0441\u0442\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e:<\/p>\n<figure class=\"full-width\"><figcaption>\u041f\u0443\u0441\u0442\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u0412\u0430\u0433\u043d\u0435\u0440\u0430-\u0424\u0438\u0448\u0435\u0440\u0430 \u2014 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0435\u0439 \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u041b\u0435\u0432\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u0430 \u043c\u0435\u0436\u0434\u0443 &#8216;Levenshtein&#8217; \u0438 &#8216;Livinshten&#8217;.<\/figcaption><\/figure>\n<p><iframe id=\"60e46a0ff2fa57a26f179f65\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60e46a0ff2fa57a26f179f65\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p><em>\u041a\u043e\u0434 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0443\u0441\u0442\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0412\u0430\u0433\u043d\u0435\u0440\u0430 \u2014 \u0424\u0438\u0448\u0435\u0440\u0430:<\/em><\/p>\n<p>\u041f\u0435\u0440\u0435\u0431\u0435\u0440\u0451\u043c \u0432\u0441\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0432 \u043c\u0430\u0442\u0440\u0438\u0446\u0435 \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u0442\u0443 \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443\u043b\u0443, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u0438\u0434\u0435\u043b\u0438 \u0440\u0430\u043d\u0435\u0435. \u041f\u0435\u0440\u0432\u044b\u0439 \u0448\u0430\u0433 \u0432 \u043d\u0430\u0448\u0435\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u0435 if min(i, j) = 0 \u2014 \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u0443\u0442\u043e\u0447\u043d\u044f\u0435\u043c, \u043d\u0435 \u0440\u0430\u0432\u043d\u044b \u043b\u0438 i \u0438 j \u043d\u0443\u043b\u044e? \u0415\u0441\u043b\u0438 \u0434\u0430, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438 max(i, j), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0432 \u043d\u0430\u0448\u0435\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u2014 i \u0438 j:<\/p>\n<figure class=\"full-width\"><figcaption>\u041d\u0430\u0447\u043d\u0451\u043c \u0441\u043f\u0440\u0430\u0432\u0430, \u0432\u0434\u043e\u043b\u044c \u0440\u0451\u0431\u0435\u0440, \u0433\u0434\u0435 i \u0438\/\u0438\u043b\u0438 j \u0440\u0430\u0432\u043d\u043e 0, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u043c\u0430\u0442\u0440\u0438\u0446\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043e max(i, j)<\/figcaption><\/figure>\n<p><iframe id=\"60e4703b8ff4968fafa2a89d\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60e4703b8ff4968fafa2a89d\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p><em>\u041a\u043e\u0434 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 min(i, j) == 0, \u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0432\u044b\u0448\u0435 max(i, j).<\/em><\/p>\n<p>\u0421 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u043a\u0440\u0430\u044f\u043c\u0438 \u043d\u0430\u0448\u0435\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u043c\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c, \u043d\u043e \u043d\u0430\u043c \u0432\u0441\u0451 \u0435\u0449\u0451 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u2014 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c. \u0412\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a if min(i, j) = 0 \u2014 \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u043d\u0438 \u043e\u0434\u043d\u043e \u0438\u0437 \u043d\u0438\u0445 \u043d\u0435 \u0440\u0430\u0432\u043d\u043e 0? \u0417\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 min {. \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u0430 \u043f\u043e\u0441\u043b\u0435 \u0432\u0437\u044f\u0442\u044c <strong>\u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435<\/strong> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u0421\u0435\u0439\u0447\u0430\u0441 \u044d\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b \u2014 \u043e\u043d\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u043d\u0430\u0448\u0435\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u0435:<\/p>\n<figure class=\"full-width\"><figcaption>\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043d\u043e\u0432\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0431\u0435\u0440\u0451\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u0442\u0440\u0451\u0445 \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0445 \u043f\u043e\u0437\u0438\u0446\u0438\u0439 (\u043e\u0431\u0432\u0435\u0434\u0435\u043d\u043e \u043a\u0440\u0443\u0436\u043a\u043e\u043c \u0432\u0432\u0435\u0440\u0445\u0443 \u0441\u043b\u0435\u0432\u0430)<\/figcaption><\/figure>\n<p>lev(i-1, j), \u0430 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u2014 \u044d\u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438. \u0417\u0430\u0442\u0435\u043c \u0431\u0435\u0440\u0451\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u0442\u0440\u0451\u0445. \u041e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f. +1 \u0441\u043b\u0435\u0432\u0430 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 a[i] != b[i] \u2014 \u044d\u0442\u043e \u0448\u0442\u0440\u0430\u0444 \u0437\u0430 \u043d\u0435\u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432.<\/p>\n<figure class=\"full-width\"><figcaption>\u0415\u0441\u043b\u0438 a[i] != b[j], \u043f\u0440\u0438\u0431\u0430\u0432\u043b\u044f\u0435\u043c 1 \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u2014 \u044d\u0442\u043e \u0448\u0442\u0440\u0430\u0444 \u0437\u0430 \u043d\u0435\u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432<\/figcaption><\/figure>\n<p>\u042d\u0442\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0432 \u0446\u0438\u043a\u043b\u0435 \u043f\u043e \u0432\u0441\u0435\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<p><iframe id=\"60e4706d12b0d58fd6dde611\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60e4706d12b0d58fd6dde611\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p><em>\u041f\u043e\u043b\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0430\u0441\u0447\u0451\u0442\u0430 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u041b\u0435\u0432\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u0430 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0412\u0430\u0433\u043d\u0435\u0440\u0430 \u2014 \u0424\u0438\u0448\u0435\u0440\u0430.<\/em><\/p>\n<p>\u0418\u0442\u0430\u043a, \u043c\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u043b\u0438 \u043a\u0430\u0436\u0434\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u043c\u0430\u0442\u0440\u0438\u0446\u0435 \u2014 \u044d\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u043b\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438 a \u0434\u043e \u043f\u043e\u0437\u0438\u0446\u0438\u0438 i \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 b \u0434\u043e \u043f\u043e\u0437\u0438\u0446\u0438\u0438 j. \u041c\u044b \u0438\u0449\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0434\u043b\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f a \u0432 b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0431\u0435\u0440\u0451\u043c \u043f\u0440\u0430\u0432\u043e\u0435 \u043d\u0438\u0436\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 lev[-1, -1].<\/p>\n<figure class=\"full-width\"><figcaption>\u041e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043f\u043e \u043c\u0430\u0442\u0440\u0438\u0446\u0435 \u2014 \u0432 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 [-1, -1] \u0432\u043d\u0438\u0437\u0443 \u2014 \u0441\u043f\u0440\u0430\u0432\u0430 \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u041b\u0435\u0432\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u0430 \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438<\/figcaption><\/figure>\n<p><iframe id=\"60e4709fda3d598f9a4a513e\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60e4709fda3d598f9a4a513e\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<h3>\u0412\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0435 \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e<\/h3>\n<p>\u0414\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u043c\u044b \u043e\u0431\u044b\u0447\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432:<\/p>\n<ul>\n<li>\n<p>TF-IDF.<\/p>\n<\/li>\n<li>\n<p>BM25.<\/p>\n<\/li>\n<li>\n<p>word2vec\/doc2vec.<\/p>\n<\/li>\n<li>\n<p>BERT.<\/p>\n<\/li>\n<li>\n<p>USE.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0442\u0430\u043d\u0434\u0435\u043c\u0435 \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f\u043c\u0438 <em>\u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445<\/em> \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0445 \u0441\u043e\u0441\u0435\u0434\u0435\u0439 (ANN) \u044d\u0442\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0432 \u043c\u0438\u0440\u0435 \u043f\u043e\u0438\u0441\u043a\u0430 \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0430, \u0435\u0441\u043b\u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043c\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u2014 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0436\u0438\u0437\u043d\u0435\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b\u0435 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u044b. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 TF-IDF, BM25 \u0438 BERT, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u043c\u0438 \u0438 \u043e\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u044e\u0442 \u043a\u0430\u043a \u0440\u0430\u0437\u0440\u0435\u0436\u0435\u043d\u043d\u044b\u0435, \u0442\u0430\u043a \u0438 \u043f\u043b\u043e\u0442\u043d\u044b\u0435 <a href=\"https:\/\/www.pinecone.io\/learn\/vector-embeddings\/\">\u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f<\/a>.<\/p>\n<h3>1. TF-IDF<\/h3>\n<p>\u041f\u043e\u0447\u0442\u0435\u043d\u043d\u044b\u0439 \u0434\u0435\u0434\u0443\u0448\u043a\u0430 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0430, \u0440\u043e\u0434\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u0435\u0449\u0451 \u0432 1970-\u0445 \u0433\u043e\u0434\u0430\u0445. \u041e\u043d \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0447\u0430\u0441\u0442\u0435\u0439: <strong>T<\/strong>erm <strong>F<\/strong>requency (TF) \u0438 <strong>I<\/strong>nverse <strong>D<\/strong>ocument <strong>F<\/strong>requency (IDF). \u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 TF \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0442\u0435\u0440\u043c\u0438\u043d \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0435, \u0438 \u0434\u0435\u043b\u0438\u0442 \u0435\u0433\u043e \u043d\u0430 \u043e\u0431\u0449\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u0432 \u044d\u0442\u043e\u0433\u043e \u0436\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430.<\/p>\n<figure class=\"full-width\"><figcaption>\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u0442\u0435\u0440\u043c\u0438\u043d\u0430 (TF) TF-IDF \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 (&#171;bananas&#187;) \u0438 \u0434\u0435\u043b\u0438\u0442 \u0435\u0451 \u043d\u0430 \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u0432\u0441\u0435\u0445 \u043b\u0435\u043a\u0441\u0435\u043c<\/figcaption><\/figure>\n<p>\u042d\u0442\u043e \u043f\u0435\u0440\u0432\u0430\u044f \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0430 \u043d\u0430\u0448\u0435\u0433\u043e \u0440\u0430\u0441\u0447\u0451\u0442\u0430, \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 f(q, D) \u0432 \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u0435 \u0438 \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u0432\u0441\u0435\u0445 \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u0432 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 f(t, D) \u0432 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u0438 \u0434\u0440\u043e\u0431\u0438. TF \u2014 \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c, \u043d\u043e \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u043c\u0438 \u0438 \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438. \u0415\u0441\u043b\u0438 \u0431\u044b \u043c\u044b \u0438\u0441\u043a\u0430\u043b\u0438 \u0441\u043b\u043e\u0432\u043e &#171;the&#187;, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0442\u043e\u043b\u044c\u043a\u043e TF, \u043c\u044b \u0431\u044b \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u043b\u0438 \u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u0442\u0443 \u0436\u0435 \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u044c, \u0447\u0442\u043e \u0438 \u043f\u0440\u0438 \u043f\u043e\u0438\u0441\u043a\u0435 &#171;bananas&#187;. \u042d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e, \u043f\u043e\u043a\u0430 \u043c\u044b \u043d\u0435 \u043d\u0430\u0447\u043d\u0451\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0438\u043b\u0438 \u0438\u0441\u043a\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u043b\u0438\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u041c\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u0442\u0430\u043a\u0438\u0435 \u0441\u043b\u043e\u0432\u0430, \u043a\u0430\u043a <em>&#8216;the&#8217;<\/em>, &#8216;is&#8217; \u0438\u043b\u0438 <em>&#8216;it&#8217;<\/em>, \u0431\u044b\u043b\u0438 \u043e\u0446\u0435\u043d\u0435\u043d\u044b \u0442\u0430\u043a \u0436\u0435 \u0432\u044b\u0441\u043e\u043a\u043e, \u043a\u0430\u043a <em>&#8216;bananas&#8217;<\/em> \u0438\u043b\u0438 <em>&#8216;street&#8217;<\/em>.<\/p>\n<p>\u0412 \u0438\u0434\u0435\u0430\u043b\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0431\u043e\u043b\u0435\u0435 \u0440\u0435\u0434\u043a\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0432\u044b\u0448\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u043c\u043d\u043e\u0436\u0438\u0442\u044c TF \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u043b\u0435\u043d \u2014 IDF. \u041e\u0431\u0440\u0430\u0442\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u0438\u0437\u043c\u0435\u0440\u044f\u0435\u0442, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u0442\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u043e\u0432\u043e \u0432\u043e <em>\u0432\u0441\u0435\u0445<\/em> \u043d\u0430\u0448\u0438\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0445.<\/p>\n<figure class=\"full-width\"><figcaption>\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 (IDF) TF-IDF \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0445 \u043d\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441.<\/figcaption><\/figure>\n<p>\u0417\u0434\u0435\u0441\u044c \u0442\u0440\u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412\u044b\u0447\u0438\u0441\u043b\u0438\u0432 IDF \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 <em>&#8216;is&#8217;<\/em>, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u0447\u0438\u0441\u043b\u043e, \u0447\u0435\u043c \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u043e\u043b\u0435\u0435 \u0440\u0435\u0434\u043a\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 <em>&#8216;forest&#8217;<\/em>. \u0415\u0441\u043b\u0438 \u0431\u044b \u043f\u043e\u0441\u043b\u0435 \u043c\u044b \u0438\u0441\u043a\u0430\u043b\u0438 \u043e\u0431\u0430 \u0441\u043b\u043e\u0432\u0430 <em>&#8216;is&#8217;<\/em> \u0438 <em>&#8216;forest&#8217;<\/em>, \u0442\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u043b\u0438 \u0431\u044b TF \u0438 IDF \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041c\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u043e\u0446\u0435\u043d\u043a\u0438 TF(&#8216;is&#8217;, D) \u0438 TF(&#8216;forest&#8217;, D) \u0434\u043b\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 a, b \u0438 c. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 IDF \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a\u043e \u0432\u0441\u0435\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 IDF(&#8216;is&#8217;) \u0438 IDF(&#8216;forest&#8217;) \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437. \u0417\u0430\u0442\u0435\u043c \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f TF-IDF \u0434\u043b\u044f \u043e\u0431\u043e\u0438\u0445 \u0441\u043b\u043e\u0432 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0435 \u043f\u0443\u0442\u0451\u043c \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 TF \u0438 IDF. \u041f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 a \u043d\u0430\u0431\u0438\u0440\u0430\u0435\u0442 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u043b\u043b\u043e\u0432 \u0434\u043b\u044f &#8216;forest&#8217;, \u0430 &#8216;is&#8217; \u0432\u0441\u0435\u0433\u0434\u0430 \u043d\u0430\u0431\u0438\u0440\u0430\u0435\u0442 0, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 IDF(&#8216;is&#8217;) \u0440\u0430\u0432\u043d\u043e 0.<\/p>\n<p><iframe id=\"60e470d812b0d58fd6dde612\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60e470d812b0d58fd6dde612\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p>\u042d\u0442\u043e \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u043e \u0433\u0434\u0435 \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f <em>\u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0435<\/em> \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0430? \u0418\u0442\u0430\u043a, \u043c\u044b \u0431\u0435\u0440\u0451\u043c \u043d\u0430\u0448 \u0441\u043b\u043e\u0432\u0430\u0440\u043d\u044b\u0439 \u0437\u0430\u043f\u0430\u0441 (\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u0441\u043b\u043e\u0432 \u0432 \u043d\u0430\u0448\u0435\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445) \u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c TF-IDF \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430.<\/p>\n<figure class=\"full-width\"><figcaption>\u041c\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 TF-IDF \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 \u0441\u043b\u043e\u0432\u0430\u0440\u044f, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u0435\u043a\u0442\u043e\u0440 TF-IDF. \u042d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0435<\/figcaption><\/figure>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u043a\u0442\u043e\u0440\u044b TF-IDF, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u044d\u0442\u043e \u0432\u043e\u0435\u0434\u0438\u043d\u043e:<\/p>\n<p><iframe id=\"60e470f7dc7e91a24fcac3d1\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60e470f7dc7e91a24fcac3d1\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p>\u041e\u0442\u0441\u044e\u0434\u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u0435\u043a\u0442\u043e\u0440 TF-IDF. \u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u043b\u0435\u0433\u043a\u043e \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0431\u043e\u043b\u0435\u0435 20 000 \u0441\u043b\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u044d\u0442\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u043d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u0440\u0430\u0437\u0440\u0435\u0436\u0435\u043d\u044b, \u0430 \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u043c\u044b\u0441\u043b \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c.<\/p>\n<h3>2. BM25<\/h3>\n<p>\u041f\u0440\u0435\u0435\u043c\u043d\u0438\u043a TF-IDF, Okapi BM25, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f<\/p>\n<\/hr>\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-326065","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/326065","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=326065"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/326065\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=326065"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=326065"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=326065"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}