diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-04-12 03:04:48 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-04-12 03:04:48 +0000 |
| commit | cf0b407efa0557fc18cf2953da27a6f978c5405f (patch) | |
| tree | e237f8a4c9a99e5378a16279f784ffca5411ff7e | |
| parent | 8ba4856bed8a9b789e0e165f2cf30e97cc03a5b7 (diff) | |
automatic import of python-deeppavlov
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-deeppavlov.spec | 662 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 664 insertions, 0 deletions
@@ -0,0 +1 @@ +/deeppavlov-1.1.1.tar.gz diff --git a/python-deeppavlov.spec b/python-deeppavlov.spec new file mode 100644 index 0000000..5e4d481 --- /dev/null +++ b/python-deeppavlov.spec @@ -0,0 +1,662 @@ +%global _empty_manifest_terminate_build 0 +Name: python-deeppavlov +Version: 1.1.1 +Release: 1 +Summary: An open source library for building end-to-end dialog systems and training chatbots. +License: Apache License, Version 2.0 +URL: https://github.com/deeppavlov/DeepPavlov +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/63/ca/92187ea41f6a26200ba1bbdb46a4b894d088ba4cfc7ef22e716e5609e5ba/deeppavlov-1.1.1.tar.gz +BuildArch: noarch + +Requires: python3-aio-pika +Requires: python3-fastapi +Requires: python3-filelock +Requires: python3-nltk +Requires: python3-numpy +Requires: python3-overrides +Requires: python3-pandas +Requires: python3-prometheus-client +Requires: python3-pydantic +Requires: python3-pybind11 +Requires: python3-requests +Requires: python3-scikit-learn +Requires: python3-scipy +Requires: python3-tqdm +Requires: python3-uvicorn +Requires: python3-sphinx-rtd-theme +Requires: python3-nbsphinx +Requires: python3-ipykernel +Requires: python3-jinja2 +Requires: python3-sphinx-copybutton +Requires: python3-pandoc +Requires: python3-ipython-genutils +Requires: python3-sphinx +Requires: python3-sphinx +Requires: python3-boto3 +Requires: python3-flake8 +Requires: python3-pytest +Requires: python3-pytest-instafail +Requires: python3-pexpect + +%description +[](https://github.com/deeppavlov/DeepPavlov/blob/master/LICENSE) + +[](https://pepy.tech/project/deeppavlov) +<img align="right" height="27%" width="27%" src="https://raw.githubusercontent.com/deeppavlov/DeepPavlov/master/docs/_static/deeppavlov_logo.png"/> + +DeepPavlov is an open-source conversational AI library built on [PyTorch](https://pytorch.org/). + +DeepPavlov is designed for +* development of production ready chat-bots and complex conversational systems, +* research in the area of NLP and, particularly, of dialog systems. + +## Quick Links + +* Demo [*demo.deeppavlov.ai*](https://demo.deeppavlov.ai/) +* Documentation [*docs.deeppavlov.ai*](http://docs.deeppavlov.ai/) + * Model List [*docs:features/*](http://docs.deeppavlov.ai/en/master/features/overview.html) + * Contribution Guide [*docs:contribution_guide/*](http://docs.deeppavlov.ai/en/master/devguides/contribution_guide.html) +* Issues [*github/issues/*](https://github.com/deeppavlov/DeepPavlov/issues) +* Forum [*forum.deeppavlov.ai*](https://forum.deeppavlov.ai/) +* Blogs [*medium.com/deeppavlov*](https://medium.com/deeppavlov) +* [Extended colab tutorials](https://github.com/deeppavlov/dp_tutorials) +* Docker Hub [*hub.docker.com/u/deeppavlov/*](https://hub.docker.com/u/deeppavlov/) + * Docker Images Documentation [*docs:docker-images/*](http://docs.deeppavlov.ai/en/master/intro/installation.html#docker-images) + +Please leave us [your feedback](https://forms.gle/i64fowQmiVhMMC7f9) on how we can improve the DeepPavlov framework. + +**Models** + +[Named Entity Recognition](http://docs.deeppavlov.ai/en/master/features/models/NER.html) | [Intent/Sentence Classification](http://docs.deeppavlov.ai/en/master/features/models/classifiers.html) | + +[Question Answering over Text (SQuAD)](http://docs.deeppavlov.ai/en/master/features/models/SQuAD.html) | [Knowledge Base Question Answering](http://docs.deeppavlov.ai/en/master/features/models/kbqa.html) + +[Sentence Similarity/Ranking](http://docs.deeppavlov.ai/en/master/features/models/neural_ranking.html) | [TF-IDF Ranking](http://docs.deeppavlov.ai/en/master/features/models/tfidf_ranking.html) + +[Automatic Spelling Correction](http://docs.deeppavlov.ai/en/master/features/models/spelling_correction.html) | [Entity Linking](http://docs.deeppavlov.ai/en/master/features/models/entity_linking.html) + +[Open Domain Questions Answering](http://docs.deeppavlov.ai/en/master/features/models/odqa.html) | [Russian SuperGLUE](http://docs.deeppavlov.ai/en/master/features/models/superglue.html) + +**Embeddings** + +[BERT embeddings for the Russian, Polish, Bulgarian, Czech, and informal English](http://docs.deeppavlov.ai/en/master/features/pretrained_vectors.html#bert) + +[ELMo embeddings for the Russian language](http://docs.deeppavlov.ai/en/master/features/pretrained_vectors.html#elmo) + +[FastText embeddings for the Russian language](http://docs.deeppavlov.ai/en/master/features/pretrained_vectors.html#fasttext) + +**Auto ML** + +[Tuning Models](http://docs.deeppavlov.ai/en/master/features/hypersearch.html) + +**Integrations** + +[REST API](http://docs.deeppavlov.ai/en/master/integrations/rest_api.html) | [Socket API](http://docs.deeppavlov.ai/en/master/integrations/socket_api.html) + +[Amazon AWS](http://docs.deeppavlov.ai/en/master/integrations/aws_ec2.html) + +## Installation + +0. We support `Linux` platform, `Python 3.6`, `3.7`, `3.8`, `3.9` and `3.10` + * **`Python 3.5` is not supported!** + +1. Create and activate a virtual environment: + * `Linux` + ``` + python -m venv env + source ./env/bin/activate + ``` +2. Install the package inside the environment: + ``` + pip install deeppavlov + ``` + +## QuickStart + +There is a bunch of great pre-trained NLP models in DeepPavlov. Each model is +determined by its config file. + +List of models is available on +[the doc page](http://docs.deeppavlov.ai/en/master/features/overview.html) in +the `deeppavlov.configs` (Python): + +```python +from deeppavlov import configs +``` + +When you're decided on the model (+ config file), there are two ways to train, +evaluate and infer it: + +* via [Command line interface (CLI)](https://github.com/deeppavlov/DeepPavlov/blob/master/#command-line-interface-cli) and +* via [Python](https://github.com/deeppavlov/DeepPavlov/blob/master/#python). + +#### GPU requirements + +By default, DeepPavlov installs models requirements from PyPI. PyTorch from PyPI could not support your device CUDA +capability. To run supported DeepPavlov models on GPU you should have [CUDA](https://developer.nvidia.com/cuda-toolkit) +compatible with used GPU and [PyTorch version](https://github.com/deeppavlov/DeepPavlov/blob/master/deeppavlov/requirements/pytorch.txt) required by DeepPavlov models. +See [docs](https://docs.deeppavlov.ai/en/master/intro/quick_start.html#using-gpu) for details. + +### Command line interface (CLI) + +To get predictions from a model interactively through CLI, run + +```bash +python -m deeppavlov interact <config_path> [-d] [-i] +``` + +* `-d` downloads required data - pretrained model files and embeddings (optional). +* `-i` installs model requirements (optional). + +You can train it in the same simple way: + +```bash +python -m deeppavlov train <config_path> [-d] [-i] +``` + +Dataset will be downloaded regardless of whether there was `-d` flag or not. + +To train on your own data you need to modify dataset reader path in the +[train config doc](http://docs.deeppavlov.ai/en/master/intro/config_description.html#train-config). +The data format is specified in the corresponding model doc page. + +There are even more actions you can perform with configs: + +```bash +python -m deeppavlov <action> <config_path> [-d] [-i] +``` + +* `<action>` can be + * `install` to install model requirements (same as `-i`), + * `download` to download model's data (same as `-d`), + * `train` to train the model on the data specified in the config file, + * `evaluate` to calculate metrics on the same dataset, + * `interact` to interact via CLI, + * `riseapi` to run a REST API server (see + [doc](http://docs.deeppavlov.ai/en/master/integrations/rest_api.html)), + * `predict` to get prediction for samples from *stdin* or from + *<file_path>* if `-f <file_path>` is specified. +* `<config_path>` specifies path (or name) of model's config file +* `-d` downloads required data +* `-i` installs model requirements + + +### Python + +To get predictions from a model interactively through Python, run + +```python +from deeppavlov import build_model + +model = build_model(<config_path>, install=True, download=True) + +# get predictions for 'input_text1', 'input_text2' +model(['input_text1', 'input_text2']) +``` +where +* `install=True` installs model requirements (optional), +* `download=True` downloads required data from web - pretrained model files and embeddings (optional), +* `<config_path>` is model name (e.g. `'ner_ontonotes_bert_mult'`), path to the chosen model's config file (e.g. + `"deeppavlov/configs/ner/ner_ontonotes_bert_mult.json"`), or `deeppavlov.configs` attribute (e.g. + `deeppavlov.configs.ner.ner_ontonotes_bert_mult` without quotation marks). + +You can train it in the same simple way: + +```python +from deeppavlov import train_model + +model = train_model(<config_path>, install=True, download=True) +``` + +To train on your own data you need to modify dataset reader path in the +[train config doc](http://docs.deeppavlov.ai/en/master/intro/config_description.html#train-config). +The data format is specified in the corresponding model doc page. + +You can also calculate metrics on the dataset specified in your config file: + +```python +from deeppavlov import evaluate_model + +model = evaluate_model(<config_path>, install=True, download=True) +``` + +DeepPavlov also [allows](https://docs.deeppavlov.ai/en/master/features/python.html) to build a model from components for +inference using Python. + +## License + +DeepPavlov is Apache 2.0 - licensed. + + +%package -n python3-deeppavlov +Summary: An open source library for building end-to-end dialog systems and training chatbots. +Provides: python-deeppavlov +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-deeppavlov +[](https://github.com/deeppavlov/DeepPavlov/blob/master/LICENSE) + +[](https://pepy.tech/project/deeppavlov) +<img align="right" height="27%" width="27%" src="https://raw.githubusercontent.com/deeppavlov/DeepPavlov/master/docs/_static/deeppavlov_logo.png"/> + +DeepPavlov is an open-source conversational AI library built on [PyTorch](https://pytorch.org/). + +DeepPavlov is designed for +* development of production ready chat-bots and complex conversational systems, +* research in the area of NLP and, particularly, of dialog systems. + +## Quick Links + +* Demo [*demo.deeppavlov.ai*](https://demo.deeppavlov.ai/) +* Documentation [*docs.deeppavlov.ai*](http://docs.deeppavlov.ai/) + * Model List [*docs:features/*](http://docs.deeppavlov.ai/en/master/features/overview.html) + * Contribution Guide [*docs:contribution_guide/*](http://docs.deeppavlov.ai/en/master/devguides/contribution_guide.html) +* Issues [*github/issues/*](https://github.com/deeppavlov/DeepPavlov/issues) +* Forum [*forum.deeppavlov.ai*](https://forum.deeppavlov.ai/) +* Blogs [*medium.com/deeppavlov*](https://medium.com/deeppavlov) +* [Extended colab tutorials](https://github.com/deeppavlov/dp_tutorials) +* Docker Hub [*hub.docker.com/u/deeppavlov/*](https://hub.docker.com/u/deeppavlov/) + * Docker Images Documentation [*docs:docker-images/*](http://docs.deeppavlov.ai/en/master/intro/installation.html#docker-images) + +Please leave us [your feedback](https://forms.gle/i64fowQmiVhMMC7f9) on how we can improve the DeepPavlov framework. + +**Models** + +[Named Entity Recognition](http://docs.deeppavlov.ai/en/master/features/models/NER.html) | [Intent/Sentence Classification](http://docs.deeppavlov.ai/en/master/features/models/classifiers.html) | + +[Question Answering over Text (SQuAD)](http://docs.deeppavlov.ai/en/master/features/models/SQuAD.html) | [Knowledge Base Question Answering](http://docs.deeppavlov.ai/en/master/features/models/kbqa.html) + +[Sentence Similarity/Ranking](http://docs.deeppavlov.ai/en/master/features/models/neural_ranking.html) | [TF-IDF Ranking](http://docs.deeppavlov.ai/en/master/features/models/tfidf_ranking.html) + +[Automatic Spelling Correction](http://docs.deeppavlov.ai/en/master/features/models/spelling_correction.html) | [Entity Linking](http://docs.deeppavlov.ai/en/master/features/models/entity_linking.html) + +[Open Domain Questions Answering](http://docs.deeppavlov.ai/en/master/features/models/odqa.html) | [Russian SuperGLUE](http://docs.deeppavlov.ai/en/master/features/models/superglue.html) + +**Embeddings** + +[BERT embeddings for the Russian, Polish, Bulgarian, Czech, and informal English](http://docs.deeppavlov.ai/en/master/features/pretrained_vectors.html#bert) + +[ELMo embeddings for the Russian language](http://docs.deeppavlov.ai/en/master/features/pretrained_vectors.html#elmo) + +[FastText embeddings for the Russian language](http://docs.deeppavlov.ai/en/master/features/pretrained_vectors.html#fasttext) + +**Auto ML** + +[Tuning Models](http://docs.deeppavlov.ai/en/master/features/hypersearch.html) + +**Integrations** + +[REST API](http://docs.deeppavlov.ai/en/master/integrations/rest_api.html) | [Socket API](http://docs.deeppavlov.ai/en/master/integrations/socket_api.html) + +[Amazon AWS](http://docs.deeppavlov.ai/en/master/integrations/aws_ec2.html) + +## Installation + +0. We support `Linux` platform, `Python 3.6`, `3.7`, `3.8`, `3.9` and `3.10` + * **`Python 3.5` is not supported!** + +1. Create and activate a virtual environment: + * `Linux` + ``` + python -m venv env + source ./env/bin/activate + ``` +2. Install the package inside the environment: + ``` + pip install deeppavlov + ``` + +## QuickStart + +There is a bunch of great pre-trained NLP models in DeepPavlov. Each model is +determined by its config file. + +List of models is available on +[the doc page](http://docs.deeppavlov.ai/en/master/features/overview.html) in +the `deeppavlov.configs` (Python): + +```python +from deeppavlov import configs +``` + +When you're decided on the model (+ config file), there are two ways to train, +evaluate and infer it: + +* via [Command line interface (CLI)](https://github.com/deeppavlov/DeepPavlov/blob/master/#command-line-interface-cli) and +* via [Python](https://github.com/deeppavlov/DeepPavlov/blob/master/#python). + +#### GPU requirements + +By default, DeepPavlov installs models requirements from PyPI. PyTorch from PyPI could not support your device CUDA +capability. To run supported DeepPavlov models on GPU you should have [CUDA](https://developer.nvidia.com/cuda-toolkit) +compatible with used GPU and [PyTorch version](https://github.com/deeppavlov/DeepPavlov/blob/master/deeppavlov/requirements/pytorch.txt) required by DeepPavlov models. +See [docs](https://docs.deeppavlov.ai/en/master/intro/quick_start.html#using-gpu) for details. + +### Command line interface (CLI) + +To get predictions from a model interactively through CLI, run + +```bash +python -m deeppavlov interact <config_path> [-d] [-i] +``` + +* `-d` downloads required data - pretrained model files and embeddings (optional). +* `-i` installs model requirements (optional). + +You can train it in the same simple way: + +```bash +python -m deeppavlov train <config_path> [-d] [-i] +``` + +Dataset will be downloaded regardless of whether there was `-d` flag or not. + +To train on your own data you need to modify dataset reader path in the +[train config doc](http://docs.deeppavlov.ai/en/master/intro/config_description.html#train-config). +The data format is specified in the corresponding model doc page. + +There are even more actions you can perform with configs: + +```bash +python -m deeppavlov <action> <config_path> [-d] [-i] +``` + +* `<action>` can be + * `install` to install model requirements (same as `-i`), + * `download` to download model's data (same as `-d`), + * `train` to train the model on the data specified in the config file, + * `evaluate` to calculate metrics on the same dataset, + * `interact` to interact via CLI, + * `riseapi` to run a REST API server (see + [doc](http://docs.deeppavlov.ai/en/master/integrations/rest_api.html)), + * `predict` to get prediction for samples from *stdin* or from + *<file_path>* if `-f <file_path>` is specified. +* `<config_path>` specifies path (or name) of model's config file +* `-d` downloads required data +* `-i` installs model requirements + + +### Python + +To get predictions from a model interactively through Python, run + +```python +from deeppavlov import build_model + +model = build_model(<config_path>, install=True, download=True) + +# get predictions for 'input_text1', 'input_text2' +model(['input_text1', 'input_text2']) +``` +where +* `install=True` installs model requirements (optional), +* `download=True` downloads required data from web - pretrained model files and embeddings (optional), +* `<config_path>` is model name (e.g. `'ner_ontonotes_bert_mult'`), path to the chosen model's config file (e.g. + `"deeppavlov/configs/ner/ner_ontonotes_bert_mult.json"`), or `deeppavlov.configs` attribute (e.g. + `deeppavlov.configs.ner.ner_ontonotes_bert_mult` without quotation marks). + +You can train it in the same simple way: + +```python +from deeppavlov import train_model + +model = train_model(<config_path>, install=True, download=True) +``` + +To train on your own data you need to modify dataset reader path in the +[train config doc](http://docs.deeppavlov.ai/en/master/intro/config_description.html#train-config). +The data format is specified in the corresponding model doc page. + +You can also calculate metrics on the dataset specified in your config file: + +```python +from deeppavlov import evaluate_model + +model = evaluate_model(<config_path>, install=True, download=True) +``` + +DeepPavlov also [allows](https://docs.deeppavlov.ai/en/master/features/python.html) to build a model from components for +inference using Python. + +## License + +DeepPavlov is Apache 2.0 - licensed. + + +%package help +Summary: Development documents and examples for deeppavlov +Provides: python3-deeppavlov-doc +%description help +[](https://github.com/deeppavlov/DeepPavlov/blob/master/LICENSE) + +[](https://pepy.tech/project/deeppavlov) +<img align="right" height="27%" width="27%" src="https://raw.githubusercontent.com/deeppavlov/DeepPavlov/master/docs/_static/deeppavlov_logo.png"/> + +DeepPavlov is an open-source conversational AI library built on [PyTorch](https://pytorch.org/). + +DeepPavlov is designed for +* development of production ready chat-bots and complex conversational systems, +* research in the area of NLP and, particularly, of dialog systems. + +## Quick Links + +* Demo [*demo.deeppavlov.ai*](https://demo.deeppavlov.ai/) +* Documentation [*docs.deeppavlov.ai*](http://docs.deeppavlov.ai/) + * Model List [*docs:features/*](http://docs.deeppavlov.ai/en/master/features/overview.html) + * Contribution Guide [*docs:contribution_guide/*](http://docs.deeppavlov.ai/en/master/devguides/contribution_guide.html) +* Issues [*github/issues/*](https://github.com/deeppavlov/DeepPavlov/issues) +* Forum [*forum.deeppavlov.ai*](https://forum.deeppavlov.ai/) +* Blogs [*medium.com/deeppavlov*](https://medium.com/deeppavlov) +* [Extended colab tutorials](https://github.com/deeppavlov/dp_tutorials) +* Docker Hub [*hub.docker.com/u/deeppavlov/*](https://hub.docker.com/u/deeppavlov/) + * Docker Images Documentation [*docs:docker-images/*](http://docs.deeppavlov.ai/en/master/intro/installation.html#docker-images) + +Please leave us [your feedback](https://forms.gle/i64fowQmiVhMMC7f9) on how we can improve the DeepPavlov framework. + +**Models** + +[Named Entity Recognition](http://docs.deeppavlov.ai/en/master/features/models/NER.html) | [Intent/Sentence Classification](http://docs.deeppavlov.ai/en/master/features/models/classifiers.html) | + +[Question Answering over Text (SQuAD)](http://docs.deeppavlov.ai/en/master/features/models/SQuAD.html) | [Knowledge Base Question Answering](http://docs.deeppavlov.ai/en/master/features/models/kbqa.html) + +[Sentence Similarity/Ranking](http://docs.deeppavlov.ai/en/master/features/models/neural_ranking.html) | [TF-IDF Ranking](http://docs.deeppavlov.ai/en/master/features/models/tfidf_ranking.html) + +[Automatic Spelling Correction](http://docs.deeppavlov.ai/en/master/features/models/spelling_correction.html) | [Entity Linking](http://docs.deeppavlov.ai/en/master/features/models/entity_linking.html) + +[Open Domain Questions Answering](http://docs.deeppavlov.ai/en/master/features/models/odqa.html) | [Russian SuperGLUE](http://docs.deeppavlov.ai/en/master/features/models/superglue.html) + +**Embeddings** + +[BERT embeddings for the Russian, Polish, Bulgarian, Czech, and informal English](http://docs.deeppavlov.ai/en/master/features/pretrained_vectors.html#bert) + +[ELMo embeddings for the Russian language](http://docs.deeppavlov.ai/en/master/features/pretrained_vectors.html#elmo) + +[FastText embeddings for the Russian language](http://docs.deeppavlov.ai/en/master/features/pretrained_vectors.html#fasttext) + +**Auto ML** + +[Tuning Models](http://docs.deeppavlov.ai/en/master/features/hypersearch.html) + +**Integrations** + +[REST API](http://docs.deeppavlov.ai/en/master/integrations/rest_api.html) | [Socket API](http://docs.deeppavlov.ai/en/master/integrations/socket_api.html) + +[Amazon AWS](http://docs.deeppavlov.ai/en/master/integrations/aws_ec2.html) + +## Installation + +0. We support `Linux` platform, `Python 3.6`, `3.7`, `3.8`, `3.9` and `3.10` + * **`Python 3.5` is not supported!** + +1. Create and activate a virtual environment: + * `Linux` + ``` + python -m venv env + source ./env/bin/activate + ``` +2. Install the package inside the environment: + ``` + pip install deeppavlov + ``` + +## QuickStart + +There is a bunch of great pre-trained NLP models in DeepPavlov. Each model is +determined by its config file. + +List of models is available on +[the doc page](http://docs.deeppavlov.ai/en/master/features/overview.html) in +the `deeppavlov.configs` (Python): + +```python +from deeppavlov import configs +``` + +When you're decided on the model (+ config file), there are two ways to train, +evaluate and infer it: + +* via [Command line interface (CLI)](https://github.com/deeppavlov/DeepPavlov/blob/master/#command-line-interface-cli) and +* via [Python](https://github.com/deeppavlov/DeepPavlov/blob/master/#python). + +#### GPU requirements + +By default, DeepPavlov installs models requirements from PyPI. PyTorch from PyPI could not support your device CUDA +capability. To run supported DeepPavlov models on GPU you should have [CUDA](https://developer.nvidia.com/cuda-toolkit) +compatible with used GPU and [PyTorch version](https://github.com/deeppavlov/DeepPavlov/blob/master/deeppavlov/requirements/pytorch.txt) required by DeepPavlov models. +See [docs](https://docs.deeppavlov.ai/en/master/intro/quick_start.html#using-gpu) for details. + +### Command line interface (CLI) + +To get predictions from a model interactively through CLI, run + +```bash +python -m deeppavlov interact <config_path> [-d] [-i] +``` + +* `-d` downloads required data - pretrained model files and embeddings (optional). +* `-i` installs model requirements (optional). + +You can train it in the same simple way: + +```bash +python -m deeppavlov train <config_path> [-d] [-i] +``` + +Dataset will be downloaded regardless of whether there was `-d` flag or not. + +To train on your own data you need to modify dataset reader path in the +[train config doc](http://docs.deeppavlov.ai/en/master/intro/config_description.html#train-config). +The data format is specified in the corresponding model doc page. + +There are even more actions you can perform with configs: + +```bash +python -m deeppavlov <action> <config_path> [-d] [-i] +``` + +* `<action>` can be + * `install` to install model requirements (same as `-i`), + * `download` to download model's data (same as `-d`), + * `train` to train the model on the data specified in the config file, + * `evaluate` to calculate metrics on the same dataset, + * `interact` to interact via CLI, + * `riseapi` to run a REST API server (see + [doc](http://docs.deeppavlov.ai/en/master/integrations/rest_api.html)), + * `predict` to get prediction for samples from *stdin* or from + *<file_path>* if `-f <file_path>` is specified. +* `<config_path>` specifies path (or name) of model's config file +* `-d` downloads required data +* `-i` installs model requirements + + +### Python + +To get predictions from a model interactively through Python, run + +```python +from deeppavlov import build_model + +model = build_model(<config_path>, install=True, download=True) + +# get predictions for 'input_text1', 'input_text2' +model(['input_text1', 'input_text2']) +``` +where +* `install=True` installs model requirements (optional), +* `download=True` downloads required data from web - pretrained model files and embeddings (optional), +* `<config_path>` is model name (e.g. `'ner_ontonotes_bert_mult'`), path to the chosen model's config file (e.g. + `"deeppavlov/configs/ner/ner_ontonotes_bert_mult.json"`), or `deeppavlov.configs` attribute (e.g. + `deeppavlov.configs.ner.ner_ontonotes_bert_mult` without quotation marks). + +You can train it in the same simple way: + +```python +from deeppavlov import train_model + +model = train_model(<config_path>, install=True, download=True) +``` + +To train on your own data you need to modify dataset reader path in the +[train config doc](http://docs.deeppavlov.ai/en/master/intro/config_description.html#train-config). +The data format is specified in the corresponding model doc page. + +You can also calculate metrics on the dataset specified in your config file: + +```python +from deeppavlov import evaluate_model + +model = evaluate_model(<config_path>, install=True, download=True) +``` + +DeepPavlov also [allows](https://docs.deeppavlov.ai/en/master/features/python.html) to build a model from components for +inference using Python. + +## License + +DeepPavlov is Apache 2.0 - licensed. + + +%prep +%autosetup -n deeppavlov-1.1.1 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-deeppavlov -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed Apr 12 2023 Python_Bot <Python_Bot@openeuler.org> - 1.1.1-1 +- Package Spec generated @@ -0,0 +1 @@ +8f463db78e5e2842212a99c8afab7788 deeppavlov-1.1.1.tar.gz |
