{"id":368325,"date":"2024-05-21T03:40:21","date_gmt":"2024-05-21T03:40:21","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=368325"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=368325","title":{"rendered":"<span>GPT \u0438\u043b\u0438 GigaChat \u2014 \u043e\u0442\u0432\u0435\u0442\u0438\u0442 RAGAS<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 <a href=\"https:\/\/habr.com\/ru\/articles\/787940\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a> \u043c\u044b \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u043b\u0438\u0441\u044c \u0441 \u0442\u0435\u043c, \u043a\u0430\u043a RAGAS \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0440\u0435\u0442\u0440\u0438\u0432\u0435\u0440\u043e\u0432 \u0432 RAG-\u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445. \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044f \u043d\u0430\u0448\u0435 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0432\u0430\u0436\u043d\u044b\u0439 \u0430\u0441\u043f\u0435\u043a\u0442 &#8212; \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u0438\u043b\u0438 LLM. \u042d\u0442\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438\u0433\u0440\u0430\u044e\u0442 \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u0443\u044e \u0440\u043e\u043b\u044c \u0432 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0442\u0435\u0445 \u043e\u0442\u0432\u0435\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u043f\u0440\u0438 \u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u0441 \u0447\u0430\u0442-\u0431\u043e\u0442\u0430\u043c\u0438. \u041f\u043e\u043d\u044f\u0442\u044c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b \u043e\u043d\u0438 \u0432 \u0441\u0432\u043e\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0435, \u043a\u0440\u0430\u0439\u043d\u0435 \u0432\u0430\u0436\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u0442 \u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u044b \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439.<\/p>\n<p>\u041e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u0432 \u043e\u0446\u0435\u043d\u043a\u0435 LLM \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u0430\u043d\u0430\u043b\u0438\u0437 &#171;\u0433\u0430\u043b\u043b\u044e\u0446\u0438\u043d\u0430\u0446\u0438\u0439&#187; &#8212; \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0439, \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435, \u043d\u043e \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0435 \u043e\u0442\u0432\u0435\u0442\u044b. \u042d\u0442\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430 \u0432 \u0441\u0432\u0435\u0442\u0435 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0434\u0430\u0436\u0435 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 LLM \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u0440\u043e\u0436\u0434\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u044b\u0435 \u0438\u043b\u0438 \u0432\u0432\u043e\u0434\u044f\u0449\u0438\u0435 \u0432 \u0437\u0430\u0431\u043b\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u041a\u0430\u043a \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0434\u0435\u0436\u043d\u044b \u0438 \u0442\u043e\u0447\u043d\u044b \u043e\u0442\u0432\u0435\u0442\u044b, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u044c\u044e?<\/p>\n<p>\u042f \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b, \u0447\u0442\u043e \u0432 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435 \u043f\u043e \u0441\u0443\u0442\u0438 \u0434\u0432\u0430 \u043d\u0430\u0431\u043e\u0440\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 &#8212; \u043e\u0434\u0438\u043d \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0435\u0442\u0440\u0438\u0432\u0435\u0440\u0430, \u0434\u0440\u0443\u0433\u043e\u0439 \u0437\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438. \u041a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0437\u043c\u0435\u0440\u044f\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u0440\u0438\u043a <code>faithfulness<\/code> \u0438 <code>answer relevance<\/code>. \u041f\u043e\u0440\u0430 \u0441\u043d\u043e\u0432\u0430 \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442 \u0434\u0432\u0438\u0436\u043a\u0430 RAGAS.<\/p>\n<h3>Faithfulness<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0435\u0440\u0438\u0442\u044c \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u0442\u043e <code>faithfulness<\/code> \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u0442 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u0430, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e LLM, \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0443. \u0421\u0443\u0442\u044c \u044d\u0442\u043e\u0439 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435, \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u0432\u0441\u0435 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f, \u0441\u0434\u0435\u043b\u0430\u043d\u043d\u044b\u0435 \u0432 \u043e\u0442\u0432\u0435\u0442\u0435, \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0438\u0437 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430. \u041f\u043e\u043a\u0430 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u043e. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u0435\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ef6\/f62\/812\/ef6f628129e5ac6e4dc048fe3800e379.png\" width=\"1438\" height=\"154\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ef6\/f62\/812\/ef6f628129e5ac6e4dc048fe3800e379.png\"\/><\/figure>\n<ol>\n<li>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u0437 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0431\u043e\u0440 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0439. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u044f\u0437\u044b\u043a\u043e\u0432\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u043c\u043f\u0442 <code>LONG_FORM_ANSWER_PROMPT<\/code>. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442\u0435 \u0443 \u0431\u043e\u0442\u0430: &#171;\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0441\u043e\u043b\u043d\u0446\u0435?&#187; \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 \u043e\u0442\u0432\u0435\u0442: &#171;\u0421\u043e\u043b\u043d\u0446\u0435 &#8212; \u044d\u0442\u043e \u0437\u0432\u0435\u0437\u0434\u0430 \u0432 \u0446\u0435\u043d\u0442\u0440\u0435 \u0421\u043e\u043b\u043d\u0435\u0447\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u043a\u0440\u0443\u0433 \u0417\u0435\u043c\u043b\u0438, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044f \u0441\u0432\u0435\u0442 \u0438 \u0442\u0435\u043f\u043b\u043e.&#187;<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f LLM, \u044f \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u044e \u044d\u0442\u043e\u0442 \u043e\u0442\u0432\u0435\u0442 \u0432 \u0441\u0435\u0440\u0438\u044e \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0439:<\/p>\n<ol>\n<li>\n<p>\u0421\u043e\u043b\u043d\u0446\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0432\u0435\u0437\u0434\u043e\u0439.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u043b\u043d\u0446\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0446\u0435\u043d\u0442\u0440\u0435 \u0421\u043e\u043b\u043d\u0435\u0447\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u043b\u043d\u0446\u0435 \u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u043a\u0440\u0443\u0433 \u0417\u0435\u043c\u043b\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u043b\u043d\u0446\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0417\u0435\u043c\u043b\u044e \u0441\u0432\u0435\u0442\u043e\u043c \u0438 \u0442\u0435\u043f\u043b\u043e\u043c.<\/p>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0448\u0430\u0433\u0430, \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0438\u0445 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0441\u0442\u0438 \u0438\u043b\u0438 \u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u0430 \u0438 \u043e\u0442\u0432\u0435\u0442\u0430. \u042d\u0442\u043e\u0442 \u044d\u0442\u0430\u043f \u0442\u0430\u043a\u0436\u0435 \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u0442 \u044f\u0437\u044b\u043a\u043e\u0432\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u043e\u043c\u043f\u0442\u0430 <code>NLI_STATEMENTS_MESSAGE<\/code>. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0431\u044b\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c:<\/p>\n<p>&#171;\u0421\u043e\u043b\u043d\u0446\u0435 &#8212; \u044d\u0442\u043e \u0437\u0432\u0435\u0437\u0434\u0430, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0430\u044f\u0441\u044f \u0432 \u0446\u0435\u043d\u0442\u0440\u0435 \u0421\u043e\u043b\u043d\u0435\u0447\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u041e\u043d\u043e \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u043c\u0430\u0441\u0441\u044b \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u044d\u043d\u0435\u0440\u0433\u0438\u0438, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0449\u0435\u0439 \u0436\u0438\u0437\u043d\u044c \u043d\u0430 \u0417\u0435\u043c\u043b\u0435.&#187;<\/p>\n<ol>\n<li>\n<p>\u0421\u043e\u043b\u043d\u0446\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0432\u0435\u0437\u0434\u043e\u0439. <\/p>\n<ul>\n<li>\n<p><strong>\u041e\u0446\u0435\u043d\u043a\u0430<\/strong>: &#8216;1&#8217;. \u042d\u0442\u043e \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u0442\u043e\u0447\u043d\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0421\u043e\u043b\u043d\u0446\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0437\u0432\u0435\u0437\u0434\u0430.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0421\u043e\u043b\u043d\u0446\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0446\u0435\u043d\u0442\u0440\u0435 \u0421\u043e\u043b\u043d\u0435\u0447\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. <\/p>\n<ul>\n<li>\n<p><strong>\u041e\u0446\u0435\u043d\u043a\u0430<\/strong>: &#8216;1&#8217;. \u042d\u0442\u043e \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u0436\u0435 \u0432\u0435\u0440\u043d\u043e \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0443, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044f \u043d\u0430 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0421\u043e\u043b\u043d\u0446\u0430 \u0432 \u0421\u043e\u043b\u043d\u0435\u0447\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0421\u043e\u043b\u043d\u0446\u0435 \u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u043a\u0440\u0443\u0433 \u0417\u0435\u043c\u043b\u0438. <\/p>\n<ul>\n<li>\n<p><strong>\u041e\u0446\u0435\u043d\u043a\u0430<\/strong>: &#8216;0&#8217;. \u042d\u0442\u043e \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u043d\u0435\u0432\u0435\u0440\u043d\u043e \u0438 \u043d\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0443.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0421\u043e\u043b\u043d\u0446\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0417\u0435\u043c\u043b\u044e \u0441\u0432\u0435\u0442\u043e\u043c \u0438 \u0442\u0435\u043f\u043b\u043e\u043c. <\/p>\n<ul>\n<li>\n<p><strong>\u041e\u0446\u0435\u043d\u043a\u0430<\/strong>: &#8216;1&#8217;. \u042d\u0442\u043e \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u043d\u043e \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0421\u043e\u043b\u043d\u0446\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u044d\u043d\u0435\u0440\u0433\u0438\u0438.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u043c\u0435\u0442\u0440\u0438\u043a\u0443, \u043a\u0430\u043a \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u0434\u0438\u043a\u0442\u043e\u0432.<\/p>\n<p> \u0422\u0435\u043f\u0435\u0440\u044c \u044f \u0434\u0443\u043c\u0430\u044e \u0431\u043e\u043b\u0435\u0435 \u043c\u0435\u043d\u0435\u0435 \u044f\u0441\u043d\u043e, \u0447\u0442\u043e \u044d\u0442\u0430 \u043c\u0435\u0442\u0440\u0438\u043a\u0430 \u043a\u0430\u043a \u0440\u0430\u0437 \u0438 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043c\u0435\u0440\u0443 \u0433\u0430\u043b\u043b\u044e\u0446\u0438\u043d\u0430\u0446\u0438\u0439 \u0432 \u043e\u0442\u0432\u0435\u0442\u0430\u0445 \u043d\u0430\u0448\u0435\u0439 LLM. \u041c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u044d\u0442\u0430 \u043c\u0435\u0442\u0440\u0438\u043a\u0430 \u0434\u0443\u0431\u043b\u0438\u0440\u0443\u0435\u0442 <code>context_recall<\/code>. \u041d\u043e \u043e\u043d\u0438 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u043d\u044b\u0435. Recall \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0432\u044b \u0441\u043e\u0431\u0440\u0430\u043b\u0438, \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e ground truth, \u043d\u0435\u043a\u043e\u0435\u0433\u043e \u044d\u0442\u0430\u043b\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441. \u041d\u043e \u0434\u0430\u043b\u0435\u0435, \u0432\u0430\u0448\u0430 LLM \u043c\u043e\u0436\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u043f\u0435\u0440\u0435\u0432\u0440\u0430\u0442\u044c \u0434\u0430\u0436\u0435 \u044d\u0442\u043e\u0442 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u0432\u043e\u0442 \u0437\u0434\u0435\u0441\u044c \u043a\u0430\u043a \u0440\u0430\u0437 \u0438 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0441\u0446\u0435\u043d\u0443 <code>faithfulness<\/code>.<\/p>\n<\/li>\n<\/ol>\n<p>\u0425\u043e\u0440\u043e\u0448\u043e, \u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0438 \u044d\u0442\u043e\u0439 \u043c\u0435\u0442\u0440\u0438\u043a\u0438, \u0447\u0442\u043e\u0431\u044b \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438. \u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u044f\u0437\u044b\u043a\u043e\u0432\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0435 \u0433\u0430\u043b\u043b\u044e\u0446\u0438\u043d\u0438\u0440\u0443\u0435\u0442, \u043e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435\u043f\u043e\u043b\u043d\u044b\u0435 \u043e\u0442\u0432\u0435\u0442\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u043f\u0440\u043e \u043c\u0430\u0441\u0441\u0443 \u0438 \u0434\u0438\u0430\u043c\u0435\u0442\u0440 \u0421\u043e\u043b\u043d\u0446\u0430, \u043d\u043e \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0442\u0432\u0435\u0442\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e \u043c\u0430\u0441\u0441\u0443 (\u0438 \u0443\u043a\u0430\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435), \u0442\u0435 \u0437\u0434\u0435\u0441\u044c <code>faithfulness<\/code> \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0447\u043a\u0435, \u043d\u043e \u043f\u043e \u0444\u0430\u043a\u0442\u0443 \u043e\u0442\u0432\u0435\u0442 \u043d\u0435 \u0432\u043f\u043e\u043b\u043d\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439. \u0417\u043d\u0430\u0447\u0438\u0442, \u043f\u043e\u0440\u0430 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u0435\u0449\u0435 \u043e\u0434\u043d\u0443 \u043c\u0435\u0442\u0440\u0438\u043a\u0443 &#8212; <code>answer relevance<\/code><\/p>\n<h3>Answer relevancy<\/h3>\n<p>\u041c\u0435\u0442\u0440\u0438\u043a\u0430 \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u0442, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u0443, \u043f\u0440\u043e\u0432\u043e\u0434\u044f \u0430\u043d\u0430\u043b\u0438\u0437 \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0438\u0437 \u043e\u0442\u0432\u0435\u0442\u0430 \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0441 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c. \u0415\u0441\u043b\u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0442\u0435\u0441\u043d\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c, \u044d\u0442\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0432\u044b\u0441\u043e\u043a\u0443\u044e \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u0430.<\/p>\n<p>\u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043e\u0442\u0432\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u0442\u043e\u0447\u043d\u043e \u0430\u0434\u0440\u0435\u0441\u0443\u0435\u0442 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441, \u0442\u043e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0441\u0445\u043e\u0436\u0438 \u0438\u043b\u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u0443. \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u043e\u0432, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u044e, \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0441 &#171;\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c&#187; \u043e\u0442\u0432\u0435\u0442\u043e\u043c.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u0433\u043b\u044f\u043d\u0435\u043c \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439.<\/p>\n<ol>\n<li>\n<p>\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u043c\u0435\u0442\u0440\u0438\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u0440\u043e\u043c\u043f\u0442 <code>QUESTION_GEN<\/code>, \u0447\u0442\u043e\u0431\u044b \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0431\u044b\u0442\u044c \u0437\u0430\u0434\u0430\u043d\u044b \u043a \u044d\u0442\u043e\u043c\u0443 \u043e\u0442\u0432\u0435\u0442\u0443. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c <code>strictness<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0434\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u0433\u043e\u0441\u0442\u044c \u043e\u0446\u0435\u043d\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0442\u0435\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u043c\u0435\u0442\u0440\u0438\u043a\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u043a\u043e\u0441\u0438\u043d\u0443\u0441\u043d\u043e\u0435 \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u0430 \u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432. \u042d\u0442\u043e \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0431\u043b\u0438\u0437\u043a\u0438 \u043a \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c\u0443, \u043e\u0442\u0440\u0430\u0436\u0430\u044f \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0418\u0442\u043e\u0433\u043e\u0432\u0430\u044f \u043e\u0446\u0435\u043d\u043a\u0430 \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0441\u0438\u043d\u0443\u0441\u043d\u043e\u0433\u043e \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0430 \u043c\u0435\u0436\u0434\u0443 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c \u0438 \u0432\u0441\u0435\u043c\u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u043c\u0438, \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u043d\u043e\u0435 \u043d\u0430 \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043e\u0442\u0432\u0435\u0442 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u043a\u043b\u043e\u043d\u0447\u0438\u0432\u044b\u043c (committal).<\/p>\n<\/li>\n<\/ol>\n<p>\u0412 \u043f\u0440\u043e\u0448\u043b\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0438 \u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0440\u0435\u0442\u0440\u0438\u0432\u0435\u0440\u0430, \u043c\u044b \u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043d\u0430 \u0442\u0430\u043a\u0438\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438, \u043a\u0430\u043a \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0438 \u043f\u043e\u043b\u043d\u043e\u0442\u0430 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430. \u041d\u043e \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0435 \u043f\u0440\u043e\u043c\u043f\u0442\u044b \u0434\u043b\u044f \u0440\u0443\u0441\u0441\u043a\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0451 \u0435\u0434\u0438\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e.<\/p>\n<h3>\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0445\u043e\u0440\u043e\u0448\u0438\u0439 testset<\/h3>\n<p>\u041d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u043b\u0438 \u0441\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0445\u0430\u0431\u0440\u0430. \u0418 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0431\u044b\u043b \u0440\u0430\u0437\u0431\u0430\u0432\u043b\u0435\u043d \u043d\u0435\u043d\u0443\u0436\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u0440\u0442\u0438\u0442\u044c \u043d\u0430\u043c \u0436\u0438\u0437\u043d\u044c. \u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0432\u0441\u0451 \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0447\u0438\u0441\u0442\u0438\u043c \u044d\u0442\u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u043d\u0442.<\/p>\n<pre><code class=\"python\">from langchain_community.document_loaders import AsyncHtmlLoader from bs4 import BeautifulSoup # \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u0432 \u043b\u0430\u043d\u0433\u0447\u0435\u0439\u043d \u0443\u0440\u0435\u0437\u0430\u043d\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b BS  loader = AsyncHtmlLoader(       ['https:\/\/habr.com\/ru\/articles\/729664\/',        'https:\/\/habr.com\/ru\/articles\/733262\/',        'https:\/\/habr.com\/ru\/articles\/734146\/',        'https:\/\/habr.com\/ru\/articles\/735920\/'        ]   )  # \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0441\u044b\u0440\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 html = loader.load()  # \u043e\u0447\u0438\u0449\u0430\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u043d\u0442 def clean_content(docs):       for doc in docs:           soup = BeautifulSoup(doc.page_content, 'html.parser')           content = soup.find(\"div\", class_=\"article-formatted-body article-formatted-body article-formatted-body_version-2\")           doc.page_content = content.text              return docs  habr_docs = clean_content(html)  habr_docs[0]<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ea1\/37f\/166\/ea137f166d7137f85045450acd1f3c40.png\" width=\"2106\" height=\"880\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ea1\/37f\/166\/ea137f166d7137f85045450acd1f3c40.png\"\/><\/figure>\n<p>\u0412 \u043f\u0440\u043e\u0448\u043b\u044b\u0439 \u0440\u0430\u0437, \u0431\u044b\u043b\u043e \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d79\/cfb\/aa3\/d79cfbaa30501ecff0ee7e9f390de811.png\" width=\"2070\" height=\"660\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d79\/cfb\/aa3\/d79cfbaa30501ecff0ee7e9f390de811.png\"\/><\/figure>\n<p>\u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u0438\u0439 \u044f\u0437\u044b\u043a \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0437\u0430\u043b\u0435\u0437\u0430\u0442\u044c \u0432 \u043a\u043e\u0434 \u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u0440\u043e\u043c\u043f\u0442\u044b \u0432\u0440\u0443\u0447\u043d\u0443\u044e. \u0412 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f <strong>\u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u044f<\/strong> \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 \u044f\u0437\u044b\u043a (\u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u0441\u0435 \u0442\u043e\u0439 \u0436\u0435 LLM). \u041e\u0434\u043d\u0430\u043a\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432, \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0441\u0430\u043c\u0438 \u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u043a\u0438.<\/p>\n<pre><code class=\"python\">from ragas.testset import TestsetGenerator   from ragas.testset.evolutions import simple, reasoning, multi_context  # \u0437\u0430\u0434\u0430\u0435\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u043e \u0442\u0438\u043f\u0430\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 distributions = {       simple: 0.6,       multi_context: 0.2,       reasoning: 0.2   }  # \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0438 \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u0443\u0435\u043c testsetgenerator = TestsetGenerator.with_openai(       generator_llm='gpt-4-0125-preview',       critic_llm='gpt-4-0125-preview',       chunk_size=700   ).adapt(language='russian', evolutions=distributions)  # \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u0443\u0435\u043c testsetgenerator.adapt(language='russian', evolutions=distributions)  # \u0432 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 testset \u0441\u0440\u0430\u0437\u0443 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 ground_truth testset = testsetgenerator.generate_with_langchain_docs(habr_docs, 150, distributions, raise_exceptions=False)  testset_pd = testset.to_pandas()  testset_pd.sample(10)<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/674\/e4b\/eb0\/674e4beb0d533381bbd25d3f5ad20022.png\" width=\"2720\" height=\"710\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/674\/e4b\/eb0\/674e4beb0d533381bbd25d3f5ad20022.png\"\/><\/figure>\n<p>\u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0435 \u0432\u0441\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0438\u043c\u0435\u044e\u0442 <code>ground_truth<\/code>, \u0442\u0443\u0442 \u043a\u0430\u043a \u0440\u0430\u0437 \u043f\u0440\u0438\u0447\u0438\u043d\u0430 \u0432 \u0441\u043b\u0435\u0433\u043a\u0430 \u043a\u043e\u0440\u044f\u0432\u044b\u0445 \u043f\u0440\u043e\u043c\u043f\u0442\u0430\u0445. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043c\u044b \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u043c \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0435\u0449\u0435 \u0440\u0430\u0437 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<pre><code class=\"python\">llm = ChatOpenAI(model_name='gpt-3.5-turbo-1106')  def evaluate_ragas(ragas_dataset):     result = evaluate(       ragas_dataset,       metrics=[           context_precision,           context_recall,           faithfulness,           answer_relevancy,       ],  )         return result  def create_data_for_ragas(qa_chain, eval_dataset):     rag_dataset = []     for row in tqdm(eval_dataset):       answer = qa_chain({'query' : row['question']})            rag_dataset.append(           {\"question\" : row['question'],            \"answer\" : answer['result'],            \"contexts\" : [context.page_content for context in answer['source_documents']],            \"ground_truths\" : [row['ground_truth']]            }    )  rag_df = pd.DataFrame(rag_dataset)     rag_eval_dataset = Dataset.from_pandas(rag_df)       return rag_eval_dataset    qa_chain_base = RetrievalQA.from_chain_type(       llm,       retriever=vectorstore.as_retriever(search_kwargs={\"k\": 5}),       return_source_documents=True   )  qa_ragas_baseline = create_data_for_ragas(qa_chain_base, eval_dataset) baseline_result = evaluate_ragas(qa_ragas_baseline)  qa_chain_short = RetrievalQA.from_chain_type(       llm,       retriever=vectorstore.as_retriever(search_kwargs={'k': 3}),       return_source_documents=True   )  qa_ragas_short = create_data_for_ragas(qa_chain_short, eval_dataset) short_retrieval_result = evaluate_ragas(qa_ragas_short)  print(f'baseline:{baseline_result}')   print(f'short_retrieval: {short_retrieval_result}')<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9f8\/b2c\/e20\/9f8b2ce203740c1b2c9225f2e565d36e.png\" width=\"2066\" height=\"140\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9f8\/b2c\/e20\/9f8b2ce203740c1b2c9225f2e565d36e.png\"\/><\/figure>\n<h3>\u0410 \u0447\u0442\u043e GigaChat?<\/h3>\n<p>Langchain \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u043f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/python.langchain.com\/docs\/integrations\/llms\/\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a> \u0412 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u043e\u0442\u0435\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0444\u0438\u043b\u0438\u0430\u043b\u0430 \u0441\u043a\u0430\u0439\u043d\u0435\u0442\u0430 (YandexGPT \u0438 GigaChat). \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0433\u0438\u0433\u0430\u0447\u0430\u0442 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u0440\u044f\u0441\u0442\u0438 \u0431\u0443\u0431\u043d\u043e\u043c:<\/p>\n<ol>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u043d\u0430 <a href=\"https:\/\/developers.sber.ru\/studio\/login\" rel=\"noopener noreferrer nofollow\">\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435<\/a><\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/developers.sber.ru\/docs\/ru\/gigachat\/getting-started\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u043e\u0435\u043a\u0442<\/a><\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c <a href=\"https:\/\/developers.sber.ru\/docs\/ru\/gigachat\/api\/reference\/rest\/post-token\" rel=\"noopener noreferrer nofollow\">\u0442\u043e\u043a\u0435\u043d<\/a><\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a7f\/ce4\/f37\/a7fce4f37a9073a0c902b01e67e622c1.png\" width=\"3816\" height=\"1832\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a7f\/ce4\/f37\/a7fce4f37a9073a0c902b01e67e622c1.png\"\/><\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0430\u043c\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0433\u0438\u0433\u0430\u0447\u0430\u0442\u0430.<\/p>\n<pre><code>pip install --upgrade --quiet  gigachat <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u044f \u043c\u043e\u0449\u044c \u0432 \u043d\u0430\u0448\u0438\u0445 \u0440\u0443\u043a\u0430\u0445.<\/p>\n<pre><code class=\"python\">from langchain_community.chat_models import GigaChat from langchain.schema import HumanMessage, SystemMessage    chat = GigaChat(verify_ssl_certs=False) chat.access_token = '' # \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0432\u0430\u0448 \u0442\u043e\u043a\u0435\u043d  messages = [       SystemMessage(           content='You are a helpful AI that shares everything you know. Talk in Russian.'       ),       HumanMessage(content='\u0427\u0442\u043e \u0434\u0443\u043c\u0430\u0435\u0448\u044c \u043e\u0431 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e \u0422\u0430\u043a\u0435\u0440\u0430 \u041a\u0430\u0440\u043b\u0441\u043e\u043d\u0430?'),   ]      print(chat(messages).content)<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3f2\/133\/4b6\/3f21334b66b15b1de856a72859a75716.png\" width=\"2572\" height=\"476\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3f2\/133\/4b6\/3f21334b66b15b1de856a72859a75716.png\"\/><\/figure>\n<p>\u041d\u0443 \u0438 \u0437\u0430\u043c\u0435\u0440\u044f\u0435\u043c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e:<\/p>\n<pre><code class=\"python\">qa_chain_giga = RetrievalQA.from_chain_type(       chat,       retriever=vectorstore.as_retriever(search_kwargs={\"k\": 5}),       return_source_documents=True   )      qa_ragas_giga = create_data_for_ragas(qa_chain_giga, eval_dataset)   giga_retrieval_result = evaluate_ragas(qa_ragas_giga)  print(f'baseline: {baseline_result}')   print(f'short_retrieval: {short_retrieval_result}') print(f'giga_chat: {giga_retrieval_result}')<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b6b\/7c7\/ff6\/b6b7c7ff68e13749dbd48f86e9d16f13.png\" width=\"2068\" height=\"178\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b6b\/7c7\/ff6\/b6b7c7ff68e13749dbd48f86e9d16f13.png\"\/><\/figure>\n<p>\u0414\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043d\u0435\u043f\u043b\u043e\u0445\u043e, \u043e\u0442\u0432\u0435\u0442\u044b \u0433\u0438\u0433\u0430\u0447\u0430\u0442\u0430 \u0434\u0430\u0436\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043b\u0443\u0447\u0448\u0435 gpt-3.5. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0442\u0432\u0435\u0442\u0430 \u0441\u0431\u0435\u0440\u043e\u0432\u0441\u043a\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<pre><code class=\"python\">print(giga_retrieval_result.iloc[13,:].question) print(giga_retrieval_result.iloc[13,:].answer) print(giga_retrieval_result.iloc[13,:].ground_truth)<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e9f\/dc8\/511\/e9fdc85111b007c8cb3b15ba1e89c779.png\" width=\"2518\" height=\"102\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e9f\/dc8\/511\/e9fdc85111b007c8cb3b15ba1e89c779.png\"\/><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e08\/b1d\/3de\/e08b1d3defbe1137e5a61816e4fd71ad.png\" width=\"2610\" height=\"128\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e08\/b1d\/3de\/e08b1d3defbe1137e5a61816e4fd71ad.png\"\/><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5c9\/e52\/5d3\/5c9e525d3438fcfeefa4e21655ed1885.png\" width=\"2544\" height=\"138\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5c9\/e52\/5d3\/5c9e525d3438fcfeefa4e21655ed1885.png\"\/><\/figure>\n<p>\u041c\u044b \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u0440\u0438\u043a\u0438, \u043d\u043e \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u043d\u0438 \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u044b. \u041c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0430\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0432\u0435\u0437\u043b\u043e \u0438 \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0435 \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e &#171;\u0445\u043e\u0440\u043e\u0448\u0438\u0435&#187; \u0432\u043e\u043f\u0440\u043e\u0441\u044b? \u042f \u0440\u0435\u0448\u0438\u043b \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0441\u0435\u0442 \u0438 \u0437\u0430\u043c\u0435\u0440\u0438\u0442\u044c \u043d\u0430 \u043d\u0435\u043c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e, \u0446\u0438\u0444\u0440\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f1a\/cd3\/eab\/f1acd3eab48b70cba56c5741788512af.png\" width=\"2064\" height=\"266\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f1a\/cd3\/eab\/f1acd3eab48b70cba56c5741788512af.png\"\/><\/figure>\n<p>\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u0438\u0435, \u043d\u043e, \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0440\u0430\u0434\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u044b\u0432\u0430 \u043d\u0435\u0442. \u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u0441\u0435 \u043d\u0430\u0448\u0438 \u043f\u0440\u0430\u0432\u043a\u0438 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u043d\u0443\u0436\u043d\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u0438 \u0442\u043e\u0439 \u0436\u0435 \u0432\u044b\u0431\u043e\u0440\u043a\u0435.<\/p>\n<h3>\u0415\u0441\u043b\u0438 \u043d\u0435 RAGAS, \u0442\u043e \u0447\u0442\u043e?<\/h3>\n<h4>TruLens<\/h4>\n<p>\u0425\u043e\u0440\u043e\u0448\u043e, \u043c\u044b \u0443\u0431\u0435\u0434\u0438\u043b\u0438\u0441\u044c, \u0447\u0442\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0447\u0430\u0442-\u0431\u043e\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0442\u044c \u0432\u043f\u043e\u043b\u043d\u0435 \u043d\u0430\u0443\u0447\u043d\u043e, \u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0435\u0441\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e RAGAS. \u0425\u043e\u0440\u043e\u0448\u0430\u044f \u0438\u0434\u0435\u044f \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0441\u0432\u043e\u0435 \u0432\u043e\u043f\u043b\u043e\u0449\u0435\u043d\u0438\u0435 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0430\u0445, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 <a href=\"https:\/\/www.trulens.org\/\" rel=\"noopener noreferrer nofollow\">TruLens<\/a> .<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5d0\/ee5\/9d3\/5d0ee59d34afe668326e1704e9679866.png\" width=\"2464\" height=\"1132\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5d0\/ee5\/9d3\/5d0ee59d34afe668326e1704e9679866.png\"\/><\/figure>\n<p>\u041c\u0435\u0442\u0440\u0438\u043a\u0438 \u043f\u043e\u0445\u043e\u0436\u0438\u0435: <code>answer relevance<\/code>, <code>context relevance<\/code>, <code>groundedness<\/code> &#8212; \u0438 \u043e\u043d\u0438 \u0442\u0430\u043a\u0436\u0435 \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u044e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0430\u0441\u043f\u0435\u043a\u0442\u044b RAG. \u0412 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0442\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0431\u043e\u0440\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/575\/31a\/de9\/57531ade95fbf8788f35ac94f5b71c7b.png\" width=\"1108\" height=\"864\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/575\/31a\/de9\/57531ade95fbf8788f35ac94f5b71c7b.png\"\/><\/figure>\n<h4>ARES<\/h4>\n<p>\u0412 \u043a\u043e\u043d\u0446\u0435 2023 \u0432\u044b\u0448\u043b\u0430 <a href=\"https:\/\/arxiv.org\/pdf\/2311.09476.pdf\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u044f<\/a>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u044b\u043b\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u044f, \u0443\u043b\u0443\u0447\u0448\u0430\u044e\u0449\u0430\u044f \u043f\u043e\u0434\u0445\u043e\u0434 RAGAS &#8212; ARES (An Automated Evaluation Framework for Retrieval-Augmented Generation Systems).<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/743\/e91\/008\/743e9100818418441bad6f40de50d8b5.png\" width=\"1318\" height=\"434\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/743\/e91\/008\/743e9100818418441bad6f40de50d8b5.png\"\/><\/figure>\n<p>\u0414\u043b\u044f ARES \u043d\u0443\u0436\u043d\u043e \u0442\u0440\u0438 \u0442\u0438\u043f\u0430 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445: \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u0438\u0437 \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u043a\u043e\u0440\u043f\u0443\u0441\u0430, \u043d\u0430\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u0439 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 \u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043e\u0442\u0432\u0435\u0442\u043e\u0432. ARES \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043b\u0435\u0433\u043a\u0438\u0435 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 FLAN-T5 XXL), \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043d\u0430 \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0438 \u043f\u0440\u0435\u0434\u0438\u043a\u0442\u0438\u0432\u043d\u043e-\u0443\u0441\u0438\u043b\u0435\u043d\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434(<a href=\"https:\/\/arxiv.org\/abs\/2311.01453\" rel=\"noopener noreferrer nofollow\">PPI<\/a>) \u0434\u043b\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u043c\u0435\u0442\u0440\u0438\u043a: <code>context relevance<\/code>,<code>answer faithfulness<\/code>, <code>answer relevance<\/code>.<\/p>\n<p>\u041f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043b\u0443\u0447\u0448\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b, \u0447\u0435\u043c \u0442\u043e\u0442 \u0436\u0435 RAGAS:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/62b\/096\/a30\/62b096a300af32e1586c9b91d50afadb.png\" width=\"1428\" height=\"1014\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/62b\/096\/a30\/62b096a300af32e1586c9b91d50afadb.png\"\/><\/figure>\n<p>\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442 \u0443\u0432\u0430\u0436\u0435\u043d\u0438\u0435, \u043d\u043e \u0441\u0430\u043c \u043f\u043e\u0434\u0445\u043e\u0434 \u044f \u043f\u043e\u043a\u0430 \u043d\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b.<\/p>\n<h3>\u0412\u044b\u0432\u043e\u0434\u044b<\/h3>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u0430\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u044f \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0435\u0440\u0435\u0431\u0440\u044f\u043d\u043e\u0439 \u043f\u0443\u043b\u0435\u0439, \u0438, \u0431\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e, \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d\u0430 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0435\u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0439, \u0430, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0434\u0430\u0436\u0435 \u0432\u0440\u0435\u0434\u043d\u043e\u0439.<br \/>\u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0434\u043b\u044f \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0432 QA-\u0441\u0438\u0442\u0435\u043c\u0430\u0445, \u043e\u043d\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u043d\u0430. \u0421\u0430\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a RAGAS \u0435\u0449\u0435 \u043f\u043e\u043a\u0430 \u0441\u044b\u0440\u043e\u0432\u0430\u0442, \u043d\u043e \u0441 \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u043e\u0439 \u043a\u0440\u0438\u0432\u0438\u0437\u043d\u043e\u0439 \u0440\u0443\u043a \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0438 \u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u0442\u044c \u043a \u0432\u0430\u0448\u0435\u043c\u0443 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0443 \u0447\u0430\u0442-\u0431\u043e\u0442\u0430. \u0421\u0430\u043c \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0442\u0435\u0441\u0442\u0441\u0435\u0442 \u043d\u0443\u0436\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u043a\u0430 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u044b\u0432\u0430\u0435\u0442 \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u043e\u0439, \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432 \u043d\u0435\u0433\u043e \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438 \u0436\u0438\u0432\u0443\u044e \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443. \u041a\u043b\u044e\u0447\u0435\u0432\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 &#8212; \u044d\u0442\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0441\u0431\u043e\u0440\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043f\u043e \u0441\u0443\u0442\u0438 \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u043c\u0435\u0442\u0440\u0438\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0432 TruLens \u044d\u0442\u043e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0443\u0436\u0435 \u0437\u0430\u0448\u0438\u0442, \u0432 RAGAS \u0435\u0433\u043e \u043f\u043e\u043a\u0430 \u043d\u0435\u0442. \u0411\u0443\u0434\u0435\u0442 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u043d\u043e\u0432\u044b\u043c\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438.<\/p>\n<p>\u041f\u0438\u0448\u0443 \u043f\u0440\u043e AI \u0438 NLP \u0432\u00a0<a href=\"https:\/\/t.me\/nlp_daily\" rel=\"noopener noreferrer nofollow\">\u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c<\/a>.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/794022\/\"> https:\/\/habr.com\/ru\/articles\/794022\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 <a href=\"https:\/\/habr.com\/ru\/articles\/787940\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a> \u043c\u044b \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u043b\u0438\u0441\u044c \u0441 \u0442\u0435\u043c, \u043a\u0430\u043a RAGAS \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0440\u0435\u0442\u0440\u0438\u0432\u0435\u0440\u043e\u0432 \u0432 RAG-\u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445. \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044f \u043d\u0430\u0448\u0435 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0432\u0430\u0436\u043d\u044b\u0439 \u0430\u0441\u043f\u0435\u043a\u0442 &#8212; \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u0438\u043b\u0438 LLM. \u042d\u0442\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438\u0433\u0440\u0430\u044e\u0442 \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u0443\u044e \u0440\u043e\u043b\u044c \u0432 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0442\u0435\u0445 \u043e\u0442\u0432\u0435\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u043f\u0440\u0438 \u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u0441 \u0447\u0430\u0442-\u0431\u043e\u0442\u0430\u043c\u0438. \u041f\u043e\u043d\u044f\u0442\u044c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b \u043e\u043d\u0438 \u0432 \u0441\u0432\u043e\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0435, \u043a\u0440\u0430\u0439\u043d\u0435 \u0432\u0430\u0436\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u0442 \u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u044b \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439.<\/p>\n<p>\u041e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u0432 \u043e\u0446\u0435\u043d\u043a\u0435 LLM \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u0430\u043d\u0430\u043b\u0438\u0437 &#171;\u0433\u0430\u043b\u043b\u044e\u0446\u0438\u043d\u0430\u0446\u0438\u0439&#187; &#8212; \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0439, \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435, \u043d\u043e \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0435 \u043e\u0442\u0432\u0435\u0442\u044b. \u042d\u0442\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430 \u0432 \u0441\u0432\u0435\u0442\u0435 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0434\u0430\u0436\u0435 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 LLM \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u0440\u043e\u0436\u0434\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u044b\u0435 \u0438\u043b\u0438 \u0432\u0432\u043e\u0434\u044f\u0449\u0438\u0435 \u0432 \u0437\u0430\u0431\u043b\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u041a\u0430\u043a \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0434\u0435\u0436\u043d\u044b \u0438 \u0442\u043e\u0447\u043d\u044b \u043e\u0442\u0432\u0435\u0442\u044b, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u044c\u044e?<\/p>\n<p>\u042f \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b, \u0447\u0442\u043e \u0432 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435 \u043f\u043e \u0441\u0443\u0442\u0438 \u0434\u0432\u0430 \u043d\u0430\u0431\u043e\u0440\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 &#8212; \u043e\u0434\u0438\u043d \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0435\u0442\u0440\u0438\u0432\u0435\u0440\u0430, \u0434\u0440\u0443\u0433\u043e\u0439 \u0437\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438. \u041a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0437\u043c\u0435\u0440\u044f\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u0440\u0438\u043a <code>faithfulness<\/code> \u0438 <code>answer relevance<\/code>. \u041f\u043e\u0440\u0430 \u0441\u043d\u043e\u0432\u0430 \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442 \u0434\u0432\u0438\u0436\u043a\u0430 RAGAS.<\/p>\n<h3>Faithfulness<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0435\u0440\u0438\u0442\u044c \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u0442\u043e <code>faithfulness<\/code> \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u0442 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u0430, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e LLM, \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0443. \u0421\u0443\u0442\u044c \u044d\u0442\u043e\u0439 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435, \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u0432\u0441\u0435 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f, \u0441\u0434\u0435\u043b\u0430\u043d\u043d\u044b\u0435 \u0432 \u043e\u0442\u0432\u0435\u0442\u0435, \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0438\u0437 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430. \u041f\u043e\u043a\u0430 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u043e. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u0435\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f.<\/p>\n<figure class=\"full-width\"><\/figure>\n<ol>\n<li>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u0437 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0431\u043e\u0440 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0439. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u044f\u0437\u044b\u043a\u043e\u0432\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u043c\u043f\u0442 <code>LONG_FORM_ANSWER_PROMPT<\/code>. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442\u0435 \u0443 \u0431\u043e\u0442\u0430: &#171;\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0441\u043e\u043b\u043d\u0446\u0435?&#187; \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 \u043e\u0442\u0432\u0435\u0442: &#171;\u0421\u043e\u043b\u043d\u0446\u0435 &#8212; \u044d\u0442\u043e \u0437\u0432\u0435\u0437\u0434\u0430 \u0432 \u0446\u0435\u043d\u0442\u0440\u0435 \u0421\u043e\u043b\u043d\u0435\u0447\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u043a\u0440\u0443\u0433 \u0417\u0435\u043c\u043b\u0438, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044f \u0441\u0432\u0435\u0442 \u0438 \u0442\u0435\u043f\u043b\u043e.&#187;<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f LLM, \u044f \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u044e \u044d\u0442\u043e\u0442 \u043e\u0442\u0432\u0435\u0442 \u0432 \u0441\u0435\u0440\u0438\u044e \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0439:<\/p>\n<ol>\n<li>\n<p>\u0421\u043e\u043b\u043d\u0446\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0432\u0435\u0437\u0434\u043e\u0439.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u043b\u043d\u0446\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0446\u0435\u043d\u0442\u0440\u0435 \u0421\u043e\u043b\u043d\u0435\u0447\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u043b\u043d\u0446\u0435 \u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u043a\u0440\u0443\u0433 \u0417\u0435\u043c\u043b\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u043b\u043d\u0446\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0417\u0435\u043c\u043b\u044e \u0441\u0432\u0435\u0442\u043e\u043c \u0438 \u0442\u0435\u043f\u043b\u043e\u043c.<\/p>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0448\u0430\u0433\u0430, \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0438\u0445 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0441\u0442\u0438 \u0438\u043b\u0438 \u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u0430 \u0438 \u043e\u0442\u0432\u0435\u0442\u0430. \u042d\u0442\u043e\u0442 \u044d\u0442\u0430\u043f \u0442\u0430\u043a\u0436\u0435 \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u0442 \u044f\u0437\u044b\u043a\u043e\u0432\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u043e\u043c\u043f\u0442\u0430 <code>NLI_STATEMENTS_MESSAGE<\/code>. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0431\u044b\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c:<\/p>\n<p>&#171;\u0421\u043e\u043b\u043d\u0446\u0435 &#8212; \u044d\u0442\u043e \u0437\u0432\u0435\u0437\u0434\u0430, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0430\u044f\u0441\u044f \u0432 \u0446\u0435\u043d\u0442\u0440\u0435 \u0421\u043e\u043b\u043d\u0435\u0447\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u041e\u043d\u043e \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u043c\u0430\u0441\u0441\u044b \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u044d\u043d\u0435\u0440\u0433\u0438\u0438, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0449\u0435\u0439 \u0436\u0438\u0437\u043d\u044c \u043d\u0430 \u0417\u0435\u043c\u043b\u0435.&#187;<\/p>\n<ol>\n<li>\n<p>\u0421\u043e\u043b\u043d\u0446\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0432\u0435\u0437\u0434\u043e\u0439. <\/p>\n<ul>\n<li>\n<p><strong>\u041e\u0446\u0435\u043d\u043a\u0430<\/strong>: &#8216;1&#8217;. \u042d\u0442\u043e \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u0442\u043e\u0447\u043d\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0421\u043e\u043b\u043d\u0446\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0437\u0432\u0435\u0437\u0434\u0430.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0421\u043e\u043b\u043d\u0446\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0446\u0435\u043d\u0442\u0440\u0435 \u0421\u043e\u043b\u043d\u0435\u0447\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. <\/p>\n<ul>\n<li>\n<p><strong>\u041e\u0446\u0435\u043d\u043a\u0430<\/strong>: &#8216;1&#8217;. \u042d\u0442\u043e \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u0436\u0435 \u0432\u0435\u0440\u043d\u043e \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0443, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044f \u043d\u0430 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0421\u043e\u043b\u043d\u0446\u0430 \u0432 \u0421\u043e\u043b\u043d\u0435\u0447\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0421\u043e\u043b\u043d\u0446\u0435 \u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u043a\u0440\u0443\u0433 \u0417\u0435\u043c\u043b\u0438. <\/p>\n<ul>\n<li>\n<p><strong>\u041e\u0446\u0435\u043d\u043a\u0430<\/strong>: &#8216;0&#8217;. \u042d\u0442\u043e \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u043d\u0435\u0432\u0435\u0440\u043d\u043e \u0438 \u043d\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0443.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0421\u043e\u043b\u043d\u0446\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0417\u0435\u043c\u043b\u044e \u0441\u0432\u0435\u0442\u043e\u043c \u0438 \u0442\u0435\u043f\u043b\u043e\u043c. <\/p>\n<ul>\n<li>\n<p><strong>\u041e\u0446\u0435\u043d\u043a\u0430<\/strong>: &#8216;1&#8217;. \u042d\u0442\u043e \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u043d\u043e \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0421\u043e\u043b\u043d\u0446\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u044d\u043d\u0435\u0440\u0433\u0438\u0438.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u043c\u0435\u0442\u0440\u0438\u043a\u0443, \u043a\u0430\u043a \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u0434\u0438\u043a\u0442\u043e\u0432.<\/p>\n<p> \u0422\u0435\u043f\u0435\u0440\u044c \u044f \u0434\u0443\u043c\u0430\u044e \u0431\u043e\u043b\u0435\u0435 \u043c\u0435\u043d\u0435\u0435 \u044f\u0441\u043d\u043e, \u0447\u0442\u043e \u044d\u0442\u0430 \u043c\u0435\u0442\u0440\u0438\u043a\u0430 \u043a\u0430\u043a \u0440\u0430\u0437 \u0438 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043c\u0435\u0440\u0443 \u0433\u0430\u043b\u043b\u044e\u0446\u0438\u043d\u0430\u0446\u0438\u0439 \u0432 \u043e\u0442\u0432\u0435\u0442\u0430\u0445 \u043d\u0430\u0448\u0435\u0439 LLM. \u041c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u044d\u0442\u0430 \u043c\u0435\u0442\u0440\u0438\u043a\u0430 \u0434\u0443\u0431\u043b\u0438\u0440\u0443\u0435\u0442 <code>context_recall<\/code>. \u041d\u043e \u043e\u043d\u0438 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u043d\u044b\u0435. Recall \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0432\u044b \u0441\u043e\u0431\u0440\u0430\u043b\u0438, \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e ground truth, \u043d\u0435\u043a\u043e\u0435\u0433\u043e \u044d\u0442\u0430\u043b\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441. \u041d\u043e \u0434\u0430\u043b\u0435\u0435, \u0432\u0430\u0448\u0430 LLM \u043c\u043e\u0436\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u043f\u0435\u0440\u0435\u0432\u0440\u0430\u0442\u044c \u0434\u0430\u0436\u0435 \u044d\u0442\u043e\u0442 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u0432\u043e\u0442 \u0437\u0434\u0435\u0441\u044c \u043a\u0430\u043a \u0440\u0430\u0437 \u0438 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0441\u0446\u0435\u043d\u0443 <code>faithfulness<\/code>.<\/p>\n<\/li>\n<\/ol>\n<p>\u0425\u043e\u0440\u043e\u0448\u043e, \u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0438 \u044d\u0442\u043e\u0439 \u043c\u0435\u0442\u0440\u0438\u043a\u0438, \u0447\u0442\u043e\u0431\u044b \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438. \u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u044f\u0437\u044b\u043a\u043e\u0432\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0435 \u0433\u0430\u043b\u043b\u044e\u0446\u0438\u043d\u0438\u0440\u0443\u0435\u0442, \u043e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435\u043f\u043e\u043b\u043d\u044b\u0435 \u043e\u0442\u0432\u0435\u0442\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u043f\u0440\u043e \u043c\u0430\u0441\u0441\u0443 \u0438 \u0434\u0438\u0430\u043c\u0435\u0442\u0440 \u0421\u043e\u043b\u043d\u0446\u0430, \u043d\u043e \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0442\u0432\u0435\u0442\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e \u043c\u0430\u0441\u0441\u0443 (\u0438 \u0443\u043a\u0430\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435), \u0442\u0435 \u0437\u0434\u0435\u0441\u044c <code>faithfulness<\/code> \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0447\u043a\u0435, \u043d\u043e \u043f\u043e \u0444\u0430\u043a\u0442\u0443 \u043e\u0442\u0432\u0435\u0442 \u043d\u0435 \u0432\u043f\u043e\u043b\u043d\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439. \u0417\u043d\u0430\u0447\u0438\u0442, \u043f\u043e\u0440\u0430 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u0435\u0449\u0435 \u043e\u0434\u043d\u0443 \u043c\u0435\u0442\u0440\u0438\u043a\u0443 &#8212; <code>answer relevance<\/code><\/p>\n<h3>Answer relevancy<\/h3>\n<p>\u041c\u0435\u0442\u0440\u0438\u043a\u0430 \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u0442, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u0443, \u043f\u0440\u043e\u0432\u043e\u0434\u044f \u0430\u043d\u0430\u043b\u0438\u0437 \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0438\u0437 \u043e\u0442\u0432\u0435\u0442\u0430 \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0441 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c. \u0415\u0441\u043b\u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0442\u0435\u0441\u043d\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c, \u044d\u0442\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0432\u044b\u0441\u043e\u043a\u0443\u044e \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u0430.<\/p>\n<p>\u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043e\u0442\u0432\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u0442\u043e\u0447\u043d\u043e \u0430\u0434\u0440\u0435\u0441\u0443\u0435\u0442 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441, \u0442\u043e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0441\u0445\u043e\u0436\u0438 \u0438\u043b\u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u0443. \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u043e\u0432, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u044e, \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0441 &#171;\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c&#187; \u043e\u0442\u0432\u0435\u0442\u043e\u043c.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u0433\u043b\u044f\u043d\u0435\u043c \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439.<\/p>\n<ol>\n<li>\n<p>\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u043c\u0435\u0442\u0440\u0438\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u0440\u043e\u043c\u043f\u0442 <code>QUESTION_GEN<\/code>, \u0447\u0442\u043e\u0431\u044b \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0431\u044b\u0442\u044c \u0437\u0430\u0434\u0430\u043d\u044b \u043a \u044d\u0442\u043e\u043c\u0443 \u043e\u0442\u0432\u0435\u0442\u0443. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c <code>strictness<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0434\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u0433\u043e\u0441\u0442\u044c \u043e\u0446\u0435\u043d\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0442\u0435\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u043c\u0435\u0442\u0440\u0438\u043a\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u043a\u043e\u0441\u0438\u043d\u0443\u0441\u043d\u043e\u0435 \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u0430 \u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432. \u042d\u0442\u043e \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0431\u043b\u0438\u0437\u043a\u0438 \u043a \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c\u0443, \u043e\u0442\u0440\u0430\u0436\u0430\u044f \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0418\u0442\u043e\u0433\u043e\u0432\u0430\u044f \u043e\u0446\u0435\u043d\u043a\u0430 \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0441\u0438\u043d\u0443\u0441\u043d\u043e\u0433\u043e \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0430 \u043c\u0435\u0436\u0434\u0443 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c \u0438 \u0432\u0441\u0435\u043c\u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u043c\u0438, \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u043d\u043e\u0435 \u043d\u0430 \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043e\u0442\u0432\u0435\u0442 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u043a\u043b\u043e\u043d\u0447\u0438\u0432\u044b\u043c (committal).<\/p>\n<\/li>\n<\/ol>\n<p>\u0412 \u043f\u0440\u043e\u0448\u043b\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0438 \u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0440\u0435\u0442\u0440\u0438\u0432\u0435\u0440\u0430, \u043c\u044b \u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043d\u0430 \u0442\u0430\u043a\u0438\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438, \u043a\u0430\u043a \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0438 \u043f\u043e\u043b\u043d\u043e\u0442\u0430 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430. \u041d\u043e \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0435 \u043f\u0440\u043e\u043c\u043f\u0442\u044b \u0434\u043b\u044f \u0440\u0443\u0441\u0441\u043a\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0451 \u0435\u0434\u0438\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e.<\/p>\n<h3>\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0445\u043e\u0440\u043e\u0448\u0438\u0439 testset<\/h3>\n<p>\u041d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u043b\u0438 \u0441\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0445\u0430\u0431\u0440\u0430. \u0418 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0431\u044b\u043b \u0440\u0430\u0437\u0431\u0430\u0432\u043b\u0435\u043d \u043d\u0435\u043d\u0443\u0436\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u0440\u0442\u0438\u0442\u044c \u043d\u0430\u043c \u0436\u0438\u0437\u043d\u044c. \u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0432\u0441\u0451 \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0447\u0438\u0441\u0442\u0438\u043c \u044d\u0442\u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u043d\u0442.<\/p>\n<pre><code class=\"python\">from langchain_community.document_loaders import AsyncHtmlLoader from bs4 import BeautifulSoup # \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u0432 \u043b\u0430\u043d\u0433\u0447\u0435\u0439\u043d \u0443\u0440\u0435\u0437\u0430\u043d\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b BS  loader = AsyncHtmlLoader(       ['https:\/\/habr.com\/ru\/articles\/729664\/',        'https:\/\/habr.com\/ru\/articles\/733262\/',        'https:\/\/habr.com\/ru\/articles\/734146\/',        'https:\/\/habr.com\/ru\/articles\/735920\/'        ]   )  # \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0441\u044b\u0440\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 html = loader.load()  # \u043e\u0447\u0438\u0449\u0430\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u043d\u0442 def clean_content(docs):       for doc in docs:           soup = BeautifulSoup(doc.page_content, 'html.parser')           content = soup.find(\"div\", class_=\"article-formatted-body article-formatted-body article-formatted-body_version-2\")           doc.page_content = content.text              return docs  habr_docs = clean_content(html)  habr_docs[0]<\/code><\/pre>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412 \u043f\u0440\u043e\u0448\u043b\u044b\u0439 \u0440\u0430\u0437, \u0431\u044b\u043b\u043e \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u0438\u0439 \u044f\u0437\u044b\u043a \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0437\u0430\u043b\u0435\u0437\u0430\u0442\u044c \u0432 \u043a\u043e\u0434 \u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u0440\u043e\u043c\u043f\u0442\u044b \u0432\u0440\u0443\u0447\u043d\u0443\u044e. \u0412 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f <strong>\u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u044f<\/strong> \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 \u044f\u0437\u044b\u043a (\u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u0441\u0435 \u0442\u043e\u0439 \u0436\u0435 LLM). \u041e\u0434\u043d\u0430\u043a\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432, \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0441\u0430\u043c\u0438 \u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u043a\u0438.<\/p>\n<pre><code class=\"python\">from ragas.testset import TestsetGenerator   from ragas.testset.evolutions import simple, reasoning, multi_context  # \u0437\u0430\u0434\u0430\u0435\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u043e \u0442\u0438\u043f\u0430\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 distributions = {       simple: 0.6,       multi_context: 0.2,       reasoning: 0.2   }  # \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0438 \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u0443\u0435\u043c testsetgenerator = TestsetGenerator.with_openai(       generator_llm='gpt-4-0125-preview',       critic_llm='gpt-4-0125-preview',       chunk_size=700   ).adapt(language='russian', evolutions=distributions)  # \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u0443\u0435\u043c testsetgenerator.adapt(language='russian', evolutions=distributions)  # \u0432 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 testset \u0441\u0440\u0430\u0437\u0443 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 ground_truth testset = testsetgenerator.generate_with_langchain_docs(habr_docs, 150, distributions, raise_exceptions=False)  testset_pd = testset.to_pandas()  testset_pd.sample(10)<\/code><\/pre>\n<figure class=\"full-width\"><\/figure>\n<p>\u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0435 \u0432\u0441\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0438\u043c\u0435\u044e\u0442 <code>ground_truth<\/code>, \u0442\u0443\u0442 \u043a\u0430\u043a \u0440\u0430\u0437 \u043f\u0440\u0438\u0447\u0438\u043d\u0430 \u0432 \u0441\u043b\u0435\u0433\u043a\u0430 \u043a\u043e\u0440\u044f\u0432\u044b\u0445 \u043f\u0440\u043e\u043c\u043f\u0442\u0430\u0445. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043c\u044b \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u043c \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0435\u0449\u0435 \u0440\u0430\u0437 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<pre><code class=\"python\">llm = ChatOpenAI(model_name='gpt-3.5-turbo-1106')  def evaluate_ragas(ragas_dataset):     result = evaluate(       ragas_dataset,       metrics=[           context_precision,           context_recall,           faithfulness,           answer_relevancy,       ],  )         return result  def create_data_for_ragas(qa_chain, eval_dataset):     rag_dataset = []     for row in tqdm(eval_dataset):       answer = qa_chain({'query' : row['question']})            rag_dataset.append(           {\"question\" : row['question'],            \"answer\" : answer['result'],            \"contexts\" : [context.page_content for context in answer['source_documents']],            \"ground_truths\" : [row['ground_truth']]            }    )  rag_df = pd.DataFrame(rag_dataset)     rag_eval_dataset = Dataset.from_pandas(rag_df)       return rag_eval_dataset    qa_chain_base = RetrievalQA.from_chain_type(       llm,       retriever=vectorstore.as_retriever(search_kwargs={\"k\": 5}),       return_source_documents=True   )  qa_ragas_baseline = create_data_for_ragas(qa_chain_base, eval_dataset) baseline_result = evaluate_ragas(qa_ragas_baseline)  qa_chain_short = RetrievalQA.from_chain_type(       llm,       retriever=vectorstore.as_retriever(search_kwargs={'k': 3}),       return_source_documents=True   )  qa_ragas_short = create_data_for_ragas(qa_chain_short, eval_dataset) short_retrieval_result = evaluate_ragas(qa_ragas_short)  print(f'baseline:{baseline_result}')   print(f'short_retrieval: {short_retrieval_result}')<\/code><\/pre>\n<figure class=\"full-width\"><\/figure>\n<h3>\u0410 \u0447\u0442\u043e GigaChat?<\/h3>\n<p>Langchain \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u043f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/python.langchain.com\/docs\/integrations\/llms\/\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a> <\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-368325","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/368325","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=368325"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/368325\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=368325"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=368325"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=368325"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}