google-cloud-discovery_engine-v1beta 0.12.0 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google/cloud/discovery_engine/v1beta/completion_service/client.rb +219 -0
- data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/client.rb +205 -0
- data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/operations.rb +14 -0
- data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/service_stub.rb +136 -0
- data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/client.rb +19 -1
- data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/client.rb +19 -1
- data/lib/google/cloud/discovery_engine/v1beta/data_store_service/client.rb +10 -1
- data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/client.rb +10 -1
- data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/operations.rb +14 -0
- data/lib/google/cloud/discovery_engine/v1beta/document_service/client.rb +3 -1
- data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/client.rb +3 -1
- data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/operations.rb +14 -0
- data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/operations.rb +14 -0
- data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/client.rb +824 -0
- data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/operations.rb +809 -0
- data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/paths.rb +318 -0
- data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest/client.rb +770 -0
- data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest/operations.rb +1106 -0
- data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest/service_stub.rb +306 -0
- data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest.rb +54 -0
- data/lib/google/cloud/discovery_engine/v1beta/evaluation_service.rb +57 -0
- data/lib/google/cloud/discovery_engine/v1beta/project_service/rest/operations.rb +14 -0
- data/lib/google/cloud/discovery_engine/v1beta/rest.rb +3 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/client.rb +1035 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/operations.rb +809 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/paths.rb +73 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest/client.rb +967 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest/operations.rb +1106 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest/service_stub.rb +426 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest.rb +54 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_service.rb +57 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/client.rb +911 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/paths.rb +69 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/rest/client.rb +850 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/rest/service_stub.rb +366 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/rest.rb +53 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service.rb +56 -0
- data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/operations.rb +14 -0
- data/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb +60 -5
- data/lib/google/cloud/discovery_engine/v1beta/search_service/paths.rb +68 -0
- data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb +60 -5
- data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/operations.rb +14 -0
- data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest/operations.rb +14 -0
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/client.rb +139 -0
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/client.rb +132 -0
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/operations.rb +14 -0
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/service_stub.rb +75 -0
- data/lib/google/cloud/discovery_engine/v1beta/version.rb +1 -1
- data/lib/google/cloud/discovery_engine/v1beta.rb +3 -0
- data/lib/google/cloud/discoveryengine/v1beta/answer_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1beta/chunk_pb.rb +50 -0
- data/lib/google/cloud/discoveryengine/v1beta/common_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1beta/completion_pb.rb +2 -1
- data/lib/google/cloud/discoveryengine/v1beta/completion_service_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1beta/completion_service_services_pb.rb +8 -0
- data/lib/google/cloud/discoveryengine/v1beta/conversational_search_service_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1beta/custom_tuning_model_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1beta/data_store_pb.rb +2 -1
- data/lib/google/cloud/discoveryengine/v1beta/data_store_service_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1beta/document_processing_config_pb.rb +4 -1
- data/lib/google/cloud/discoveryengine/v1beta/evaluation_pb.rb +56 -0
- data/lib/google/cloud/discoveryengine/v1beta/evaluation_service_pb.rb +59 -0
- data/lib/google/cloud/discoveryengine/v1beta/evaluation_service_services_pb.rb +57 -0
- data/lib/google/cloud/discoveryengine/v1beta/import_config_pb.rb +12 -1
- data/lib/google/cloud/discoveryengine/v1beta/purge_config_pb.rb +7 -1
- data/lib/google/cloud/discoveryengine/v1beta/sample_query_pb.rb +49 -0
- data/lib/google/cloud/discoveryengine/v1beta/sample_query_service_pb.rb +59 -0
- data/lib/google/cloud/discoveryengine/v1beta/sample_query_service_services_pb.rb +63 -0
- data/lib/google/cloud/discoveryengine/v1beta/sample_query_set_pb.rb +47 -0
- data/lib/google/cloud/discoveryengine/v1beta/sample_query_set_service_pb.rb +57 -0
- data/lib/google/cloud/discoveryengine/v1beta/sample_query_set_service_services_pb.rb +59 -0
- data/lib/google/cloud/discoveryengine/v1beta/search_service_pb.rb +20 -1
- data/lib/google/cloud/discoveryengine/v1beta/user_event_service_pb.rb +2 -1
- data/lib/google/cloud/discoveryengine/v1beta/user_event_service_services_pb.rb +5 -0
- data/proto_docs/google/api/client.rb +14 -10
- data/proto_docs/google/api/resource.rb +7 -2
- data/proto_docs/google/cloud/discoveryengine/v1beta/answer.rb +14 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/chunk.rb +119 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/completion.rb +31 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/conversational_search_service.rb +38 -2
- data/proto_docs/google/cloud/discoveryengine/v1beta/custom_tuning_model.rb +16 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/data_store.rb +25 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/data_store_service.rb +10 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/document.rb +1 -1
- data/proto_docs/google/cloud/discoveryengine/v1beta/document_processing_config.rb +43 -2
- data/proto_docs/google/cloud/discoveryengine/v1beta/evaluation.rb +223 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/evaluation_service.rb +194 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/import_config.rb +199 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/purge_config.rb +119 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/sample_query.rb +82 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/sample_query_service.rb +179 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/sample_query_set.rb +57 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/sample_query_set_service.rb +186 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb +401 -8
- data/proto_docs/google/cloud/discoveryengine/v1beta/serving_config.rb +11 -5
- metadata +44 -2
@@ -32,6 +32,9 @@ module Google
|
|
32
32
|
# The full resource name of the Document Processing Config.
|
33
33
|
# Format:
|
34
34
|
# `projects/*/locations/*/collections/*/dataStores/*/documentProcessingConfig`.
|
35
|
+
# @!attribute [rw] chunking_config
|
36
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig::ChunkingConfig]
|
37
|
+
# Whether chunking mode is enabled.
|
35
38
|
# @!attribute [rw] default_parsing_config
|
36
39
|
# @return [::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig::ParsingConfig]
|
37
40
|
# Configurations for default Document parser.
|
@@ -46,13 +49,42 @@ module Google
|
|
46
49
|
# * `pdf`: Override parsing config for PDF files, either digital parsing, ocr
|
47
50
|
# parsing or layout parsing is supported.
|
48
51
|
# * `html`: Override parsing config for HTML files, only digital parsing and
|
49
|
-
#
|
52
|
+
# layout parsing are supported.
|
50
53
|
# * `docx`: Override parsing config for DOCX files, only digital parsing and
|
51
|
-
#
|
54
|
+
# layout parsing are supported.
|
55
|
+
# * `pptx`: Override parsing config for PPTX files, only digital parsing and
|
56
|
+
# layout parsing are supported.
|
52
57
|
class DocumentProcessingConfig
|
53
58
|
include ::Google::Protobuf::MessageExts
|
54
59
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
55
60
|
|
61
|
+
# Configuration for chunking config.
|
62
|
+
# @!attribute [rw] layout_based_chunking_config
|
63
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig::ChunkingConfig::LayoutBasedChunkingConfig]
|
64
|
+
# Configuration for the layout based chunking.
|
65
|
+
class ChunkingConfig
|
66
|
+
include ::Google::Protobuf::MessageExts
|
67
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
68
|
+
|
69
|
+
# Configuration for the layout based chunking.
|
70
|
+
# @!attribute [rw] chunk_size
|
71
|
+
# @return [::Integer]
|
72
|
+
# The token size limit for each chunk.
|
73
|
+
#
|
74
|
+
# Supported values: 100-500 (inclusive).
|
75
|
+
# Default value: 500.
|
76
|
+
# @!attribute [rw] include_ancestor_headings
|
77
|
+
# @return [::Boolean]
|
78
|
+
# Whether to include appending different levels of headings to chunks
|
79
|
+
# from the middle of the document to prevent context loss.
|
80
|
+
#
|
81
|
+
# Default value: False.
|
82
|
+
class LayoutBasedChunkingConfig
|
83
|
+
include ::Google::Protobuf::MessageExts
|
84
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
56
88
|
# Related configurations applied to a specific type of document parser.
|
57
89
|
# @!attribute [rw] digital_parsing_config
|
58
90
|
# @return [::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig::ParsingConfig::DigitalParsingConfig]
|
@@ -61,6 +93,9 @@ module Google
|
|
61
93
|
# @return [::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig::ParsingConfig::OcrParsingConfig]
|
62
94
|
# Configurations applied to OCR parser. Currently it only applies to
|
63
95
|
# PDFs.
|
96
|
+
# @!attribute [rw] layout_parsing_config
|
97
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig::ParsingConfig::LayoutParsingConfig]
|
98
|
+
# Configurations applied to layout parser.
|
64
99
|
class ParsingConfig
|
65
100
|
include ::Google::Protobuf::MessageExts
|
66
101
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -85,6 +120,12 @@ module Google
|
|
85
120
|
include ::Google::Protobuf::MessageExts
|
86
121
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
87
122
|
end
|
123
|
+
|
124
|
+
# The layout parsing configurations for documents.
|
125
|
+
class LayoutParsingConfig
|
126
|
+
include ::Google::Protobuf::MessageExts
|
127
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
128
|
+
end
|
88
129
|
end
|
89
130
|
|
90
131
|
# @!attribute [rw] key
|
@@ -0,0 +1,223 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2024 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Cloud
|
22
|
+
module DiscoveryEngine
|
23
|
+
module V1beta
|
24
|
+
# An evaluation is a single execution (or run) of an evaluation process. It
|
25
|
+
# encapsulates the state of the evaluation and the resulting data.
|
26
|
+
# @!attribute [rw] name
|
27
|
+
# @return [::String]
|
28
|
+
# Identifier. The full resource name of the
|
29
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::Evaluation Evaluation}, in the format
|
30
|
+
# of `projects/{project}/locations/{location}/evaluations/{evaluation}`.
|
31
|
+
#
|
32
|
+
# This field must be a UTF-8 encoded string with a length limit of 1024
|
33
|
+
# characters.
|
34
|
+
# @!attribute [rw] evaluation_spec
|
35
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1beta::Evaluation::EvaluationSpec]
|
36
|
+
# Required. The specification of the evaluation.
|
37
|
+
# @!attribute [r] quality_metrics
|
38
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1beta::QualityMetrics]
|
39
|
+
# Output only. The metrics produced by the evaluation, averaged across all
|
40
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery SampleQuery}s in the
|
41
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::SampleQuerySet SampleQuerySet}.
|
42
|
+
#
|
43
|
+
# Only populated when the evaluation's state is SUCCEEDED.
|
44
|
+
# @!attribute [r] state
|
45
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1beta::Evaluation::State]
|
46
|
+
# Output only. The state of the evaluation.
|
47
|
+
# @!attribute [r] error
|
48
|
+
# @return [::Google::Rpc::Status]
|
49
|
+
# Output only. The error that occurred during evaluation. Only populated when
|
50
|
+
# the evaluation's state is FAILED.
|
51
|
+
# @!attribute [r] create_time
|
52
|
+
# @return [::Google::Protobuf::Timestamp]
|
53
|
+
# Output only. Timestamp the
|
54
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::Evaluation Evaluation} was created
|
55
|
+
# at.
|
56
|
+
# @!attribute [r] end_time
|
57
|
+
# @return [::Google::Protobuf::Timestamp]
|
58
|
+
# Output only. Timestamp the
|
59
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::Evaluation Evaluation} was completed
|
60
|
+
# at.
|
61
|
+
# @!attribute [r] error_samples
|
62
|
+
# @return [::Array<::Google::Rpc::Status>]
|
63
|
+
# Output only. A sample of errors encountered while processing the request.
|
64
|
+
class Evaluation
|
65
|
+
include ::Google::Protobuf::MessageExts
|
66
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
67
|
+
|
68
|
+
# Describes the specification of the evaluation.
|
69
|
+
# @!attribute [rw] search_request
|
70
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest]
|
71
|
+
# Required. The search request that is used to perform the evaluation.
|
72
|
+
#
|
73
|
+
# Only the following fields within SearchRequest are supported; if any
|
74
|
+
# other fields are provided, an UNSUPPORTED error will be returned:
|
75
|
+
#
|
76
|
+
# * {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#serving_config SearchRequest.serving_config}
|
77
|
+
# * {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#branch SearchRequest.branch}
|
78
|
+
# * {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#canonical_filter SearchRequest.canonical_filter}
|
79
|
+
# * {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#query_expansion_spec SearchRequest.query_expansion_spec}
|
80
|
+
# * {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#spell_correction_spec SearchRequest.spell_correction_spec}
|
81
|
+
# * {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#content_search_spec SearchRequest.content_search_spec}
|
82
|
+
# * {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#user_pseudo_id SearchRequest.user_pseudo_id}
|
83
|
+
# @!attribute [rw] query_set_spec
|
84
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1beta::Evaluation::EvaluationSpec::QuerySetSpec]
|
85
|
+
# Required. The specification of the query set.
|
86
|
+
class EvaluationSpec
|
87
|
+
include ::Google::Protobuf::MessageExts
|
88
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
89
|
+
|
90
|
+
# Describes the specification of the query set.
|
91
|
+
# @!attribute [rw] sample_query_set
|
92
|
+
# @return [::String]
|
93
|
+
# Required. The full resource name of the
|
94
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::SampleQuerySet SampleQuerySet}
|
95
|
+
# used for the evaluation, in the format of
|
96
|
+
# `projects/{project}/locations/{location}/sampleQuerySets/{sampleQuerySet}`.
|
97
|
+
class QuerySetSpec
|
98
|
+
include ::Google::Protobuf::MessageExts
|
99
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
# Describes the state of an evaluation.
|
104
|
+
module State
|
105
|
+
# The evaluation is unspecified.
|
106
|
+
STATE_UNSPECIFIED = 0
|
107
|
+
|
108
|
+
# The service is preparing to run the evaluation.
|
109
|
+
PENDING = 1
|
110
|
+
|
111
|
+
# The evaluation is in progress.
|
112
|
+
RUNNING = 2
|
113
|
+
|
114
|
+
# The evaluation completed successfully.
|
115
|
+
SUCCEEDED = 3
|
116
|
+
|
117
|
+
# The evaluation failed.
|
118
|
+
FAILED = 4
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
# Describes the metrics produced by the evaluation.
|
123
|
+
# @!attribute [rw] doc_recall
|
124
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1beta::QualityMetrics::TopkMetrics]
|
125
|
+
# Recall per document, at various top-k cutoff levels.
|
126
|
+
#
|
127
|
+
# Recall is the fraction of relevant documents retrieved out of all
|
128
|
+
# relevant documents.
|
129
|
+
#
|
130
|
+
# Example (top-5):
|
131
|
+
# * For a single
|
132
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery SampleQuery}, If 3 out
|
133
|
+
# of 5 relevant documents are retrieved in the top-5, recall@5 = 3/5 = 0.6
|
134
|
+
# @!attribute [rw] doc_precision
|
135
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1beta::QualityMetrics::TopkMetrics]
|
136
|
+
# Precision per document, at various top-k cutoff levels.
|
137
|
+
#
|
138
|
+
# Precision is the fraction of retrieved documents that are relevant.
|
139
|
+
#
|
140
|
+
# Example (top-5):
|
141
|
+
# * For a single
|
142
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery SampleQuery}, If 4 out
|
143
|
+
# of 5 retrieved documents in the top-5 are relevant, precision@5 = 4/5 =
|
144
|
+
# 0.8
|
145
|
+
# @!attribute [rw] doc_ndcg
|
146
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1beta::QualityMetrics::TopkMetrics]
|
147
|
+
# Normalized discounted cumulative gain (NDCG) per document, at various top-k
|
148
|
+
# cutoff levels.
|
149
|
+
#
|
150
|
+
# NDCG measures the ranking quality, giving higher relevance to top
|
151
|
+
# results.
|
152
|
+
#
|
153
|
+
# Example (top-3):
|
154
|
+
# Suppose {::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery SampleQuery}
|
155
|
+
# with three retrieved documents (D1, D2, D3) and binary relevance
|
156
|
+
# judgements (1 for relevant, 0 for not relevant):
|
157
|
+
#
|
158
|
+
# Retrieved: [D3 (0), D1 (1), D2 (1)]
|
159
|
+
# Ideal: [D1 (1), D2 (1), D3 (0)]
|
160
|
+
#
|
161
|
+
# Calculate NDCG@3 for each
|
162
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery SampleQuery}:
|
163
|
+
# * DCG@3: 0/log2(1+1) + 1/log2(2+1) + 1/log2(3+1) = 1.13
|
164
|
+
# * Ideal DCG@3: 1/log2(1+1) + 1/log2(2+1) + 0/log2(3+1) = 1.63
|
165
|
+
# * NDCG@3: 1.13/1.63 = 0.693
|
166
|
+
# @!attribute [rw] page_recall
|
167
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1beta::QualityMetrics::TopkMetrics]
|
168
|
+
# Recall per page, at various top-k cutoff levels.
|
169
|
+
#
|
170
|
+
# Recall is the fraction of relevant pages retrieved out of all relevant
|
171
|
+
# pages.
|
172
|
+
#
|
173
|
+
# Example (top-5):
|
174
|
+
# * For a single
|
175
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery SampleQuery}, if 3 out
|
176
|
+
# of 5 relevant pages are retrieved in the top-5, recall@5 = 3/5 = 0.6
|
177
|
+
# @!attribute [rw] page_ndcg
|
178
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1beta::QualityMetrics::TopkMetrics]
|
179
|
+
# Normalized discounted cumulative gain (NDCG) per page, at various top-k
|
180
|
+
# cutoff levels.
|
181
|
+
#
|
182
|
+
# NDCG measures the ranking quality, giving higher relevance to top
|
183
|
+
# results.
|
184
|
+
#
|
185
|
+
# Example (top-3):
|
186
|
+
# Suppose {::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery SampleQuery}
|
187
|
+
# with three retrieved pages (P1, P2, P3) and binary relevance judgements (1
|
188
|
+
# for relevant, 0 for not relevant):
|
189
|
+
#
|
190
|
+
# Retrieved: [P3 (0), P1 (1), P2 (1)]
|
191
|
+
# Ideal: [P1 (1), P2 (1), P3 (0)]
|
192
|
+
#
|
193
|
+
# Calculate NDCG@3 for
|
194
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery SampleQuery}:
|
195
|
+
# * DCG@3: 0/log2(1+1) + 1/log2(2+1) + 1/log2(3+1) = 1.13
|
196
|
+
# * Ideal DCG@3: 1/log2(1+1) + 1/log2(2+1) + 0/log2(3+1) = 1.63
|
197
|
+
# * NDCG@3: 1.13/1.63 = 0.693
|
198
|
+
class QualityMetrics
|
199
|
+
include ::Google::Protobuf::MessageExts
|
200
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
201
|
+
|
202
|
+
# Stores the metric values at specific top-k levels.
|
203
|
+
# @!attribute [rw] top_1
|
204
|
+
# @return [::Float]
|
205
|
+
# The top-1 value.
|
206
|
+
# @!attribute [rw] top_3
|
207
|
+
# @return [::Float]
|
208
|
+
# The top-3 value.
|
209
|
+
# @!attribute [rw] top_5
|
210
|
+
# @return [::Float]
|
211
|
+
# The top-5 value.
|
212
|
+
# @!attribute [rw] top_10
|
213
|
+
# @return [::Float]
|
214
|
+
# The top-10 value.
|
215
|
+
class TopkMetrics
|
216
|
+
include ::Google::Protobuf::MessageExts
|
217
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
218
|
+
end
|
219
|
+
end
|
220
|
+
end
|
221
|
+
end
|
222
|
+
end
|
223
|
+
end
|
@@ -0,0 +1,194 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2024 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Cloud
|
22
|
+
module DiscoveryEngine
|
23
|
+
module V1beta
|
24
|
+
# Request message for
|
25
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::EvaluationService::Client#get_evaluation EvaluationService.GetEvaluation}
|
26
|
+
# method.
|
27
|
+
# @!attribute [rw] name
|
28
|
+
# @return [::String]
|
29
|
+
# Required. Full resource name of
|
30
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::Evaluation Evaluation}, such as
|
31
|
+
# `projects/{project}/locations/{location}/evaluations/{evaluation}`.
|
32
|
+
#
|
33
|
+
# If the caller does not have permission to access the
|
34
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::Evaluation Evaluation}, regardless of
|
35
|
+
# whether or not it exists, a PERMISSION_DENIED error is returned.
|
36
|
+
#
|
37
|
+
# If the requested
|
38
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::Evaluation Evaluation} does not
|
39
|
+
# exist, a NOT_FOUND error is returned.
|
40
|
+
class GetEvaluationRequest
|
41
|
+
include ::Google::Protobuf::MessageExts
|
42
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
43
|
+
end
|
44
|
+
|
45
|
+
# Request message for
|
46
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::EvaluationService::Client#list_evaluations EvaluationService.ListEvaluations}
|
47
|
+
# method.
|
48
|
+
# @!attribute [rw] parent
|
49
|
+
# @return [::String]
|
50
|
+
# Required. The parent location resource name, such as
|
51
|
+
# `projects/{project}/locations/{location}`.
|
52
|
+
#
|
53
|
+
# If the caller does not have permission to list
|
54
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::Evaluation Evaluation}s under this
|
55
|
+
# location, regardless of whether or not this location exists, a
|
56
|
+
# `PERMISSION_DENIED` error is returned.
|
57
|
+
# @!attribute [rw] page_size
|
58
|
+
# @return [::Integer]
|
59
|
+
# Maximum number of
|
60
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::Evaluation Evaluation}s to return. If
|
61
|
+
# unspecified, defaults to 100. The maximum allowed value is 1000. Values
|
62
|
+
# above 1000 will be coerced to 1000.
|
63
|
+
#
|
64
|
+
# If this field is negative, an `INVALID_ARGUMENT` error is returned.
|
65
|
+
# @!attribute [rw] page_token
|
66
|
+
# @return [::String]
|
67
|
+
# A page token
|
68
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::ListEvaluationsResponse#next_page_token ListEvaluationsResponse.next_page_token},
|
69
|
+
# received from a previous
|
70
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::EvaluationService::Client#list_evaluations EvaluationService.ListEvaluations}
|
71
|
+
# call. Provide this to retrieve the subsequent page.
|
72
|
+
#
|
73
|
+
# When paginating, all other parameters provided to
|
74
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::EvaluationService::Client#list_evaluations EvaluationService.ListEvaluations}
|
75
|
+
# must match the call that provided the page token. Otherwise, an
|
76
|
+
# `INVALID_ARGUMENT` error is returned.
|
77
|
+
class ListEvaluationsRequest
|
78
|
+
include ::Google::Protobuf::MessageExts
|
79
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
80
|
+
end
|
81
|
+
|
82
|
+
# Response message for
|
83
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::EvaluationService::Client#list_evaluations EvaluationService.ListEvaluations}
|
84
|
+
# method.
|
85
|
+
# @!attribute [rw] evaluations
|
86
|
+
# @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Evaluation>]
|
87
|
+
# The {::Google::Cloud::DiscoveryEngine::V1beta::Evaluation Evaluation}s.
|
88
|
+
# @!attribute [rw] next_page_token
|
89
|
+
# @return [::String]
|
90
|
+
# A token that can be sent as
|
91
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::ListEvaluationsRequest#page_token ListEvaluationsRequest.page_token}
|
92
|
+
# to retrieve the next page. If this field is omitted, there are no
|
93
|
+
# subsequent pages.
|
94
|
+
class ListEvaluationsResponse
|
95
|
+
include ::Google::Protobuf::MessageExts
|
96
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
97
|
+
end
|
98
|
+
|
99
|
+
# Request message for
|
100
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::EvaluationService::Client#create_evaluation EvaluationService.CreateEvaluation}
|
101
|
+
# method.
|
102
|
+
# @!attribute [rw] parent
|
103
|
+
# @return [::String]
|
104
|
+
# Required. The parent resource name, such as
|
105
|
+
# `projects/{project}/locations/{location}`.
|
106
|
+
# @!attribute [rw] evaluation
|
107
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1beta::Evaluation]
|
108
|
+
# Required. The {::Google::Cloud::DiscoveryEngine::V1beta::Evaluation Evaluation}
|
109
|
+
# to create.
|
110
|
+
class CreateEvaluationRequest
|
111
|
+
include ::Google::Protobuf::MessageExts
|
112
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
113
|
+
end
|
114
|
+
|
115
|
+
# Metadata for
|
116
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::EvaluationService::Client#create_evaluation EvaluationService.CreateEvaluation}
|
117
|
+
# method.
|
118
|
+
class CreateEvaluationMetadata
|
119
|
+
include ::Google::Protobuf::MessageExts
|
120
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
121
|
+
end
|
122
|
+
|
123
|
+
# Request message for
|
124
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::EvaluationService::Client#list_evaluation_results EvaluationService.ListEvaluationResults}
|
125
|
+
# method.
|
126
|
+
# @!attribute [rw] evaluation
|
127
|
+
# @return [::String]
|
128
|
+
# Required. The evaluation resource name, such as
|
129
|
+
# `projects/{project}/locations/{location}/evaluations/{evaluation}`.
|
130
|
+
#
|
131
|
+
# If the caller does not have permission to list [EvaluationResult][]
|
132
|
+
# under this evaluation, regardless of whether or not this evaluation
|
133
|
+
# set exists, a `PERMISSION_DENIED` error is returned.
|
134
|
+
# @!attribute [rw] page_size
|
135
|
+
# @return [::Integer]
|
136
|
+
# Maximum number of [EvaluationResult][] to return. If unspecified,
|
137
|
+
# defaults to 100. The maximum allowed value is 1000. Values above 1000 will
|
138
|
+
# be coerced to 1000.
|
139
|
+
#
|
140
|
+
# If this field is negative, an `INVALID_ARGUMENT` error is returned.
|
141
|
+
# @!attribute [rw] page_token
|
142
|
+
# @return [::String]
|
143
|
+
# A page token
|
144
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::ListEvaluationResultsResponse#next_page_token ListEvaluationResultsResponse.next_page_token},
|
145
|
+
# received from a previous
|
146
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::EvaluationService::Client#list_evaluation_results EvaluationService.ListEvaluationResults}
|
147
|
+
# call. Provide this to retrieve the subsequent page.
|
148
|
+
#
|
149
|
+
# When paginating, all other parameters provided to
|
150
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::EvaluationService::Client#list_evaluation_results EvaluationService.ListEvaluationResults}
|
151
|
+
# must match the call that provided the page token. Otherwise, an
|
152
|
+
# `INVALID_ARGUMENT` error is returned.
|
153
|
+
class ListEvaluationResultsRequest
|
154
|
+
include ::Google::Protobuf::MessageExts
|
155
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
156
|
+
end
|
157
|
+
|
158
|
+
# Response message for
|
159
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::EvaluationService::Client#list_evaluation_results EvaluationService.ListEvaluationResults}
|
160
|
+
# method.
|
161
|
+
# @!attribute [rw] evaluation_results
|
162
|
+
# @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::ListEvaluationResultsResponse::EvaluationResult>]
|
163
|
+
# The
|
164
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::ListEvaluationResultsResponse::EvaluationResult EvaluationResult}s.
|
165
|
+
# @!attribute [rw] next_page_token
|
166
|
+
# @return [::String]
|
167
|
+
# A token that can be sent as
|
168
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::ListEvaluationResultsRequest#page_token ListEvaluationResultsRequest.page_token}
|
169
|
+
# to retrieve the next page. If this field is omitted, there are no
|
170
|
+
# subsequent pages.
|
171
|
+
class ListEvaluationResultsResponse
|
172
|
+
include ::Google::Protobuf::MessageExts
|
173
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
174
|
+
|
175
|
+
# Represents the results of an evaluation for a single
|
176
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery SampleQuery}.
|
177
|
+
# @!attribute [r] sample_query
|
178
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery]
|
179
|
+
# Output only. The
|
180
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery SampleQuery} that was
|
181
|
+
# evaluated.
|
182
|
+
# @!attribute [r] quality_metrics
|
183
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1beta::QualityMetrics]
|
184
|
+
# Output only. The metrics produced by the evaluation, for a given
|
185
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery SampleQuery}.
|
186
|
+
class EvaluationResult
|
187
|
+
include ::Google::Protobuf::MessageExts
|
188
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
189
|
+
end
|
190
|
+
end
|
191
|
+
end
|
192
|
+
end
|
193
|
+
end
|
194
|
+
end
|