"Help in the work": how to make chatbots smarter

ServiceNow announced the acquisition of a startup, Parlo, which develops solutions based on machine learning, in particular, systems for processing natural language (NLP). We will tell you about the purpose of acquiring a startup and the chat bot setup algorithm on the Now Platform platform.


/ photo ☰☵ Michele MF CC

Why is it ServiceNow


In Parlo offer Broca platform, which is sharpened by speech recognition. ServiceNow plan to integrate Broca into its Now Platform. Pat Casey, Senior Vice President, DevOps for ServiceNow, says the company is seeking to diversify the process of interacting with machines using gesture and voice recognition technology.

NLP functions are going to provide a chat bot with a Virtual Agent that already supports integration with IBM Watson. This chat bot is designed to handle requests from employees and customers and can perform a number of tasks, such as resetting passwords or generating an incident report. Virtual Agent chat rooms can also be integrated with corporate instant messengers: Slack or Microsoft Teams. According to the company, the chat bot is capable of processing 15–20% of all routine customer requests related, for example, with placing orders and checking their status.

When the Virtual Agent adds product features from Parlo, the chat bot can better understand employees (including slang and conversational phrases). Due to this, the staff and customers of the company will be easier to interact with the chat bot and the platform as a whole.


/ papa pic pd photo

The deal was to be closed at the end of May. After that, the SN planned to begin the implementation of NLP functions in the Virtual Agent solution. However, the Virtual Agent solution already has some “intellectual abilities” thanks to integration with IBM Watson.

They are already rated at the University of Alberta. Chat bot Virtual Agent used for two weeks. At the end of the test, the bot successfully processed 30% of incoming user requests. The university plans to continue using the system in solving everyday tasks in order to achieve an indicator of 80% or more.

How to create a chat bot


Now Platform allows you to implement your chat bot application integrated with IBM Watson services. Next, consider one of the implementation options provided in the ServiceNow documentation. In the whitepaper is the following algorithm:

1. Set subject rules

First you need to create an asynchronous rule in the live_message table. This will be the entry point for the chat bot application. The asynchronous approach unlocks semaphores before processing REST messages sent to the Watson system. These semaphores control the number of transactions executed in parallel. As a result, it helps to increase productivity when working with multiple users at the same time.

2. Call REST API

Next, you need to register the outgoing call REST to the Conversation service from IBM Watson. Here is an example of code that is held in the official ServiceNow document:

send: function(text) { try { var r = new sn_ws.RESTMessageV2 ('WatsonConversation', 'Message'); r.setStringParameterNoEscape ('message', text); r.setStringParameterNoEscape ('version', this.version); r.setStringParameterNoEscape ('workplaceId', this.workplace_id); r.setStringParameterNoEscape ('context', this.getContext ()); var response = r.execute(); var responseBody = response.getBody(); var httpStatus = response.getStatusCode(); var responseObj = JSON.parse(responseBody); return { intents: this.parseIntents(responseObj ['intents'],'intent','confidence'), entities: this.parseEntities(responseObj ['entities'], 'entity', 'value'), outputs: responseObj ['output'], ['text'], input: responseObj ['input'], ['text'], context: responseObj ['context'], conversation_id: responseObj ['context'], ['conversation_id'] response: responseBody }; } catch(ex) { gs.error(ex + ': ' + responseBody); gs.addErrorMessage(ex); gs.addErrorMessage(response); return ex; } }, 

This code uses the REST message object created earlier, sets the parameters and makes a REST call using r.execute (). Further, the script is blocked waiting for the response HTTP object.

3. Send the answer to the client chat

After the application code has received a response from the Watson service, and processing is complete, the system sends a response message to the end user. This is done using the LiveFeedMessage script and calling the postMessage (data) method.

Next, you need to set another rule for business logic, which already sends a message to the frontend (you can find the necessary list of configurations here ).

ServiceNow also offers another integration option that uses synchronous rules. You can read it in the pdf-document by reference .

Thus, the Virtual Agent chat bots will help to process a large number of similar requests, such as support, and give technical support specialists time to solve more complex tasks. As noted in ServiceNow, the system will be available from the version of the Kingston platform.



PS What we write about in the First blog about corporate IaaS:


PPS Our other materials on Habré:

Source: https://habr.com/ru/post/412789/


All Articles