Siebel REST API for the Language AI Service

The REST API for Language AI service supports named entity recognition (NER) with an option to select custom PII. Note the following about using this API:

  1. You can specify to detect one or more named entities in the text.

  2. You can specify to detect PII entities only by mentioning them in the request payload.

  3. Input text (including batch loads) is analyzed for named entities.

  4. The response is filtered based on the PII list specified.

    If no PII is specified, then all named entities will be recognised in the response.

  5. The request parameters to use when calling the Language NER API are described in the following table.

    Request Parameter Description

    key

    This parameter refers to the document index (SR Id or other identifier). The value is in the format doc_<index> where <index> is an integer. Some example values are doc1, doc2, and so on.

    text

    The input text from which the named entities are to be recognised.

    PII

    The subset of named entities – which you can select from the entire list of Named Entities.

  6. The output parameters for the Language NER API service are described in the following table.

    Output Parameter Description

    Status

    The status of the operation.

    OPCRequestId

    The request/transaction ID maintained by the OCI. This identifier is also used by any debug or DevOps operation.

    key

    Refers to the document index using the SR Id or other identifier.

    Entities

    An array of named entities identified by OCI in the text. Each array element has a 'type' and 'text' element where:

    • type refers to the type of named entity (such as PHONE_NUMBER, EMAIL, ORG, EVENT, and so on).

    • text refers to the exact text (word/number) representing the entity.

Sample API to be Invoked (POST)

 https://<hostname:port>/<siebel>/<v1.0>/service/SiebelOCIAIWebService/InvokeOCIAI

Sample Request Payload

{

"body" :
    {
        "Context": "Language:BatchDetectLanguageEntities", 
        "BatchDetectLanguageEntities_Param_1":
        {
            "documents":[
            {
             "key": "doc1",
             "text":"Oracle has partnered with zoom for the best audio experience. Please select computer audio when joining the meeting. You can download the Zoom mobile app on iOS or Android for HD audio. Zoom interface is very simple and intuitive to use. For educational vieos on other amazing Oracle Products, please reach out to  edus_in@oracle.com"
            },
            {
              "key": "doc2",
             "text": "Red Bull Racing Honda is a car company."
                } ,
                {
             "key":"doc3",
             "text": "In 2020 people worldwide moved to working remotely because of the COVID-19 pandemic. As a result, collaborative tools like video conferencing, email and chat have become critical, as they allow employees to perform their jobs from home. However, the human element of work has been much more difficult for workforces to navigate, bringing mental health and burnout challenges to the forefront. To support current remote workforce challenges, organisations are turning to emerging technologies such as artificial intelligence (AI), machine learning (ML), and chatbots in partnership with Workforce Intelligence to benefit million of users."
                } ,
                 {
             "key":"doc4",
             "text": "OCI recently added new services to existing compliance program including SOC, HIPAA, and ISO to enable our customers to solve their use cases. We also released new white papers and guidance documents related to Object Storage, the Australian Prudential Regulation Authority (APRA), and the Central Bank of Brazil. These resources help regulated customers better understand how OCI supports their regional and industry-specific compliance requirements. Not only are we expanding our number of compliance offerings and regulatory alignments, we continue to add regions and services at a faster clip."
                }
            ]
        },
        "BatchDetectLanguageEntities_Param_2":"pii:email,phone_number,org"
    }
}

Other entity types (such as URL, IPADDRESS, and so on) can be specified for example as follows:

"Context": "Language:BatchDetectLanguageEntities", 
"BatchDetectLanguageEntities_Param_2":"pii:email,phone_number,org,person,URL,IPADDRESS"

The following will detect and return all PII entity information in the given text documents:

"Context": "Language:BatchDetectLanguageEntities", 
"BatchDetectLanguageEntities_Param_3":"PII"

Sample Corresponding Response Payload

