Characterize a given text by surfacing the overall sentiment breakdown, the most important positive and negative features, and quotes that best represent the content and tone of the text.

Notes

  • The key parameter (API key) can be passed in the query string, while the text parameter should be posted as JSON in the message body (see example below).
$obj = array(
	"text" => "I love natural language processing!  NLP is lots of fun."
);

$options = array(
  'http' => array(
    'method'  => 'POST',
    'content' => json_encode($obj),
    'header'=>  "Content-Type: application/json\r\n" .
                "Accept: application/json\r\n"
    )
);

$context  = stream_context_create($options);
$result = file_get_contents("http://api.addstructure.com/v1/analysis/summary?key=APIKEY", false, $context);
echo($result);
Language