File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -318,7 +318,7 @@ The above command returns an object.
318318Call the ` question() ` method and pass the following:
319319
3203201 . Your question
321- 1 . A context that the model will use to try to answer your question
321+ 1 . (Optional) A context that the model will use to try to answer your question
322322
323323``` php
324324echo json_encode($client->question('<Your question >','<Your context >'));
@@ -358,10 +358,14 @@ The above command returns an object.
358358
359359### Sentiment Analysis Endpoint
360360
361- Call the ` sentiment() ` method and pass the text you want to analyze the sentiment of:
361+ Call the ` sentiment() ` method and pass the following:
362+
363+ 1 . The text you want to analyze and get the sentiment of
364+ 1 . (Optional) The target element that the sentiment should apply to
365+
362366
363367``` php
364- echo json_encode($client->sentiment('<Your block of text >'));
368+ echo json_encode($client->sentiment('<Your block of text >', '< Your target element >' ));
365369```
366370
367371The above command returns an object.
Original file line number Diff line number Diff line change @@ -432,10 +432,11 @@ public function sentenceDependencies($text)
432432 return $ response ->body ;
433433 }
434434
435- public function sentiment ($ text )
435+ public function sentiment ($ text, $ target = NULL )
436436 {
437437 $ payload = array (
438- 'text ' => $ text
438+ 'text ' => $ text ,
439+ 'target ' => $ target
439440 );
440441 $ response = \Httpful \Request::post ($ this ->rootURL . '/ ' . 'sentiment ' , $ payload )
441442 ->expectsJson ()
You can’t perform that action at this time.
0 commit comments