Cognigy Named a Leader in January 2022 Gartner® Magic Quadrant ™ for Enterprise Conversational AI Platforms! Download the report
Easy-to-use platform even for non-techies
Understand what your customers say in any language
Connect to your digital ecosystem with free Cognigy.AI Extensions
Integrate with any CRMs, ERPs, RPA, and more
Enhance customer interactions with AI on the frontline
Connect customers to the right agent on the first try
Give your agents the confidence to solve complex requests
Boost your customers’ experience and agents’ efficiency
Improve customer satisfaction with detailed insights
Engage with your customers on the platform of their choice
Drive appropriate actions with intelligent processes
Integrate easily with existing enterprise infrastructure
Increase operational efficiency and reduce agent attrition
Dive deep into the world of conversational AI
Learn everything about voice bots and virtual agents
Become an expert in Conversational AI and automation
See Conversational AI in action through demos
Explore Cognigy.AI and get support from the community
Join our mission to make Conversational AI more accessible
Find us at live conferences or virtual meetups
Help us achieve our vision with your talents and skills
Be the first to know about all the latest news
Reach out to our experts and get your questions answered
See how we help your organization secure sensitive data and comply with applicable laws and regulations.
An in-depth guide into the trusted use of AI in customer service automation
Find out everything you need to know about establishing "Explainable AI" based on the AIC4 criteria catalogue.
Creating a good conversational AI might make you realize how complex the idea of a successful conversation is. You will probably have to deal with problems that have never crossed your mind and look for possible solutions to assure that the conversation seems natural.
Let’s imagine that you have created a virtual agent which answers any product related question perfectly but can’t react naturally to other statements. Take insults for example: for some reason, people tend to test virtual agents with offensive comments, maybe with the intention of verifying if the response is “human” enough. Wouldn’t it be great if your AI could detect abusive language and respond appropriately? But as we know, for an AI to learn properly we need to feed it enough data and write the correct machine learning algorithms.
How can you manage that with Cognigy.AI?
In this situation, TensorFlow is your best friend. This well-known deep learning library has kindly arranged a strategy to use its models in JavaScript. At the TensorFlow.js.org website you can find many existing models, which are converted and ready to use in any JavaScript application after installation. Luckily, there is even a TensorFlow.js model which detects toxic language! Now we can use that in order to handle our insulting-language-problem.
How to create the module
First, install the model:
Just like that, you are ready to create your toxicity detection Custom Module! You can learn how to create your own Custom Module in the docs.
Let’s start with the code. The first thing you need to do in your code file is import the TensorFlow.js model that you installed earlier.
Afterwards, create an async function, as described in docs. In your function, apply methods from your model, following its documentation. For example, to save the toxicity model to a constant and use it on the input text, you would write:
Now you are free to apply any changes to improve the model before saving the results. In the example, the results of the toxicity analysis will be written in Cognigy Context or Input Object:
When your Custom Module is ready, you can upload it and add it to your Flow:
You will see the analysis’ results in the Interaction Panel:
Then, you can detect toxic language using the Logic node. For example, to identify an insult you could use an If node:
Now you just need to add the appropriate reaction and test your AI with a new skill!
The practicality of TensorFlow.js doesn’t end here. It is possible to convert any TensorFlow SavedModel, most TensorFlow Hub modules, Keras HDF5 or tf.keras SavedModel into TensorFlow.js with provided tfjs-converter. Just follow the steps explained here.
Stay up to date with the latest Conversational AI tips and news.