diff --git a/composer.json b/composer.json index 5969110..3b4a578 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "Laravel package for accessing NLP tools", "type": "library", "require": { - "web64/php-nlp-client": "^0.30", + "web64/php-nlp-client": "^0.40", "lsmonki/php-open-calais": "^2.1", "stichoza/google-translate-php": "~3.2" }, diff --git a/src/LaravelNlp/LaravelNlp.php b/src/LaravelNlp/LaravelNlp.php index a539e77..419bfd5 100644 --- a/src/LaravelNlp/LaravelNlp.php +++ b/src/LaravelNlp/LaravelNlp.php @@ -39,17 +39,18 @@ public function translate($text, $source_lang = null, $target_lang = null) return $translator->translate( $text ); } - public function sentiment( $text, $language = 'en' ) - { - $response = $this->polyglot($text, $language); + // public function sentiment( $text, $language = 'en' ) + // { + // $response = $this->sentiment($text, $language); - if ( $response ) - return $response->getSentiment(); + // if ( $response ) + // return $response->getSentiment(); - } + // } + public function entities( $text, $language = 'en' ) { - $response = $this->polyglot($text, $language); + $response = $this->polyglot_entities($text, $language); if ( $response ) return $response->getEntities();