Measures how relevant the generated response was to the question specified.
Response relevance is the measure of how relevant the generated response is to the question asked. It is a measure of how well the response addresses the question asked and if it contains any additional information that is not relevant to the question asked.Columns required:
from uptrain import EvalLLM, EvalsOPENAI_API_KEY = "sk-********************" # Insert your OpenAI key heredata = [{ "question": "What are the benefits of regular exercise?", "response": "Regular exercise has well-documented health benefits. On a related note, the importance of routine health check-ups in preventive healthcare cannot be emphasized enough. It allows for early detection of potential health issues and facilitates proactive management for individuals."}]eval_llm = EvalLLM(openai_api_key=OPENAI_API_KEY)res = eval_llm.evaluate( data = data, checks = [Evals.RESPONSE_RELEVANCE])
By default, we are using GPT 3.5 Turbo for evaluations. If you want to use a different model, check out this tutorial.
Sample Response:
[ { "score_response_relevance": 0.0, "explanation_response_relevance": "The LLM response contains a lot of additional irrelevant information because it goes off on a tangent about routine health check-ups and preventive healthcare, which is not directly related to the benefits of regular exercise. This additional information distracts from the main topic and does not directly address the user query.\"\n\n \"The LLM response doesn't answer the user query at all because it completely ignores the specific benefits of regular exercise. Instead, it focuses on the importance of routine health check-ups in preventive healthcare. The user asked about the benefits of regular exercise, and the response fails to address this aspect, leading to potential dissatisfaction." }]
A higher response relevance score reflects that the generated response is relevant to the question asked.
The question asked was “The benefits of regular exercise”The response does not answer the question being asked and contains irrelevant information about the benefits of regular health check-ups.Resulting in a low response relevance score.
Tutorial
Open this tutorial in GitHub
Have Questions?
Join our community for any questions or requests
Was this page helpful?
{"docsConfig":{"$schema":"https://mintlify.com/docs.json","theme":"mint","name":"UpTrain","colors":{"primary":"#6D2992","light":"#C732FA","dark":"#9015E3"},"favicon":"/favicon.png","logo":{"light":"https://mintcdn.com/uptrain/Hto7tf5kKLk8zIKR/logo/light.png?fit=max\u0026auto=format\u0026n=Hto7tf5kKLk8zIKR\u0026q=85\u0026s=f96ebab976035aed978ef5ded3dbb069","dark":"https://mintcdn.com/uptrain/Hto7tf5kKLk8zIKR/logo/dark.png?fit=max\u0026auto=format\u0026n=Hto7tf5kKLk8zIKR\u0026q=85\u0026s=352da90db117bd7238cb9f245131cfc5"},"background":{"image":"https://mintlify.s3.us-west-1.amazonaws.com/uptrain/images/background.png","decoration":null,"color":{"light":null,"dark":"#121212"}},"navbar":{"primary":{"type":"github","href":"https://github.com/uptrain-ai/uptrain"}},"seo":{"indexing":"navigable"},"footer":{"socials":{"twitter":"https://twitter.com/UpTrainAI/","github":"https://github.com/uptrain-ai/uptrain/","linkedin":"https://www.linkedin.com/company/uptrain-ai/"}},"integrations":{"posthog":{"apiKey":"phc_xZJotYlN8qX9dI0AIeGYi6Yt2a0zTZaZ2igmYlHLTq6"}},"navigation":{"global":{"anchors":[{"anchor":"Changelog","href":"https://github.com/uptrain-ai/uptrain/releases","icon":"list"},{"anchor":"Blog","href":"https://blog.uptrain.ai/","icon":"newspaper"},{"anchor":"Contributing","href":"https://github.com/uptrain-ai/uptrain/blob/main/CONTRIBUTING.md","icon":"code"},{"anchor":"Community","href":"https://join.slack.com/t/uptraincommunity/shared_invite/zt-1yih3aojn-CEoR_gAh6PDSknhFmuaJeg","icon":"slack"},{"anchor":"Contact Us","href":"https://calendly.com/uptrain-sourabh/30min","icon":"phone"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"uptrain","hasAudioNarration":false,"actualSubdomain":"uptrain","customDomains":["docs.uptrain.ai"],"gitSource":{"type":"github","owner":"uptrain-ai","repo":"uptrain","deployBranch":"main","contentDirectory":"docs","isPrivate":false,"mountPath":"","label":""},"feedback":{"thumbs":true},"entitlements":{},"buildId":"6ae9147c39acb9aed2b43290:success","clientVersion":"0.0.4088","searchFilterCounts":[{"language":"default","tag":"Documentation","count":59},{"language":"default","tag":"Pre-configured Evaluations","count":26},{"language":"default","tag":"Integrations","count":12},{"language":"default","tag":"Getting Started","count":8},{"language":"default","tag":"Supported LLMs","count":7},{"language":"default","tag":"Framework","count":6},{"language":"default","tag":"LlamaIndex","count":6},{"language":"default","tag":"Context Awareness Evals","count":5},{"language":"default","tag":"Response Quality Evals","count":5},{"language":"default","tag":"Tutorials","count":5}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"predefined-evaluations/response-quality/response-relevance","slug":"/predefined-evaluations/response-quality/response-relevance","pageMetadata":{"title":"Response Relevance","description":"Measures how relevant the generated response was to the question specified.","href":"/predefined-evaluations/response-quality/response-relevance"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Measures how relevant the generated response was to the question specified.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,ul:`ul`,..._provideComponents(),...props.components},{Card,CardGroup,CodeBlock,Heading,Info,Note}=_components;if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Note)_missingMdxReference(`Note`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Response relevance is the measure of how relevant the generated response is to the question asked. It is a measure of how well the response addresses the question asked and if it contains any additional information that is not relevant to the question asked.`}),`\n`,_jsx(_components.p,{children:`Columns required:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`question`}),`: The question asked by the user`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`response`}),`: The response given by the model`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`how-to-use-it`,children:`How to use it?`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`15`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`15`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` uptrain `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` EvalLLM, Evals`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`OPENAI_API_KEY`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"sk-********************\"`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Insert your OpenAI key here`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`data `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"question\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"What are the benefits of regular exercise?\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"response\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Regular exercise has well-documented health benefits. On a related note, the importance of routine health check-ups in preventive healthcare cannot be emphasized enough. It allows for early detection of potential health issues and facilitates proactive management for individuals.\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}]`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`eval_llm `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` EvalLLM(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`openai_api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`OPENAI_API_KEY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`res `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` eval_llm.evaluate(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` data`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` data,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` checks`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [Evals.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`RESPONSE_RELEVANCE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),`\n`,_jsxs(Info,{children:[`By default, we are using GPT 3.5 Turbo for evaluations. If you want to use a different model, check out this `,_jsx(_components.a,{href:`https://github.com/uptrain-ai/uptrain/blob/main/examples/open_source_evaluator_tutorial.ipynb`,children:`tutorial`}),`.`]}),`\n`,_jsx(_components.p,{children:`Sample Response:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"score_response_relevance\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0.0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"explanation_response_relevance\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"The LLM response contains a lot of additional irrelevant information because it goes off on a tangent about routine health check-ups and preventive healthcare, which is not directly related to the benefits of regular exercise. This additional information distracts from the main topic and does not directly address the user query.`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"\\\\n\\\\n`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`The LLM response doesn't answer the user query at all because it completely ignores the specific benefits of regular exercise. Instead, it focuses on the importance of routine health check-ups in preventive healthcare. The user asked about the benefits of regular exercise, and the response fails to address this aspect, leading to potential dissatisfaction.\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`]})})}),`\n`,_jsx(Note,{children:`A higher response relevance score reflects that the generated response is relevant to the question asked.`}),`\n`,_jsx(_components.p,{children:`The question asked was “The benefits of regular exercise”`}),`\n`,_jsx(_components.p,{children:`The response does not answer the question being asked and contains irrelevant information about the benefits of regular health check-ups.`}),`\n`,_jsx(_components.p,{children:`Resulting in a low response relevance score.`}),`\n`,_jsxs(CardGroup,{cols:2,children:[_jsx(Card,{title:`Tutorial`,href:`https://github.com/uptrain-ai/uptrain/blob/main/examples/checks/response_quality/relevance.ipynb`,icon:`github`,color:`#808080`,children:_jsx(_components.p,{children:`Open this tutorial in GitHub`})}),_jsx(Card,{title:`Have Questions?`,href:`https://join.slack.com/t/uptraincommunity/shared_invite/zt-1yih3aojn-CEoR_gAh6PDSknhFmuaJeg`,icon:`slack`,color:`#808080`,children:_jsx(_components.p,{children:`Join our community for any questions or requests`})})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Response Relevance","description":"Measures how relevant the generated response was to the question specified.","href":"/predefined-evaluations/response-quality/response-relevance"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"How to use it?","slug":"how-to-use-it","depth":3,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"uptrain","siteName":"UpTrain","title":"Response Relevance - UpTrain","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-01-06T22:47:48.028Z","originalFileLocation":"predefined-evaluations/response-quality/response-relevance.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Measures how relevant the generated response was to the question specified.\">\u003cmeta data-mint-head name=\"application-name\" content=\"UpTrain\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/uptrain/3JvsXakXvBCLlzif/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/uptrain/3JvsXakXvBCLlzif/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/uptrain/3JvsXakXvBCLlzif/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/uptrain/3JvsXakXvBCLlzif/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/uptrain/3JvsXakXvBCLlzif/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/uptrain/3JvsXakXvBCLlzif/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/uptrain/3JvsXakXvBCLlzif/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/uptrain/3JvsXakXvBCLlzif/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/uptrain/3JvsXakXvBCLlzif/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Response Relevance - UpTrain\">\u003cmeta data-mint-head property=\"og:description\" content=\"Measures how relevant the generated response was to the question specified.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"UpTrain\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.uptrain.ai/predefined-evaluations/response-quality/response-relevance\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://uptrain.mintlify.site/_mintlify/api/og/v2?division=Response+Quality+Evals\u0026amp;title=Response+Relevance\u0026amp;description=Measures+how+relevant+the+generated+response+was+to+the+question+specified.\u0026amp;theme=c853b0cee4a61bf131536eca\u0026amp;signature=f675c8a4b074bb00f9c9f39f36bea340a6304f76fed5e8d007096e948d4fafdc\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Response Relevance - UpTrain\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Measures how relevant the generated response was to the question specified.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://uptrain.mintlify.site/_mintlify/api/og/v2?division=Response+Quality+Evals\u0026amp;title=Response+Relevance\u0026amp;description=Measures+how+relevant+the+generated+response+was+to+the+question+specified.\u0026amp;theme=c853b0cee4a61bf131536eca\u0026amp;signature=f675c8a4b074bb00f9c9f39f36bea340a6304f76fed5e8d007096e948d4fafdc\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/uptrain/3JvsXakXvBCLlzif/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"UpTrain\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#6D2992\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.uptrain.ai/predefined-evaluations/response-quality/response-relevance\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/predefined-evaluations/response-quality/response-relevance.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.uptrain.ai/#organization\",\"name\":\"UpTrain\",\"url\":\"https://docs.uptrain.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/uptrain/Hto7tf5kKLk8zIKR/logo/light.png?fit=max\u0026auto=format\u0026n=Hto7tf5kKLk8zIKR\u0026q=85\u0026s=f96ebab976035aed978ef5ded3dbb069\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.uptrain.ai#website\",\"name\":\"UpTrain\",\"url\":\"https://docs.uptrain.ai\",\"publisher\":{\"@id\":\"https://docs.uptrain.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.uptrain.ai/predefined-evaluations/response-quality/response-relevance#webpage\",\"url\":\"https://docs.uptrain.ai/predefined-evaluations/response-quality/response-relevance\",\"name\":\"Response Relevance\",\"description\":\"Measures how relevant the generated response was to the question specified.\",\"dateModified\":\"2026-01-06T22:47:48.028Z\",\"isPartOf\":{\"@id\":\"https://docs.uptrain.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.uptrain.ai/predefined-evaluations/response-quality/response-relevance#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.uptrain.ai/predefined-evaluations/response-quality/response-relevance#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Pre-configured Evaluations\",\"item\":\"https://docs.uptrain.ai/predefined-evaluations/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Response Quality Evals\",\"item\":\"https://docs.uptrain.ai/predefined-evaluations/response-quality/response-completeness\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Response Relevance\",\"item\":\"https://docs.uptrain.ai/predefined-evaluations/response-quality/response-relevance\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.uptrain.ai/predefined-evaluations/response-quality/response-relevance#article\",\"headline\":\"Response Relevance\",\"name\":\"Response Relevance\",\"description\":\"Measures how relevant the generated response was to the question specified.\",\"url\":\"https://docs.uptrain.ai/predefined-evaluations/response-quality/response-relevance\",\"mainEntityOfPage\":{\"@id\":\"https://docs.uptrain.ai/predefined-evaluations/response-quality/response-relevance#webpage\"},\"dateModified\":\"2026-01-06T22:47:48.028Z\",\"publisher\":{\"@id\":\"https://docs.uptrain.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.uptrain.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"UpTrain\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"UpTrain","nav":{"global":{"anchors":[{"anchor":"Changelog","href":"https://github.com/uptrain-ai/uptrain/releases","icon":"list"},{"anchor":"Blog","href":"https://blog.uptrain.ai/","icon":"newspaper"},{"anchor":"Contributing","href":"https://github.com/uptrain-ai/uptrain/blob/main/CONTRIBUTING.md","icon":"code"},{"anchor":"Community","href":"https://join.slack.com/t/uptraincommunity/shared_invite/zt-1yih3aojn-CEoR_gAh6PDSknhFmuaJeg","icon":"slack"},{"anchor":"Contact Us","href":"https://calendly.com/uptrain-sourabh/30min","icon":"phone"}]},"anchors":[{"anchor":"Documentation","icon":"book-open","groups":[{"group":"Getting Started","pages":[{"title":"Introduction","href":"/getting-started/introduction"},{"title":"Quickstart","href":"/getting-started/quickstart"},{"title":"Why we are building UpTrain","href":"/getting-started/why-we-are-building-uptrain"},{"title":"Why Open Source?","href":"/getting-started/why-open-source"},{"group":"Dashboard","pages":[{"title":"Getting Started","href":"/getting-started/dashboard/getting_started"},{"title":"Create a Project","href":"/getting-started/dashboard/project"},{"title":"Evaluations","href":"/getting-started/dashboard/evaluations"},{"title":"Experiments","href":"/getting-started/dashboard/experiments"}]}]},{"group":"Pre-configured Evaluations","pages":[{"title":"Overview","href":"/predefined-evaluations/overview"},{"group":"Ground Truth Comparison Evals","pages":[{"title":"Response Matching","href":"/predefined-evaluations/ground-truth-comparison/response-matching"}]},{"group":"Response Quality Evals","pages":[{"title":"Response Completeness","href":"/predefined-evaluations/response-quality/response-completeness"},{"title":"Response Conciseness","description":"Grades how concise the generated response is or if it has any additional irrelevant information for the question asked.","href":"/predefined-evaluations/response-quality/response-conciseness"},{"title":"Response Relevance","href":"/predefined-evaluations/response-quality/response-relevance"},{"title":"Response Validity","description":"Checks if the response generated is valid or not. A response is considered to be valid if it contains any information.","href":"/predefined-evaluations/response-quality/response-validity"},{"title":"Response Consistency","href":"/predefined-evaluations/response-quality/response-consistency"}]},{"group":"Context Awareness Evals","pages":[{"title":"Context Relevance","href":"/predefined-evaluations/context-awareness/context-relevance"},{"title":"Context Utilization","href":"/predefined-evaluations/context-awareness/context-utilization"},{"title":"Factual Accuracy","href":"/predefined-evaluations/context-awareness/factual-accuracy"},{"title":"Context Conciseness","href":"/predefined-evaluations/context-awareness/context-conciseness"},{"title":"Context Reranking","href":"/predefined-evaluations/context-awareness/context-reranking"}]},{"group":"Security Evals","pages":[{"title":"Jailbreak Detection","href":"/predefined-evaluations/safeguarding/jailbreak"},{"title":"Prompt Injection","href":"/predefined-evaluations/safeguarding/prompt-injection"}]},{"group":"Language Quality Evals","pages":[{"title":"Language Features","href":"/predefined-evaluations/language-quality/fluency-and-coherence"},{"title":"Tonality","href":"/predefined-evaluations/language-quality/tonality"}]},{"group":"Query Clarity Evals","pages":[{"title":"Sub-Query Completeness","href":"/predefined-evaluations/query-quality/sub-query-completeness"},{"title":"Multi-Query Accuracy","href":"/predefined-evaluations/query-quality/multi-query-accuracy"}]},{"group":"Code Related Evals","pages":[{"title":null,"href":"/predefined-evaluations/code-evals/code-hallucination"}]},{"group":"Conversation Evals","pages":[{"title":"User Satisfaction","href":"/predefined-evaluations/conversation-evals/user-satisfaction"},{"title":"Query Resolution","href":"/predefined-evaluations/conversation-evals/query-resolution"},{"title":"Guideline Adherence","href":"/predefined-evaluations/conversation-evals/guideline-adherence"},{"title":"Number of Turns","href":"/predefined-evaluations/conversation-evals/number-of-turns"}]},{"group":"Creating Custom Evals","pages":[{"title":"Custom Guideline","href":"/predefined-evaluations/custom-evals/custom-guideline"},{"title":"Custom Prompts","href":"/predefined-evaluations/custom-evals/custom-prompt-eval"},{"title":"Custom Python Evals","href":"/predefined-evaluations/custom-evals/custom-eval"}]}]},{"group":"Supported LLMs","pages":[{"title":"OpenAI","href":"/llms/openai"},{"title":"Azure","href":"/llms/azure"},{"title":"Claude","href":"/llms/claude"},{"title":"Mistral","href":"/llms/mistral"},{"title":"Together AI","href":"/llms/together_ai"},{"title":"Anyscale","href":"/llms/anyscale"},{"title":"Ollama","href":"/llms/ollama"}]},{"group":"Integrations","pages":[{"group":"Framework","pages":[{"group":"LlamaIndex","pages":[{"title":"LlamaIndex Overview","href":"/integrations/framework/llamaindex-methods/overview"},{"title":"EvalLlamaIndex","href":"/integrations/framework/llamaindex-methods/evalllamaindex"},{"group":"Callback Handler","pages":[{"title":"Overview","href":"/integrations/framework/llamaindex-methods/callback_handler/overview"},{"title":"RAG Query Engine Evaluations","href":"/integrations/framework/llamaindex-methods/callback_handler/rag_query"},{"title":"Sub-Question Query Generation Evaluation","href":"/integrations/framework/llamaindex-methods/callback_handler/subques_query"},{"title":"Re-Ranking Evaluations","href":"/integrations/framework/llamaindex-methods/callback_handler/reranking"}]}]}]},{"group":"Observation Tools","pages":[{"title":"Langfuse","href":"/integrations/observation-tools/langfuse"},{"title":"Helicone","href":"/integrations/observation-tools/helicone"},{"title":"Zeno","href":"/integrations/observation-tools/zeno"}]},{"group":"Vector Database","pages":[{"title":"ChromaDB","href":"/integrations/vector_db/chroma"},{"title":"Qdrant","href":"/integrations/vector_db/qdrant"},{"title":"FAISS","href":"/integrations/vector_db/faiss"}]}]},{"group":"Tutorials","pages":[{"title":"Open Source Evaluator","href":"/tutorials/open-source-evaluator"},{"title":"Uptrain API Client","href":"/tutorials/uptrain-api-client"},{"title":"Experiments Evaluation Demo","href":"/tutorials/experiments-evaluation-tutorial"},{"title":"OpenAI Evals","href":"/tutorials/openai-evals"},{"title":"Analyzing RAG Failure Cases","href":"/tutorials/analyzing-failure-cases"}]},{"group":"FAQ","pages":[{"title":"Frequently Asked Questions","sidebarTitle":"FAQ","href":"/faq/faq"}]}]}]},"basePath":"","title":"Response Relevance - UpTrain","buildId":"dpl_DTau1J5HqS9UTgVSDwGksstFWtPa","deploymentId":"dpl_DTau1J5HqS9UTgVSDwGksstFWtPa","dynamics":[],"chunks":[]}