Class: Google::Apis::CommentanalyzerV1alpha1::AnalyzeCommentResponse

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 analysis response 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) ⇒ AnalyzeCommentResponse

Returns a new instance of AnalyzeCommentResponse.



157
158
159
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 157

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

Instance Attribute Details

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

Scores for the requested attributes. The map keys are attribute names (same as the requested_attribute field in AnalyzeCommentRequest, for example "ATTACK_ON_AUTHOR", "INFLAMMATORY", etc). Corresponds to the JSON property attributeScores



133
134
135
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 133

def attribute_scores
  @attribute_scores
end

#client_tokenString

Same token from the original AnalyzeCommentRequest. Corresponds to the JSON property clientToken

Returns:

  • (String)


138
139
140
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 138

def client_token
  @client_token
end

#detected_languagesArray<String>

Contains the languages detected from the text content, sorted in order of likelihood. Corresponds to the JSON property detectedLanguages

Returns:

  • (Array<String>)


144
145
146
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 144

def detected_languages
  @detected_languages
end

#languagesArray<String>

The language(s) used by CommentAnalyzer service to choose which Model to use when analyzing the comment. Might better be called "effective_languages". The logic used to make the choice is as follows: if !Request.languages.empty() effective_languages = Request.languages else effective_languages = detected_languages[0] Corresponds to the JSON property languages

Returns:

  • (Array<String>)


155
156
157
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 155

def languages
  @languages
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



162
163
164
165
166
167
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 162

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