class Documents extends Resource (View source)

The "documents" collection of methods.

Typical usage is:

 $languageService = new Google\Service\CloudNaturalLanguage(...);
 $documents = $languageService->documents;

Methods

analyzeEntities(AnalyzeEntitiesRequest $postBody, array $optParams = [])

Finds named entities (currently proper names and common nouns) in the text along with entity types, probability, mentions for each entity, and other properties. (documents.analyzeEntities)

analyzeSentiment(AnalyzeSentimentRequest $postBody, array $optParams = [])

Analyzes the sentiment of the provided text. (documents.analyzeSentiment)

annotateText(AnnotateTextRequest $postBody, array $optParams = [])

A convenience method that provides all features in one call.

classifyText(ClassifyTextRequest $postBody, array $optParams = [])

Classifies a document into categories. (documents.classifyText)

moderateText(ModerateTextRequest $postBody, array $optParams = [])

Moderates a document for harmful and sensitive categories.

Details

AnalyzeEntitiesResponse analyzeEntities(AnalyzeEntitiesRequest $postBody, array $optParams = [])

Finds named entities (currently proper names and common nouns) in the text along with entity types, probability, mentions for each entity, and other properties. (documents.analyzeEntities)

Parameters

AnalyzeEntitiesRequest $postBody
array $optParams

Optional parameters.

Return Value

AnalyzeEntitiesResponse

Exceptions

Exception

AnalyzeSentimentResponse analyzeSentiment(AnalyzeSentimentRequest $postBody, array $optParams = [])

Analyzes the sentiment of the provided text. (documents.analyzeSentiment)

Parameters

AnalyzeSentimentRequest $postBody
array $optParams

Optional parameters.

Return Value

AnalyzeSentimentResponse

Exceptions

Exception

AnnotateTextResponse annotateText(AnnotateTextRequest $postBody, array $optParams = [])

A convenience method that provides all features in one call.

(documents.annotateText)

Parameters

AnnotateTextRequest $postBody
array $optParams

Optional parameters.

Return Value

AnnotateTextResponse

Exceptions

Exception

ClassifyTextResponse classifyText(ClassifyTextRequest $postBody, array $optParams = [])

Classifies a document into categories. (documents.classifyText)

Parameters

ClassifyTextRequest $postBody
array $optParams

Optional parameters.

Return Value

ClassifyTextResponse

Exceptions

Exception

ModerateTextResponse moderateText(ModerateTextRequest $postBody, array $optParams = [])

Moderates a document for harmful and sensitive categories.

(documents.moderateText)

Parameters

ModerateTextRequest $postBody
array $optParams

Optional parameters.

Return Value

ModerateTextResponse

Exceptions

Exception