pub struct LanguageService { /* private fields */ }Expand description
Implements a client for the Cloud Natural Language API.
§Service Description
Provides text analysis operations such as sentiment analysis and entity recognition.
§Configuration
LanguageService has various configuration parameters, the defaults should
work with most applications.
§Pooling and Cloning
LanguageService holds a connection pool internally, it is advised to
create one and the reuse it. You do not need to wrap LanguageService in
an Rc or Arc to reuse it, because it already uses an Arc
internally.
Implementations§
Source§impl LanguageService
impl LanguageService
Sourcepub async fn new_with_config(conf: ClientConfig) -> Result<Self>
pub async fn new_with_config(conf: ClientConfig) -> Result<Self>
Creates a new client with the specified configuration.
Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: LanguageService + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: LanguageService + 'static,
Creates a new client from the provided stub.
The most common case for calling this function is when mocking the client.
Sourcepub fn analyze_sentiment(&self) -> AnalyzeSentiment
pub fn analyze_sentiment(&self) -> AnalyzeSentiment
Analyzes the sentiment of the provided text.
Sourcepub fn analyze_entities(&self) -> AnalyzeEntities
pub fn analyze_entities(&self) -> AnalyzeEntities
Finds named entities (currently proper names and common nouns) in the text along with entity types, probability, mentions for each entity, and other properties.
Sourcepub fn classify_text(&self) -> ClassifyText
pub fn classify_text(&self) -> ClassifyText
Classifies a document into categories.
Sourcepub fn moderate_text(&self) -> ModerateText
pub fn moderate_text(&self) -> ModerateText
Moderates a document for harmful and sensitive categories.
Sourcepub fn annotate_text(&self) -> AnnotateText
pub fn annotate_text(&self) -> AnnotateText
A convenience method that provides all features in one call.
Trait Implementations§
Source§impl Clone for LanguageService
impl Clone for LanguageService
Source§fn clone(&self) -> LanguageService
fn clone(&self) -> LanguageService
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more