Empowering Conversations with ChatGPT: The Art of Prompt Engineering

The release of ChatGPT in November 2022 gave a mega boost for the world of AI. With that, everyone started playing around with Large Language Models (LLMs) and explore the possibilities of them.

While opening up interesting possibilities, new approaches and methodologies for interacting with LLMs came into the play. Prompt engineering is one of the major domains even the general public is interested in right now.

To get myself familiar with the context and not to feel left behind, I followed several online resources including the Prompt Engineering for developers from Deeplearning.ai. Here are some interesting points caught my attention. This brief would be helpful for anyone who’s using ChatGPT or any LLM not only in development scenarios, even for general daily chaos.

What’s actually Prompt Engineering?

Without any hesitation, I asked this question from ChatGPT 😀

Prompt engineering refers to the process of designing and refining prompts to elicit desired responses from a language model like ChatGPT. It involves crafting the initial instruction or query in a way that effectively communicates the desired task or information to the model. Prompt engineering can significantly influence the quality and relevance of the model’s responses.

ChatGPT

In simple terms,

Prompt engineering is the methodology of giving clear instructions to LLMs. It helps the language model to understand the instructions clearly and provide a better precise output.

LLMs in the GPT family (GPT-3, GPT3.5, GPT4 etc.) are trained to predict the next word occurrence of a given output. given that, the instructions we provide to the model should be specific and understandable. There are no hard bound rules for prompting the instructions, but the most precise would be better.  

There are two key principles we should keep in mind when prompting.

  1. Write clear and specific instructions.
  2. Give the model time to “think”.

Be clear! Be Precise!

There are many tactics which we can follow in order to make out instructions clear and easy to understand for an LLM.

Use delimiters to indicate distinct parts of the input

Let’s get the example of using a GPT model to summarize a particular text. It’s always better to clearly indicate which text parts of the prompt is the instruction and which is the actual text to be summarized. You can use any delimiter you feel comfortable with. Here I’m using double quotes to determine the text to summarised.

Ask for structured outputs

When it comes to LLM aided application development, we use OpenAI APIs to perform several natural language processing tasks. For an example we can use the GPT models to extract key entities, and the sentiment from a set of product reviews. When using the output of the model in a software system, it’s always easy to get the output from a structured format like JSON object or in HTML.

Here’s a prompt which gets feedback for a hotel as the input and gives a structured JSON output. This comes handy in many analytics scenarios and integrating OpenAI APIs in production environments.  

It’s always good to go step by step

Even for humans, it’s better to provide instructions in steps to complete a particular task. It works well with LLMs too. Here’s an example of performing a summarization and two translations for a customer review through a single prompt. Observe the structure of the prompt and how it’s guiding the LLM to the desired output. Make sure you construct your prompt as procedural instructions.  

Here’s the output in JSON.

{
  "review": "I recently stayed at Sunny Sands Hotel in Galle, Sri Lanka, and it was amazing! The hotel is right by the beautiful beach, and the rooms were clean and comfy. The staff was friendly, and the food was delicious. I also loved the pool and the convenient location near tourist attractions. Highly recommend it for a memorable stay in Sri Lanka!",
  "English_summary": "A delightful stay at Sunny Sands Hotel in Galle, Sri Lanka, with its beautiful beachfront location, clean and comfortable rooms, friendly staff, delicious food, lovely pool, and convenient proximity to tourist attractions.",
  "French_summary": "Un séjour enchanté à l'hôtel Sunny Sands à Galle, Sri Lanka, avec son emplacement magnifique en bord de plage, ses chambres propres et confortables, son personnel amical, sa délicieuse cuisine, sa belle piscine et sa proximité pratique des attractions touristiques.",
  "Spanish_summary": "Una estancia encantadora en el hotel Sunny Sands en Galle, Sri Lanka, con su hermosa ubicación frente a la playa, habitaciones limpias y cómodas, personal amable, comida deliciosa, hermosa piscina y ubicación conveniente cerca de atracciones turísticas."
}

Hallucinations are one of the major limitations LLMs are having.  Hallucination occurs when the model produces coherent-sounding, verbose but inaccurate information due to a lack of understanding of cause and effect. Following proper prompt methodologies and tactics can prevent hallucinations to some extend but not 100%.

It’s always the developer’s responsibility to develop AI systems follow the responsible AI principles and accountable for the process.

Feel free to share your experiences with prompt engineering and how you are using LLMs in your development scenarios.

Happy coding!

Do we really need AI?

DALL-E Artwork

Since the launch of ChatGPT in last November, not only the tech community, but also the general public started peeping into the world of AI. As mentioned in my article “AI summer is Here”, organisations are looking for avenues where they can use the power of AI and advance analytics to empower their business processes and gain competitive advantage.

Though everyone is looking forward for using AI, are we really ready? Are we there?

These are my thoughts on the pathway an organisation may follow to adopt AI in their business processes with a sensible return on investment.

First of all, there’s a key concept we should keep in mind. “AI is not a wizard or a magical thing that can do everything.” It’s a man-made concept build upon mathematics, statistics and computer science which we can use as a toolset for certain tasks.

We want to use AI! We want to do something with it! OR We want to do everything with it!

Hold on… Though there’s a ‘trend’ for AI, you should not jump at it without knowing nothing or without analysing your business use cases thoroughly. you should first identify what value the organization is going to gain after using AI or any advance analytics capability. Most likely you can’t do everything with AI (yet). It’s all about identifying the correct use case and correct approach that aligns with your business process.

Let’s not focus on doing something with AI. Let’s focus on doing the right thing with it.

We have a lot of data! So, we are there, right?

Data is the key asset we have when it comes to any analytical use case. Most of the organizations are collecting data with their processes from day 1. The problem lies with the way data is managed and how they maintain data assets and the platform. Some may have a proper data warehouse or lake house architecture which has been properly managed with CI/CD concepts etc, but some may have spread sheets sitting on a local computer which they called their “data”!

The very first thing an organization should do before moving into advance analytics would be streamlining their data platform. Implementing a proper data warehouse architecture or a data lake architecture which follows something similar to Medallion architecture would be essential before moving into any analytics workloads.

If the organization is growing and having a plan to use machine learning and data science within a broader perspective, it is strongly recommended to enable MLOps capabilities within the organization. It would provide a clear platform for model development, maintenance and monitoring.

Having a lot of data doesn’t mean you are right on track. Clearing out the path and streamlining the data management process is essential.

Do we really need to use AI or advance analytics?

This question is real! I have seen many cases where people tend to invest on advance analytics even before getting their business processes align with modern infrastructure needs. It’s not something that you can just enable by a click of a button. Before investing your time and money for AI, first make sure your IT infrastructure, data platforms, work force and IT processes are up to date and ready to expand for future needs.

For an example, will say you are running a retail business which you are planning to use machine learning to perform sales forecasts. If your daily sales data is still sitting on a local SQL server and that’s the same infrastructure you going to use for predictive analytics, definitely that’s going to be a failure. First make sure your data is secured (maybe on a cloud infrastructure) and ready to expose for an analytical platform without hassling with the daily business operations.  

ChatGPT can do everything right?

ChatGPT can chat! 😀

As I stated previously, AI is not a wizard. So as ChatGPT. You can use ChatGPT and it’s underlying OpenAI models mostly for natural language processing based tasks and code generation and understanding (Keep in mind that it’s not going to be 100% accurate). If your use case is related to NLP, then GPT-3 models may be an option.

When to use generative AI?

Variational Autoencoders, Generative Adversarial Networks and many more have risen and continue to advance the field of AI. That has given a huge boost for the domain of generative AI. These models are capable of generating new examples that are like examples from a given dataset.

It is being used in diverse fields such as natural language processing (GPT-3, GPT-4), computer vision (DALL-E), speech recognition and many more.

OpenAI is the leading Generative AI service provider in the domain right now and Microsoft Azure offers Azure OpenAI, which is an enterprise level serving of OpenAI services with additional advantages like security and governance from Azure cloud.

If you are thinking about using generative AI with your business use case, strongly recommend going through the following considerations.

If you have said yes to all of the above, then OpenAI may be the right cognitive service to go with.

If it’s not the case, you have to look at other machine learning paradigms and off-the-shelf ML models like cognitive services which may cater better to the scenario.

Ok! What should be the first step?

Take a deep dive for your business processes and identify the gaps in digital transformation. After addressing those ground level issues, then look on the data landscape and analyse the possibilities of performing analytical tasks with the it. Start with a small non-critical use case and then move for the complex scenarios.

If you have any specific use cases in mind, and want to see how AI/ machine learning can help to optimize those processes, I’m more than happy to have a discussion with you.  

btw, the image on the top is generated by DALL-E with the prompt of “A cute image of a robot toy sitting near a lake – digital art

Unlocking the Power of Language with GPT-3

