cognitive_endpoint {AzureCognitive} | R Documentation |
Object representing an Azure Cognitive Service endpoint
Description
Object representing an Azure Cognitive Service endpoint
Usage
cognitive_endpoint(url, service_type, key = NULL, aad_token = NULL,
cognitive_token = NULL, auth_header = "ocp-apim-subscription-key")
Arguments
url |
The URL of the endpoint. |
service_type |
What type (or kind) of service the endpoint provides. See below for the services that AzureCognitive currently recognises. |
key |
The subscription key (single- or multi-service) to use to authenticate with the endpoint. |
aad_token |
An Azure Active Directory (AAD) OAuth token, as an alternative to a key for the services that allow AAD authentication. |
cognitive_token |
A Cognitive Service token, as another alternative to a key for the services that accept it. |
auth_header |
The name of the HTTP request header for authentication. Only used if a subscription key is supplied. |
Details
Currently, cognitive_endpoint
recognises the following service types:
-
CognitiveServices
: multiple service types -
ComputerVision
: generic computer vision service -
Face
: face recognition -
LUIS
: language understanding -
CustomVision.Training
: Training endpoint for a custom vision service -
CustomVision.Prediction
: Prediction endpoint for a custom vision service -
ContentModerator
: Content moderation (text and images) -
Text
: text analytics -
TextTranslate
: text translation
Value
An object inheriting from class cognitive_endpoint
, that can be used to communicate with the REST endpoint. The subclass of the object indicates the type of service provided.
See Also
call_cognitive_endpoint, create_cognitive_service, get_cognitive_service
Examples
## Not run:
cognitive_endpoint("https://myvisionservice.api.cognitive.azure.com",
service_type="Computervision", key="key")
cognitive_endpoint("https://mylangservice.api.cognitive.azure.com",
service_type="LUIS", key="key")
# authenticating with AAD
token <- AzureAuth::get_azure_token("https://cognitiveservices.azure.com",
tenant="mytenant", app="app_id", password="password")
cognitive_endpoint("https://myvisionservice.api.cognitive.azure.com",
service_type="Computervision", aad_token=token)
## End(Not run)