Skip to content

Googlelang

flowtask.interfaces.GoogleLang

GoogleLanguage

GoogleLanguage(*args, **kwargs)

Bases: GoogleClient, ABC

Google Cloud Natural Language Client for analyzing text for sentiment, entities, syntax, and content classification.

analyze_entities async

analyze_entities(text)

Analyze entities in the provided text.

Parameters:

Name Type Description Default
text str

The text to analyze.

required

Returns:

Name Type Description
list

A list of entities with their types and salience scores.

analyze_sentiment async

analyze_sentiment(text)

Analyze the sentiment of the provided text.

Parameters:

Name Type Description Default
text str

The text to analyze.

required

Returns:

Name Type Description
dict

Sentiment score and magnitude.

analyze_syntax async

analyze_syntax(text)

Analyze syntax of the provided text.

Parameters:

Name Type Description Default
text str

The text to analyze.

required

Returns:

Name Type Description
list

A list of tokens with their parts of speech and dependency relationships.

classify_text async

classify_text(text)

Classify the content of the provided text into categories.

Parameters:

Name Type Description Default
text str

The text to classify.

required

Returns:

Name Type Description
list

A list of categories with confidence scores.

get_client async

get_client()

Get the Natural Language client, with caching.