Yes. This is all about the hype of ChatGPT. It’s obvious that most of us are too obsessed with it and spending a lot of time with that amazing tool even as the regular search engine! (Is that a bye-bye google? 😀 )

I thought of discussing the usage of underlying mechanics of ChatGPT: Large Language Models (LLMs) and the applicability of these giants in intelligent application development.

What actually ChatGPT is?

ChatGPT is a conversational AI model developed by OpenAI. It uses the GPT-3 architecture, which is based on Transformer neural networks. GPT-3 is large language model with about 175 billion parameters. The model has been trained on a huge corpus of text data (about 45TB) to generate human-like responses to text inputs. Most of the data used in training is harvested from public internet. ChatGPT can perform a variety of language tasks such as answering questions, generating text, translating languages, and more.

ChatGPT is only a single use case of a massive research. The underlying power is the ANN architecture GPT-3. Let’s dig down step by step while discussing following pinpoints.

What are Large Language Models (LLMs)?

LLMs are deep learning algorithms that can recognize, summarize, translate, predict and generate text and other content based on knowledge gained from massive datasets. As the name suggests, these language models are trained with massive amounts of textual data using unsupervised learning. (Yes, there’s no data labelling involved with this). BLOOM from Hugging Face, ESMFold from Meta AI, Gato by DeepMind, BERT from Google, MT-NLG from Nvidia & Microsoft, GPT-3 from OpenAI are some of the LLMs in the AI space.

Large language models are among the most successful applications of transformer models. They aren’t just for teaching machines human languages, but for understanding proteins, writing software code and much more.

What are Transformers?

Encoder decoder architecture
The  encoder-decoder structure of the Transformer architecture
Taken from “Attention Is All You Need

Transformers? Are we going to talk about bumblebee here? Actually not!

Transformers are a type of neural network architecture (similar as Convolutional Neural Networks, Recurrent Neural Networks etc.) designed for processing sequential data such as text, speech, or time-series data. They were introduced in the 2017 research paper “Attention is All You Need“. Transformers use self-attention mechanisms to process the input sequence and compute a weighted sum of the features at each position, allowing the model to efficiently process sequences of varying length and capture long-range dependencies. They have been successful in many natural language processing tasks such as machine translation and have become a popular choice in recent years.

For a deep learning enthusiast this may sound familiar with the RNN architecture which are mostly used for learning sequential tasks. Unless the RNNs, transformers are capable of capturing long term dependencies which make them so capable of complex natural language processing tasks.

GPT stands for “Generative Pre-trained Transformer”. As the name implies it’s built with the blessing of transformers.

Alright… now GPT-3 is the hero here! So, what’s cool about GPT-3?

  • GPT-3 is one successful innovation in the LLMs (It’s not the only LLM in the world)
  • GPT-3 model itself has no knowledge; its strength lies in its ability to predict the subsequent word(s) in a sequence. It is not intended to store or recall factual information.
  • As such the model itself has no knowledge, it is just good at predicting the next word(s) in the sequence. It is not designed to store or retrieve facts.
  • It’s a pretrained machine learning model. You cannot download or retrain the model since it’s massive! (fine-tuning with our own data is possible).
  • GPT-3 is having a closed-API access which you need an API key to access.
  • GPT-3 is good mostly for English language tasks.
  • A bit of downside: the outputs can be biased and abusive – since it’s learning from the data fetched from public internet.

If you are really interested in learning the science behind GPT-3 I would recommend to take a look on the paper : Language Models are Few-Shot Learners

What’s OpenAI?

The 2015 founded research organisation OpenAI is the creators of GPT-3 architecture. GPT-3 is not the only interesting innovation from OpenAI. If you have seen AI generated arts which are created from a natural language phrases as the input, it’s most probably from DALL-E 2 neural network which is also from OpenAI.

OpenAI is having there set of APIs, which can be easily adapted for developers in their intelligent application development tasks.

Check the OpenAI APIs here: https://beta.openai.com/overview    

What can be the use cases of GPT-3?

We all know ChatGPT is ground-breaking. Our focus should be exploring the approaches which we can use its underlying architecture (GPT-3) in application development.

Since the beginning of the deep neural networks, there have been lot of research and innovation in the computer vision space. The networks like ResNet were ground-breaking and even surpass the human accuracy level in tasks like image classification with ImageNet dataset. We were getting the advantage of having pre-trained state-of-the-art networks for computer vision tasks without bothering on large training datasets.

