Googlelang¶
flowtask.interfaces.GoogleLang
¶
GoogleLanguage
¶
Bases: GoogleClient, ABC
Google Cloud Natural Language Client for analyzing text for sentiment, entities, syntax, and content classification.
analyze_entities
async
¶
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 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 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 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. |