Class: Google::Apis::CommentanalyzerV1alpha1::AnalyzeCommentRequest
- Inherits:
-
Object
- Object
- Google::Apis::CommentanalyzerV1alpha1::AnalyzeCommentRequest
- 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 request message.
Instance Attribute Summary collapse
-
#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 AnalyzeCommentRequest with a particular client's 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).
-
#do_not_store ⇒ Boolean
(also: #do_not_store?)
Do not store the comment or context sent in this request.
-
#languages ⇒ Array<String>
The language(s) of the comment and context (if none are specified, the language is automatically detected).
-
#requested_attributes ⇒ Hash<String,Google::Apis::CommentanalyzerV1alpha1::AttributeParameters>
Specification of requested attributes.
-
#session_id ⇒ String
Session ID.
-
#span_annotations ⇒ Boolean
(also: #span_annotations?)
An advisory parameter that will return span annotations if the model is capable of providing scores with sub-comment resolution.
Instance Method Summary collapse
-
#initialize(**args) ⇒ AnalyzeCommentRequest
constructor
A new instance of AnalyzeCommentRequest.
-
#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) ⇒ AnalyzeCommentRequest
Returns a new instance of AnalyzeCommentRequest
108 109 110 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 108 def initialize(**args) update!(**args) end |
Instance Attribute Details
#client_token ⇒ String
Opaque token that is echoed from the request to the response.
Corresponds to the JSON property clientToken
32 33 34 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 32 def client_token @client_token end |
#comment ⇒ Google::Apis::CommentanalyzerV1alpha1::TextEntry
Represents a body of text.
Corresponds to the JSON property comment
37 38 39 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 37 def comment @comment end |
#community_id ⇒ String
Optional identifier associating this AnalyzeCommentRequest with a
particular client's community. Different communities may have different
norms and rules. Specifying this value enables us to explore building
community-specific models for clients.
Corresponds to the JSON property communityId
45 46 47 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 45 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
55 56 57 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 55 def context @context end |
#do_not_store ⇒ Boolean Also known as: do_not_store?
Do not store the comment or context sent in this request. By default, the
service may store comments/context for debugging purposes.
Corresponds to the JSON property doNotStore
61 62 63 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 61 def do_not_store @do_not_store 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
74 75 76 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 74 def languages @languages end |
#requested_attributes ⇒ Hash<String,Google::Apis::CommentanalyzerV1alpha1::AttributeParameters>
Specification of requested attributes. The AttributeParameters serve as
configuration for each associated attribute. The map keys are attribute
names. The following attributes are available:
"ATTACK_ON_AUTHOR" - Attack on author of original article or post.
"ATTACK_ON_COMMENTER" - Attack on fellow commenter.
"ATTACK_ON_PUBLISHER" - Attack on publisher of article/post.
"INCOHERENT" - Difficult to understand, nonsensical.
"INFLAMMATORY" - Intending to provoke or inflame.
"OBSCENE" - Obscene, such as cursing.
"OFF_TOPIC" - Not related to the original topic.
"SPAM" - Commercial/advertising spam content.
"UNSUBSTANTIAL" - Trivial.
Corresponds to the JSON property requestedAttributes
90 91 92 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 90 def requested_attributes @requested_attributes 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
98 99 100 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 98 def session_id @session_id end |
#span_annotations ⇒ Boolean Also known as: span_annotations?
An advisory parameter that will return span annotations if the model
is capable of providing scores with sub-comment resolution. This will
likely increase the size of the returned message.
Corresponds to the JSON property spanAnnotations
105 106 107 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 105 def span_annotations @span_annotations end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
113 114 115 116 117 118 119 120 121 122 123 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 113 def update!(**args) @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) @do_not_store = args[:do_not_store] if args.key?(:do_not_store) @languages = args[:languages] if args.key?(:languages) @requested_attributes = args[:requested_attributes] if args.key?(:requested_attributes) @session_id = args[:session_id] if args.key?(:session_id) @span_annotations = args[:span_annotations] if args.key?(:span_annotations) end |