[][src]Struct google_commentanalyzer1_alpha1::SuggestCommentScoreRequest

pub struct SuggestCommentScoreRequest {
    pub comment: Option<TextEntry>,
    pub languages: Option<Vec<String>>,
    pub session_id: Option<String>,
    pub context: Option<Context>,
    pub client_token: Option<String>,
    pub community_id: Option<String>,
    pub attribute_scores: Option<HashMap<String, AttributeScores>>,
}

The comment score suggestion request message.

Activities

This type is used in activities, which are methods you may call on this type or where this type is involved in. The list links the activity name, along with information about where it is used (one of request and response).

Fields

comment: Option<TextEntry>

The comment being scored.

languages: Option<Vec<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.
session_id: Option<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.

context: Option<Context>

The context of the comment.

client_token: Option<String>

Opaque token that is echoed from the request to the response.

community_id: Option<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.

attribute_scores: Option<HashMap<String, 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.

Trait Implementations

impl RequestValue for SuggestCommentScoreRequest[src]

impl Default for SuggestCommentScoreRequest[src]

impl Clone for SuggestCommentScoreRequest[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for SuggestCommentScoreRequest[src]

impl Serialize for SuggestCommentScoreRequest[src]

impl<'de> Deserialize<'de> for SuggestCommentScoreRequest[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]