Class: Google::Apis::CommentanalyzerV1alpha1::SuggestCommentScoreRequest
- Inherits:
-
Object
- Object
- Google::Apis::CommentanalyzerV1alpha1::SuggestCommentScoreRequest
- 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
-
#attribute_scores ⇒ Hash<String,Google::Apis::CommentanalyzerV1alpha1::AttributeScores>
Attribute scores for the comment.
-
#client_token ⇒ String
Opaque token that is echoed from the request to the response.
-
#comment ⇒ Google::Apis::CommentanalyzerV1alpha1::TextEntry
Represents a body of text.
-
#community_id ⇒ String
Optional identifier associating this comment score suggestion with a particular sub-community.
-
#context ⇒ Google::Apis::CommentanalyzerV1alpha1::Context
Context is typically something that a Comment is referencing or replying to (such as an article, or previous comment).
-
#languages ⇒ Array<String>
The language(s) of the comment and context (if none are specified, the language is automatically detected).
-
#session_id ⇒ String
Session ID.
Instance Method Summary collapse
-
#initialize(**args) ⇒ SuggestCommentScoreRequest
constructor
A new instance of SuggestCommentScoreRequest.
-
#update!(**args) ⇒ Object
Update properties of this object.
Methods included from Google::Apis::Core::JsonObjectSupport
Methods included from Google::Apis::Core::Hashable
Constructor Details
#initialize(**args) ⇒ SuggestCommentScoreRequest
Returns a new instance of SuggestCommentScoreRequest
411 412 413 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 411 def initialize(**args) update!(**args) end |
Instance Attribute Details
#attribute_scores ⇒ Hash<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
361 362 363 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 361 def attribute_scores @attribute_scores end |
#client_token ⇒ String
Opaque token that is echoed from the request to the response.
Corresponds to the JSON property clientToken
366 367 368 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 366 def client_token @client_token end |
#comment ⇒ Google::Apis::CommentanalyzerV1alpha1::TextEntry
Represents a body of text.
Corresponds to the JSON property comment
371 372 373 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 371 def comment @comment end |
#community_id ⇒ String
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
379 380 381 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 379 def community_id @community_id end |
#context ⇒ Google::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
389 390 391 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 389 def context @context end |
#languages ⇒ Array<String>
The language(s) of the comment and context (if none are specified, the language is automatically detected). If multiple languages are specified, the text is checked in all of them that are supported. Both ISO and BCP-47 language codes are accepted. Current Language Restrictions:
- Only English text ("en") is supported.
If none of the languages specified by the caller are supported, an
UNIMPLEMENTEDerror is returned. Corresponds to the JSON propertylanguages
401 402 403 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 401 def languages @languages end |
#session_id ⇒ String
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
409 410 411 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 409 def session_id @session_id end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
416 417 418 419 420 421 422 423 424 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 416 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 |