The Google sentiment service can analyze text submissions for the sentiment the text expresses. Passing a text string to the Google Sentiment service submits it for analysis, and the Service returns a double-precision number that ranges from -1.00 to 1.00. A value of 0 is a neutral sentiment. A negative value indicates negative sentiment, while a positive value indicates a positive sentiment. The closer to -1.00 or 1.00 the return value is, the more intense the sentiment expressed. For instance, a return value of 0.85 is a very positive sentiment.
Required Variables
To configure Process Director for the Google Sentiment service, the custom variables below must be configured:
GoogleSentiment_private_key
This string variable contains the your private key for the Google Sentiment service. This value is provided to you by Google.
GoogleSentiment_client_email
This string variable contains the email address you used as the client email address for the Google Sentiment service.
Optional Variables
GoogleSentiment_project_id
This string variable contains the Project ID for the Google Sentiment service. This value is provided to you by Google.
GoogleSentiment_private_key_id
This string variable contains the Private Key ID for the Google Sentiment service. This value is provided to you by Google.
GoogleSentiment_client_id
This string variable contains the Client ID for the Google Sentiment service. This value is provided to you by Google.
GoogleSentiment_client_x509_cert_url
This string variable contains the URL you used as the x509 Client Certificate for the Google Sentiment service.
Example
public override void SetSystemVars(BPLogix.WorkflowDirector.SDK.bp bp)
{
bp.Vars.GoogleSentiment_private_key = @"YourPrivateKey";
bp.Vars.GoogleSentiment_client_email = "email@address.com";
bp.Vars.GoogleSentiment_project_id = "YourProjectID";
bp.Vars.GoogleSentiment_private_key_id = "YourPrivateKeyID";
bp.Vars.GoogleSentiment_client_id = "YourClientID";
bp.Vars.GoogleSentiment_client_x509_cert_url =
"https://YourClientCertURL.com";
}