-
Notifications
You must be signed in to change notification settings - Fork 76
Skills
Skills are a key part of the multiskill AI assistants. DeepPavlov Dream provides a set of built-in capabilities, referred to as skills. For example, in one of the distributions, Deepy, AI assistant's abilities include talking about Moonbase and having a chit-chat. In bigger distributions like Dream it also can answer factoid questions (using Factoid QA), provide weather forecasts, and can support a smarter chit-chat.
DeepPavlov Dream lets you teach your AI assistant new skills. Customers can access these new abilities by asking your AI assistant questions or making requests. You can build skills that provide users with many different types of abilities.
Name | Requirements | Description |
---|---|---|
DialoGPT | 1.2 GB RAM, 2.1 GB GPU | generative service based on Transformers generative model, the model is set in docker compose argument PRETRAINED_MODEL_NAME_OR_PATH (for example, microsoft/DialoGPT-small with 0.2-0.5 sec on GPU) |
DialoGPT Persona-based | 1.2 GB RAM, 2.1 GB GPU | generative service based on Transformers generative model, the model was pre-trained on the PersonaChat dataset to generate a response conditioned on a several sentences of the socialbot's persona |
Image Captioning | 4 GB RAM, 5.4 GB GPU | creates text representation of a received image |
Infilling | 1 GB RAM, 1.2 GB GPU | (turned off but the code is available) generative service based on Infilling model, for the given utterance returns utterance where _ from original text is replaced with generated tokens |
Knowledge Grounding | 2 GB RAM, 2.1 GB GPU | generative service based on BlenderBot architecture providing a response to the context taking into account an additional text paragraph |
Masked LM | 1.1 GB RAM, 1 GB GPU | (turned off but the code is available) |
Seq2seq Persona-based | 1.5 GB RAM, 1.5 GB GPU | generative service based on Transformers seq2seq model, the model was pre-trained on the PersonaChat dataset to generate a response conditioned on a several sentences of the socialbot's persona |
Sentence Ranker | 1.2 GB RAM, 2.1 GB GPU | ranking model given as PRETRAINED_MODEL_NAME_OR_PATH which for a pair os sentences returns a float score of correspondence |
StoryGPT | 2.6 GB RAM, 2.15 GB GPU | generative service based on fine-tuned GPT-2, for the given set of keywords returns a short story using the keywords |
GPT-3.5 | 100 MB RAM | generative service based on OpenAI API service, the model is set in docker compose argument PRETRAINED_MODEL_NAME_OR_PATH (in particular, in this service, text-davinci-003 is used. |
ChatGPT | 100 MB RAM | generative service based on OpenAI API service, the model is set in docker compose argument PRETRAINED_MODEL_NAME_OR_PATH (in particular, in this service, gpt-3.5-turbo is used. |
Prompt StoryGPT | 3 GB RAM, 4 GB GPU | generative service based on fine-tuned GPT-2, for the given topic represented by one noun returns short story on a given topic |
GPT-J 6B | 1.5 GB RAM, 24.2 GB GPU | generative service based on Transformers generative model, the model is set in docker compose argument PRETRAINED_MODEL_NAME_OR_PATH (in particular, in this service, GPT-J model is used. |
BLOOMZ 7B | 2.5 GB RAM, 29 GB GPU | generative service based on Transformers generative model, the model is set in docker compose argument PRETRAINED_MODEL_NAME_OR_PATH (in particular, in this service, BLOOMZ-7b1 model is used. |
Name | Requirements | Description |
---|---|---|
Alexa Handler | 30 MB RAM | handler for several specific Alexa commands |
Christmas Skill | 30 MB RAM | supports FAQ, facts, and scripts for Christmas |
Comet Dialog skill | 300 MB RAM | uses COMeT ConceptNet model to express an opinion, to ask a question or give a comment about user's actions mentioned in the dialogue |
Convert Reddit | 1.2 GB RAM | uses a ConveRT encoder to build efficient representations for sentences |
Dummy Skill | a part of agent container | a fallback skill with multiple non-toxic candidate responses |
Dummy Skill Dialog | 600 MB RAM | returns the next turn from the Topical Chat dataset if the response of the user to the Dummy Skill is similar to the corresponding response in the source data |
Eliza | 30 MB RAM | Chatbot (https://github.com/wadetb/eliza) |
Emotion Skill | 40 MB RAM | returns template responses to emotions detected by Emotion Classification from Combined Classification annotator |
Factoid QA | 170 MB RAM | answers factoid questions |
Game Cooperative Skill | 100 MB RAM | provides user with a conversation about computer games: the charts of the best games for the past year, past month, and last week |
Harvesters Maintenance Skill | 30 MB RAM | Harvesters maintenance skill |
Harvesters Maintenance Gobot Skill | 30 MB RAM | Harvesters maintenance Goal-oriented skill |
Knowledge Grounding Skill | 100 MB RAM | generates a response based on the dialogue history and provided knowledge related to the current conversation topic |
Meta Script Skill | 150 MB RAM | provides a multi-turn dialogue around human activities. The skill uses COMeT Atomic model to generate commonsensical descriptions and questions on several aspects |
Misheard ASR | 40 MB RAM | uses the ASR Processor annotations to give feedback to the user when ASR confidence is too low |
News API Skill | 60 MB RAM | presents the top-rated latest news about entities or topics using the GNews API |
Oscar Skill | 30 MB RAM | supports FAQ, facts, and scripts for Oscar |
Personal Info Skill | 40 MB RAM | queries and stores user's name, birthplace, and location |
DFF Program Y Skill | 800 MB RAM | [New DFF version] Chatbot Program Y (https://github.com/keiffster/program-y) adapted for Dream socialbot |
DFF Program Y Dangerous Skill | 100 MB RAM | [New DFF version] Chatbot Program Y (https://github.com/keiffster/program-y) adapted for Dream socialbot, containing responses to dangerous situations in a dialog |
DFF Program Y Wide Skill | 110 MB RAM | [New DFF version] Chatbot Program Y (https://github.com/keiffster/program-y) adapted for Dream socialbot, which includes only very general templates (with lower confidence) |
Small Talk Skill | 35 MB RAM | asks questions using the hand-written scripts for 25 topics, including but not limited to love, sports, work, pets, etc. |
SuperBowl Skill | 30 MB RAM | supports FAQ, facts, and scripts for SuperBowl |
Text QA | 1.8 GB RAM, 2.8 GB GPU | The service finds the answer of a factoid question in text. |
Valentine's Day Skill | 30 MB RAM | supports FAQ, facts, and scripts for Valentine's Day |
Wikidata Dial Skill | 100 MB RAM | generates an utterance using Wikidata triplets. Not turned on, needs improvement |
DFF Animals Skill | 200 MB RAM | is created using DFF and has three branches of conversation about animals: user's pets, pets of the socialbot, and wild animals |
DFF Art Skill | 100 MB RAM | DFF-based skill to discuss art |
DFF Book Skill | 400 MB RAM | [New DFF version] detects book titles and authors mentioned in the user's utterance with the help of Wiki parser and Entity linking and recommends books by leveraging information from the GoodReads database |
DFF Bot Persona Skill | 150 MB RAM | aims to discuss user favorites and 20 most popular things with short stories expressing the socialbot's opinion towards them |
DFF Coronavirus Skill | 110 MB RAM | [New DFF version] retrieves data about the number of coronavirus cases and deaths in different locations sourced from the John Hopkins University Center for System Science and Engineering |
DFF Food Skill | 150 MB RAM | constructed with DFF to encourage food-related conversation |
DFF Friendship Skill | 100 MB RAM | [New DFF version] DFF-based skill to greet the user in the beginning of the dialog, and forward the user to some scripted skill |
DFF Funfact Skill | 100 MB RAM | [New DFF version] Tells user fun facts |
DFF Gaming Skill | 80 MB RAM | provides a video games discussion. Gaming Skill is for more general talk about video games |
DFF Gossip Skill | 95 MB RAM | DFF-based skill to discuss other people with news about them |
DFF Image Skill | 100 MB RAM | [New DFF version] Scripted skill that based on the sent image captioning (from annotations) responses with specified responses in case of food, animals or people detected, and default responses otherwise |
DFF Template Skill | 50 MB RAM | [New DFF version] DFF-based skill that provides an example of DFF usage |
DFF Template Prompted Skill | 50 MB RAM | [New DFF version] DFF-based skill that provides answers generated by language model based on specified prompts and the dialog context. The model to be used is specified in GENERATIVE_SERVICE_URL. For example, you may use Transformer LM GPTJ service. |
DFF Grounding Skill | 90 MB RAM | [New DFF version] DFF-based skill to answer what is the topic of the conversation, to generate acknowledgement, to generate universal responses on some dialog acts by MIDAS |
DFF Intent Responder | 100 MB RAM | [New DFF version] provides template-based replies for some of the intents detected by Intent Catcher annotator |
DFF Movie Skill | 1.1 GB RAM | is implemented using DFF and takes care of the conversations related to movies |
DFF Music Skill | 70 MB RAM | DFF-based skill to discuss music |
DFF Science Skill | 90 MB RAM | DFF-based skill to discuss science |
DFF Short Story Skill | 90 MB RAM | [New DFF version] tells user short stories from 3 categories: (1) bedtime stories, such as fables and moral stories, (2) horror stories, and (3) funny ones |
DFF Sport Skill | 70 MB RAM | DFF-based skill to discuss sports |
DFF Travel Skill | 70 MB RAM | DFF-based skill to discuss travel |
DFF Weather Skill | 1.4 GB RAM | [New DFF version] uses the OpenWeatherMap service to get the forecast for the user's location |
DFF Wiki Skill | 150 MB RAM | used for making scenarios with the extraction of entities, slot filling, facts insertion, and acknowledgements |
Name | Requirements | Description |
---|---|---|
AI FAQ Skill | 150 MB RAM | [New DFF version] Everything you wanted to know about modern AI but was afraid to ask! This FAQ Assistant chats with you while explaining the simplest topics from today's technology world. |
Fashion Stylist Skill | 150 MB RAM | [New DFF version] Stay protected in every season with da Costa Industries Clothes Assistant! Experience the ultimate comfort and protection, no matter the weather. Stay warm in winter a... |
Dream Persona Skill | 150 MB RAM | [New DFF version] Prompt-based skill that utilizes given generative service to generate responses based on the given prompt |
Marketing Skill | 150 MB RAM | [New DFF version] Connect with your audience like never before with Marketing AI Assistant! Reach new heights of success by tapping into the power of empathy. Say goodbye.. |
Fairytale Skill | 150 MB RAM | [New DFF version] This assistant will tell you or your children a short but engaging fairytale. Choose the characters and the topic and leave the rest to AI imagination. |
Nutrition Skill | 150 MB RAM | [New DFF version] Discover the secret to healthy eating with our AI assistant! Find nutritious food options for you and your loved ones with ease. Say goodbye to mealtime stress and hello to delici... |
Life Coaching Skill | 150 MB RAM | [New DFF version] Unlock your full potential with Rhodes & Co's patented AI assistant! Reach peak performance at work and at home. Get into top form effortlessly and inspire others with. |
Name | Requirements | Description |
---|---|---|
DialoGPT | 2.8 GB RAM, 2 GB GPU | Russian DialoGPT by DeepPavlov |
Dummy Skill | a fallback skill with multiple non-toxic candidate responses and random Russian questions | |
Personal Info Skill | 40 MB RAM | queries and stores user's name, birthplace, and location |
DFF Generative Skill | 50 MB RAM | [New DFF version] generative skill which uses DialoGPT service to generate 3 different hypotheses |
DFF Intent Responder | 50 MB RAM | provides template-based replies for some of the intents detected by Intent Catcher annotator |
DFF Program Y Skill | 80 MB RAM | [New DFF version] Chatbot Program Y (https://github.com/keiffster/program-y) adapted for Dream socialbot |
DFF Friendship Skill | 70 MB RAM | [New DFF version] DFF-based skill to greet the user in the beginning of the dialog, and forward the user to some scripted skill |
DFF Template Skill | 50 MB RAM | [New DFF version] DFF-based skill that provides an example of DFF usage |
Text QA | 3.8 GiB RAM, 5.2 GiB GPU | Навык для ответа на вопросы по тексту. |
There are different types of skills, and different way to classify them. In general, skills can be seen as goal-oriented or chit-chat-based.
Goal-oriented skills are focused on solving particular user problems. They usually usually have a number of intents they can recognize, with [optionally] accompanying slots and entities, and may or may not be scenario-driven.
An example of a goal-oriented skill is our Harvesters Maintenance Skill. It can answer to questions like:
- What is the status of harvesters? - which is followed by the database lookup
- What is the status of harvester {N}? - which uses slot-filling to detect the number of a harvester, and then is followed by the database lookup
- Prepare rover for a trip - which is followed then by a fake call to a Rover API to prepare one for a trip.
These skills can be implemented using rules, using neural networks, or their combination.
You can use any kind of a framework to build your Goal-Oriented Skills. We provide DFF (Dialog Flow Framework) that enables development of the goal-oriented skills using scenario-driven approach. Take a look at various dff_*_skill in the /skills
directory for details.
FAQ Skills are focused on supporting Q&A/FAQ style of conversation. AI Assistant's creator supplies a curated list of questions and answers, uses DeepPavlov library to train a model on top of that list, and then uses the model as a foundation of the FAQ Skill.
Chit-chat skills are focused on supporting a general conversation; it may be completely generic or more domain- or topic-specific.
An example of a chit-chat skill is our Program Y Skill. It supports discussion on a number of topics including but not limited to:
- Bot's profile
- User's profile
- Lunar Industries
These skills can be implemented using rules (e.g., AIML), neural models (e.g., seq2seq or seq2word like GPT), and their combinations.
You can use any kind of a framework to build your Chit-Chat Skills.
You can re-use existing DFF-based skills by replacing their contents with your own code. The easiest way is to use dff_template_skill, then begin adding your own logic to its scenario/main.py
file, either manually or with the aid of DF Designer.
// details
You can also see the video instruction in our YouTube channel here:
How to build DFF Skills in Dream-based multiskill AI Assistants with DF Designer (BETA)
...
You use our bare-bones Harvesters Maintenance Skill, then remove the rest of the contents keeping only /respond
endpoint and Flask app default boilerplate code:
#!/usr/bin/env python
import logging
import time
import random
import re
import json
from flask import Flask, request, jsonify
from os import getenv
import sentry_sdk
logging.basicConfig(format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", level=logging.INFO)
logger = logging.getLogger(__name__)
app = Flask(__name__)
@app.route("/respond", methods=["POST"])
def respond():
st_time = time.time()
dialogs = request.json["dialogs"]
responses = []
confidences = []
for dialog in dialogs:
sentence = dialog['human_utterances'][-1]['annotations'].get("spelling_preprocessing")
if sentence is None:
logger.warning('Not found spelling preprocessing annotation')
sentence = dialog['human_utterances'][-1]['text']
response = "Hello world!"
confidence = 0.8
responses.append(response)
confidences.append(confidence)
total_time = time.time() - st_time
logger.info(f"harvesters_maintenance_skill exec time = {total_time:.3f}s")
return jsonify(list(zip(responses, confidences)))
if __name__ == "__main__":
app.run(debug=False, host="0.0.0.0", port=3000)
You will need to appropriately process the user's utterance coming either directly from the user, or after being processed by the Spell Checking annotator when available (as shown above). After that you will need to provide the confidence of your skill's response. Finally, you'll need to send both the respond and the confidence back to the DeepPavlov Agent.
Registering a new skill is done by adding its configuration to the docker-compose.yml
located in the root directory, and to pipeline_conf.json
located in the /agent
subdirectory of the repository. After adding new skill, it should be built and run using docker-compose -f docker-compose.yml up --build _skill_name_
, followed by building and running agent by running command docker-compose -f docker-compose.yml build agent
followed by docker-compose -f docker-compose.yml up agent
.
You must register a skill before you can test it with your own copy of Deepy.
TODO:
- Nika to record her experiences here on how to properly add and then register your own custom Skill in Dream-based distribution.
- Skills Skills @ ReadTheDoc