NLP Pipelines

Enterprises can use the services of Webex Bot Builder intelligence rather than building a complete chatbot. An NLP pipeline bot is built using intelligence modules and is exposed as a service.

Webex Bot Builder platform enables developers to leverage pre-built Intelligence Modules (third-party or Webex Bot Builder libraries). These libraries help to "understand" the user's natural language input. A developer can choose the libraries they wish to include and also determine the order in which they are invoked. This selection, arrangement, and configuring of Intelligence Modules can be done through the Pipeline tab. Whenever an input is received from a user, it is parsed and passed through this pipeline. All the modules in the pipeline execute on this input text in sequential order.

For example, performing a spell check, date and time recognition from an application form, or converting audio into text.

Building an NLP pipeline bot

Follow these steps to build an NLP pipeline based bot (Bot intelligence as a service):

  1. Click +New NLP Pipeline.
1874

New NLP Pipeline bot

The Bot Profile screen appears.

1275
  1. Specify this information and click Done to create a new pipeline bot.
FieldDescription
Bot Unique NameA unique name for the bot that appears in the Bot URL that is used to chat with the Bot. The name cannot be edited once the bot is created. This appears below the heading and is used to define the purpose or scope of the bot.
Bot NameDisplay name for the bot. When the bot is accessed, the name of the bot will be displayed in the bot chat window beside the bot logo.
URL for the Bot Logo/Brand ImageThe URL from where the bot logo or image defaults.
  1. After the bot creation, from the categorized Intelligence libraries based on the media type on the NLP tab of the Input Recognition screen, click add to add the module to the Bot Intelligence Pipeline on the left-hand side. These modules are invoked in the order they are arranged.

Note: Modules related to text, image, video, and audio are grouped on each tab. Bot developers can now quickly access the text modules, image modules, video modules, and audio modules by navigating to the Text, Image, Video, and Audio tabs separately.

For more information, see the Intelligence module.

1829

Modules to add in the pipeline

Note: You can remove the modules that are added to the bot intelligence pipeline, using the remove icon corresponding to the module.

1830
  1. To reorder the modules manually, drag the module and drop it at the required place.
  2. Click Update Pipeline.

When the bot building is successful, the bot is displayed on the NLP Pipelines tab of the Dashboard.

NLP pipeline testing

Pipeline bot testing can be performed either by providing the text or URL on the Test pipeline bot screen. Based on the bot intelligence modules configured in the NLP, consumer inputs are processed through this sequence of modules to segregate the input parameters accordingly for analyzing the sentiment of the text, performing the spell check, expanding the contracted consumer text, and so on.

Follow these steps to test a pipeline based bot:

  1. Select a specific pipeline bot on the NLP pipelines tab of the dashboard.
  2. Click the Test tab. The Test NLP pipeline screen appears.
1826

Pipeline bot screen for testing

  1. Select the Message type input. Possible values:
  • Text
  • URL
1826

Message type inputs

  1. Enter the message in the provided Message box, in case if you set the Message type input to Text
    Note: Provide the URL, if you set the Message type Input to URL. You also have to add URL-related modules in the bot intelligence pipeline (such as OCR).
  2. Click Test pipeline to classify the input parameters in the consumer message based on the configured bot intelligence modules.
1920

Test result of pipeline bot for the text message input

1821

Test result of pipeline bot for the URL input

1827

Test result of pipeline bot for URL input configured with image captioning module

Testing in other apps

Getting bot access token

To integrate the bot with other systems, an access code is required. Follow these steps to get the access code of the bot:

  1. Navigate to the NLP pipelines tab on the dashboard.
1727
  1. Click the required bot.
  2. Click the ellipses icon corresponding to a specific bot and click Copy Access Token.
1770

Testing in Postman

Follow these steps to access your pipeline bot and test it through postman.

  • Open a new postman tab by clicking on + set request type as 'Post' from the dropdown

KeyValue
bot-access-token<Your bot's access token copied from Webex Bot Builder>
Content-Typeapplication/json
  • Navigate to Body section, select type as ‘raw’, and enter your request in this format:
{
   "msg": "your test text goes here",
"msg_type": "text"}

Transaction history in NLP pipelines

NLP pipelines contain a ‘Transactions’ tab similar to ‘Sessions’ in Q&A and Task bots. This allows developers to track usage of their pipelines and view the results of individual NLP transactions, providing granular insights into the performance of individual modules for each transaction. NLP node in Webex connect is powered by a system created NLP pipeline in each tenant. With the addition of this feature, developers stand to gain a better understanding of their conversational automation performance and can adjust their flows accordingly.

Transactions tab in NLP pipelines

Transactions tab in NLP pipelines

Users can search for transactions they’re interested in using a transaction ID or the date range when the transaction took place.
Clicking on any transaction in the table will display transaction details. User message along with information about all the modules used with their outputs is available on the left. The right side contains the raw response of the NLP pipeline.

Transaction details with modules and their output on the left and raw response on the right

Transaction details with modules and their output on the left and raw response on the right

Intelligence modules

Intelligence modules are pre-built libraries available to the developers. These include various third-party libraries as well as libraries built by Webex Bot Builder and can be leveraged by developers while designing and building their bot. These modules can be used by including them in the Pipeline.
The following table contains the list of all available intelligence modules, a brief explanation of their purpose, and details on different implementations available on IMIbot.ai. Scroll right for columns that aren't visible.

FunctionDetailsIP OwnerDescriptionProsConsSample InputSample Output
Spell CheckChecks for misspelt words in a given sentence and sends the sentence back with those words corrected to the most likely words.IMImobileThis implementation is based on an open-source project which takes a deterministic
approach and is non-contextual in nature.
cheaper, no external call, slightly fasternot contextual,
slightly lower accuracy
Spell check modulespell cheek module
MicrosoftThis is a Microsoft service and involves an external API call. It is machine learning based and is contextual.contextual, slightly higher accuracy, improves over timerelatively more expensive, involves an external call, slightly slowerspel chek modulespell check module
Units RecognitionParses a given sentence for a mention of one or more of the following metrics and the corresponding unit of measurement used.IMImobileMetrics currently supported:  Distance
 Volume  Currency
