Class: Google::Apis::CommentanalyzerV1alpha1::SuggestCommentScoreRequest

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
generated/google/apis/commentanalyzer_v1alpha1/classes.rb,
generated/google/apis/commentanalyzer_v1alpha1/representations.rb,
generated/google/apis/commentanalyzer_v1alpha1/representations.rb

Overview

The comment score suggestion request message.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Google::Apis::Core::JsonObjectSupport

#to_json

Methods included from Google::Apis::Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ SuggestCommentScoreRequest

Returns a new instance of SuggestCommentScoreRequest.



407
408
409
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 407

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

Instance Attribute Details

#attribute_scoresHash<String,Google::Apis::CommentanalyzerV1alpha1::AttributeScores>

Attribute scores for the comment. The map keys are attribute names, same as the requested_attribute field in AnalyzeCommentRequest (for example "ATTACK_ON_AUTHOR", "INFLAMMATORY", etc.). This field has the same type as the attribute_scores field in AnalyzeCommentResponse. To specify an overall attribute score for the entire comment as a whole, use the summary_score field of the mapped AttributeScores object. To specify scores on specific subparts of the comment, use the span_scores field. All SpanScore objects must have begin and end fields set. All Score objects must be explicitly set (for binary classification, use the score values 0 and 1). If Score objects don't include a ScoreType, PROBABILITY is assumed. attribute_scores must not be empty. The mapped AttributeScores objects also must not be empty. An INVALID_ARGUMENT error is returned for all malformed requests. Corresponds to the JSON property attributeScores



362
363
364
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 362

def attribute_scores
  @attribute_scores
end

#client_tokenString

Opaque token that is echoed from the request to the response. Corresponds to the JSON property clientToken

Returns:

  • (String)


367
368
369
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 367

def client_token
  @client_token
end

#commentGoogle::Apis::CommentanalyzerV1alpha1::TextEntry

Represents a body of text. Corresponds to the JSON property comment



372
373
374
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 372

def comment
  @comment
end

#community_idString

Optional identifier associating this comment score suggestion with a particular sub-community. Different communities may have different norms and rules. Specifying this value enables training community-specific models. Corresponds to the JSON property communityId

Returns:

  • (String)


380
381
382
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 380

def community_id
  @community_id
end

#contextGoogle::Apis::CommentanalyzerV1alpha1::Context

Context is typically something that a Comment is referencing or replying to (such as an article, or previous comment). Note: Populate only ONE OF the following fields. The oneof syntax cannot be used because that would require nesting entries inside another message and breaking backwards compatibility. The server will return an error if more than one of the following fields is present. Corresponds to the JSON property context



390
391
392
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 390

def context
  @context
end

#languagesArray<String>

The language(s) of the comment and context. If none are specified, we attempt to automatically detect the language. Both ISO and BCP-47 language codes are accepted. Corresponds to the JSON property languages

Returns:

  • (Array<String>)


397
398
399
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 397

def languages
  @languages
end

#session_idString

Session ID. Used to join related RPCs into a single session. For example, an interactive tool that calls both the AnalyzeComment and SuggestCommentScore RPCs should set all invocations of both RPCs to the same Session ID, typically a random 64-bit integer. Corresponds to the JSON property sessionId

Returns:

  • (String)


405
406
407
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 405

def session_id
  @session_id
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



412
413
414
415
416
417
418
419
420
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 412

def update!(**args)
  @attribute_scores = args[:attribute_scores] if args.key?(:attribute_scores)
  @client_token = args[:client_token] if args.key?(:client_token)
  @comment = args[:comment] if args.key?(:comment)
  @community_id = args[:community_id] if args.key?(:community_id)
  @context = args[:context] if args.key?(:context)
  @languages = args[:languages] if args.key?(:languages)
  @session_id = args[:session_id] if args.key?(:session_id)
end