{
    "Status": "Success",
    "OPCRequestId": "850E5831E5BE437FA6DE27EE61583F77/2D62DEA891C61E675399E2F20BACC56F/E749D506C91009EE9B90BF8E7714E7B7",
    "documents": {
        "Response": [
            {
                "key": "doc4",
                "entities": [
                    {
                        "type": "ORG",
                        "length": "3",
                        "offset": "0",
                        "text": "OCI",
                        "subType": "null",
                        "score": "1.0"
                    },
                    {
                        "type": "ORG",
                        "length": "3",
                        "offset": "73",
                        "text": "SOC",
                        "subType": "null",
                        "score": "1.0"
                    },
                    {
                        "type": "ORG",
                        "length": "5",
                        "offset": "78",
                        "text": "HIPAA",
                        "subType": "null",
                        "score": "1.0"
                    },
                    {
                        "type": "ORG",
                        "length": "3",
                        "offset": "89",
                        "text": "ISO",
                        "subType": "null",
                        "score": "1.0"
                    },
                    {
                        "type": "ORG",
                        "length": "42",
                        "offset": "231",
                        "text": "Australian Prudential Regulation Authority",
                        "subType": "null",
                        "score": "1.0"
                    },
                    {
                        "type": "ORG",
                        "length": "12",
                        "offset": "290",
                        "text": "Central Bank",
                        "subType": "null",
                        "score": "0.9999995827674866"
                    },
                    {
                        "type": "ORG",
                        "length": "3",
                        "offset": "377",
                        "text": "OCI",
                        "subType": "null",
                        "score": "1.0"
                    }
                ]
            },
            {
                "key": "doc3",
                "entities": {
                    "type": "ORG",
                    "length": "22",
                    "offset": "586",
                    "text": "Workforce Intelligence",
                    "subType": "null",
                    "score": "1.0"
                }
            },
            {
                "key": "doc2",
                "entities": {
                    "type": "ORG",
                    "length": "21",
                    "offset": "0",
                    "text": "Red Bull Racing Honda",
                    "subType": "null",
                    "score": "1.0"
                }
            },
            {
                "key": "doc1",
                "entities": [
                    {
                        "type": "ORG",
                        "length": "6",
                        "offset": "0",
                        "text": "Oracle",
                        "subType": "null",
                        "score": "1.0"
                    },
                    {
                        "type": "ORG",
                        "length": "6",
                        "offset": "277",
                        "text": "Oracle",
                        "subType": "null",
                        "score": "1.0"
                    },
                    {
                        "type": "EMAIL",
                        "length": "18",
                        "offset": "315",
                        "text": "edus_in@oracle.com",
                        "subType": "null",
                        "score": "0.9752325245161998"
                    }
                ]
            }
        ]
    }
}

Sample API to be Invoked (POST)

https://<siebel server or host>:<host port>/siebel/v1.0/service/SiebelOCIAIWebService/InvokeOCIAI
Example:
https://phoenix201061.appsdev1.fusionappsdphx1.oraclevcn.com:16690/siebel/v1.0/service/SiebelOCIAIWebService/InvokeOCIAI

authentication : sadmin/ldap

Sample Payload for Sentiment Analysis

//Request payload:
{
    "body": {
        "Context": "Language:BatchDetectLanguageSentiments",  
        "BatchDetectLanguageSentiments_Param_1": {
          "documents": [
                {
                    "key": "doc1",
                    "text": "Oracle has partnered with zoom for the best audio experience. Please select computer audio when joining the meeting. You can download the Zoom mobile app on iOS or Android for HD audio. Zoom interface is very simple and intuitive to use. For educational vieos on other amazing Oracle Products, please reach out to  edus_in@oracle.com"
                }
            ]
        }        
    }
}

Sample Corresponding Response Payload

{
    "Status": "Success",
    "OPCRequestId": "E20E0932B4054EACBE6BB33F0A3CC146/43994C43A1BED9FA5C8AFA622AE952E5/5B6D9C80A0325E6DF47BD7A871756495",
    "documents": {
        "Response": {
            "key": "doc1",
            "documentSentiment": "Positive",
            "Sentiments": {
                "positive": "0.97745436",
                "negative": "0.0",
                "mixed": "0.022545636",
                "neutral": "0.0"
            }
        }
    }
}

Sample Payload for Text Classification

//Request payload
{
    "body": {
        "Context": "Language:BatchDetectLanguageTextClassification",  
        "BatchDetectLanguageTextClassification_Param_1": {
          "documents": [
                {
                    "key": "doc1",
                    "text": "Oracle has partnered with zoom for the best audio experience. Please select computer audio when joining the meeting. You can download the Zoom mobile app on iOS or Android for HD audio. Zoom interface is very simple and intuitive to use. For educational vieos on other amazing Oracle Products, please reach out to  edus_in@oracle.com"
                },
                {
                    "key": "doc2",
                    "text": "OCI recently added new services to existing compliance program including SOC, HIPAA, and ISO to enable our customers to solve their use cases. We also released new white papers and guidance documents related to Object Storage, the Australian Prudential Regulation Authority (APRA), and the Central Bank of Brazil. These resources help regulated customers better understand how OCI supports their regional and industry-specific compliance requirements. Not only are we expanding our number of compliance offerings and regulatory alignments, we continue to add regions and services at a faster clip."
                },
                {
                    "key": "doc3",
                    "text": "Red Bull Racing Honda is a car company."
                }
            ]
        }        
    }
    
}

Sample Corresponding Response Payload

{
    "Status": "Success",
    "OPCRequestId": "7A0A64D4CD2841808B250320F28A2ECC/89E562C0784B8EA5F48B8FB5FA463FF3/20A50715BA04A46CC7398C9B856F53E8",
    "documents": {
        "Response": [
            {
                "key": "doc3",
                "TextClassification": {
                    "label": "Autos and Vehicles/Motor Vehicles",
                    "score": "0.371180564"
                }
            },
            {
                "key": "doc2",
                "TextClassification": {
                    "label": "Business and Industry/Business Operations",
                    "score": "0.193597227"
                }
            },
            {
                "key": "doc1",
                "TextClassification": {
                    "label": "Computer and Electronics/Software",
                    "score": "1.0"
                }
            }
        ]
    }
}

