Skip to content

Commit 1ed6ad4

Browse files
authored
Release 1.5.0
2 parents 168e979 + 926f7a7 commit 1ed6ad4

File tree

9 files changed

+227
-74
lines changed

9 files changed

+227
-74
lines changed

.readthedocs.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# .readthedocs.yml
2+
version: 2
23

34
build:
4-
image: latest
5-
5+
os: "ubuntu-20.04"
6+
tools:
7+
python: "3.10"
68
formats: []
79

810
python:
9-
pip_install: true
10-
version: 3.6
11-
extra_requirements:
11+
install:
12+
- method: pip
13+
path: .
14+
extra_requirements:
1215
- docs

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ Please leave us [your feedback](https://forms.gle/i64fowQmiVhMMC7f9) on how we c
6060

6161
## Installation
6262

63-
0. We support `Linux` platform, `Python 3.6`, `3.7`, `3.8`, `3.9` and `3.10`
64-
* **`Python 3.5` is not supported!**
63+
0. DeepPavlov supports `Linux`, `Windows 10+` (through WSL/WSL2), `MacOS` (Big Sur+) platforms, `Python 3.6`, `3.7`, `3.8`, `3.9` and `3.10`.
64+
Depending on the model used, you may need from 4 to 16 GB RAM.
6565

6666
1. Create and activate a virtual environment:
6767
* `Linux`
@@ -99,6 +99,7 @@ By default, DeepPavlov installs models requirements from PyPI. PyTorch from PyPI
9999
capability. To run supported DeepPavlov models on GPU you should have [CUDA](https://developer.nvidia.com/cuda-toolkit)
100100
compatible with used GPU and [PyTorch version](deeppavlov/requirements/pytorch.txt) required by DeepPavlov models.
101101
See [docs](https://docs.deeppavlov.ai/en/master/intro/quick_start.html#using-gpu) for details.
102+
GPU with Pascal or newer architecture and 4+ GB VRAM is recommended.
102103

103104
### Command line interface (CLI)
104105

deeppavlov/_meta.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = '1.4.0'
1+
__version__ = '1.5.0'
22
__author__ = 'Neural Networks and Deep Learning lab, MIPT'
33
__description__ = 'An open source library for building end-to-end dialog systems and training chatbots.'
44
__keywords__ = ['NLP', 'NER', 'SQUAD', 'Intents', 'Chatbot']

deeppavlov/core/commands/train.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ def train_evaluate_model_from_config(config: Union[str, Path, dict],
9292
if iterator is None:
9393
try:
9494
data = read_data_by_config(config)
95-
if config.get('train', {}).get('val_every_n_epochs') and not data.get('valid'):
95+
# TODO: check class objects, not strings
96+
is_mtl = config['dataset_reader']['class_name'] == 'multitask_reader'
97+
if config.get('train', {}).get('val_every_n_epochs') and not data.get('valid') and not is_mtl:
9698
error_message = 'The value "val_every_n_epochs" is set in the config but no validation data is provided'
9799
raise AttributeError(error_message)
98100
except ConfigError as e:

docs/features/models/NER.ipynb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@
8080
"metadata": {},
8181
"outputs": [],
8282
"source": [
83-
"!python -m deeppavlov install ner_ontonotes_bert_torch"
83+
"!python -m deeppavlov install ner_ontonotes_bert"
8484
]
8585
},
8686
{
8787
"cell_type": "markdown",
8888
"metadata": {},
8989
"source": [
90-
"`ner_ontonotes_bert_torch` is the name of the model's *config_file*. [What is a Config File?](http://docs.deeppavlov.ai/en/master/intro/configuration.html) \n",
90+
"`ner_ontonotes_bert` is the name of the model's *config_file*. [What is a Config File?](http://docs.deeppavlov.ai/en/master/intro/configuration.html) \n",
9191
"\n",
9292
"Configuration file defines the model and describes its hyperparameters. To use another model, change the name of the *config_file* here and further.\n",
9393
"The full list of NER models with their config names can be found in the [table](#3.-Models-list).\n",
@@ -126,7 +126,7 @@
126126
"source": [
127127
"from deeppavlov import build_model\n",
128128
"\n",
129-
"ner_model = build_model('ner_ontonotes_bert_torch', download=True, install=True)"
129+
"ner_model = build_model('ner_ontonotes_bert', download=True, install=True)"
130130
]
131131
},
132132
{
@@ -180,7 +180,7 @@
180180
"metadata": {},
181181
"outputs": [],
182182
"source": [
183-
"! python -m deeppavlov interact ner_ontonotes_bert_torch -d"
183+
"! python -m deeppavlov interact ner_ontonotes_bert -d"
184184
]
185185
},
186186
{
@@ -198,7 +198,7 @@
198198
"metadata": {},
199199
"outputs": [],
200200
"source": [
201-
"! python -m deeppavlov predict ner_ontonotes_bert_torch -f <file-name>"
201+
"! python -m deeppavlov predict ner_ontonotes_bert -f <file-name>"
202202
]
203203
},
204204
{
@@ -224,7 +224,7 @@
224224
"source": [
225225
"from deeppavlov import evaluate_model\n",
226226
"\n",
227-
"model = evaluate_model('ner_ontonotes_bert_torch', download=True)"
227+
"model = evaluate_model('ner_ontonotes_bert', download=True)"
228228
]
229229
},
230230
{
@@ -240,7 +240,7 @@
240240
"metadata": {},
241241
"outputs": [],
242242
"source": [
243-
"! python -m deeppavlov evaluate ner_ontonotes_bert_torch"
243+
"! python -m deeppavlov evaluate ner_ontonotes_bert"
244244
]
245245
},
246246
{
@@ -275,7 +275,7 @@
275275
"from deeppavlov import train_model\n",
276276
"from deeppavlov.core.commands.utils import parse_config\n",
277277
"\n",
278-
"model_config = parse_config('ner_ontonotes_bert_torch')\n",
278+
"model_config = parse_config('ner_ontonotes_bert')\n",
279279
"\n",
280280
"# dataset that the model was trained on\n",
281281
"print(model_config['dataset_reader']['data_path'])"
@@ -401,7 +401,7 @@
401401
"metadata": {},
402402
"outputs": [],
403403
"source": [
404-
"! python -m deeppavlov train ner_ontonotes_bert_torch"
404+
"! python -m deeppavlov train ner_ontonotes_bert"
405405
]
406406
},
407407
{

docs/features/models/multitask_bert.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ Multi-task BERT in DeepPavlov
22
=============================
33

44
Multi-task BERT in DeepPavlov is an implementation of BERT training algorithm published in the paper
5-
`Multi-Task Deep Neural Networks for Natural Language Understanding <https://arxiv.org/abs/1901.11504>`_.
5+
`Knowledge Transfer Between Tasks and Languages in the Multi-task
6+
Encoder-agnostic Transformer-based Models <https://www.dialog-21.ru/media/5902/karpovdpluskonovalovv002.pdf>`_.
67

78
The idea is to share BERT body between several tasks. This is necessary if a model pipe has several
89
components using BERT and the amount of GPU memory is limited. Each task has its own 'head' part attached to the

docs/integrations/rest_api.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,26 @@ Here are POST request payload examples for some of the library models:
117117
| | |  "question_raw":["What strained the relationship between Great Britain and its colonies?"]} |
118118
+-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
119119

120+
REST API Usage Example
121+
======================
122+
123+
To start server with ``squad_bert`` model run:
124+
125+
.. code:: bash
126+
127+
python -m deeppavlov riseapi squad_bert -id
128+
129+
To get response from this model on another terminal run:
130+
131+
.. code:: bash
132+
133+
curl -X POST http://0.0.0.0:5000/model -H 'Content-Type: application/json' -d '{
134+
"context_raw": [
135+
"All work and no play makes Jack a dull boy.",
136+
"I used to be an adventurer like you, then I took an arrow in the knee."
137+
],
138+
"question_raw": [
139+
"What makes Jack a dull boy?",
140+
"Who I used to be?"
141+
]
142+
}'

docs/intro/installation.rst

Lines changed: 39 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,69 @@
11
Installation
22
============
33

4+
DeepPavlov supports **Linux**, **Windows 10+** (through WSL/WSL2), **MacOS** (Big Sur+) platforms, **Python 3.6-3.10**.
5+
Depending on the model used, you may need from 4 to 16 GB RAM.
46

5-
We support ``Linux`` platform, ``Python 3.6``, ``3.7``, ``3.8``, ``3.9`` and ``3.10``.
6-
7-
.. note::
8-
9-
* ``Python 3.5`` is not supported!
7+
Install with pip
8+
~~~~~~~~~~~~~~~~
109

10+
You should install DeepPavlov in a `virtual environment <https://docs.python.org/3/library/venv.html>`_. If you’re
11+
unfamiliar with Python virtual environments, take a look at this
12+
`guide <https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/>`_. A virtual
13+
environment makes it easier to manage different projects, and avoid compatibility issues between dependencies.
1114

1215
#. Create a virtual environment:
1316

1417
.. code:: bash
1518
1619
python -m venv env
1720
18-
#. Activate the environment:
21+
#. Activate the virtual environment on Linux (`source` could be replaced with `.`):
1922

20-
* Linux
21-
22-
.. code:: bash
23+
.. code:: bash
2324
24-
source ./env/bin/activate
25+
source env/bin/activate
2526
26-
#. Install the package inside this virtual environment:
27+
#. Install DeepPavlov inside this virtual environment:
2728

2829
.. code:: bash
2930
3031
pip install deeppavlov
3132
33+
Install from source
34+
~~~~~~~~~~~~~~~~~~~
35+
36+
Install DeepPavlov **dev** branch from source with the following command:
37+
38+
.. code:: bash
39+
40+
pip install git+http://github.com/deeppavlov/DeepPavlov@dev
41+
42+
This command installs the bleeding edge dev version rather than the latest release version. The dev version is useful
43+
for staying up-to-date with the latest developments. For instance, if a bug has been fixed since the last release but
44+
a new release hasn’t been rolled out yet. However, this means the dev version may not always be stable.
45+
46+
Editable install
47+
~~~~~~~~~~~~~~~~
48+
49+
You will need an editable install if you want to make changes in the DeepPavlov source code that immediately take place
50+
without requiring a new installation.
51+
52+
Clone the repository and install DeepPavlov with the following commands:
53+
54+
.. code:: bash
55+
56+
git clone http://github.com/deeppavlov/DeepPavlov.git
57+
pip install -e DeepPavlov
3258
3359
Docker Images
34-
-------------
60+
~~~~~~~~~~~~~
3561

3662
We have built several DeepPavlov based Docker images, which include:
3763

3864
* DeepPavlov based Jupyter notebook Docker image;
3965
* Docker images which serve some of our models and allow to access them
40-
via REST API (``riseapi`` mode).
66+
via REST API (:doc:`riseapi </integrations/rest_api>` mode).
4167

4268
Here is our `DockerHub repository <https://hub.docker.com/u/deeppavlov/>`_ with
4369
images and deployment instructions.

0 commit comments

Comments
 (0)