Using Sentiment Analysis Via Web Services

<< Click to Display Table of Contents >>

Navigation:  Advanced >

Using Sentiment Analysis Via Web Services

The ThinkAutomation Sentiment Analysis Engine can be accessed directly via the ThinkAutomation Web Services. This enables you to train the Sentiment Analyzer and get Sentiment Scores for any text directly without having to create Triggers. Messages sent for Training or Scoring via the web services will not be stored in the ThinkAutomation Message Store. Only the Sentiment Analyzer database will be updated.

 

The following web service calls can be made:

 

SentimentTrainNegative(UserName As String, Password As String, ClassName As String, MessageText As String) As Integer

 

Trains the Sentiment Engine with a negative sentiment message contained in MessageText. Pass an optional ClassName to separate specific classes of sentiment (eg, Sales, Support etc). You must pass your ThinkAutomation UserName/Password. Returns the number of tokens added.

 

SentimentTrainPositive(UserName As String, Password As String, ClassName As String, MessageText As String) As Integer

 

Trains the Sentiment Engine with a positive sentiment message contained in MessageText. Pass an optional ClassName to separate specific classes of sentiment (eg, Sales, Support etc). You must pass your ThinkAutomation UserName/Password. Returns the number of tokens added.

 

SentimentAddIgnoreWords(UserName As String, Password As String, ClassName As String, IgnoreWords As String) As Integer

 

Adds ignore words to the Sentiment Engine contained in IgnoreWords. Pass an optional ClassName to separate specific classes of sentiment (eg, Sales, Support etc). You must pass your ThinkAutomation UserName/Password. Returns the number of unique ignore tokens added.

 

SentimentClear(UserName As String, Password As String, ClassName As String) As Integer

 

Clears all tokens from the Sentiment Database for the specified ClassName. Returns the number of tokens deleted.

 

SentimentScore(UserName As String, Password As String, ClassName As String, MessageText As String) As Integer

 

Returns the sentiment score for the message contained in MessageText. Pass an optional ClassName to separate specific classes of sentiment (eg, Sales, Support etc). You must pass your ThinkAutomation UserName/Password. Returns the score between 1 and 100. 100 being maximum positive sentiment.

 

 

All the Sentiment Analysis web services will return a negative number if an error occurs.

-1 = Sentiment Analyzer could not connect to the database.

-2 = Access denied - invalid username/password specified.

-3 = Could not initialize. The web services could not read the ThinkAutomation settings via the registry.

-4 = Other error.

 

Note: The password passed to these functions can either be the plain text password or a Base64 encoded MD5Hash of the password.

 

Note: Messages passed to the SentimentScore or Training functions are not stored in the ThinkAutomation Message Store when called directly from the web services. If using the ThinkAutomation Hosted Service however, they will count towards the total allowed monthly messages processed count that your hosted subscription includes.

ThinkAutomation © Parker Software 2016