Sample Payload for Detection of Dominant Language

//Request payload
{
    "body": {
        "Context": "Language:BatchDetectDominantLanguage",  
        "BatchDetectDominantLanguage_Param_1": {
          "documents": [
                {
                    "key": "doc1",
                    "text": "Oracle has partnered with zoom for the best audio experience. Please select computer audio when joining the meeting. You can download the Zoom mobile app on iOS or Android for HD audio. Zoom interface is very simple and intuitive to use. For educational vieos on other amazing Oracle Products, please reach out to  edus_in@oracle.com"
                },
           
                {
                    "key": "doc3",
                    "text": "Buongiorno! Oggi vi presento la mia famiglia. Io sono il padre, mi chiamo Gennaro Pirlo, ho trentasette anni, e lavoro come scrittore e giornalista da quando ne avevo venti.Mia moglie si chiama Antonella Totti, ha trentacinque anni ed è una splendida attrice di teatro.La nostra famiglia è composta anche da altre due persone, i nostri figli, Manuela che ha diciassette anni, e Marco che ha quindici anni, e poi c'è anche Tremendo, il cane che vive con noi da nove anni, ed è parte della famiglia. Viviamo tutti nella nostra splendida casa con un grande giardino."
                }
            ]
        }        
    }
    
}

Sample Corresponding Response Payload

{
    "Status": "Success",
    "OPCRequestId": "E3DAADACD8784125AAA7BC38316813E4/1714D759EB3309119E0C4E7ADC9390E0/F170A38C6C089C7FF7289EA4D3F9897F",
    "documents": {
        "Response": [
            {
                "key": "doc3",
                "languages": {
                    "name": "Italian",
                    "code": "it",
                    "score": "1.0"
                }
            },
           
            {
                "key": "doc1",
                "languages": {
                    "name": "English",
                    "code": "en",
                    "score": "1.0"
                }
            }
        ]
    }
}

Sample Payload for Language Translation

//Request payload
{
   "body": {
        "Context": "Language:BatchLanguageTranslation",  
        "BatchLanguageTranslation_Param_1": {
          "documents": [
                {
                    "key": "doc1",
                    "text": "Oracle has partnered with zoom for the best audio experience. Please select computer audio when joining the meeting. You can download the Zoom mobile app on iOS or Android for HD audio. Zoom interface is very simple and intuitive to use. For educational vieos on other amazing Oracle Products, please reach out to  edus_in@oracle.com"
                }
            ]
        },
        "BatchLanguageTranslation_Param_2": "TargetLanguageCode:it"        
    }
    
}

Sample Corresponding Response Payload

{
    "Status": "Success",
    "OPCRequestId": "19CFED98A2F140C7B60F264C8D62CEB4/3E01A076AF57008E32532C2CA3934FD9/4544F0D0E7F084C36AA821B6565102E3",
    "documents": {
        "Response": {
            "key": "doc1",
            "LanguageTranslation": {
                "translatedText": "Oracle ha stretto una partnership con zoom per offrire la migliore esperienza audio. Selezionare l'audio del computer quando si partecipa alla riunione. È possibile scaricare l'app mobile Zoom su iOS o Android per l'audio HD. L'interfaccia Zoom è molto semplice e intuitiva da usare. Per conoscere gli eventi formativi su altri straordinari prodotti Oracle, contatta  edus_in@oracle.com"
            }
        }
    }
}

Sample Payload for LanguagePiiEntities

//Request Payload
{
    "body": {
        "Context": "Language:BatchDetectLanguagePiiEntities",
        "BatchDetectLanguagePiiEntities_Param_1": {
            "documents": [
                {
                    "key": "doc1",
                    "text": "A SWIFT (Society for Worldwide Interbank Financial Telecommunication) code, also known as a BIC (Bank Identifier Code) number is HDFC000009"
                }
            ]
        },
        "BatchDetectLanguagePiiEntities_Param_2": "mode:MASK",
        "BatchDetectLanguagePiiEntities_Param_3": "isUnmaskedFromEnd:true",
        "BatchDetectLanguagePiiEntities_Param_4": "leaveCharactersUnmasked:3",
        "BatchDetectLanguagePiiEntities_Param_5": "maskingCharacter:*"
    }
}

Sample Corresponding Response Payload

{
    "Status": "Success",
    "OPCRequestId": "3E866FFD9FDB4F92B2093DD55CA1713D/E7A63B05AB6FF208BE87332C70321DE5/4A1C05FCCDE9A3F23FD13B14CBDBBB4A",
    "documents": {
        "Response": {
            "key": "doc1",
            "entities": {
                "type": "BANK_SWIFT",
                "length": "10",
                "maskedText": "A SWIFT (Society for Worldwide Interbank Financial Telecommunication) code, also known as a BIC (Bank Identifier Code) number is *******009",
                "languageCode": "en",
                "offset": "129",
                "text": "HDFC000009",
                "score": "0.9926007986068726"
            }
        }
    }

For more information about using the Siebel REST API for Language AI Service, see Siebel REST API Guide.