Class: Google::Apis::CommentanalyzerV1alpha1::CommentAnalyzerService
- Inherits:
-
Google::Apis::Core::BaseService
- Object
- Google::Apis::Core::BaseService
- Google::Apis::CommentanalyzerV1alpha1::CommentAnalyzerService
- Defined in:
- generated/google/apis/commentanalyzer_v1alpha1/service.rb
Overview
Perspective Comment Analyzer API
The Perspective Comment Analyzer API provides information about the potential impact of a comment on a conversation (e.g. it can provide a score for the " toxicity" of a comment). Users can leverage the "SuggestCommentScore" method to submit corrections to improve Perspective over time. Users can set the " doNotStore" flag to ensure that all submitted comments are automatically deleted after scores are returned.
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
Attributes inherited from Google::Apis::Core::BaseService
#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path
Instance Method Summary collapse
-
#analyze_comment(analyze_comment_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CommentanalyzerV1alpha1::AnalyzeCommentResponse
Analyzes the provided text and returns scores for requested attributes.
-
#initialize ⇒ CommentAnalyzerService
constructor
A new instance of CommentAnalyzerService.
-
#suggestscore_comment(suggest_comment_score_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CommentanalyzerV1alpha1::SuggestCommentScoreResponse
Suggest comment scores as training data.
Methods inherited from Google::Apis::Core::BaseService
#batch, #batch_upload, #fetch_all, #http
Methods included from Google::Apis::Core::Logging
Constructor Details
#initialize ⇒ CommentAnalyzerService
Returns a new instance of CommentAnalyzerService.
50 51 52 53 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/service.rb', line 50 def initialize super('https://commentanalyzer.googleapis.com/', '') @batch_path = 'batch' end |
Instance Attribute Details
#key ⇒ String
Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
43 44 45 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/service.rb', line 43 def key @key end |
#quota_user ⇒ String
Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
48 49 50 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/service.rb', line 48 def quota_user @quota_user end |
Instance Method Details
#analyze_comment(analyze_comment_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CommentanalyzerV1alpha1::AnalyzeCommentResponse
Analyzes the provided text and returns scores for requested attributes.
74 75 76 77 78 79 80 81 82 83 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/service.rb', line 74 def analyze_comment(analyze_comment_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1alpha1/comments:analyze', ) command.request_representation = Google::Apis::CommentanalyzerV1alpha1::AnalyzeCommentRequest::Representation command.request_object = analyze_comment_request_object command.response_representation = Google::Apis::CommentanalyzerV1alpha1::AnalyzeCommentResponse::Representation command.response_class = Google::Apis::CommentanalyzerV1alpha1::AnalyzeCommentResponse command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#suggestscore_comment(suggest_comment_score_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CommentanalyzerV1alpha1::SuggestCommentScoreResponse
Suggest comment scores as training data.
104 105 106 107 108 109 110 111 112 113 |
# File 'generated/google/apis/commentanalyzer_v1alpha1/service.rb', line 104 def suggestscore_comment(suggest_comment_score_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1alpha1/comments:suggestscore', ) command.request_representation = Google::Apis::CommentanalyzerV1alpha1::SuggestCommentScoreRequest::Representation command.request_object = suggest_comment_score_request_object command.response_representation = Google::Apis::CommentanalyzerV1alpha1::SuggestCommentScoreResponse::Representation command.response_class = Google::Apis::CommentanalyzerV1alpha1::SuggestCommentScoreResponse command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |