Skip to content

Fetch google nlp text sentiment

NLPtext3rd party APIintegrationmodel

Analyze the overall sentiment of texts using Google Cloud's NLP endpoint.

Each text's sentiment will be expressed as a magnitude (in [0, inf]) and a positive or negative score (in [-1, 1]).

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.

Step signature
fetch_google_nlp_text_sentiment(text_column: text, {"param": value}) -> (magnitude: number, score: number)

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

Example call (in recipe editor)
fetch_google_nlp_text_sentiment(ds.text_column) -> (ds.magnitude, ds.score)

Inputs


text_column: column:text

Column containing the texts to analyze.

Outputs


magnitude: column:number

A numerical column indicating the overall strength of emotion (both positive and negative) within the given text, with values ranging between 0.0 and +inf. Each expression of emotion within the text contributes to the text's magnitude, so longer text blocks may have greater absolute values.


score: column:number

A numerical column indicating the overall emotional leaning of the text in normalized form, with values ranging between -1.0 (negative) and 1.0 (positive).

Parameters


integration: string

ID of the integration you'd like to use.