Class: Google::Cloud::Ces::V1beta::DataStoreTool::BoostSpec

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/cloud/ces/v1beta/data_store_tool.rb

Overview

Boost specification to boost certain documents.

Defined Under Namespace

Classes: ConditionBoostSpec

Instance Attribute Summary collapse

Instance Attribute Details

#condition_boost_specs::Array<::Google::Cloud::Ces::V1beta::DataStoreTool::BoostSpec::ConditionBoostSpec>

Returns Required. A list of boosting specifications.

Returns:



163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
# File 'proto_docs/google/cloud/ces/v1beta/data_store_tool.rb', line 163

class BoostSpec
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Boost specification for a condition.
  # @!attribute [rw] condition
  #   @return [::String]
  #     Required. An expression which specifies a boost condition. The syntax
  #     is the same as filter expression syntax. Currently, the only supported
  #     condition is a list of BCP-47 lang codes. Example: To boost suggestions
  #     in languages en or fr: (lang_code: ANY("en", "fr"))
  # @!attribute [rw] boost
  #   @return [::Float]
  #     Optional. Strength of the boost, which should be in [-1, 1]. Negative
  #     boost means demotion. Default is 0.0.
  #
  #     Setting to 1.0 gives the suggestions a big promotion. However, it does
  #     not necessarily mean that the top result will be a boosted suggestion.
  #
  #     Setting to -1.0 gives the suggestions a big demotion. However, other
  #     suggestions that are relevant might still be shown.
  #
  #     Setting to 0.0 means no boost applied. The boosting condition is
  #     ignored.
  # @!attribute [rw] boost_control_spec
  #   @return [::Google::Cloud::Ces::V1beta::DataStoreTool::BoostSpec::ConditionBoostSpec::BoostControlSpec]
  #     Optional. Complex specification for custom ranking based on customer
  #     defined attribute value.
  class ConditionBoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for custom ranking based on customer specified attribute
    # value. It provides more controls for customized ranking than the simple
    # (condition, boost) combination above.
    # @!attribute [rw] field_name
    #   @return [::String]
    #     Optional. The name of the field whose value will be used to determine
    #     the boost amount.
    # @!attribute [rw] attribute_type
    #   @return [::Google::Cloud::Ces::V1beta::DataStoreTool::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
    #     Optional. The attribute type to be used to determine the boost
    #     amount. The attribute value can be derived from the field value of
    #     the specified field_name. In the case of numerical it is
    #     straightforward i.e. attribute_value = numerical_field_value. In the
    #     case of freshness however, attribute_value = (time.now() -
    #     datetime_field_value).
    # @!attribute [rw] interpolation_type
    #   @return [::Google::Cloud::Ces::V1beta::DataStoreTool::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
    #     Optional. The interpolation type to be applied to connect the control
    #     points listed below.
    # @!attribute [rw] control_points
    #   @return [::Array<::Google::Cloud::Ces::V1beta::DataStoreTool::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
    #     Optional. The control points used to define the curve. The monotonic
    #     function (defined through the interpolation_type above) passes
    #     through the control points listed here.
    class BoostControlSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # The control points used to define the curve. The curve defined
      # through these control points can only be monotonically increasing
      # or decreasing(constant values are acceptable).
      # @!attribute [rw] attribute_value
      #   @return [::String]
      #     Optional. Can be one of:
      #     1. The numerical field value.
      #     2. The duration spec for freshness:
      #     The value must be formatted as an XSD `dayTimeDuration` value (a
      #     restricted subset of an ISO 8601 duration value). The pattern for
      #     this is: `[nD][T[nH][nM][nS]]`.
      # @!attribute [rw] boost_amount
      #   @return [::Float]
      #     Optional. The value between -1 to 1 by which to boost the score if
      #     the attribute_value evaluates to the value specified above.
      class ControlPoint
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # The attribute(or function) for which the custom ranking is to be
      # applied.
      module AttributeType
        # Unspecified AttributeType.
        ATTRIBUTE_TYPE_UNSPECIFIED = 0

        # The value of the numerical field will be used to dynamically update
        # the boost amount. In this case, the attribute_value (the x value)
        # of the control point will be the actual value of the numerical
        # field for which the boost_amount is specified.
        NUMERICAL = 1

        # For the freshness use case the attribute value will be the duration
        # between the current time and the date in the datetime field
        # specified. The value must be formatted as an XSD `dayTimeDuration`
        # value (a restricted subset of an ISO 8601 duration value). The
        # pattern for this is: `[nD][T[nH][nM][nS]]`.
        # E.g. `5D`, `3DT12H30M`, `T24H`.
        FRESHNESS = 2
      end

      # The interpolation type to be applied. Default will be linear
      # (Piecewise Linear).
      module InterpolationType
        # Interpolation type is unspecified. In this case, it defaults to
        # Linear.
        INTERPOLATION_TYPE_UNSPECIFIED = 0

        # Piecewise linear interpolation will be applied.
        LINEAR = 1
      end
    end
  end
end