Automatic text generation
You can train a virtual assistant solely with text documents and delegate the task of understanding user questions and generating answers automatically.
The generateanswer function or llmgenerateanswer function must be added to the scenario for automatic text generation to work in the virtual assistant.
Automatic text generation is the newest technology available for virtual assistants. It analyzes the user’s question and creates a suitable answer based on the available information. The answer is generated based on request, which includes:
- segment;
- prompt;
- conversation history;
- user's question.
Segment
The automatic text generation process requires data from which the virtual assistant learns. You must specify and add texts in the Knowledge base view. For example, an ice-cream shop virtual assistant’s knowledge base should include all necessary information about the products the shop sells. Information added to virtual assistant’s knowledge base is automatically divided in small chunks or segments. Segments take part in answer generation.
Prompt
Prompts also take part in answer generation. A prompt consists of additional instructions and commands, presented in a descriptive manner, for the automatic text generation model to generate the desired output. A prompt can be either short or long and detailed.
Creating an effective prompt entails significant effort and experimentation. We recommend creating a detailed prompt and specifying contextual conditions that the text generation model should consider when generating a response. Before incorporating a prompt into a scenario, its impact can be evaluated in the knowledge test by entering the prompt text in the Prompt field.
You can work with prompts in the training view Prompts, and the basic prompt’s ID is system_text_prompt.
Conversation history and user’s question
The user’s question and conversation history also take part in the generation process. When user types a question in the chat conversation, segments from knowledge base are selected according to their similarity to the question. The selected segments together with prompt, the user’s question and conversation history create a single request. The request is sent to the text generation module. The module receives the request, generates an answer and sends it to the user.