Class: Google::Cloud::Ces::V1beta::DataStoreTool::BoostSpec::ConditionBoostSpec
- Inherits:
-
Object
- Object
- Google::Cloud::Ces::V1beta::DataStoreTool::BoostSpec::ConditionBoostSpec
- Extended by:
- Protobuf::MessageExts::ClassMethods
- Includes:
- Protobuf::MessageExts
- Defined in:
- proto_docs/google/cloud/ces/v1beta/data_store_tool.rb
Overview
Boost specification for a condition.
Defined Under Namespace
Classes: BoostControlSpec
Instance Attribute Summary collapse
-
#boost ⇒ ::Float
Optional.
-
#boost_control_spec ⇒ ::Google::Cloud::Ces::V1beta::DataStoreTool::BoostSpec::ConditionBoostSpec::BoostControlSpec
Optional.
-
#condition ⇒ ::String
Required.
Instance Attribute Details
#boost ⇒ ::Float
Returns 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.
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 |
# File 'proto_docs/google/cloud/ces/v1beta/data_store_tool.rb', line 191 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 |
#boost_control_spec ⇒ ::Google::Cloud::Ces::V1beta::DataStoreTool::BoostSpec::ConditionBoostSpec::BoostControlSpec
Returns Optional. Complex specification for custom ranking based on customer defined attribute value.
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 |
# File 'proto_docs/google/cloud/ces/v1beta/data_store_tool.rb', line 191 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 |
#condition ⇒ ::String
Returns 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")).
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 |
# File 'proto_docs/google/cloud/ces/v1beta/data_store_tool.rb', line 191 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 |