The LLMs like GPT-3 is addressing the gap of the lack of such networks in natural language analysis tasks. Simply it’s a massive pre-trained knowledge base that can understand language.

There are many interesting use cases of GPT-3 as a language model in use cases including but not limited to:

  • Dynamic chatbots for customer service use cases which provide more human-like interaction with users.
  • Intelligent document management by generating smart tagging/ paraphrasing, summarizing textual documents.
  • Content generation for websites, new articles, educational materials etc.
  • Advance textual classification tasks
  • Sentiment analysis
  • Semantic search capabilities which provide natural language query capability.
  • Text translation, keyword identification etc.
  • Programming code generation and code optimisation

Since the GPT-3 can be fine-tuned with a given set of training data, the possibilities are limitless with the natural language understanding capability it is having. You can be creative and come up with the next big idea which improves the productivity of your business.

What is Azure OpenAI?

Azure OpenAI is a collaboration between Microsoft’s Azure cloud platform and OpenAI, aimed at providing cloud-based access to OpenAI’s cutting-edge AI models and tools. The partnership provides a seamless platform for developers and organizations to build, deploy, and scale AI applications and services, leveraging the computing resources and technology of the Azure cloud.

Users can access the service through REST APIs, Python SDK or through the Azure OpenAI Service Studio, which is the web-based interface dedicated for OpenAI services.

In enterprise application development scenarios, using OpenAI services through Azure makes it much easier for integration.

Azure OpenAI opened for general availability very recently and I’m pretty sure there’ll be vast improvements in the coming days with the product.

Let’s keep our eyes open and start innovating on ways which we can use this super-power wisely.

FAQ Bot in Minutes!

qna)Almost all the tech giants are massively investing on chatbots and make them available for the use of general public in an efficient and easy way. Many development tools, SDKs and services are now available in the market to build your own chatbots. Microsoft QnA Maker is one of the most handy tools to get started for building a basic Question & Answer Bot.

qna3Microsoft QnA Maker was in public preview for quite a while and it came for general availability with the Build 2018 announcements. If you have bots that already built using the QnA Maker preview portal, just go and migrate the knowledge bases that you’ve created to the new portal that has attached to QnA Maker management Portal. Here’s the guide to do that.

Building a bot using is pretty straight forward. What you need to have is a set of question and answer pairs that you need to add as the knowledge base of your chatbot. Tw knowlesge base can be created manually using the online editor or you can just upload a question & answer pairs in CSV/TSV formats, a word document or even a product manual. If you want to add set of FAQs in a website, what you have to do is provide the URL of that for to extract the information.

qna4

Testing the knowledge base realtime

The created knowledge can be tested using the portal Realtime. The corrections for the classifications also can be done through the portal. One of the major advantages of QnA Maker service is that the bot knowledge base can be directly deployed on client’s Azure Tennent without spoiling any privacy or compliance issues.

Publishing the knowledge base would create a REST endpoint that you can access through Microsoft Bot Framework and then directly publish into a desired channel. The sample code for building a simple QnA maker powered bot is available here on GitHub.

qna5One of the promising feature comes with the latest updates is the “Small Talk” request response dataset from Microsoft. This can make your bot seems more intelligent and human like. (Even Mmmm… s 😀 ) You can select your desired personality from Professional, Friendly or Humorous and download the dataset as a TSV. Then add that to your existing knowledge base. This will give your bot a more human like touch. (Make sure to select the datasets that is specifically built for QnA maker)

The pricing for the QnA maker service is just charging for the hosting service not for the number of transactions. (Note that you’d be charge for the bot service separately 😉 ) You can refer more about pricing here.  https://azure.microsoft.com/en-us/pricing/details/cognitive-services/qna-maker/

QnA maker is not the fully intelligent knowledge base building platform. But it can help you to come out with a fully functioning bot in minutes.

Tips & Tricks for building a better LUIS model – 2

Capture2017 ended up making ‘chatbots’ not a trend but an essential in the tech world. With the rise of chatbots, building up effective natural language understanding (NLU) models is a must. LUIS is an admirable service from Microsoft Cognitive Services that can use for building NLU models.

Most of the cases LUIS models perform well but in some cases LUIS models pop out with unexpected results. This may cause with various reasons including the less understanding on the business domain of the chatbot.

Here I’m adding few more for the points we discussed in the previous article, that we need to consider when building accurate LUIS models.

Note that LUIS has got a major update as well as a UI change compared to the version we used back last year.

Using Phrase List

