Class: Google::Apis::FirebasemlV2beta::GoogleCloudAiplatformV1beta1LogprobsResultCandidate

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/firebaseml_v2beta/classes.rb,
lib/google/apis/firebaseml_v2beta/representations.rb,
lib/google/apis/firebaseml_v2beta/representations.rb

Overview

A single token and its associated log probability.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudAiplatformV1beta1LogprobsResultCandidate

Returns a new instance of GoogleCloudAiplatformV1beta1LogprobsResultCandidate.



2329
2330
2331
# File 'lib/google/apis/firebaseml_v2beta/classes.rb', line 2329

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#log_probabilityFloat

The log probability of this token. A higher value indicates that the model was more confident in this token. The log probability can be used to assess the relative likelihood of different tokens and to identify when the model is uncertain. Corresponds to the JSON property logProbability

Returns:

  • (Float)


2314
2315
2316
# File 'lib/google/apis/firebaseml_v2beta/classes.rb', line 2314

def log_probability
  @log_probability
end

#tokenString

The token's string representation. Corresponds to the JSON property token

Returns:

  • (String)


2319
2320
2321
# File 'lib/google/apis/firebaseml_v2beta/classes.rb', line 2319

def token
  @token
end

#token_idFixnum

The token's numerical ID. While the token field provides the string representation of the token, the token_id is the numerical representation that the model uses internally. This can be useful for developers who want to build custom logic based on the model's vocabulary. Corresponds to the JSON property tokenId

Returns:

  • (Fixnum)


2327
2328
2329
# File 'lib/google/apis/firebaseml_v2beta/classes.rb', line 2327

def token_id
  @token_id
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2334
2335
2336
2337
2338
# File 'lib/google/apis/firebaseml_v2beta/classes.rb', line 2334

def update!(**args)
  @log_probability = args[:log_probability] if args.key?(:log_probability)
  @token = args[:token] if args.key?(:token)
  @token_id = args[:token_id] if args.key?(:token_id)
end