Skip to content

Commit

Permalink
Release 0.1.1
Browse files Browse the repository at this point in the history
Release 0.1.1
  • Loading branch information
seliverstov committed Dec 12, 2018
2 parents 3aeecc7 + 5280613 commit 4686425
Show file tree
Hide file tree
Showing 56 changed files with 1,181 additions and 405 deletions.
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ python:
pip_install: true
version: 3.6
extra_requirements:
- docs
- docs
1 change: 1 addition & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ node('gpu') {
}
stage('Setup') {
env.CUDA_VISIBLE_DEVICES=0
env.TFHUB_CACHE_DIR="tfhub_cache"
sh """
virtualenv --python=python3 '.venv-$BUILD_NUMBER'
. '.venv-$BUILD_NUMBER/bin/activate'
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![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)
[![Downloads](https://pepy.tech/badge/deeppavlov)](https://pepy.tech/project/deeppavlov)
[![License Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/deepmipt/DeepPavlov/blob/master/LICENSE)

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,
Expand Down Expand Up @@ -71,7 +71,7 @@ print(HelloBot(['Hello!', 'Boo...', 'Bye.']))

[Goal(Task)-oriented Bot](http://docs.deeppavlov.ai/en/latest/skills/go_bot.html) | [Seq2seq Goal-Oriented bot](http://docs.deeppavlov.ai/en/latest/skills/seq2seq_go_bot.html)

[Open Domain Questions Answering](http://docs.deeppavlov.ai/en/latest/skills/odqa.html) | [eCommerce Bot](http://docs.deeppavlov.ai/en/latest/skills/ecommerce_bot_skill.html)
[Open Domain Questions Answering](http://docs.deeppavlov.ai/en/latest/skills/odqa.html) | [eCommerce Bot](http://docs.deeppavlov.ai/en/master/skills/ecommerce.html)

[Frequently Asked Questions Answering](http://docs.deeppavlov.ai/en/latest/skills/faq.html) | [Pattern Matching](http://docs.deeppavlov.ai/en/latest/skills/pattern_matching.html)

Expand All @@ -89,7 +89,7 @@ print(HelloBot(['Hello!', 'Boo...', 'Bye.']))

0. Currently we support `Linux` and `Windows` platforms and `Python 3.6`
* **`Python 3.5` is not supported!**
* **`Windows` platform requires `Visual Studio 2015/2017` with `C++` build tools installed!**
* **`Windows` platform requires `Git` for Windows (for example, [git](https://git-scm.com/download/win)), `Visual Studio 2015/2017` with `C++` build tools installed!**

1. Create a virtual environment with `Python 3.6`:
```
Expand Down
6 changes: 3 additions & 3 deletions deeppavlov/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
from .download import deep_download

# TODO: make better and add typing
def train_model(config, download=False):
train_evaluate_model_from_config(config, download=download)
def train_model(config, download=False, recursive=False):
train_evaluate_model_from_config(config, download=download, recursive=recursive)
return build_model(config, load_trained=True)
except ImportError:
'Assuming that requirements are not yet installed'

__version__ = '0.1.0'
__version__ = '0.1.1'
__author__ = 'Neural Networks and Deep Learning lab, MIPT'
__description__ = 'An open source library for building end-to-end dialog systems and training chatbots.'
__keywords__ = ['NLP', 'NER', 'SQUAD', 'Intents', 'Chatbot']
Expand Down
2 changes: 1 addition & 1 deletion deeppavlov/agents/ecommerce_agent/ecommerce_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def make_agent() -> EcommerceAgent:
agent: created Ecommerce agent
"""

config_path = find_config('bleu_retrieve')
config_path = find_config('tfidf_retrieve')
skill = build_model(config_path)
agent = EcommerceAgent(skills=[skill])
return agent
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"dataset_reader": {
"class_name": "odqa_reader",
"data_path": "{DOWNLOADS_PATH}/odqa/enwiki20161221",
"save_path": "{DOWNLOADS_PATH}/odqa/enwiki20161221.db",
"dataset_format": "wiki"
},
"dataset_iterator": {
"class_name": "sqlite_iterator",
"shuffle": false,
"load_path": "{DOWNLOADS_PATH}/odqa/enwiki20161221.db"
},
"chainer": {
"in": [
"x"
],
"out": [
"y"
],
"pipe": [
{
"class_name": "hashing_tfidf_vectorizer",
"id": "vectorizer",
"fit_on_batch": [
"x"
],
"save_path": "{MODELS_PATH}/odqa/enwiki20161221_tfidf_matrix.npz",
"load_path": "{MODELS_PATH}/odqa/enwiki20161221_tfidf_matrix.npz",
"tokenizer": {
"class_name": "stream_spacy_tokenizer",
"lemmas": true,
"ngram_range": [
1,
2
]
}
},
{
"class_name": "tfidf_ranker",
"top_n": 25,
"in": [
"x"
],
"out": [
"y",
"score"
],
"vectorizer": "#vectorizer"
}
]
},
"train": {
"validate_best": false,
"test_best": false,
"batch_size": 10000
},
"metadata": {
"variables": {
"ROOT_PATH": "~/.deeppavlov",
"DOWNLOADS_PATH": "{ROOT_PATH}/downloads",
"MODELS_PATH": "{ROOT_PATH}/models"
},
"requirements": [
"{DEEPPAVLOV_PATH}/requirements/spacy.txt",
"{DEEPPAVLOV_PATH}/requirements/en_core_web_sm.txt"
],
"labels": {
"server_utils": "Ranker"
},
"download": [
{
"url": "http://files.deeppavlov.ai/datasets/wikipedia/enwiki20161221.tar.gz",
"subdir": "{DOWNLOADS_PATH}"
},
{
"url": "http://files.deeppavlov.ai/deeppavlov_data/en_odqa_enwiki20161221.tar.gz",
"subdir": "{MODELS_PATH}"
}
]
}
}
14 changes: 10 additions & 4 deletions deeppavlov/configs/doc_retrieval/en_ranker_tfidf_wiki.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
},
"chainer": {
"in": [
"x"
"docs"
],
"in_y": [
"doc_ids",
"doc_nums"
],
"out": [
"y"
Expand All @@ -22,7 +26,9 @@
"class_name": "hashing_tfidf_vectorizer",
"id": "vectorizer",
"fit_on_batch": [
"x"
"docs",
"doc_ids",
"doc_nums"
],
"save_path": "{MODELS_PATH}/odqa/enwiki_tfidf_matrix.npz",
"load_path": "{MODELS_PATH}/odqa/enwiki_tfidf_matrix.npz",
Expand All @@ -37,9 +43,9 @@
},
{
"class_name": "tfidf_ranker",
"top_n": 5,
"top_n": 25,
"in": [
"x"
"docs"
],
"out": [
"y",
Expand Down
12 changes: 9 additions & 3 deletions deeppavlov/configs/doc_retrieval/ru_ranker_tfidf_wiki.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
},
"chainer": {
"in": [
"x"
"docs"
],
"in_y": [
"doc_ids",
"doc_nums"
],
"out": [
"y"
Expand All @@ -22,7 +26,9 @@
"class_name": "hashing_tfidf_vectorizer",
"id": "vectorizer",
"fit_on_batch": [
"x"
"docs",
"doc_ids",
"doc_nums"
],
"save_path": "{MODELS_PATH}/odqa/ruwiki_tfidf_matrix.npz",
"load_path": "{MODELS_PATH}/odqa/ruwiki_tfidf_matrix.npz",
Expand All @@ -39,7 +45,7 @@
"class_name": "tfidf_ranker",
"top_n": 5,
"in": [
"x"
"docs"
],
"out": [
"y",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"dataset_reader": {
"class_name": "file_paths_reader",
"data_path": "{DOWNLOADS_PATH}/elmo-lm-ready4fine-example-data/data/",
"train": "train/*",
"valid": "heldout/*"
},
"dataset_iterator": {
"class_name": "elmo_file_paths_iterator",
"seed": 31415,
"unroll_steps": 20,
"max_word_length": 50,
"n_gpus": 1,
"shuffle": false,
"bos":"<S>",
"eos":"</S>",
"save_path": "{MODELS_PATH}/elmo-lm-ready4fine-tuning-ru-news-simple/vocab.txt",
"load_path":"{MODELS_PATH}/elmo-lm-ready4fine-tuning-ru-news-simple/vocab.txt"
},
"chainer": {
"in": [
"x_char_ids"
],
"in_y": [
"y_token_ids"
],
"pipe": [
{
"class_name": "elmo_model",
"options_json_path": "{MODELS_PATH}/elmo-lm-ready4fine-tuning-ru-news-simple/options.json",
"unroll_steps": 20,
"batch_size": 128,
"save_path": "{MODELS_PATH}/elmo-lm-ready4fine-tuning-ru-news-simple/saves/model",
"load_path": "{MODELS_PATH}/elmo-lm-ready4fine-tuning-ru-news-simple/saves/model",
"in": ["x_char_ids", "y_token_ids"],
"in_y": [],
"n_gpus": 1,
"out": ["loss"]
}
],
"out": [
"x_char_ids",
"y_token_ids"
]
},
"train": {
"epochs": 20,
"batch_size": 128,
"log_every_n_batches": 100,
"val_every_n_epochs": 1,
"validation_patience": 4,
"metric_optimization": "minimize",
"metrics": [
{
"name": "elmo_loss2ppl",
"inputs": ["loss"]
}
],
"tensorboard_log_dir": "{MODELS_PATH}/elmo-lm-ready4fine-tuning-ru-news-simple/logs"
},
"metadata": {
"variables": {
"ROOT_PATH": "~/.deeppavlov",
"DOWNLOADS_PATH": "{ROOT_PATH}/downloads",
"MODELS_PATH": "{ROOT_PATH}/models"
},
"requirements": [
"{DEEPPAVLOV_PATH}/requirements/tf.txt",
"{DEEPPAVLOV_PATH}/requirements/tf-hub.txt"
],
"download": [
{
"url": "http://files.deeppavlov.ai/deeppavlov_data/elmo-lm-ready4fine-example-data.tar.gz",
"subdir": "{DOWNLOADS_PATH}/"
},
{
"url": "http://files.deeppavlov.ai/deeppavlov_data/elmo-lm-ready4fine-tuning-ru-news-simple.tar.gz",
"subdir": "{MODELS_PATH}/"
}
]
}
}
82 changes: 82 additions & 0 deletions deeppavlov/configs/elmo/elmo-lm-ready4fine-tuning-ru-news.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"dataset_reader": {
"class_name": "file_paths_reader",
"data_path": "{DOWNLOADS_PATH}/elmo-lm-ready4fine-example-data/data/",
"train": "train/*",
"valid": "heldout/*"
},
"dataset_iterator": {
"class_name": "elmo_file_paths_iterator",
"seed": 31415,
"unroll_steps": 20,
"max_word_length": 50,
"n_gpus": 1,
"shuffle": false,
"bos":"<S>",
"eos":"</S>",
"save_path": "{MODELS_PATH}/elmo-lm-ready4fine-tuning-ru-news/vocab.txt",
"load_path":"{MODELS_PATH}/elmo-lm-ready4fine-tuning-ru-news/vocab.txt"
},
"chainer": {
"in": [
"x_char_ids"
],
"in_y": [
"y_token_ids"
],
"pipe": [
{
"class_name": "elmo_model",
"options_json_path": "{MODELS_PATH}/elmo-lm-ready4fine-tuning-ru-news/options.json",
"unroll_steps": 20,
"batch_size": 128,
"save_path": "{MODELS_PATH}/elmo-lm-ready4fine-tuning-ru-news/saves/model",
"load_path": "{MODELS_PATH}/elmo-lm-ready4fine-tuning-ru-news/saves/model",
"in": ["x_char_ids", "y_token_ids"],
"in_y": [],
"n_gpus": 1,
"out": ["loss"]
}
],
"out": [
"x_char_ids",
"y_token_ids"
]
},
"train": {
"epochs": 20,
"batch_size": 128,
"log_every_n_batches": 100,
"val_every_n_epochs": 1,
"validation_patience": 4,
"metric_optimization": "minimize",
"metrics": [
{
"name": "elmo_loss2ppl",
"inputs": ["loss"]
}
],
"tensorboard_log_dir": "{MODELS_PATH}/elmo-lm-ready4fine-tuning-ru-news/logs"
},
"metadata": {
"variables": {
"ROOT_PATH": "~/.deeppavlov",
"DOWNLOADS_PATH": "{ROOT_PATH}/downloads",
"MODELS_PATH": "{ROOT_PATH}/models"
},
"requirements": [
"{DEEPPAVLOV_PATH}/requirements/tf.txt",
"{DEEPPAVLOV_PATH}/requirements/tf-hub.txt"
],
"download": [
{
"url": "http://files.deeppavlov.ai/deeppavlov_data/elmo-lm-ready4fine-example-data.tar.gz",
"subdir": "{DOWNLOADS_PATH}/"
},
{
"url": "http://files.deeppavlov.ai/deeppavlov_data/elmo-lm-ready4fine-tuning-ru-news.tar.gz",
"subdir": "{MODELS_PATH}/"
}
]
}
}

0 comments on commit 4686425

Please sign in to comment.