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



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

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



135
136
137
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 135

def attribute_scores
  @attribute_scores
end

#client_tokenString

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

Returns:

  • (String)


140
141
142
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 140

def client_token
  @client_token
end

#detected_languagesArray<String>

Contains the language as detected from the text content. If no language was specified in the request, the first (the most likely) language is used to select an appropriate model. Sorted in order of likelihood. Corresponds to the JSON property detectedLanguages

Returns:

  • (Array<String>)


147
148
149
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 147

def detected_languages
  @detected_languages
end

#languagesArray<String>

The language(s) requested by the client, as specified in the request. If the request did not specify any language, this will be empty and the detected_languages field will be populated. Corresponds to the JSON property languages

Returns:

  • (Array<String>)


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

def languages
  @languages
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



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

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