Intent
User
: I want to book a ticket to Boston on July 4th.
Intent
: Booking Ticket.
There are various ways to express a user’s intent to book a ticket from one place to another. They can be classified as intent declared by a designer as “Booking Ticket.” In order to help LLMs to understand “Booking Ticket,” it was suggested to give a few examples. Certainly the more (diverse), the better. Intent Example:
- I plan to fly to Boston on Independence Day.
- Could you help me check the flights from Los Angeles to Boston in July?
Slot
In order to query the flight database, it is necessary to extract the flight information that a user is checking. The information is called slots, each consisting of type, name and value. For example, at least three slots are needed for checking flights: Date, Departure city, Arrival city. Slot filling is looking for specific pieces of information that can be named entities (e.g., the city name) or other things (e.g., a piece of text). Slot is also referred as variable in PromptDialog.
Entity
Entity is a ‘thing’ that has names, like people, places, products etc. These things can be used to fill slots or just left alone.
Slot Filling
The value of a slot (variable) can be filled anywhere during a conversation. It can be extracted from user input or set manually. The followings are several ways to do slot filling.
1. Entity Recognition
Entity recognition is the most common method in slot filling. PromptDialog has the following three approaches to do entity recognition:
- A set of predefined entities are included, such as date, number, telephone, and ordinal words, eliminating the need of annotation, training and recognition.
- PromptDialog is a large language model based (e.g., chatGPT) entity recognition method to improve intent classification and entity recognition.
2. Whole Utterance
The entire user utterance is used to fill a slot. A common scenario is to collect user feedback which requires using the whole utterance, rather than extracting a specific phrase from it. It should be noted that although we do not care about the specific values extracted, we still need to add different examples to ensure that the model performs intent classification accurately and understands that the current utterance is going to be used for slot filling.
3. User Defined Value
In this case, a specific value is selected to fill slots. For example, when booking air tickets, a user may be asked if a window seat is preferred or not. The value of Slot ‘windows’ shall be ’ true’ or ‘false.‘ No matter whether the user says “Yes” or “I want to sit next to window”, the ‘windows’ slot shall be set to ’True.‘
4. Reset
Sometimes a slot value needs to be reset. For example, a user might want to clear the previously entered information, or assign the slot an initial value at the beginning of a conversation. It can also be used when filling different slots of the same entity type, such as numbers: Fill in the order number when an order identifier is given, and fill in the phone number when a phone number is provided.
Bot Response
The system will send different responses according to user utterance. PromptDialog currently supports five kinds of responses:
- Text
- Image
- Attachment
- Webhook
- Action
Template
Intent Template
The intent template exists for the purpose of reusing intents. There are a few standard intents in conversation design, such as confirmation, denial and appreciation. Repeatedly constructing the same kind of intents is time consuming and error prone. Intent template is here to solve this problem. We can save an intent to be reused as a template and add it to the intent list.
Entity Template
For the same reason, there are standard entities that are commonly used across different projects. A set of predefined entities are stored in the system for quick references.
Response Template
The response list exists for the reuse of responses. We often encounter repeated responses in conversations, such as goodbye, calling the same webhook, and thanks. We can save the response to be reused as an response template and add it to the response list. When we need to use this response elsewhere in the project, we can directly refer the saved response. You are strongly recommended to use the response list as much as possible.
Frequently Asked Questions (FAQ)
A list of typical questions that users might ask regarding a particular subject. Each faq tuple has three components: (question, similar questions, answer).
PromptDialog supports FAQs in one way:
- ChatGPT/GPT4 enabled retrieval augmented generation (RAG) to answer questions. PromptDialog employed an embedding and retrieval approach to dramatically improve accuracy. This is an approach we recommend if users do not provie similar questions. However, there is small cost associated as the users need to access OpenAI/ChatGPT.
Knowledge Base
In addition to FAQs, PromptAI can turn enterprise documents of various forms including CSV, PDF, Doc, Text, and HTML into one knowledge base and employ retrieval augmented generation (RAG) to answer questions directly based on these unstructured documents.
Form
Form is used to collect multiple pieces of information like ticket booking, hotel reservation, order query, etc. In PromptDialog, only a few configurations are needed to complete the design of a form, which was once quite complex:
Slots
The slot list declares several slots that the form needs to collect, how the bot asks about these slots’ value, and how to fill slots from the user reply. The bot will ask the user in sequence until all slots are filled.Abort
Users may not answer in the way we expect. If the user says “I don’t want to continue ”, the form filling will exit.Complete
When all the slots are filled out, the form will ask for a confirmation and then complete.