Fetch google nlp entities sentiment¶
NLP • text • 3rd party API • integration • model
Analyze sentiment about entities in a text using Google Cloud's NLP endpoint.
Each text will be analyzed using Google's API. Any detected entity will generate a row containing information about its sentiment and type, along with a reference to the original text (its index in the input dataset). For more information about the columns in the resulting dataset see the Outputs section below.
API integration
To use this step your team needs to have the Google NLP integration configured in Graphext. The corresponding credentials
are required to connect to a third-party API. You can configure API integrations following the INTEGRATIONS
or ADD INTEGRATION
link in the top-left corner of your Team's page, selecting API keys
, and then the name of the desired third-party service.
To enable the Google NLP integration in particular you will need access to Google's NLP service. Follow the instructions here to create the required API key.
Usage¶
The following are the step's expected inputs and outputs and their specific types.
fetch_google_nlp_entities_sentiment(text_column: text, {"param": value}) -> (ds_out: dataset)
where the object {"param": value}
is optional in most cases and if present may contain any of the parameters described in the
corresponding section below.
Example¶
The step has no parameters, so simply use
fetch_google_nlp_entities_sentiment(ds.text_column) -> (ds_out)
Inputs¶
text_column: column:text
Column containing the texts to analyze.
Outputs¶
ds_out: dataset
The result of the analysis.
The new dataset will have the following columns:
sentiment_magnitude
: Indicates the overall strength of emotion (both positive and negative) within the given text, between 0.0 and +inf.sentiment_score
: Ranges between -1.0 (negative) and 1.0 (positive) and corresponds to the overall emotional leaning of the text.entity
: name of the entity detected in the texts.type
: category related to Google NLP's categories. See more herename_type
: name of the previous column's category.original_text
: The text the entity was extracted fromoriginal_index
: Original index of the text in your input column so you can join if you see fit.
Parameters¶
integration: string
ID of the integration you'd like to use.