#[non_exhaustive]pub struct AnnotateTextResponse {
pub sentences: Vec<Sentence>,
pub entities: Vec<Entity>,
pub document_sentiment: Option<Sentiment>,
pub language_code: String,
pub categories: Vec<ClassificationCategory>,
pub moderation_categories: Vec<ClassificationCategory>,
pub language_supported: bool,
}Expand description
The text annotations response message.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.sentences: Vec<Sentence>Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.
entities: Vec<Entity>Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities or [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v2.AnnotateTextRequest.Features.extract_entity_sentiment].
document_sentiment: Option<Sentiment>The overall sentiment for the document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.
language_code: StringThe language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See [Document.language][] field for more details.
categories: Vec<ClassificationCategory>Categories identified in the input document.
moderation_categories: Vec<ClassificationCategory>Harmful and sensitive categories identified in the input document.
language_supported: boolWhether the language is officially supported by all requested features. The API may still return a response when the language is not supported, but it is on a best effort basis.
Implementations§
Source§impl AnnotateTextResponse
impl AnnotateTextResponse
Sourcepub fn set_document_sentiment<T: Into<Option<Sentiment>>>(self, v: T) -> Self
pub fn set_document_sentiment<T: Into<Option<Sentiment>>>(self, v: T) -> Self
Sets the value of document_sentiment.
Sourcepub fn set_language_code<T: Into<String>>(self, v: T) -> Self
pub fn set_language_code<T: Into<String>>(self, v: T) -> Self
Sets the value of language_code.
Sourcepub fn set_language_supported<T: Into<bool>>(self, v: T) -> Self
pub fn set_language_supported<T: Into<bool>>(self, v: T) -> Self
Sets the value of language_supported.
Sourcepub fn set_sentences<T, V>(self, v: T) -> Self
pub fn set_sentences<T, V>(self, v: T) -> Self
Sets the value of sentences.
Sourcepub fn set_entities<T, V>(self, v: T) -> Self
pub fn set_entities<T, V>(self, v: T) -> Self
Sets the value of entities.
Sourcepub fn set_categories<T, V>(self, v: T) -> Self
pub fn set_categories<T, V>(self, v: T) -> Self
Sets the value of categories.
Sourcepub fn set_moderation_categories<T, V>(self, v: T) -> Self
pub fn set_moderation_categories<T, V>(self, v: T) -> Self
Sets the value of moderation_categories.
Trait Implementations§
Source§impl Clone for AnnotateTextResponse
impl Clone for AnnotateTextResponse
Source§fn clone(&self) -> AnnotateTextResponse
fn clone(&self) -> AnnotateTextResponse
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more