GBP 50"units": [ { "result": "50 GBP", "unit": “GBP", "unittype": "amount-of-money", "value":
50 }
Numbers RecognitionParses a given sentence for a mention of a number or a numeric quantity and extracts it in the response.IMImobileRecognizes numbers in both numeral as well as word
forms
five million{ "numbers": [ 5000000 ]
}
Date & Time RecognitionParses a given sentence for a mention of a date or time and extracts them into the most likely standard representations.IMImobileRecognizes time and dates in both structured as well as natural language forms5 days after day after tomorrow at 9AM{
"date": "21/08/2018", "time": "09:00"
}
Word
Tokenization
Tokenization
Parses a given sentence into an array of individual words (tokens).
IMImobile (Spacy)This implementation is based
on a fast, free and open-source library called
Spacy
no external calls, fastercomparatively lesser
flexibility, opinionated, only supports
English
Elon Musk is the CEO of Tesla. He is also the CEO of SpaceX.{ "word_tokens": [ "Elon",
"Musk",
"is",
“still",
“the",
"CEO",
"of",
“Telsa" ] }
The capital of Canada is Ottawa. I am going to travel to Ottawa"word_tokens": [
"The",
"capital",
"of",
"Canada",
"is",
"Ottawa",
".",
"I",
"am",
"going",
"to",
"travel",
"to",
"Ottawa"
]
IMImobile (NLTK)Based on a suite of libraries and programs for symbolic and statistical NLP for Englishgreater
flexibility, no external calls, supports multiple languages
lower performance
Sentence
Tokenization
Tokenization
Parses a given paragraph into an array of sentences.
IMImobile (Spacy)This implementation is based
on a fast, free and open-source library called
Spacy
no external calls, fastercomparatively lesser
flexibility, opinionated, only supports
English
Elon Musk is the CEO of Tesla. He is also the CEO of SpaceX.{ "sentence_tokens": [
"Elon Musk is the CEO of Tesla.",
"He is also the CEO of SpaceX."
]
}
IMImobile (NLTK)Based on a suite of libraries and programs for symbolic and statistical NLP for Englishgreater
flexibility, no external calls, supports multiple languages
lower performance
LemmatizationParses a given sentence and returns the root forms (aka lemmas or lexemes) of all the words in the sentence.IMImobile (Spacy)This implementation is based
on a fast, free and open-source library called
Spacy
no external calls, fastercomparatively lesser
flexibility, opinionated, only supports
English
I am loving itI be love -PRON-
GoogleA paid service by Googlecontextual, slightly higher accuracynot free, involves an external call, slightly slowerI am loving itI be love it
Parts-Of- Speech TaggingParses a given sentence and assigns the most appropriate part-of- speech tag to each of the words in the sentence.IMImobile (Spacy)This implementation is based
on a fast, free and open-source library called
Spacy
no external calls, fastercomparatively lesser
flexibility, opinionated, only supports
Bots are awesome{"pos_tag": "NOUN", "word": "Bots"}, {"pos_tag": "VERB", "word": "are"},
English{"pos_tag": "ADJECTIVE", "word": "awesome" }
GoogleA paid service by Googlecontextual, slightly higher accuracynot free, involves an external call, slightly slowerBots are awesome{"person": "PERSON_UNKNO WN",
"pos_tag": "NOUN", "proper": "PROPER_UNKNO WN",
"word": "Bots"}, {"person": "PERSON_UNKNO WN",
"pos_tag": "VERB", "proper": "PROPER_UNKNO WN",
"word": "are" }, {"person": "PERSON_UNKNO WN", "pos_tag": "ADJECTIVE", "proper": "PROPER_UNKNO WN",
"word": "awesome" }
Sentiment AnalysisAnalyzes a given sentence or phrase for the sentiment expressed in it as one of threeIMImobile (Vader)This implementation is based on a free and open-source library called VADERcheaper, no external call, slightly fasterlower accuracythis is awesomepositive
possibilities: negative, neutral and positive.I am unhappy with the service{
"inputParams": {
"actual_text": "I am unhappy with the service",
"bot_id": "502",
"databases": {
"database": {},
"mapping": {}
},
"sentiment": "negative",
"text": "I am unhappy with the service"
}
GoogleA paid service by Googlehigher accuracynot free, involves an external call, slightly sloweryou are splendidly stupidnegative
Named Entity RecognitionExtracts named entities from the input text. Commonly supported entities are nationalities, location,
buildings, people, events, organizations, etc.
IMImobile (Spacy)This implementation is based
on a fast, free and open-source library called
Spacy
no external calls, fasterlower entity coverage, lower accuracyIMImobile is listed in London{
"gpe": ["London”] }
DandelionA paid service by Dandelionhigher accuracy, higher entity coverage, improves over timenot free, involves an external call, slightly slowerIMImobile is listed in London{
"gpe": ["London"], "org": ["IMImobile"], "person": []
}
Question DetectionDetermines whether the input phrase is a question.IMImobileA module built in-house based on other NLP building blocksHow much did they pay for it?pay for it?
{
"accomp": “much”, "method": “auxpass starting with WH”, "questype": “how”
}
Language TranslationTranslates text from a source language to the target language.GoogleA paid service by Googlevery accurate, great language supportexpensive, involves an external callHelloBonjour
Profanity filterParses a given input against a pre-configured list of profane words and masks them outIMImobileCustom implementation based on other NLP building blocksWhat the fuckWhat the f**k
ChunkingRetrieves phrases from input textIMImobile
(Spacy)
This implementation is basedthe autobiography of John has 13 chapters"chunking": [
"the autobiography",
"John",
"13 chapters"
]
on a fast, free and open-source library called
Spacy
Common senseDetects if the input phrase falls under any of a large category set of small talk or common sense intents like greetings, abuse, and so on.IMImobileCustom implementation based on other NLP building blockshi"intent": "isGreeting"
ContractionExpands contracted textIMImobileCustom implementation based on other NLP building blocksI didn't receive the credit card yet"expanded_text": "I did not receive the credit card yet"
Custom Named Entity RecognitionPicks and classifies entities from input text to predefined, custom entity classes.IMImobileCustom implementation based on other NLP building blocksIMImobile is listed in London“city”:”London”
Emotion ClassifierDetects emotions in a given textIMImobileCustom implementation based on other NLP building blocksI am unhappy with your service"emotionclassifier": {},
"emotions": [
{
"angry": 44,
"disapproval": 5,
"irritation/skepticism": 5
}
Image captioningCaptions a given imageAzureA paid service by Microsoft
Azure
https://iso.500px.com/wp-content/uploads/2015/03/business_cover.jpeg{
"confidence": 0.9841809900994755,
"text": "a man wearing glasses and a suit and tie"
}
],
"tags": [
"person",
"wearing",
"necktie",
"man",
"suit",
"clothing",
"jacket",
"glasses",
"looking",
"bow",
"gray",
"brown",
"dressed",
"young",
"hat",
"standing"
]
Language DetectionDetects the language of given textGoogleA paid service by GoogleBook doctor's appointment

هاو آري أنت
"language": "en",
"language_detection": {},
"text": "Book doctor's appointment "

"language": "ar",
"language_detection": {},
"text": "هاو آري أنت"
Numeric Range DetectorDetects numeric range/interval for 2 languages - English, HindiIMImobile (haptik)This implementation is based
on a fast, free and open-source library called haptik
You can refer from 7-18 pages for information related to NLP module."number_ranges": [
{
"max": "18",
"min": "7",
"original_text": "7-18"
}
OCRTakes an image url as an input and returns the text detected in the image as response.GoogleA paid service by Googlehttps://preview.redd.it/pvqsd1lov7m71.jpg?width=509&auto=webp&s=02d4b24842c0f07564e7a17a74f691333190e7ff{
"bounds": "(93,151),(451,151),(451,719),(93,719)",
"description": "THE CHOICE IS YOURS\nII I-\nH E\nMATRI X\nRESURRECTIONS\nDECEMBER\nONLY IN CINEMAS\nwhatisthematrix.c om\n"
}
Parse tree generationGenerates a grammatical dependency graph or parse tree of a given sentence using the standard spacy vocabulary nomenclature.GoogleA paid service by GoogleBook an appointment{
"inputParams": {
"actual_text": "Book an appointment",
"bot_id": "502",
"databases": {
"database": {},
"mapping": {}
},
"parsetree": [
{
"outward_tokens": [
{
"index": 2,
"word": "appointment"
}
],
"parse_label": "ROOT",
"pos": "VERB",
"token": {
"index": 0,
"word": "Book"
},
"towards_token": {}
},
{
"outward_tokens": [],
"parse_label": "DET",
"pos": "DETERMINER",
"token": {
"index": 1,
"word": "an"
},
"towards_token": {
"index": 2,
"word": "appointment"
}
},
{
"outward_tokens": [
{
"index": 1,
"word": "an"
}
],
"parse_label": "DOBJ",
"pos": "NOUN",
"token": {
"index": 2,
"word": "appointment"
},
"towards_token": {
"index": 0,
"word": "Book"
}
}
],
"text": "Book an appointment"
}
IMImobile (Spacy)This implementation is based
on a fast, free and open-source library called
Spacy
Order two large sausage pizza{
"inputParams": {
"actual_text": "Order two large sausage pizza",
"bot_id": "502",
"databases": {
"database": {},
"mapping": {}
},
"parsetree": [
{
"outward_tokens": [
{
"index": 1,
"word": "two"
},
{
"index": 4,
"word": "pizza"
}
],
"parse_label": "ROOT",
"pos": "NOUN",
"token": {
"index": 0,
"word": "Order"
},
"towards_token": {}
},
{
"outward_tokens": [],
"parse_label": "NUMMOD",
"pos": "CARDINAL",
"token": {
"index": 1,
"word": "two"
},
"towards_token": {
"index": 0,
"word": "Order"
}
},
{
"outward_tokens": [],
"parse_label": "AMOD",
"pos": "ADJECTIVE",
"token": {
"index": 2,
"word": "large"
},
"towards_token": {
"index": 4,
"word": "pizza"
}
},
{
"outward_tokens": [],
"parse_label": "COMPOUND",
"pos": "NOUN",
"token": {
"index": 3,
"word": "sausage"
},
"towards_token": {
"index": 4,
"word": "pizza"
}
},
{
"outward_tokens": [
{
"index": 2,
"word": "large"
},
{
"index": 3,
"word": "sausage"
}
],
"parse_label": "DOBJ",
"pos": "NOUN",
"token": {
"index": 4,
"word": "pizza"
},
"towards_token": {
"index": 0,
"word": "Order"
}
}
],
"text": "Order two large sausage pizza"
},
"pipelines": [
{
"_id": "5b8901000e0ff44f7e071e41",
"cons": "comparatively lesser flexibility, opinionated, platform only supports English",
"contextual": false,
"created_at": 1535705344000,
"default": false,
"description": "",
"display_values": {},
"id": 14,
"input_params": {},
"is_added": true,
"is_paid": "free",
"library": "spacy",
"module": "parsetree",
"pipeLineSrc": "assets/img/pipeline-no-hover-drag.svg",
"pros": "free, no external calls, faster",
"unique_name": "Spacy Parse Tree",
"updated_at": 1535705344000
}
],
"timeStamp": "2021-09-13 06:32:10.187997",
"timestamp": "Mon, 13 Sep 2021 12:02:10 GMT",
"transaction_id": "d4c6f3fea251456096a481c3170845a8"
}
Phone number detectionDetects phone numbers for 6 languages - english, hindi, gujarati, marathi, tamil and bengaliIMImobile (haptik)This implementation is based
on a fast, free and open-source library called haptik
If you require any further information, feel free to contact us at @ 91234****2."phone_numbers": [
{
"original_text": "9123457687",
"phone_number": "9123457687"
}
Text to speechConverts the given text into speech file.GoogleA paid service by Google
AzureA paid service by Microsoft AzureMy Credit Card is lost or stolen, what do I need to do?{
"inputParams": {
"actual_text": "My Credit Card is lost or stolen, what do I need to do?",
"audio_url": "http://imibot-production.s3.amazonaws.com/6/502/502/audio/8968.mp3",
"bot_id": "502",
"databases": {
"database": {},
"mapping": {}
}
AmazonA paid service by Amazon