Skip to content
Dilyara Baymurzina edited this page Jun 27, 2022 · 12 revisions

Overview

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.

Available English Skills and Services

Services

Name Requirements Description
DialoGPT 1.3 GiB RAM, 1 GiB 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)
Infilling 1.7 GiB RAM, 1 GiB GPU generative service based on Infilling model, for the given utterance returns utterance where _ from original text is replaced with generated tokens

Skills

Name Requirements Description
Christmas Skill supports FAQ, facts, and scripts for Christmas
Comet Dialog skill 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 900 MiB 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 MiB 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 MiB RAM Chatbot (https://github.com/wadetb/eliza)
Emotion skill 30 MiB RAM returns template responses to emotions detected by Emotion Classification from Combined Classification annotator
Factoid QA 200 MiB RAM answers factoid questions
Game Cooperative skill 120 MiB RAM provides user with a conversation about computer games: the charts of the best games for the past year, past month, and last week
Intent Responder 40 MiB RAM provides template-based replies for some of the intents detected by Intent Catcher annotator
Knowledge Grounding skill 60 MiB RAM, 1.5 GiB GPU generates a response based on the dialogue history and provided knowledge related to the current conversation topic
Meta Script skill 150 MiB 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 MiB RAM uses the ASR Processor annotations to give feedback to the user when ASR confidence is too low
News API skill 60 MiB RAM presents the top-rated latest news about entities or topics using the GNews API
Oscar Skill supports FAQ, facts, and scripts for Oscar
Personal Info skill 40 MiB RAM queries and stores user's name, birthplace, and location
Personality Catcher 30 MiB RAM
DFF Program Y skill 800 MiB RAM [New DFF version] Chatbot Program Y (https://github.com/keiffster/program-y) adapted for Dream socialbot
DFF Program Y Dangerous skill 150 MiB 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 130 MiB 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 MiB RAM asks questions using the hand-written scripts for 25 topics, including but not limited to love, sports, work, pets, etc.
SuperBowl Skill supports FAQ, facts, and scripts for SuperBowl
Valentine's Day Skill supports FAQ, facts, and scripts for Valentine's Day
Wikidata Dial Skill generates an utterance using Wikidata triplets. Not turned on, needs improvement
DFF Animals skill 250 MiB 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 200 MiB RAM DFF-based skill to discuss art
DFF Book skill 450 MiB 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 170 MiB RAM aims to discuss user favorites and 20 most popular things with short stories expressing the socialbot's opinion towards them
DFF Coronavirus skill 150 MiB 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 170 MiB RAM constructed with DFF to encourage food-related conversation
DFF Friendship skill 100 MiB 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 MiB RAM [New DFF version] Tells user fun facts
DFF Gaming skill 120 MiB RAM provides a video games discussion. Gaming Skill is for more general talk about video games
DFF Gossip skill 95 MiB RAM DFF-based skill to discuss other people with news about them
DFF Grounding skill 90 MiB 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 Movie skill 1.1 GiB RAM is implemented using DFF and takes care of the conversations related to movies
DFF Music skill 100 MiB RAM DFF-based skill to discuss music
DFF Science skill 90 MiB RAM DFF-based skill to discuss science
DFF Short Story skill 90 MiB 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 Sports Skill 100 MiB RAM DFF-based skill to discuss sports
DFF Travel skill 90 MiB RAM DFF-based skill to discuss travel
DFF Weather skill 1.4 GiB RAM [New DFF version] uses the OpenWeatherMap service to get the forecast for the user's location
DFF Wiki skill 160 MiB RAM used for making scenarios with the extraction of entities, slot filling, facts insertion, and acknowledgements

Available Russian Skills and Services

Name Requirements Description
DialoGPT 2.8 GiB RAM, 2 GiB GPU Сервис генерации реплики по текстовому контексту диалога на основе предобученной модели Russian DialoGPT
Dummy Skill a part of agent container Навык для генерации ответов-заглушек и выдачис лучайных вопросов из базы в каечстве linking-questions.
Personal Info skill 40 MiB RAM Сценарный навык для извлечения и запоминания основной личной информации о пользователе.
DFF Generative skill 50 MiB RAM [New DFF version] навык, выдающий 5 гипотез, выданных сервисом DialoGPT
DFF Intent Responder 50 MiB RAM [New DFF version] Сценарный навык на основе DFF для ответа на специальные намерения пользователя.
DFF Program Y skill 80 MiB RAM [New DFF version] Сценарный навык на основе DFF для ответа на общие вопросы в виде AIML компоненты.
DFF Friendship skill 70 MiB RAM [New DFF version] Сценарный навык на основе DFF приветственной части диалога с пользователем.

Types of Skills

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

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

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

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.

Developing Own DFF Skill

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)

...

Developing Own Custom Skill

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 Own Skill

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.

Provided Skills

Currently, we provide 3 skills, including two different implementations of the *Harvesters Maintenance Skill (goal-oriented: generic and Go-Bot-based one) and one Program Y (chit-chat: AIML-based).

We plan to add new skills from our Dream 1.0 socialbot that was running on our Demo Website from September 3 to the end of November 2020. Check out our Roadmap.

Resources