Class NSAIAgent

AI services, such as Translation, Statistics, Sentiment analysis, backed by calls to Public Cloud providers.

Examples

NSAIAgent agent;
agent.callMethod(arg1, arg2);

Constructors

NSAIAgent()

Initializes a new instance of the NSAIAgent class.

Declaration

NSAIAgent

Examples

NSAIAgent agent;
agent.callMethod(arg1, arg2);

Methods

DetectLanguage(String)

Given a (reasonably short) text, detect the language it is written in.

Declaration

String DetectLanguage(String text)

Examples

NSAIAgent agent;
String text;
String res = agent.DetectLanguage(text);

Parameters

Type Name Description
String text

Returns

Type Description
String

DetectSentiment(String)

Detect the sentiment of a (reasonably short) text. Sentiment analysis may cause a translation to be made, since sentiment analysis only supports a limited set of languages

Declaration

NSSentiment DetectSentiment(String text)

Examples

NSAIAgent agent;
String text;
Sentiment res = agent.DetectSentiment(text);

Parameters

Type Name Description
String text

Returns

Type Description
NSSentiment

GetTrainingStatus()

Calling the HugoAI endpoint to fetch the current training status.

Declaration

NSCategorizationStatusResponse GetTrainingStatus()

Examples

NSAIAgent agent;
NSCategorizationStatusResponse res = agent.GetTrainingStatus();

Returns

Type Description
NSCategorizationStatusResponse Carrier to describe the current status of HugoAI categorization.

GuessCategory(Integer)

Given a ticket's ID, guess the ticket category it should be placed in.

Declaration

Integer GuessCategory(Integer ticketId)

Examples

NSAIAgent agent;
Integer ticketId;
Integer res = agent.GuessCategory(ticketId);

Parameters

Type Name Description
Integer ticketId ticket Id.

Returns

Type Description
Integer ticket category.

TrainCategoryGuesser(Integer,Integer,Integer)

The category guesser training API will be called with an array of CategorizationTrainingItem during the (background, Batch) execution of this call.

Declaration

String TrainCategoryGuesser(Integer selectionId, Integer maxItems, Integer maxTextLength)

Examples

NSAIAgent agent;
Integer selectionId;
Integer maxItems;
Integer maxTextLength;
String res = agent.TrainCategoryGuesser(selectionId, maxItems, maxTextLength);

Parameters

Type Name Description
Integer selectionId
Integer maxItems
Integer maxTextLength

Returns

Type Description
String

Translate(String,String)

Translate a text from one language to another.

Declaration

String Translate(String text, String targetLanguage)

Examples

NSAIAgent agent;
String text;
String targetLanguage;
String res = agent.Translate(text, targetLanguage);

Parameters

Type Name Description
String text Original text
String targetLanguage The language to translate to.

Returns

Type Description
String translated text.