You can create a phrase list for teaching synonyms for the model. For an example here, I’ve added a phrase list for the word “good”. The wizard recommends a set of words that can added to the phrase list and you can select the appropriate words from those suggestions. No need of typing all the synonyms. Let LUIS handle it. 😊

3_phrase listAnother use of the Phrase list is to train the model the domain specific words. As an example, you can add a list of fruit names (Apple, Orange, Grapes) to a phrase list and give it a name. It’ll help the LUIS model to align according to the given domain.

Use same amount of utterances to train each intent

When you training the intents using possible utterances, make sure to use roughly the same number of utterances for each intent. Else the intent predicting process might be bias to intents with higher number of utterances.

Comparing the accuracy of the model with published versions

With the new LUIS portal, you can test the accuracy of the built model without connecting it to a bot service. Adding to that you can compare the difference of two versions of the same LUIS model at the same time. After observing the difference for various utterances, you can decide which model version should go for production.

5_test

LUIS Programmatic API

This is not directly attached with optimizing the accuracy. LUIS Programmatic API allows you to do all most all the tasks that you perform to build and train a LUIS model through API calls. This may comes handy when you building a bot that can learn by itself.

Add Bing spell checker to the chatbot

You may notice that the spelling mistakes of the user cause wrong intent identifications. To overcome this issue, you can enable bing spell checker in your LUIS model. This may cost you a bit, but the accuracy of identifying intents would go up.

1_spellcheck

If you have more tips & tricks to share for optimizing NLU models, do share here as comments. 😊

Chatbots : What & Why?

robot-customer-serviceThe word ‘chatbots’ has become one of the most whispered words in the tech world today. Each and every tech company is putting a lot of effort on researching and developing bot related technologies.

The very first thing that you should keep in your mind is “Bot is not an acronym neither a magic app”. Bot is an application that operates as an agent for a user or another program or simulates a human activity.

I would say, there’s no Artificial intelligence or natural language processing attached with most of the chatbots you see out there. But AI and machine learning have become prominent factors of giving bots more human side.

The evolution of chatting paradigms and the rapid adaptation of millennials for chatting platforms like Facebook messenger, WhatsApp and Viber increased the need of chatbots that can handle business processes.

df

Evolution of user interaction

The same way a website is interacting with a user, bot acts as the interface into the service. Simplicity, increasing productivity, personalized service lines are some of the major benefits that we can achieve with getting chatbots into the play.

Super bots Vs domain specific bots

Probably the very first thought that comes to your mind when it says ‘bots’ might be “Siri, Cortana or Google assistant”. Dominating our pockets with their ability of interacting as a personal assistant, these software utilities can be defined as super bots. They are equipped with speech recognition as well as natural language understanding. Normally there’s a persona specifically designed for these super bots. The backend of these intelligent applications is backed with machine learning and deep learning based technological interventions.

we-put-siri-alexa-google-assistant-and-cortana-through-a-marathon-of-tests-to-see-whos-winning-the-virtual-assistant-race--heres-what-we-found

AI powered personal assistants in your pocket and home

Domain specific bots are easy to find and easy to build (comparatively to the super bots). They are specifically designed aligning to a particular business process.  Ordering a pizza from nearest pizza shop, customer service call centers or booking a flight ticket are some example business processes that can be easily adopted to a conversational bot interface. These bots may use machine learning techniques for natural language understanding.

Business bots Vs Consumer bots

Bots are not only mend to be to involve in business process. Fun is mandatory! The consumer bots are specifically designed to maintain human like conversations with the users. Sometimes even for flirting 😉 Mitsuku is known as one of the prominent consumer bots that have built for today.

Text or the voice?

Interacting with a chatbot can be done in several ways. Textual communication is just one thing. Speech recognition enables the user to interact with the chatbots with speech. Some chatbots provide interactive clickable cards for user interaction. Amazon Alexa even has a hardware component that interacts with the user with voice commands.

Building bots

There are plenty of programming paradigms prevailing today that helps you to build conversational bots. Microsoft Bot Framework is a programmer friendly framework that supports C# or node.js for deploying bots. Integrating chat channels like Skype and messenger can be too done through the framework.

Natural Language understanding provides more human like nature for bot’s conversations. For that, LUIS service by Microsoft, API.AI, wit.ai are some prominent services used today by the programmers. No need to go from the scratch of machine learning algorithms. Just an API call will do the magic for you.

Bots can be given more human like abilities with machine learning based intelligent API services and SDKs. Microsoft Cognitive services is a valuable toolset that you can use to give your chatbot the ability to see, hear and even think!

