Be the first to read our first Ebook!

In the Age of AutoML, we are all Data Scientists! | Artificial Intelligence (AI) has become increasingly essential to our daily routine lives.

Published on Jun 17, 2022 by Diamondra R

If you search the internet for the keyword "Text Sentiment Analysis," we immediately understand its interest. Still, the most important thing is to know how to set up an API that we can consume directly to integrate it into our application.

In this blog, we will describe the steps to quickly set up a "Text Sentiment Analysis" API without encountering obstacles such as finding a server and installing the necessary prerequisites but only in a few clicks.

This API can be interested in text categorization to improve sales and customer loyalty. Sentiment analysis lets you get a feel for how customers think about a product or service. Doing it manually is impossible due to the amount of data processing. These may be customer reviews published on social networks. We can use the author's sentiment information from these sources to make critical business decisions.

Step 1: Go to https://cloud.smartpredict.ai.

After login, click on “New Project.” 

Choose “Manual Flow” mode and create a project.

We will immediately go to the “deploy” button. We will not use the “build space.”

Then click confirm

From the list of modules on the right, search for the “BERT Sentiment Analysis Model” module from the search bar and drag the module to the left.

Then search for the "Model Predictor" module and drag the instance into the workspace like this.

Delete the default link between “WEB Service IN” and “WEB Service OUT” by clicking on it and pressing delete. Then connect each instance to have the same connection indicated by the image below.

This flowchart describes the tasks of our Webservice, which is to receive requests, then enter them into a predictor model using a BERT Sentiment Analysis model, and return the result to Web Service OUT.

We are then asked to insert an example of input, in this format.

Then click on deploy.

It depends on the use of our API, but if we wish to save resources, it is recommended to use serverless mode.

Here we choose the resource to allocate to our SPVM free deployment is more than enough to set up our Text Sentiment Analysis API.

Go to monitor space

Wait until it is ready to use it.

We have some sample code to integrate into our application, but first of all, it is interesting to test the model ourselves first

We have some sample code to integrate into our application, but first of all, it is interesting to test the model ourselves first

Click on predict, and let’s create a new request. Enter the name you want, but in our case, we will put “Text Sentiment Analysis.”

A default request is automatically generated. Let’s click immediately on the Launch Request button.

We immediately obtain the sentiment analysis results in response to our API. We can use any programming language we want (we can use sample code in the monitor space)

And this is how to set up a “Text Sentiment Analysis easily.”