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
414 415 416 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 414 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
364 365 366 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 364 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
369 370 371 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 369 def client_token @client_token end |
#comment ⇒ Google::Apis::CommentanalyzerV1alpha1::TextEntry
Represents a body of text.
Corresponds to the JSON property comment
374 375 376 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 374 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
382 383 384 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 382 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
392 393 394 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 392 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
UNIMPLEMENTED
error is returned. Corresponds to the JSON propertylanguages
404 405 406 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 404 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
412 413 414 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 412 def session_id @session_id end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
419 420 421 422 423 424 425 426 427 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 419 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 |