Reference documentation and code samples for the Google Cloud Dialogflow V2 Client class TopNMetrics.
Evaluation metrics when retrieving n smart replies with the model.
Generated from protobuf message google.cloud.dialogflow.v2.SmartReplyMetrics.TopNMetrics
Namespace
Google \ Cloud \ Dialogflow \ V2 \ SmartReplyMetrics
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ n
int
Number of retrieved smart replies. For example, when n is 3, this evaluation contains metrics for when Dialogflow retrieves 3 smart replies with the model.
↳ recall
float
Defined as number of queries whose top n smart replies have at least one similar (token match similarity above the defined threshold) reply as the real reply divided by number of queries with at least one smart reply. Value ranges from 0.0 to 1.0 inclusive.
getN
Number of retrieved smart replies. For example, when n is 3, this
evaluation contains metrics for when Dialogflow retrieves 3 smart replies
with the model.
Returns
Type
Description
int
setN
Number of retrieved smart replies. For example, when n is 3, this
evaluation contains metrics for when Dialogflow retrieves 3 smart replies
with the model.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getRecall
Defined as number of queries whose top n smart replies have at least one
similar (token match similarity above the defined threshold) reply as the
real reply divided by number of queries with at least one smart reply.
Value ranges from 0.0 to 1.0 inclusive.
Returns
Type
Description
float
setRecall
Defined as number of queries whose top n smart replies have at least one
similar (token match similarity above the defined threshold) reply as the
real reply divided by number of queries with at least one smart reply.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Dialogflow V2 Client - Class TopNMetrics (2.1.2)\n\nVersion latestkeyboard_arrow_down\n\n- [2.1.2 (latest)](/php/docs/reference/cloud-dialogflow/latest/V2.SmartReplyMetrics.TopNMetrics)\n- [2.1.1](/php/docs/reference/cloud-dialogflow/2.1.1/V2.SmartReplyMetrics.TopNMetrics)\n- [2.0.1](/php/docs/reference/cloud-dialogflow/2.0.1/V2.SmartReplyMetrics.TopNMetrics)\n- [1.17.2](/php/docs/reference/cloud-dialogflow/1.17.2/V2.SmartReplyMetrics.TopNMetrics)\n- [1.16.0](/php/docs/reference/cloud-dialogflow/1.16.0/V2.SmartReplyMetrics.TopNMetrics)\n- [1.15.1](/php/docs/reference/cloud-dialogflow/1.15.1/V2.SmartReplyMetrics.TopNMetrics)\n- [1.14.0](/php/docs/reference/cloud-dialogflow/1.14.0/V2.SmartReplyMetrics.TopNMetrics)\n- [1.13.0](/php/docs/reference/cloud-dialogflow/1.13.0/V2.SmartReplyMetrics.TopNMetrics)\n- [1.12.3](/php/docs/reference/cloud-dialogflow/1.12.3/V2.SmartReplyMetrics.TopNMetrics)\n- [1.11.0](/php/docs/reference/cloud-dialogflow/1.11.0/V2.SmartReplyMetrics.TopNMetrics)\n- [1.10.2](/php/docs/reference/cloud-dialogflow/1.10.2/V2.SmartReplyMetrics.TopNMetrics)\n- [1.9.0](/php/docs/reference/cloud-dialogflow/1.9.0/V2.SmartReplyMetrics.TopNMetrics)\n- [1.8.0](/php/docs/reference/cloud-dialogflow/1.8.0/V2.SmartReplyMetrics.TopNMetrics)\n- [1.7.2](/php/docs/reference/cloud-dialogflow/1.7.2/V2.SmartReplyMetrics.TopNMetrics)\n- [1.6.0](/php/docs/reference/cloud-dialogflow/1.6.0/V2.SmartReplyMetrics.TopNMetrics)\n- [1.5.0](/php/docs/reference/cloud-dialogflow/1.5.0/V2.SmartReplyMetrics.TopNMetrics)\n- [1.4.0](/php/docs/reference/cloud-dialogflow/1.4.0/V2.SmartReplyMetrics.TopNMetrics)\n- [1.3.2](/php/docs/reference/cloud-dialogflow/1.3.2/V2.SmartReplyMetrics.TopNMetrics)\n- [1.2.0](/php/docs/reference/cloud-dialogflow/1.2.0/V2.SmartReplyMetrics.TopNMetrics)\n- [1.1.1](/php/docs/reference/cloud-dialogflow/1.1.1/V2.SmartReplyMetrics.TopNMetrics)\n- [1.0.1](/php/docs/reference/cloud-dialogflow/1.0.1/V2.SmartReplyMetrics.TopNMetrics) \nReference documentation and code samples for the Google Cloud Dialogflow V2 Client class TopNMetrics.\n\nEvaluation metrics when retrieving `n` smart replies with the model.\n\nGenerated from protobuf message `google.cloud.dialogflow.v2.SmartReplyMetrics.TopNMetrics`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Dialogflow \\\\ V2 \\\\ SmartReplyMetrics\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getN\n\nNumber of retrieved smart replies. For example, when `n` is 3, this\nevaluation contains metrics for when Dialogflow retrieves 3 smart replies\nwith the model.\n\n### setN\n\nNumber of retrieved smart replies. For example, when `n` is 3, this\nevaluation contains metrics for when Dialogflow retrieves 3 smart replies\nwith the model.\n\n### getRecall\n\nDefined as `number of queries whose top n smart replies have at least one\nsimilar (token match similarity above the defined threshold) reply as the\nreal reply` divided by `number of queries with at least one smart reply`.\n\nValue ranges from 0.0 to 1.0 inclusive.\n\n### setRecall\n\nDefined as `number of queries whose top n smart replies have at least one\nsimilar (token match similarity above the defined threshold) reply as the\nreal reply` divided by `number of queries with at least one smart reply`.\n\nValue ranges from 0.0 to 1.0 inclusive."]]