AIServiceLanguageClient

class oci.ai_language.AIServiceLanguageClient(config, **kwargs)
OCI AI Service solutions can help Enterprise customers integrate AI into their products immediately using our proven,
pre-trained and custom models or containers, without a need to set up an house team of AI and ML experts. This allows enterprises to focus on business drivers and development work rather than AI and ML operations, which shortens the time to market.

Methods

__init__(config, **kwargs) Creates a new service client
detect_dominant_language(…) Make a detect call to language detection pre-deployed model.
detect_language_entities(…) Make a detect call to enitiy pre-deployed model
detect_language_key_phrases(…) Make a detect call to the keyPhrase pre-deployed model.
detect_language_sentiments(…) Make a detect call to sentiment pre-deployed model.
detect_language_text_classification(…) Make a detect call to text classification from the pre-deployed model.
__init__(config, **kwargs)

Creates a new service client

Parameters:
  • config (dict) – Configuration keys and values as per SDK and Tool Configuration. The from_file() method can be used to load configuration from a file. Alternatively, a dict can be passed. You can validate_config the dict using validate_config()
  • service_endpoint (str) – (optional) The endpoint of the service to call using this client. For example https://iaas.us-ashburn-1.oraclecloud.com. If this keyword argument is not provided then it will be derived using the region in the config parameter. You should only provide this keyword argument if you have an explicit need to specify a service endpoint.
  • timeout (float or tuple(float, float)) – (optional) The connection and read timeouts for the client. The default values are connection timeout 10 seconds and read timeout 60 seconds. This keyword argument can be provided as a single float, in which case the value provided is used for both the read and connection timeouts, or as a tuple of two floats. If a tuple is provided then the first value is used as the connection timeout and the second value as the read timeout.
  • signer (AbstractBaseSigner) –

    (optional) The signer to use when signing requests made by the service client. The default is to use a Signer based on the values provided in the config parameter.

    One use case for this parameter is for Instance Principals authentication by passing an instance of InstancePrincipalsSecurityTokenSigner as the value for this keyword argument

  • retry_strategy (obj) –

    (optional) A retry strategy to apply to all calls made by this service client (i.e. at the client level). There is no retry strategy applied by default. Retry strategies can also be applied at the operation level by passing a retry_strategy keyword argument as part of calling the operation. Any value provided at the operation level will override whatever is specified at the client level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

  • circuit_breaker_strategy (obj) – (optional) A circuit breaker strategy to apply to all calls made by this service client (i.e. at the client level). This client will not have circuit breakers enabled by default, users can use their own circuit breaker strategy or the convenient DEFAULT_CIRCUIT_BREAKER_STRATEGY provided by the SDK to enable it. The specifics of circuit breaker strategy are described here.
  • circuit_breaker_callback (function) – (optional) Callback function to receive any exceptions triggerred by the circuit breaker.
detect_dominant_language(detect_dominant_language_details, **kwargs)

Make a detect call to language detection pre-deployed model.

Parameters:
  • detect_dominant_language_details (oci.ai_language.models.DetectDominantLanguageDetails) –

    (required) The details to make a language detection detect call. Example: `{“text”: “If an emerging growth company, indicate by check mark if the registrant has elected not

    to use the extended transition period for complying”}`
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type DetectDominantLanguageResult

Return type:

Response

Example:

Click here to see an example of how to use detect_dominant_language API.

detect_language_entities(detect_language_entities_details, **kwargs)

Make a detect call to enitiy pre-deployed model

Parameters:
  • detect_language_entities_details (oci.ai_language.models.DetectLanguageEntitiesDetails) –

    (required) The details to make a Entity detect call. Example: `{“text”: “If an emerging growth company, indicate by check mark if the registrant has elected not

    to use the extended transition period for complying”}`
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • model_version (str) –

    (optional) Named Entity Recognition model versions. By default user will get output from V2.1 implementation.

    Allowed values are: “V2.1”, “V1.1”

  • is_pii (bool) – (optional) If this parameter is set to true, you only get PII (Personally identifiable information) entities like PhoneNumber, Email, Person, and so on. Default value is false.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type DetectLanguageEntitiesResult

Return type:

Response

Example:

Click here to see an example of how to use detect_language_entities API.

detect_language_key_phrases(detect_language_key_phrases_details, **kwargs)

Make a detect call to the keyPhrase pre-deployed model.

Parameters:
  • detect_language_key_phrases_details (oci.ai_language.models.DetectLanguageKeyPhrasesDetails) –

    (required) The details to make keyPhrase detect call.

    Example: `{“text”: “If an emerging growth company, indicate by check mark if the registrant has elected not
    to use the extended transition period for complying”}`
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type DetectLanguageKeyPhrasesResult

Return type:

Response

Example:

Click here to see an example of how to use detect_language_key_phrases API.

detect_language_sentiments(detect_language_sentiments_details, **kwargs)

Make a detect call to sentiment pre-deployed model.

Parameters:
  • detect_language_sentiments_details (oci.ai_language.models.DetectLanguageSentimentsDetails) –

    (required) The details to make sentiment detect call. Example: `{“text”: “If an emerging growth company, indicate by check mark if the registrant has elected not

    to use the extended transition period for complying”}`
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type DetectLanguageSentimentsResult

Return type:

Response

Example:

Click here to see an example of how to use detect_language_sentiments API.

detect_language_text_classification(detect_language_text_classification_details, **kwargs)

Make a detect call to text classification from the pre-deployed model.

Parameters:
  • detect_language_text_classification_details (oci.ai_language.models.DetectLanguageTextClassificationDetails) – (required) The details to make text classification detect call. Example: {“text”: “If an emerging growth company, indicate by check mark if the registrant has elected not to use the extended transition period for complying”}
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type DetectLanguageTextClassificationResult

Return type:

Response

Example:

Click here to see an example of how to use detect_language_text_classification API.