Property | Type | Description | |
---|---|---|---|
$connection | Google\Cloud\NaturalLanguage\Connection\ConnectionInterface |
Method | Description | |
---|---|---|
__construct ( array $config = [] ) | Create a NaturalLanguage client. | |
analyzeEntities ( string | |
Finds named entities (currently finds proper names) in the text, entity types, salience, mentions for each entity, and other properties in the document. | |
analyzeSentiment ( string | |
Analyzes the sentiment of the provided document. | |
analyzeSyntax ( string | |
Analyzes the document and provides a full set of text annotations. | |
annotateText ( string | |
Analyzes the document and provides a full set of text annotations, including semantic, syntactic, and sentiment information. |
Method | Description | |
---|---|---|
formatRequest ( string | |
Formats the request for the API. | |
normalizeFeatures ( array $features ) : array | Configures features in a way the API expects. |
public __construct ( array $config = [] ) | ||
$config | array | [optional] { Configuration Options. @type string $projectId The project ID from the Google Developer's Console. @type CacheItemPoolInterface $authCache A cache for storing access tokens. **Defaults to** a simple in memory implementation. @type array $authCacheOptions Cache configuration options. @type callable $authHttpHandler A handler used to deliver Psr7 requests specifically for authentication. @type callable $httpHandler A handler used to deliver Psr7 requests. Only valid for requests sent over REST. @type string $keyFile The contents of the service account credentials .json file retrieved from the Google Developers Console. @type string $keyFilePath The full path to your service account credentials .json file retrieved from the Google Developers Console. @type int $retries Number of retries for a failed request. **Defaults to** `3`. @type array $scopes Scopes to be used for the request. } |
public analyzeEntities ( string | |
||
$content | string | |
The content to analyze. |
$options | array | [optional] { Configuration options. @type string $type The document type. Acceptable values are `PLAIN_TEXT` or `HTML`. **Defaults to** `"PLAIN_TEXT"`. @type string $language The language of the document. Both ISO (e.g., en, es) and BCP-47 (e.g., en-US, es-ES) language codes are accepted. Defaults to `"en"` (English). @type string $encodingType The text encoding type used by the API to calculate offsets. Acceptable values are `"NONE"`, `"UTF8"`, `"UTF16"` and `"UTF32"`. **Defaults to** `"UTF8"`. } |
return |
public analyzeSentiment ( string | |
||
$content | string | |
The content to analyze. |
$options | array | [optional] { Configuration options. @type string $type The document type. Acceptable values are `PLAIN_TEXT` or `HTML`. **Defaults to** `"PLAIN_TEXT"`. @type string $language The language of the document. Both ISO (e.g., en, es) and BCP-47 (e.g., en-US, es-ES) language codes are accepted. If no value is provided, the language will be detected by the service. @type string $encodingType The text encoding type used by the API to calculate offsets. Acceptable values are `"NONE"`, `"UTF8"`, `"UTF16"` and `"UTF32"`. **Defaults to** `"UTF8"`. } |
return |
public analyzeSyntax ( string | |
||
$content | string | |
The content to analyze. |
$options | array | [optional] { Configuration options. @type string $type The document type. Acceptable values are `PLAIN_TEXT` or `HTML`. **Defaults to** `"PLAIN_TEXT"`. @type string $language The language of the document. Both ISO (e.g., en, es) and BCP-47 (e.g., en-US, es-ES) language codes are accepted. If no value is provided, the language will be detected by the service. @type string $encodingType The text encoding type used by the API to calculate offsets. Acceptable values are `"NONE"`, `"UTF8"`, `"UTF16"` and `"UTF32"`. **Defaults to** `"UTF8"`. } |
return |
public annotateText ( string | |
||
$content | string | |
The content to annotate. |
$options | array | [optional] { Configuration options. @type array $features Features to apply to the request. Valid values are `syntax`, `sentiment`, and `entities`. If no features are provided the request will run with all three enabled. @type string $type The document type. Acceptable values are `PLAIN_TEXT` or `HTML`. **Defaults to** `"PLAIN_TEXT"`. @type string $language The language of the document. Both ISO (e.g., en, es) and BCP-47 (e.g., en-US, es-ES) language codes are accepted. If no value is provided, the language will be detected by the service. @type string $encodingType The text encoding type used by the API to calculate offsets. Acceptable values are `"NONE"`, `"UTF8"`, `"UTF16"` and `"UTF32"`. **Defaults to** `"UTF8"`. } |
return |