What’s next?

I guess, codeless bot building services (some are already there in the market, but not so matured) and natural language generation would be the next big things in the conversational bot building industry. Deep learning will come to scene with language generation for sure.

Time to market is a prominent factor in the world of business. Then why not going with the trend and adopt a chatbot for your own business or start building bots as your business? 😉

Tips & Tricks for building a better LUIS model

Windows-Live-Writer-1ea16f646b8b_EBC7-image_6b0e682f-3c30-4d18-a764-b7a8375e6ffeChatbots has become a ‘trend’ today. Everyone wants to attach a chatbot for their businesses. Either to the public facing phase or as the interfering interface of an internal business process. If you observe the social media handles of the major brands, they are using chatbots to communicate with their customers.

Building a bot from the scratch is not an easy task and there’s no need of going from the scratch! There’s plenty of frameworks and language understanding services that you can get the aid of.

Api.ai, Recast.ai, Motion.ai, rasa NLU, Wit.ai, Amazon Lex, Watson Conversation and LUIS.ai are some of services that you can use individually or with the use of other channels and frameworks to build your bot.

Here I’ve listed out some of the best practices I use when creating a language understanding engine using LUIS.ai; which is Microsoft’s NLU product framework.

(To get started with LUIS.ai refer the documentation here – https://docs.microsoft.com/en-us/azure/cognitive-services/luis/home )

Narrow down the scope of the bot

Don’t ever try to put up a Bot with a wide scope. First thing you should get into your mind is “LUIS doesn’t’ generate the answers for the questions. It just direct the questions come into the service into pre-defined answering lines.” Although LUIS limits the number of intents for a single LUIS model to 80, try to reduce the number of intents because it increases the probability of getting the right intent for the questions you ask. Lots of intents may confuse the language understanding algorithm of LUIS. It may lead your program to a wrong intent.

Use a good naming convention for the intents and entities

When you plan to build a LUIS model, choose a good naming convention. Else It would be hard for you when you referring the particular intent from your code. Don’t use too lengthy words as intent names. Just use short descriptive wordings. Using Camel case or dot separated phrases is a good practice.

As an example, for creating a Bot for a Pizza shop, these are some sample intents that you can use.

  • General.Introduction – Shows a general introduction about the coffee shop
  • General.ContactDetails – Show the contact details
  • General.ShowPriceList – Display the full price list of the coffee shop
  • Order.Pizza – Pizza ordering process starts
  • Order.ConfirmOrder – Confirm the placed order
  • Order.CancelOrder – Cancel a placed pizza order
  • Feedback.RecieveFeedback – Receive customer feedback.

Using this kind of dot separated phrases helps you to see the same kind of intents together in a row in your LUIS dashboard.

Use Entities wisely

Entities let you change the answer of a particular intent dynamically. It also let you to reduce the number of intents. If you using dynamic SQL queries to fetch data in your bot, entities may help you to build those queries with the appropriate parameters.

There are four types of custom entities as Simple, Composite, Hierarchal and List. If you want to identify a set of names from the question (Names of pizzas etc.) use the List type of custom entity. It increases the discoverability of the entity. You can add 20,000 items for a single list. Never forget to add the synonyms for the list items. Bot have to think from the user’s language.

img_3

Adding a item for a List type entity

There a set of pre-built entities that you can use. If you want to extract a number, age, date kind of data from the question, don’t hesitate to use them.

img_1

Pre-built Entities

Train the model with the maximum number of utterances that you can think of! –

Programmer never knows how the end user going to think. So, train each and every intent with the maximum number of utterances that you can think of.

Do check the model and improve it regularly

Even after publishing the LUIS model for the production, make sure to check the suggested utterances and retrain the model with them assigned for the correct intent.

Beware! LUIS is not from your country!

LUIS may capable of identifying a name of city in your question where you want it as an entity value. Sadly, LUIS may not recognize the name of your hometown as a city If it’s not popular as Paris or New York! So, use the ‘Feature List’ for this kind of applications. LUIS may learn that the similar kind of items in your feature list should be treated same. It doesn’t do a strict mapping. Just a hint for the algorithms behind the LUIS engine.

Do version controlling

Training the LUIS model with some utterances may lead it to push out some wrong predictions. Maintaining the clones of the previous versions may help you to rollback and start from the place you were right. Do clone the model when needed.

img_4These are just small tips you can use when building your own LUIS model. Do comment any best practice that you find useful in building an accurate model for your Bot.