azure.textanalytics
Module azure.textanalytics
API
Definitions
![](https://bcentral-dev-packageicons.azureedge.net/images/ballerinax_azure.textanalytics_1.3.0.png)
ballerinax/azure.textanalytics Ballerina library
Overview
This is a generated connector for Azure Text Analytics API v1 OpenAPI specification. The Text Analytics API is a suite of natural language processing (NLP) services built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction and language detection. Functionality for analysis of text specific to the healthcare domain and personal information are also available in the API. Further documentation can be found here
This module supports Azure Text Analytics API v1.
Prerequisites
Before using this connector in your Ballerina application, complete the following:
-
Create an Azure account
-
Create a Text Analysis resource
-
Obtain tokens by following this guide
Quickstart
To use the Azure Text Analytics connector in your Ballerina application, update the .bal file as follows:
Step 1: Import connector
Import the ballerinax/azure.textanalytics
module into the Ballerina project.
import ballerinax/azure.textanalytics;
Step 2: Create a new connector instance
You can now make the connection configuration using Ocp-Apim-Subscription-Key
.
You can do this step in two ways. You can use any one of this.
-
Option 1 : Configure API Keys in ballerina file directly.
nalytics:ApiKeysConfig apiKeyConfig = { cpApimSubscriptionKey:"<AZURE_API_KEY>" ubscriptionKey: "<Subscription Key>" nalytics:Client myClient = check new Client(apiKeyConfig, serviceUrl = "https://<REGION>.api.cognitive.microsoft.com/text/analytics/v3.1");
-
Option 2 : Configure API Keys in
Config.toml
file and configure it in ballerina file, using configurables.- Set up API Keys in
Config.toml
as shown below.
[apiKeyConfig] ocpApimSubscriptionKey = "<AZURE_API_KEY>" subscriptionKey = "<Subscription Key>"
- Configure the client in ballerina file as shown below.
configurable ApiKeysConfig & readonly apiKeyConfig = ?; textanalytics:Client myClient = check new Client(apiKeyConfig, serviceUrl = "https://<REGION>.api.cognitive.microsoft.com/text/analytics/v3.1");
- Set up API Keys in
Step 3: Invoke connector operation
-
Now you can use the operations available within the connector. Note that they are in the form of remote operations.
Following is an example on how to use sentiment prediction. The API returns a sentiment prediction, as well as sentiment scores for each sentiment class (Positive, Negative, and Neutral) for the document and each sentence within it.
Sentiment Prediction
public function main() returns error? { textanalytics:MultiLanguageBatchInput payload = { "documents": [ { "id": "string", "text": "string", "language": "string" } ]}; textanalytics:SentimentResponse res = check baseClient->sentiment(payload); }
-
Use
bal run
command to compile and run the Ballerina program.
Clients![](/images/permalink.svg)
azure.textanalytics: Client![](/images/permalink.svg)
This is a generated connector for Azure Text Analytics API v1 OpenAPI specification. The Text Analytics API is a suite of natural language processing (NLP) services built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction and language detection. Functionality for analysis of text specific to the healthcare domain and personal information are also available in the API. Further documentation can be found in https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview
Constructor![](/images/permalink.svg)
Gets invoked to initialize the connector
.
The connector initialization requires setting the API credentials.
Create a Azure Text Analytics account and obtain API key following this guide.
init (ApiKeysConfig apiKeyConfig, string serviceUrl, ClientConfiguration clientConfig)
- apiKeyConfig ApiKeysConfig - API keys for authorization
- serviceUrl string - URL of the target service
- clientConfig ClientConfiguration {} - The configurations to be used when initializing the
connector
healthStatus![](/images/permalink.svg)
function healthStatus(string jobId, int top, int skip, boolean? showStats) returns HealthcareJobState|error
Get healthcare analysis job status and results
Parameters
- jobId string - Format - uuid. Job ID
- top int (default 20) - (Optional) Set the maximum number of results per task. When both $top and $skip are specified, $skip is applied first.
- skip int (default 0) - (Optional) Set the number of elements to offset in the response. When both $top and $skip are specified, $skip is applied first.
- showStats boolean? (default ()) - (Optional) if set to true, response will contain request and document level statistics.
Return Type
- HealthcareJobState|error - OK
cancelHealthJob![](/images/permalink.svg)
Cancel healthcare prediction job
Parameters
- jobId string - Format - uuid. Job ID
languages![](/images/permalink.svg)
function languages(LanguageBatchInput payload, string? modelVersion, boolean? showStats, boolean? loggingOptOut) returns LanguageResult|error
Detect Language
Parameters
- payload LanguageBatchInput - Collection of documents to analyze for language endpoint.
- modelVersion string? (default ()) - (Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version.
- showStats boolean? (default ()) - (Optional) if set to true, response will contain request and document level statistics.
- loggingOptOut boolean? (default ()) - (Optional) If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to allow for troubleshooting issues in providing you with the Text Analytics natural language processing functions. Setting this parameter to true, disables input logging and may limit our ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI principles at https://www.microsoft.com/en-us/ai/responsible-ai.
Return Type
- LanguageResult|error - A successful call results in the detected language with the highest probability for each valid document
entitiesRecognitionPii![](/images/permalink.svg)
function entitiesRecognitionPii(MultiLanguageBatchInput payload, string? modelVersion, boolean? showStats, boolean? loggingOptOut, string? domain, string stringIndexType, string[]? piiCategories) returns PiiResult|error
Entities containing personal information
Parameters
- payload MultiLanguageBatchInput - Collection of documents to analyze.
- modelVersion string? (default ()) - (Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version.
- showStats boolean? (default ()) - (Optional) if set to true, response will contain request and document level statistics.
- loggingOptOut boolean? (default ()) - (Optional) If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to allow for troubleshooting issues in providing you with the Text Analytics natural language processing functions. Setting this parameter to true, disables input logging and may limit our ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI principles at https://www.microsoft.com/en-us/ai/responsible-ai.
- domain string? (default ()) - (Optional) if specified, will set the PII domain to include only a subset of the entity categories. Possible values include: 'PHI', 'none'.
- stringIndexType string (default "TextElement_v8") - (Optional) Specifies the method used to interpret string offsets. Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information see https://aka.ms/text-analytics-offsets
- piiCategories string[]? (default ()) - (Optional) describes the PII categories to return
Return Type
analyzeStatus![](/images/permalink.svg)
function analyzeStatus(string jobId, boolean? showStats, int top, int skip) returns AnalyzeJobState|error
Get analysis status and results
Parameters
- jobId string - Job ID for Analyze
- showStats boolean? (default ()) - (Optional) if set to true, response will contain request and document level statistics.
- top int (default 20) - (Optional) Set the maximum number of results per task. When both $top and $skip are specified, $skip is applied first.
- skip int (default 0) - (Optional) Set the number of elements to offset in the response. When both $top and $skip are specified, $skip is applied first.
Return Type
- AnalyzeJobState|error - Analysis job status and metadata.
keyPhrases![](/images/permalink.svg)
function keyPhrases(MultiLanguageBatchInput payload, string? modelVersion, boolean? showStats, boolean? loggingOptOut) returns KeyPhraseResult|error
Key Phrases
Parameters
- payload MultiLanguageBatchInput - Collection of documents to analyze.
- modelVersion string? (default ()) - (Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version.
- showStats boolean? (default ()) - (Optional) if set to true, response will contain request and document level statistics.
- loggingOptOut boolean? (default ()) - (Optional) If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to allow for troubleshooting issues in providing you with the Text Analytics natural language processing functions. Setting this parameter to true, disables input logging and may limit our ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI principles at https://www.microsoft.com/en-us/ai/responsible-ai.
Return Type
- KeyPhraseResult|error - A successful response results in 0 or more key phrases identified in each valid document
entitiesLinking![](/images/permalink.svg)
function entitiesLinking(MultiLanguageBatchInput payload, string? modelVersion, boolean? showStats, boolean? loggingOptOut, string stringIndexType) returns EntityLinkingResult|error
Linked entities from a well known knowledge base
Parameters
- payload MultiLanguageBatchInput - Collection of documents to analyze.
- modelVersion string? (default ()) - (Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version.
- showStats boolean? (default ()) - (Optional) if set to true, response will contain request and document level statistics.
- loggingOptOut boolean? (default ()) - (Optional) If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to allow for troubleshooting issues in providing you with the Text Analytics natural language processing functions. Setting this parameter to true, disables input logging and may limit our ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI principles at https://www.microsoft.com/en-us/ai/responsible-ai.
- stringIndexType string (default "TextElement_v8") - (Optional) Specifies the method used to interpret string offsets. Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information see https://aka.ms/text-analytics-offsets
Return Type
- EntityLinkingResult|error - A successful call results in a list of recognized entities with links to a well known knowledge base returned for each valid document
entitiesRecognitionGeneral![](/images/permalink.svg)
function entitiesRecognitionGeneral(MultiLanguageBatchInput payload, string? modelVersion, boolean? showStats, boolean? loggingOptOut, string stringIndexType) returns EntitiesResult|error
Named Entity Recognition
Parameters
- payload MultiLanguageBatchInput - Collection of documents to analyze.
- modelVersion string? (default ()) - (Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version.
- showStats boolean? (default ()) - (Optional) if set to true, response will contain request and document level statistics.
- loggingOptOut boolean? (default ()) - (Optional) If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to allow for troubleshooting issues in providing you with the Text Analytics natural language processing functions. Setting this parameter to true, disables input logging and may limit our ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI principles at https://www.microsoft.com/en-us/ai/responsible-ai.
- stringIndexType string (default "TextElement_v8") - (Optional) Specifies the method used to interpret string offsets. Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information see https://aka.ms/text-analytics-offsets
Return Type
- EntitiesResult|error - A successful call results in a list of recognized entities returned for each valid document.
sentiment![](/images/permalink.svg)
function sentiment(MultiLanguageBatchInput payload, string? modelVersion, boolean? showStats, boolean? loggingOptOut, boolean? opinionMining, string stringIndexType) returns SentimentResponse|error
Sentiment
Parameters
- payload MultiLanguageBatchInput - Collection of documents to analyze.
- modelVersion string? (default ()) - (Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version.
- showStats boolean? (default ()) - (Optional) if set to true, response will contain request and document level statistics.
- loggingOptOut boolean? (default ()) - (Optional) If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to allow for troubleshooting issues in providing you with the Text Analytics natural language processing functions. Setting this parameter to true, disables input logging and may limit our ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI principles at https://www.microsoft.com/en-us/ai/responsible-ai.
- opinionMining boolean? (default ()) - (Optional) if set to true, response will contain not only sentiment prediction but also opinion mining (aspect-based sentiment analysis) results.
- stringIndexType string (default "TextElement_v8") - (Optional) Specifies the method used to interpret string offsets. Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information see https://aka.ms/text-analytics-offsets
Return Type
- SentimentResponse|error - A successful call results in a document sentiment prediction, as well as sentiment scores for each sentiment class (Positive, Negative, and Neutral)
analyze![](/images/permalink.svg)
function analyze(AnalyzeBatchInput payload) returns Response|error
Submit analysis job
Parameters
- payload AnalyzeBatchInput - Collection of documents to analyze and tasks to execute.
Return Type
health![](/images/permalink.svg)
function health(MultiLanguageBatchInput payload, string? modelVersion, string stringIndexType, boolean? loggingOptOut) returns Response|error
Submit healthcare analysis job
Parameters
- payload MultiLanguageBatchInput - Collection of documents to analyze.
- modelVersion string? (default ()) - (Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version.
- stringIndexType string (default "TextElement_v8") - (Optional) Specifies the method used to interpret string offsets. Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information see https://aka.ms/text-analytics-offsets
- loggingOptOut boolean? (default ()) - (Optional) If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to allow for troubleshooting issues in providing you with the Text Analytics natural language processing functions. Setting this parameter to true, disables input logging and may limit our ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI principles at https://www.microsoft.com/en-us/ai/responsible-ai.
Records![](/images/permalink.svg)
azure.textanalytics: AnalysisInput![](/images/permalink.svg)
Fields
- analysisInput MultiLanguageBatchInput - Contains a set of input documents to be analyzed by the service.
azure.textanalytics: AnalyzeBatchInput![](/images/permalink.svg)
Fields
- Fields Included from *JobDescriptor
- displayName string
- anydata...
- Fields Included from *AnalysisInput
- analysisInput MultiLanguageBatchInput
- anydata...
- Fields Included from *JobManifest
- tasks JobmanifestTasks
- anydata...
azure.textanalytics: AnalyzeJobDisplayName![](/images/permalink.svg)
Fields
- displayName string? -
azure.textanalytics: AnalyzeJobErrorsAndStatistics![](/images/permalink.svg)
Fields
- errors TextAnalyticsError[]? -
- statistics RequestStatistics? - if showStats=true was specified in the request this field will contain information about the request payload.
azure.textanalytics: AnalyzeJobMetadata![](/images/permalink.svg)
Fields
- Fields Included from *JobMetadata
- Fields Included from *AnalyzeJobDisplayName
- displayName string
- anydata...
azure.textanalytics: AnalyzeJobState![](/images/permalink.svg)
Fields
- Fields Included from *AnalyzeJobMetadata
- Fields Included from *TasksState
- tasks TasksstateTasks
- anydata...
- Fields Included from *AnalyzeJobErrorsAndStatistics
- errors TextAnalyticsError[]
- statistics RequestStatistics
- anydata...
- Fields Included from *Pagination
- \@nextLink string
- anydata...
azure.textanalytics: ApiKeysConfig![](/images/permalink.svg)
Provides API key configurations needed when communicating with a remote HTTP endpoint.
Fields
- ocpApimSubscriptionKey string - Represents API Key
Ocp-Apim-Subscription-Key
- subscriptionKey string - Represents API Key
subscription-key
azure.textanalytics: DetectedLanguage![](/images/permalink.svg)
Fields
- name string - Long name of a detected language (e.g. English, French).
- iso6391Name string - A two letter representation of the detected language according to the ISO 639-1 standard (e.g. en, fr).
- confidenceScore float - A confidence score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true.
azure.textanalytics: DocumentEntities![](/images/permalink.svg)
Fields
- id string - Unique, non-empty document identifier.
- entities Entity[] - Recognized entities in the document.
- warnings TextAnalyticsWarning[] - Warnings encountered while processing document.
- statistics DocumentStatistics? - if showStats=true was specified in the request this field will contain information about the document payload.
azure.textanalytics: DocumentError![](/images/permalink.svg)
Fields
- id string - Document Id.
- _error TextAnalyticsError -
azure.textanalytics: DocumentHealthcareEntities![](/images/permalink.svg)
Fields
- id string - Unique, non-empty document identifier.
- entities HealthcareEntity[] - Healthcare entities.
- relations HealthcareRelation[] - Healthcare entity relations.
- warnings TextAnalyticsWarning[] - Warnings encountered while processing document.
- statistics DocumentStatistics? - if showStats=true was specified in the request this field will contain information about the document payload.
azure.textanalytics: DocumentKeyPhrases![](/images/permalink.svg)
Fields
- id string - Unique, non-empty document identifier.
- keyPhrases string[] - A list of representative words or phrases. The number of key phrases returned is proportional to the number of words in the input document.
- warnings TextAnalyticsWarning[] - Warnings encountered while processing document.
- statistics DocumentStatistics? - if showStats=true was specified in the request this field will contain information about the document payload.
azure.textanalytics: DocumentLanguage![](/images/permalink.svg)
Fields
- id string - Unique, non-empty document identifier.
- detectedLanguage DetectedLanguage -
- warnings TextAnalyticsWarning[] - Warnings encountered while processing document.
- statistics DocumentStatistics? - if showStats=true was specified in the request this field will contain information about the document payload.
azure.textanalytics: DocumentLinkedEntities![](/images/permalink.svg)
Fields
- id string - Unique, non-empty document identifier.
- entities LinkedEntity[] - Recognized well known entities in the document.
- warnings TextAnalyticsWarning[] - Warnings encountered while processing document.
- statistics DocumentStatistics? - if showStats=true was specified in the request this field will contain information about the document payload.
azure.textanalytics: DocumentSentiment![](/images/permalink.svg)
Fields
- id string - Unique, non-empty document identifier.
- sentiment string - Predicted sentiment for document (Negative, Neutral, Positive, or Mixed).
- statistics DocumentStatistics? - if showStats=true was specified in the request this field will contain information about the document payload.
- confidenceScores SentimentConfidenceScorePerLabel - Represents the confidence scores between 0 and 1 across all sentiment classes: positive, neutral, negative.
- sentences SentenceSentiment[] - Sentence level sentiment analysis.
- warnings TextAnalyticsWarning[] - Warnings encountered while processing document.
azure.textanalytics: DocumentStatistics![](/images/permalink.svg)
if showStats=true was specified in the request this field will contain information about the document payload.
Fields
- charactersCount int - Number of text elements recognized in the document.
- transactionsCount int - Number of transactions for the document.
azure.textanalytics: EntitiesResult![](/images/permalink.svg)
Fields
- documents DocumentEntities[] - Response by document
- errors DocumentError[] - Errors by document id.
- statistics RequestStatistics? - if showStats=true was specified in the request this field will contain information about the request payload.
- modelVersion string - This field indicates which model is used for scoring.
azure.textanalytics: EntitiesTask![](/images/permalink.svg)
Fields
- parameters EntitiestaskParameters? -
- taskName string? -
azure.textanalytics: EntitiestaskParameters![](/images/permalink.svg)
Fields
- 'model\-version string? -
- loggingOptOut boolean? -
- stringIndexType StringIndexType? -
azure.textanalytics: EntitiesTaskResult![](/images/permalink.svg)
Fields
- results EntitiesResult? -
azure.textanalytics: Entity![](/images/permalink.svg)
Fields
- text string - Entity text as appears in the request.
- category string - Entity type.
- subcategory string? - (Optional) Entity sub type.
- offset int - Start position for the entity text. Use of different 'stringIndexType' values can affect the offset returned.
- length int - Length for the entity text. Use of different 'stringIndexType' values can affect the length returned.
- confidenceScore float - Confidence score between 0 and 1 of the extracted entity.
azure.textanalytics: EntityLinkingResult![](/images/permalink.svg)
Fields
- documents DocumentLinkedEntities[] - Response by document
- errors DocumentError[] - Errors by document id.
- statistics RequestStatistics? - if showStats=true was specified in the request this field will contain information about the request payload.
- modelVersion string - This field indicates which model is used for scoring.
azure.textanalytics: EntityLinkingTask![](/images/permalink.svg)
Fields
- parameters EntitiestaskParameters? -
- taskName string? -
azure.textanalytics: EntityLinkingTaskResult![](/images/permalink.svg)
Fields
- results EntityLinkingResult? -
azure.textanalytics: ErrorResponse![](/images/permalink.svg)
Fields
- _error TextAnalyticsError -
azure.textanalytics: HealthcareAssertion![](/images/permalink.svg)
Fields
- conditionality string? - Describes any conditionality on the entity.
- certainty string? - Describes the entities certainty and polarity.
- association string? - Describes if the entity is the subject of the text or if it describes someone else.
azure.textanalytics: HealthcareEntity![](/images/permalink.svg)
Fields
- text string - Entity text as appears in the request.
- category string - Healthcare Entity Category.
- subcategory string? - (Optional) Entity sub type.
- offset int - Start position for the entity text. Use of different 'stringIndexType' values can affect the offset returned.
- length int - Length for the entity text. Use of different 'stringIndexType' values can affect the length returned.
- confidenceScore float - Confidence score between 0 and 1 of the extracted entity.
- Fields Included from *HealthcareLinkingProperties
- assertion HealthcareAssertion
- name string
- links HealthcareEntityLink[]
- anydata...
azure.textanalytics: HealthcareEntityLink![](/images/permalink.svg)
Fields
- dataSource string - Entity Catalog. Examples include: UMLS, CHV, MSH, etc.
- id string - Entity id in the given source catalog.
azure.textanalytics: HealthcareJobState![](/images/permalink.svg)
Fields
- Fields Included from *JobMetadata
- Fields Included from *HealthcareTaskResult
- results HealthcareResult
- errors TextAnalyticsError[]
- anydata...
- Fields Included from *Pagination
- \@nextLink string
- anydata...
azure.textanalytics: HealthcareLinkingProperties![](/images/permalink.svg)
Fields
- assertion HealthcareAssertion? -
- name string? - Preferred name for the entity. Example: 'histologically' would have a 'name' of 'histologic'.
- links HealthcareEntityLink[]? - Entity references in known data sources.
azure.textanalytics: HealthcareRelation![](/images/permalink.svg)
Every relation is an entity graph of a certain relationType, where all entities are connected and have specific roles within the relation context.
Fields
- relationType string - Type of relation. Examples include:
DosageOfMedication
or 'FrequencyOfMedication', etc.
- entities HealthcareRelationEntity[] - The entities in the relation.
azure.textanalytics: HealthcareRelationEntity![](/images/permalink.svg)
Fields
- ref string - Reference link object, using a JSON pointer RFC 6901 (URI Fragment Identifier Representation), pointing to the entity .
- role string - Role of entity in the relationship. For example: 'CD20-positive diffuse large B-cell lymphoma' has the following entities with their roles in parenthesis: CD20 (GeneOrProtein), Positive (Expression), diffuse large B-cell lymphoma (Diagnosis).
azure.textanalytics: HealthcareResult![](/images/permalink.svg)
Fields
- documents DocumentHealthcareEntities[] - Response by document
- errors DocumentError[] - Errors by document id.
- statistics RequestStatistics? - if showStats=true was specified in the request this field will contain information about the request payload.
- modelVersion string - This field indicates which model is used for scoring.
azure.textanalytics: HealthcareTaskResult![](/images/permalink.svg)
Fields
- results HealthcareResult? -
- errors TextAnalyticsError[]? -
azure.textanalytics: InnerError![](/images/permalink.svg)
Fields
- code string - Error code.
- message string - Error message.
- details record {}? - Error details.
- target string? - Error target.
- innererror InnerError? -
azure.textanalytics: JobDescriptor![](/images/permalink.svg)
Fields
- displayName string? - Optional display name for the analysis job.
azure.textanalytics: JobManifest![](/images/permalink.svg)
Fields
- tasks JobmanifestTasks - The set of tasks to execute on the input documents. Cannot specify the same task more than once.
azure.textanalytics: JobmanifestTasks![](/images/permalink.svg)
The set of tasks to execute on the input documents. Cannot specify the same task more than once.
Fields
- entityRecognitionTasks EntitiesTask[]? - Array of EntityRecognitionTasks records
- entityRecognitionPiiTasks PiiTask[]? - Array of EntityRecognitionPiiTasks records
- keyPhraseExtractionTasks KeyPhrasesTask[]? - Array of EntityRecognitionTasks records
- entityLinkingTasks EntityLinkingTask[]? - Array of EntityLinkingTasks records
- sentimentAnalysisTasks SentimentAnalysisTask[]? - Array of SentimentAnalysisTasks records
azure.textanalytics: JobMetadata![](/images/permalink.svg)
Fields
- createdDateTime string -
- expirationDateTime string? -
- jobId string -
- lastUpdateDateTime string -
- status string -
azure.textanalytics: KeyPhraseResult![](/images/permalink.svg)
Fields
- documents DocumentKeyPhrases[] - Response by document
- errors DocumentError[] - Errors by document id.
- statistics RequestStatistics? - if showStats=true was specified in the request this field will contain information about the request payload.
- modelVersion string - This field indicates which model is used for scoring.
azure.textanalytics: KeyPhrasesTask![](/images/permalink.svg)
Fields
- parameters KeyphrasestaskParameters? -
- taskName string? -
azure.textanalytics: KeyphrasestaskParameters![](/images/permalink.svg)
Fields
- 'model\-version string? -
- loggingOptOut boolean? -
azure.textanalytics: KeyPhraseTaskResult![](/images/permalink.svg)
Fields
- results KeyPhraseResult? -
azure.textanalytics: LanguageBatchInput![](/images/permalink.svg)
Fields
- documents LanguageInput[] -
azure.textanalytics: LanguageInput![](/images/permalink.svg)
Fields
- id string - Unique, non-empty document identifier.
- text string -
- countryHint string? -
azure.textanalytics: LanguageResult![](/images/permalink.svg)
Fields
- documents DocumentLanguage[] - Response by document
- errors DocumentError[] - Errors by document id.
- statistics RequestStatistics? - if showStats=true was specified in the request this field will contain information about the request payload.
- modelVersion string - This field indicates which model is used for scoring.
azure.textanalytics: LinkedEntity![](/images/permalink.svg)
Fields
- name string - Entity Linking formal name.
- matches Match[] - List of instances this entity appears in the text.
- language string - Language used in the data source.
- id string? - Unique identifier of the recognized entity from the data source.
- url string - URL for the entity's page from the data source.
- dataSource string - Data source used to extract entity linking, such as Wiki/Bing etc.
- bingId string? - Bing Entity Search API unique identifier of the recognized entity.
azure.textanalytics: Match![](/images/permalink.svg)
Fields
- confidenceScore float - If a well known item is recognized, a decimal number denoting the confidence level between 0 and 1 will be returned.
- text string - Entity text as appears in the request.
- offset int - Start position for the entity match text.
- length int - Length for the entity match text.
azure.textanalytics: MultiLanguageBatchInput![](/images/permalink.svg)
Contains a set of input documents to be analyzed by the service.
Fields
- documents MultiLanguageInput[] - The set of documents to process as part of this batch.
azure.textanalytics: MultiLanguageInput![](/images/permalink.svg)
Contains an input document to be analyzed by the service.
Fields
- id string - A unique, non-empty document identifier.
- text string - The input text to process.
- language string? - (Optional) This is the 2 letter ISO 639-1 representation of a language. For example, use "en" for English; "es" for Spanish etc. If not set, use "en" for English as default.
azure.textanalytics: Pagination![](/images/permalink.svg)
Fields
- '\@nextLink string? -
azure.textanalytics: PiiDocumentEntities![](/images/permalink.svg)
Fields
- id string - Unique, non-empty document identifier.
- redactedText string - Returns redacted text.
- entities Entity[] - Recognized entities in the document.
- warnings TextAnalyticsWarning[] - Warnings encountered while processing document.
- statistics DocumentStatistics? - if showStats=true was specified in the request this field will contain information about the document payload.
azure.textanalytics: PiiResult![](/images/permalink.svg)
Fields
- documents PiiDocumentEntities[] - Response by document
- errors DocumentError[] - Errors by document id.
- statistics RequestStatistics? - if showStats=true was specified in the request this field will contain information about the request payload.
- modelVersion string - This field indicates which model is used for scoring.
azure.textanalytics: PiiTask![](/images/permalink.svg)
Fields
- parameters PiitaskParameters? -
- taskName string? -
azure.textanalytics: PiitaskParameters![](/images/permalink.svg)
Fields
- domain string? -
- 'model\-version string? -
- loggingOptOut boolean? -
- piiCategories PiiCategories? - (Optional) describes the PII categories to return
- stringIndexType StringIndexType? -
azure.textanalytics: PiiTaskResult![](/images/permalink.svg)
Fields
- results PiiResult? -
azure.textanalytics: RequestStatistics![](/images/permalink.svg)
if showStats=true was specified in the request this field will contain information about the request payload.
Fields
- documentsCount int - Number of documents submitted in the request.
- validDocumentsCount int - Number of valid documents. This excludes empty, over-size limit or non-supported languages documents.
- erroneousDocumentsCount int - Number of invalid documents. This includes empty, over-size limit or non-supported languages documents.
- transactionsCount int - Number of transactions for the request.
azure.textanalytics: SentenceAssessment![](/images/permalink.svg)
Fields
- sentiment string - Assessment sentiment in the sentence.
- confidenceScores TargetConfidenceScoreLabel - Represents the confidence scores across all sentiment classes: positive, neutral, negative.
- offset int - The assessment offset from the start of the sentence.
- length int - The length of the assessment.
- text string - The assessment text detected.
- isNegated boolean - The indicator representing if the assessment is negated.
azure.textanalytics: SentenceSentiment![](/images/permalink.svg)
Fields
- text string - The sentence text.
- sentiment string - The predicted Sentiment for the sentence.
- confidenceScores SentimentConfidenceScorePerLabel - Represents the confidence scores between 0 and 1 across all sentiment classes: positive, neutral, negative.
- offset int - The sentence offset from the start of the document.
- length int - The length of the sentence.
- targets SentenceTarget[]? - The array of sentence targets for the sentence.
- assessments SentenceAssessment[]? - The array of assessments for the sentence.
azure.textanalytics: SentenceTarget![](/images/permalink.svg)
Fields
- sentiment string - Targeted sentiment in the sentence.
- confidenceScores TargetConfidenceScoreLabel - Represents the confidence scores across all sentiment classes: positive, neutral, negative.
- offset int - The target offset from the start of the sentence.
- length int - The length of the target.
- text string - The target text detected.
- relations TargetRelation[] - The array of either assessment or target objects which is related to the target.
azure.textanalytics: SentimentAnalysisTask![](/images/permalink.svg)
Fields
- parameters SentimentanalysistaskParameters? -
- taskName string? -
azure.textanalytics: SentimentanalysistaskParameters![](/images/permalink.svg)
Fields
- 'model\-version string? -
- loggingOptOut boolean? -
- opinionMining boolean? -
- stringIndexType StringIndexType? -
azure.textanalytics: SentimentConfidenceScorePerLabel![](/images/permalink.svg)
Represents the confidence scores between 0 and 1 across all sentiment classes: positive, neutral, negative.
Fields
- positive float - Positive value
- neutral float - Nuetral value
- negative float - Negative value
azure.textanalytics: SentimentResponse![](/images/permalink.svg)
Fields
- documents DocumentSentiment[] - Sentiment analysis per document.
- errors DocumentError[] - Errors by document id.
- statistics RequestStatistics? - if showStats=true was specified in the request this field will contain information about the request payload.
- modelVersion string - This field indicates which model is used for scoring.
azure.textanalytics: SentimentTaskResult![](/images/permalink.svg)
Fields
- results SentimentResponse? -
azure.textanalytics: TargetConfidenceScoreLabel![](/images/permalink.svg)
Represents the confidence scores across all sentiment classes: positive, neutral, negative.
Fields
- positive float - Positive
- negative float - Negative
azure.textanalytics: TargetRelation![](/images/permalink.svg)
Fields
- relationType string - The type related to the target.
- ref string - The JSON pointer indicating the linked object.
azure.textanalytics: TasksState![](/images/permalink.svg)
Fields
- tasks TasksstateTasks -
azure.textanalytics: TasksstateTasks![](/images/permalink.svg)
Fields
- completed int -
- failed int -
- inProgress int -
- total int -
- entityRecognitionTasks record {}[]? -
- entityRecognitionPiiTasks record {}[]? -
- keyPhraseExtractionTasks record {}[]? -
- entityLinkingTasks record {}[]? -
- sentimentAnalysisTasks record {}[]? -
azure.textanalytics: TaskState![](/images/permalink.svg)
Fields
- lastUpdateDateTime string -
- taskName string? -
- status string -
azure.textanalytics: TextAnalyticsError![](/images/permalink.svg)
Fields
- code string - Error code.
- message string - Error message.
- target string? - Error target.
- innererror InnerError? -
- details TextAnalyticsError[]? - Details about specific errors that led to this reported error.
azure.textanalytics: TextAnalyticsWarning![](/images/permalink.svg)
Fields
- code string - Error code.
- message string - Warning message.
- targetRef string? - A JSON pointer reference indicating the target object.
String types![](/images/permalink.svg)
azure.textanalytics: StringIndexType![](/images/permalink.svg)
StringIndexType
Import
import ballerinax/azure.textanalytics;
Metadata
Released date: over 1 year ago
Version: 1.3.0
License: Apache-2.0
Compatibility
Platform: any
Ballerina version: 2201.2.1
GraalVM compatible: Yes
Pull count
Total: 0
Current verison: 0
Weekly downloads
Keywords
IT Operations/Cloud Services
Cost/Paid
Vendor/Microsoft
Contributors
Dependencies