diff --git a/README.md b/README.md index 445ea8c090..d1f791e3a9 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ [![License Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/deepmipt/DeepPavlov/blob/master/LICENSE) ![Python 3.6](https://img.shields.io/badge/python-3.6-green.svg) -_We are still in a really early Alpha release._ +_We are still in a really early Alpha release._ +__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](https://www.tensorflow.org/) and [Keras](https://keras.io/). It is designed for * development of production ready chat-bots and complex conversational systems, @@ -52,14 +54,10 @@ print(HelloBot(['Hello!', 'Boo...', 'Bye.'])) git clone https://github.com/deepmipt/DeepPavlov.git cd DeepPavlov ``` -4. Install the requirements: +4. Install basic requirements: ``` python setup.py develop ``` -5. Install `spacy` dependencies: - ``` - python -m spacy download en - ``` # Demo @@ -80,16 +78,16 @@ Our goal is to enable AI-application developers and researchers with: ## Key Concepts * `Agent` is a conversational agent communicating with users in natural language (text). * `Skill` fulfills user’s goal in some domain. Typically, this is accomplished by presenting information or completing transaction (e.g. answer question by FAQ, booking tickets etc.). However, for some tasks a success of interaction is defined as continuous engagement (e.g. chit-chat). - * `Model` is a reusable functional component of `Skill`. + * `Component` is a reusable functional component of `Skill`. * `Rule-based Models` cannot be trained. * `Machine Learning Models` can be trained only stand alone. * `Deep Learning Models` can be trained independently and in an end-to-end mode being joined in a chain. * `Skill Manager` performs selection of the `Skill` to generate response. * ` Chainer` builds an agent/component pipeline from heterogeneous components (rule-based/ml/dl). It allows to train and infer models in a pipeline as a whole. -The smallest building block of the library is `Model`. `Model` stands for any kind of function in an NLP pipeline. It can be implemented as a neural network, a non-neural ML model or a rule-based system. Besides that, `Model` can have nested structure, i.e. a `Model` can include other `Model`'(s). +The smallest building block of the library is `Component`. `Component` stands for any kind of function in an NLP pipeline. It can be implemented as a neural network, a non-neural ML model or a rule-based system. Besides that, `Component` can have nested structure, i.e. a `Component` can include other `Component`'(s). -`Model`s can be joined into a `Skill`. `Skill` solves a larger NLP task compared to `Model`. However, in terms of implementation `Skill`s are not different from `Model`s. The only restriction of `Skill`s is that their input and output should both be strings. Therefore, `Skill`s are usually associated with dialogue tasks. +`Component`s can be joined into a `Skill`. `Skill` solves a larger NLP task compared to `Component`. However, in terms of implementation `Skill`s are not different from `Component`s. The only restriction of `Skill`s is that their input and output should both be strings. Therefore, `Skill`s are usually associated with dialogue tasks. `Agent` is supposed to be a multi-purpose dialogue system that comprises several `Skill`s and can switch between them. It can be a dialogue system that contains a goal-oriented and chatbot skills and chooses which one to use for generating the answer depending on user input. @@ -99,7 +97,13 @@ DeepPavlov is built on top of machine learning frameworks [TensorFlow](https://w # Quick start -To use our pre-trained models, you should first download them: +To use our pre-trained models, you should first install their requirements: +``` +python -m deeppavlov install +``` + + +Then download the models and data for them: ``` python -m deeppavlov download ``` @@ -441,4 +445,3 @@ DeepPavlov is built and maintained by [Neural Networks and Deep Learning Lab](ht

- diff --git a/deeppavlov/package_meta.py b/deeppavlov/package_meta.py index 9259e7bbc8..f8f2a47d87 100644 --- a/deeppavlov/package_meta.py +++ b/deeppavlov/package_meta.py @@ -1,2 +1,2 @@ -__version__ = '0.0.5.3' +__version__ = '0.0.6b' __author__ = 'Neural Networks and Deep Learning lab, MIPT' diff --git a/dp_agnt_diag.png b/dp_agnt_diag.png index e4e182bcb2..e9445e1389 100644 Binary files a/dp_agnt_diag.png and b/dp_agnt_diag.png differ diff --git a/examples/tutorials/00_deeppavlov_intro.ipynb b/examples/tutorials/00_deeppavlov_intro.ipynb index ddc393a574..02141e21d1 100644 --- a/examples/tutorials/00_deeppavlov_intro.ipynb +++ b/examples/tutorials/00_deeppavlov_intro.ipynb @@ -43,13 +43,13 @@ " \n", " `cd DeepPavlov`\n", "\n", - "- Install the requirements:\n", + "- Install basic requirements:\n", "\n", " `python setup.py develop`\n", "\n", - "- Install spacy dependencies:\n", + "- Install packages required for these tutorials:\n", "\n", - " `python -m spacy download en`\n", + " `python -m deeppavlov install gobot_dstc2`\n", "\n" ] }, diff --git a/examples/tutorials/04_deeppavlov_chitchat.ipynb b/examples/tutorials/04_deeppavlov_chitchat.ipynb index 9d9b1cfadf..a28f3b13cb 100644 --- a/examples/tutorials/04_deeppavlov_chitchat.ipynb +++ b/examples/tutorials/04_deeppavlov_chitchat.ipynb @@ -601,7 +601,7 @@ " else:\n", " input_token_emb = tf.nn.embedding_lookup(embedding_matrix, output_token)\n", "\n", - " \"\"\"\n", + " \"\"\"\n", " ATTENTION MECHANISM\n", " # here you can add attention to your model\n", " # you can find details about attention further in tutorial\n", diff --git a/utils/pip_wrapper/pip_wrapper.py b/utils/pip_wrapper/pip_wrapper.py index 40044a00e3..8e3e013300 100644 --- a/utils/pip_wrapper/pip_wrapper.py +++ b/utils/pip_wrapper/pip_wrapper.py @@ -12,6 +12,7 @@ log = get_logger(__name__) _tf_re = re.compile(r'\s*tensorflow\s*([<=>;]|$)') +_spacy_re = re.compile(r'\s*spacy\s*([<=>;]|$)') def install(*packages): @@ -20,9 +21,12 @@ def install(*packages): env=os.environ.copy()): log.warn('found tensorflow-gpu installed, so upgrading it instead of tensorflow') packages = [_tf_re.sub(r'tensorflow-gpu\1', package) for package in packages] - return subprocess.check_call([sys.executable, '-m', 'pip', 'install', - *[re.sub(r'\s', '', package) for package in packages]], - env=os.environ.copy()) + result = subprocess.check_call([sys.executable, '-m', 'pip', 'install', + *[re.sub(r'\s', '', package) for package in packages]], + env=os.environ.copy()) + if any(_spacy_re.match(package) for package in packages): + subprocess.check_call([sys.executable, '-m', 'spacy', 'download', 'en'], env=os.environ.copy()) + return result def install_from_config(config: [str, Path, dict]):