Git Product home page Git Product logo

deeppavlov's Introduction

License Apache 2.0 Python 3.6

In version 0.0.6 everything from package deeppavlov.skills except deeppavlov.skills.pattern_matching_skill was moved to deeppavlov.models so your imports might break

DeepPavlov is an open-source conversational AI library built on TensorFlow and Keras. It is designed for

  • development of production ready chat-bots and complex conversational systems,
  • NLP and dialog systems research.

Hello Bot in DeepPavlov

Import key components to build HelloBot.

from deeppavlov.core.agent import Agent, HighestConfidenceSelector
from deeppavlov.skills.pattern_matching_skill import PatternMatchingSkill

Create skills as pre-defined responses for a user's input containing specific keywords. Every skill returns response and confidence.

hello = PatternMatchingSkill(responses=['Hello world! :)'], patterns=["hi", "hello", "good day"])
bye = PatternMatchingSkill(['Goodbye world! :(', 'See you around.'], ["bye", "chao", "see you"])
fallback = PatternMatchingSkill(["I don't understand, sorry :/", 'I can say "Hello world!" 8)'])

Agent executes skills and then takes response from the skill with the highest confidence.

HelloBot = Agent([hello, bye, fallback], skills_selector=HighestConfidenceSelector())

Give the floor to the HelloBot!

print(HelloBot(['Hello!', 'Boo...', 'Bye.']))

Jupyther notebook with HelloBot example.

Features

Components

Named Entity Recognition | Slot filling

Intent/Sentence Classification | Sentence Similarity/Ranking

Question Answering over Text (SQuAD)

Morphological tagging | Automatic Spelling Correction

Skills

Goal(Task)-oriented Bot | Seq2seq Goal-Oriented bot

Open Domain Questions Answering

Frequently Asked Questions Answering

Embeddings

ELMo embeddings for the Russian language

FastText embeddings for the Russian language

Auto ML

Tuning Models with Evolutionary Algorithm

Installation

  1. Currently we support only Linux platform and Python 3.6 (Python 3.5 is not supported!)

  2. Create a virtual environment with Python 3.6:

    virtualenv env
    
  3. Activate the environment:

    source ./env/bin/activate
    
  4. Install the package inside this virtual environment:

    pip install deeppavlov
    

Demo

Demo of selected features is available at demo.ipavlov.ai

Quick start

To use our pre-trained models, you should first install their requirements:

python -m deeppavlov install <path_to_config>

Then download the models and data for them:

python -m deeppavlov download <path_to_config>

or you can use additional key -d to automatically download all required models and data with any command like interact, riseapi, etc.

Then you can interact with the models or train them with the following command:

python -m deeppavlov <mode> <path_to_config> [-d]
  • <mode> can be train, predict, interact, interactbot or riseapi
  • <path_to_config> should be a path to an NLP pipeline json config (e.g. deeppavlov/configs/ner/slotfill_dstc2.json) or a name without the .json extension of one of the config files provided in this repository (e.g. slotfill_dstc2)

For the interactbot mode you should specify Telegram bot token in -t parameter or in TELEGRAM_TOKEN environment variable. Also if you want to get custom /start and /help Telegram messages for the running model you should:

  • Add section to utils/telegram_utils/model_info.json with your custom Telegram messages
  • In model config file specify metadata.labels.telegram_utils parameter with name which refers to the added section of utils/telegram_utils/model_info.json

For riseapi mode you should specify api settings (host, port, etc.) in utils/server_utils/server_config.json configuration file. If provided, values from model_defaults section override values for the same parameters from common_defaults section. Model names in model_defaults section should be similar to the class names of the models main component.

For predict you can specify path to input file with -f or --input-file parameter, otherwise, data will be taken from stdin.
Every line of input text will be used as a pipeline input parameter, so one example will consist of as many lines, as many input parameters your pipeline expects.
You can also specify batch size with -b or --batch-size parameter.

Documentation

docs.deeppavlov.ai

Tutorials

Jupyter notebooks and videos explaining how to use DeepPalov for different tasks can be found in /examples/tutorials/

License

DeepPavlov is Apache 2.0 - licensed.

Support and collaboration

If you have any questions, bug reports or feature requests, please feel free to post on our Github Issues page. Please tag your issue with bug, feature request, or question. Also we’ll be glad to see your pull requests to add new datasets, models, embeddings, etc.

The Team

DeepPavlov is built and maintained by Neural Networks and Deep Learning Lab at MIPT within iPavlov project (part of National Technology Initiative) and in partnership with Sberbank.

deeppavlov's People

Contributors

alexeysorokin avatar avkamenev avatar deeppavlovadmin avatar dilyararimovna avatar ismaslov avatar kudep avatar litinsky avatar madrugado avatar mu-arkhipov avatar my-master avatar nikolay-bushkov avatar puleon avatar seliverstov avatar tsundokum avatar varvara-l avatar vikmary avatar yoptar avatar yurakuratov avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.