gcnlp_post {googlenlp}R Documentation

Send a POST request to the Google Cloud Natural Language API

Description

Send a POST request to the Google Cloud Natural Language API and retrieve the results.

Usage

gcnlp_post(text_body, extract_syntax = TRUE, extract_entities = TRUE,
  extract_document_sentiment = TRUE)

Arguments

text_body

The text string to send to the API.

extract_syntax

Behavior for the analyzeSyntax method. Defaults to TRUE. See the API documentation for more information.

extract_entities

Behavior for the analyzeEntities method. Defaults to TRUE. See the API documentation for more information.

extract_document_sentiment

Behavior for the analyzeSentiment method. Defaults to TRUE. See the API documentation for more information.

Value

A list containing two elements: [1] content includes the parsed response, and contains the sentences, tokens, entities, documentSentiment, language results specified in the request. [2] raw_response contains the raw response from the API.

Examples

## Not run: 
gcnlp_post(text_body = "Google, headquartered in Mountain View, unveiled
                                       the new Android phone at the Consumer Electronic Show.
                                       Sundar Pichai said in his keynote that users love
                                       their new Android phones.",
           extract_syntax = TRUE,
           extract_entities = TRUE,
           extract_document_sentiment = TRUE)

## End(Not run)


[Package googlenlp version 0.2.0 Index]