From 8883d0933a62610d71fec0215dce643630e03b1c Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 22 Aug 2019 09:41:03 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5Version=201.0=20(#49)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update MatchZoo-py * Add toy resource to package * Update CODEOWNERS * Update README.md --- CODEOWNERS | 24 +++--- CONTRIBUTING.md | 2 +- MANIFEST.in | 1 + README.md | 7 +- docs/source/model_reference.rst | 129 +++++++++++++++++++++++------- matchzoo/datasets/toy/__init__.py | 2 +- matchzoo/models/README.rst | 129 +++++++++++++++++++++++------- matchzoo/models/arcii.py | 18 ++--- matchzoo/trainers/trainer.py | 2 +- setup.py | 5 +- 10 files changed, 234 insertions(+), 85 deletions(-) create mode 100644 MANIFEST.in diff --git a/CODEOWNERS b/CODEOWNERS index 69ab16a..4228ae0 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -17,21 +17,21 @@ .codecov.yml @Chriskuei .coveragerc @Chriskuei .flake8 @Chriskuei -.gitignore @faneshion -.travis.yml @Chriskuei -CONTRIBUTING.MD @Chriskuei -Makefile @faneshion @Chriskuei +.gitignore @Chriskuei +.travis.yml @Chriskuei +CONTRIBUTING.MD @Chriskuei +Makefile @Chriskuei pytest.ini @Chriskuei -README.md @faneshion @Chriskuei -readthedocs.yml @wqh17101 -requirements.txt @faneshion @Chriskuei -setup.py @faneshion @Chriskuei +README.md @faneshion @Chriskuei +readthedocs.yml @wqh17101 +requirements.txt @Chriskuei @faneshion +setup.py @Chriskuei @faneshion # artworks /artworks/ @faneshion # tutorials -/tutorials/ @Chriskuei @faneshion +/tutorials/ @Chriskuei @faneshion @caiyinqiong # docs /docs/ @wqh17101 @@ -42,15 +42,15 @@ setup.py @faneshion @Chriskuei # matchzoo /matchzoo/auto/ @Chriskuei -/matchzoo/data_pack/ @faneshion @caiyinqiong +/matchzoo/data_pack/ @caiyinqiong @faneshion /matchzoo/dataloader/ @caiyinqiong @Chriskuei /matchzoo/datasets/ @caiyinqiong /matchzoo/embedding/ @caiyinqiong /matchzoo/engine/ @faneshion @Chriskuei /matchzoo/losses/ @faneshion @Chriskuei /matchzoo/metrics/ @faneshion @Chriskuei -/matchzoo/models/ @Chriskuei @faneshion -/matchzoo/modules/ @Chriskuei +/matchzoo/models/ @Chriskuei @faneshion @caiyinqiong +/matchzoo/modules/ @Chriskuei @caiyinqiong /matchzoo/preprocessors/ @caiyinqiong @faneshion /matchzoo/tasks/ @Chriskuei /matchzoo/trainers/ @Chriskuei diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b616d7f..b0fb7e7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -39,7 +39,7 @@ Anyone interested in MatchZoo may review your code. One of the MatchZoo core de For every pull request, we aim to promptly either merge it or say why it's not yet ready; if you go a few days without a reply, please feel free to ping the thread by adding a new comment. -For a list of MatchZoo core developers, see [Readme](https://github.com/NTMC-Community/MatchZoo-py/blob/master/README.md). +For a list of MatchZoo core developers, see [README](https://github.com/NTMC-Community/MatchZoo-py/blob/master/README.md). Contributing Flow ------------------ diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..5dc28b0 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +recursive-include matchzoo/datasets/toy * \ No newline at end of file diff --git a/README.md b/README.md index ae75af9..af1027e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@
-logo +logo
# MatchZoo-py [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=MatchZoo-py:%20deep%20learning%20for%20semantic%20matching&url=https://github.com/NTMC-Community/MatchZoo-py) @@ -10,12 +10,13 @@ > MatchZoo 是一个通用的文本匹配工具包,它旨在方便大家快速的实现、比较、以及分享最新的深度文本匹配模型。 [![Python 3.6](https://img.shields.io/badge/python-3.6%20%7C%203.7-blue.svg)](https://www.python.org/downloads/release/python-360/) -[![Gitter](https://badges.gitter.im/NTMC-Community/community.svg)](https://gitter.im/NTMC-Community/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) +[![Pypi Downloads](https://img.shields.io/pypi/dm/matchzoo-py.svg?label=pypi)](https://pypi.org/project/MatchZoo-py/) [![Documentation Status](https://readthedocs.org/projects/matchzoo-py/badge/?version=latest)](https://matchzoo-py.readthedocs.io/en/latest/?badge=latest) [![Build Status](https://travis-ci.org/NTMC-Community/MatchZoo-py.svg?branch=master)](https://travis-ci.org/NTMC-Community/MatchZoo-py) [![codecov](https://codecov.io/gh/NTMC-Community/MatchZoo-py/branch/master/graph/badge.svg)](https://codecov.io/gh/NTMC-Community/MatchZoo-py) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Requirements Status](https://requires.io/github/NTMC-Community/MatchZoo-py/requirements.svg?branch=master)](https://requires.io/github/NTMC-Community/MatchZoo-py/requirements/?branch=master) +[![Gitter](https://badges.gitter.im/NTMC-Community/community.svg)](https://gitter.im/NTMC-Community/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) --- The goal of MatchZoo is to provide a high-quality codebase for deep text matching research, such as document retrieval, question answering, conversational response ranking, and paraphrase identification. With the unified data processing pipeline, simplified model configuration and automatic hyper-parameters tunning features equipped, MatchZoo is flexible and easy to use. @@ -156,7 +157,7 @@ If you're interested in the cutting-edge research progress, please take a look a ## Install -MatchZoo is dependent on [PyTorch](https://pytorch.org). Two ways to install MatchZoo-py: +MatchZoo-py is dependent on [PyTorch](https://pytorch.org). Two ways to install MatchZoo-py: **Install MatchZoo-py from Pypi:** diff --git a/docs/source/model_reference.rst b/docs/source/model_reference.rst index 08eac11..f577b68 100644 --- a/docs/source/model_reference.rst +++ b/docs/source/model_reference.rst @@ -98,24 +98,22 @@ Examples: Model Hyper Parameters ********************** -==== =========================== ============================================================================================= ===================================== ===================================================================== - .. Name Description Default Value Default Hyper-Space -==== =========================== ============================================================================================= ===================================== ===================================================================== - 0 model_class Model class. Used internally for save/load. Changing this may cause unexpected behaviors. +==== =========================== ========================================================================================= ===================================== ===================================================================== + .. Name Description Default Value Default Hyper-Space +==== =========================== ========================================================================================= ===================================== ===================================================================== + 0 model_class Model class. Used internally for save/load. Changing this may cause unexpected behaviors. 1 task Decides model output shape, loss, and metrics. - 2 with_multi_layer_perceptron A flag of whether a multiple layer perceptron is used. Shouldn't be changed. True - 3 mlp_num_units Number of units in first `mlp_num_layers` layers. 128 quantitative uniform distribution in [8, 256), with a step size of 8 - 4 mlp_num_layers Number of layers of the multiple layer percetron. 3 quantitative uniform distribution in [1, 6), with a step size of 1 - 5 mlp_num_fan_out Number of units of the layer that connects the multiple layer percetron and the output. 64 quantitative uniform distribution in [4, 128), with a step size of 4 - 6 mlp_activation_func Activation function used in the multiple layer perceptron. relu - 7 vocab_size Size of vocabulary. 379 - 8 filters Number of filters in the 1D convolution layer. 3 - 9 kernel_size Number of kernel size in the 1D convolution layer. 3 - 10 strides Strides in the 1D convolution layer. 1 - 11 padding The padding mode in the convolution layer. It should be one of `same`, `valid`, and `causal`. 0 - 12 conv_activation_func Activation function in the convolution layer. relu - 13 dropout_rate The dropout rate. 0.3 -==== =========================== ============================================================================================= ===================================== ===================================================================== + 2 with_multi_layer_perceptron A flag of whether a multiple layer perceptron is used. Shouldn't be changed. True + 3 mlp_num_units Number of units in first `mlp_num_layers` layers. 128 quantitative uniform distribution in [8, 256), with a step size of 8 + 4 mlp_num_layers Number of layers of the multiple layer percetron. 3 quantitative uniform distribution in [1, 6), with a step size of 1 + 5 mlp_num_fan_out Number of units of the layer that connects the multiple layer percetron and the output. 64 quantitative uniform distribution in [4, 128), with a step size of 4 + 6 mlp_activation_func Activation function used in the multiple layer perceptron. relu + 7 vocab_size Size of vocabulary. 379 + 8 filters Number of filters in the 1D convolution layer. 3 + 9 kernel_size Number of kernel size in the 1D convolution layer. 3 + 10 conv_activation_func Activation function in the convolution layer. relu + 11 dropout_rate The dropout rate. 0.3 +==== =========================== ========================================================================================= ===================================== ===================================================================== DRMM #### @@ -382,6 +380,61 @@ Model Hyper Parameters 13 rnn_type Choose rnn type, lstm or gru. lstm ==== ==================== ========================================================================================= ============================================= ===================== +ArcI +#### + +Model Documentation +******************* + +ArcI Model. + +Examples: + >>> model = ArcI() + >>> model.params['left_filters'] = [32] + >>> model.params['right_filters'] = [32] + >>> model.params['left_kernel_sizes'] = [3] + >>> model.params['right_kernel_sizes'] = [3] + >>> model.params['left_pool_sizes'] = [2] + >>> model.params['right_pool_sizes'] = [4] + >>> model.params['conv_activation_func'] = 'relu' + >>> model.params['mlp_num_layers'] = 1 + >>> model.params['mlp_num_units'] = 64 + >>> model.params['mlp_num_fan_out'] = 32 + >>> model.params['mlp_activation_func'] = 'relu' + >>> model.params['dropout_rate'] = 0.5 + >>> model.guess_and_fill_missing_params(verbose=0) + >>> model.build() + +Model Hyper Parameters +********************** + +==== =========================== ========================================================================================= =================================== ========================================================================== + .. Name Description Default Value Default Hyper-Space +==== =========================== ========================================================================================= =================================== ========================================================================== + 0 model_class Model class. Used internally for save/load. Changing this may cause unexpected behaviors. + 1 task Decides model output shape, loss, and metrics. + 2 with_embedding A flag used help `auto` module. Shouldn't be changed. True + 3 embedding FloatTensor containing weights for the Embedding. + 4 embedding_input_dim Usually equals vocab size + 1. Should be set manually. + 5 embedding_output_dim Should be set manually. + 6 embedding_freeze `True` to freeze embedding layer training, `False` to enable embedding parameters. False + 7 with_multi_layer_perceptron A flag of whether a multiple layer perceptron is used. Shouldn't be changed. True + 8 mlp_num_units Number of units in first `mlp_num_layers` layers. 128 quantitative uniform distribution in [8, 256), with a step size of 8 + 9 mlp_num_layers Number of layers of the multiple layer percetron. 3 quantitative uniform distribution in [1, 6), with a step size of 1 + 10 mlp_num_fan_out Number of units of the layer that connects the multiple layer percetron and the output. 64 quantitative uniform distribution in [4, 128), with a step size of 4 + 11 mlp_activation_func Activation function used in the multiple layer perceptron. relu + 12 left_length Length of left input. 10 + 13 right_length Length of right input. 100 + 14 conv_activation_func The activation function in the convolution layer. relu + 15 left_filters The filter size of each convolution blocks for the left input. [32] + 16 left_kernel_sizes The kernel size of each convolution blocks for the left input. [3] + 17 left_pool_sizes The pooling size of each convolution blocks for the left input. [2] + 18 right_filters The filter size of each convolution blocks for the right input. [32] + 19 right_kernel_sizes The kernel size of each convolution blocks for the right input. [3] + 20 right_pool_sizes The pooling size of each convolution blocks for the right input. [2] + 21 dropout_rate The dropout rate. 0.0 quantitative uniform distribution in [0.0, 0.8), with a step size of 0.01 +==== =========================== ========================================================================================= =================================== ========================================================================== + ArcII ##### @@ -391,15 +444,15 @@ Model Documentation ArcII Model. Examples: ->>> model = ArcII() ->>> model.params['embedding_output_dim'] = 300 ->>> model.params['kernel_1d_count'] = 32 ->>> model.params['kernel_1d_size'] = 3 ->>> model.params['kernel_2d_count'] = [16, 32] ->>> model.params['kernel_2d_size'] = [[3, 3], [3, 3]] ->>> model.params['pool_2d_size'] = [[2, 2], [2, 2]] ->>> model.guess_and_fill_missing_params(verbose=0) ->>> model.build() + >>> model = ArcII() + >>> model.params['embedding_output_dim'] = 300 + >>> model.params['kernel_1d_count'] = 32 + >>> model.params['kernel_1d_size'] = 3 + >>> model.params['kernel_2d_count'] = [16, 32] + >>> model.params['kernel_2d_size'] = [[3, 3], [3, 3]] + >>> model.params['pool_2d_size'] = [[2, 2], [2, 2]] + >>> model.guess_and_fill_missing_params(verbose=0) + >>> model.build() Model Hyper Parameters ********************** @@ -414,8 +467,8 @@ Model Hyper Parameters 4 embedding_input_dim Usually equals vocab size + 1. Should be set manually. 5 embedding_output_dim Should be set manually. 6 embedding_freeze `True` to freeze embedding layer training, `False` to enable embedding parameters. False - 7 left_length Length of left input. 8 - 8 right_length Length of right input. 10 + 7 left_length Length of left input. 10 + 8 right_length Length of right input. 100 9 kernel_1d_count Kernel count of 1D convolution layer. 32 10 kernel_1d_size Kernel size of 1D convolution layer. 3 11 kernel_2d_count Kernel count of 2D convolution layer ineach block [32] @@ -425,3 +478,23 @@ Model Hyper Parameters 15 dropout_rate The dropout rate. 0.0 quantitative uniform distribution in [0.0, 0.8), with a step size of 0.01 ==== ==================== ========================================================================================= ===================================== ========================================================================== +Bert +#### + +Model Documentation +******************* + +Bert Model. + +Model Hyper Parameters +********************** + +==== ============ ========================================================================================= =================================== ========================================================================== + .. Name Description Default Value Default Hyper-Space +==== ============ ========================================================================================= =================================== ========================================================================== + 0 model_class Model class. Used internally for save/load. Changing this may cause unexpected behaviors. + 1 task Decides model output shape, loss, and metrics. + 2 mode Pretrained Bert model. bert-base-uncased + 3 dropout_rate The dropout rate. 0.0 quantitative uniform distribution in [0.0, 0.8), with a step size of 0.01 +==== ============ ========================================================================================= =================================== ========================================================================== + diff --git a/matchzoo/datasets/toy/__init__.py b/matchzoo/datasets/toy/__init__.py index ad5aee2..a2b8827 100755 --- a/matchzoo/datasets/toy/__init__.py +++ b/matchzoo/datasets/toy/__init__.py @@ -13,7 +13,7 @@ def load_data( return_classes: bool = False ) -> typing.Union[matchzoo.DataPack, typing.Tuple[matchzoo.DataPack, list]]: """ - Load WikiQA data. + Load toy data. :param stage: One of `train`, `dev`, and `test`. :param task: Could be one of `ranking`, `classification` or a diff --git a/matchzoo/models/README.rst b/matchzoo/models/README.rst index 08eac11..f577b68 100644 --- a/matchzoo/models/README.rst +++ b/matchzoo/models/README.rst @@ -98,24 +98,22 @@ Examples: Model Hyper Parameters ********************** -==== =========================== ============================================================================================= ===================================== ===================================================================== - .. Name Description Default Value Default Hyper-Space -==== =========================== ============================================================================================= ===================================== ===================================================================== - 0 model_class Model class. Used internally for save/load. Changing this may cause unexpected behaviors. +==== =========================== ========================================================================================= ===================================== ===================================================================== + .. Name Description Default Value Default Hyper-Space +==== =========================== ========================================================================================= ===================================== ===================================================================== + 0 model_class Model class. Used internally for save/load. Changing this may cause unexpected behaviors. 1 task Decides model output shape, loss, and metrics. - 2 with_multi_layer_perceptron A flag of whether a multiple layer perceptron is used. Shouldn't be changed. True - 3 mlp_num_units Number of units in first `mlp_num_layers` layers. 128 quantitative uniform distribution in [8, 256), with a step size of 8 - 4 mlp_num_layers Number of layers of the multiple layer percetron. 3 quantitative uniform distribution in [1, 6), with a step size of 1 - 5 mlp_num_fan_out Number of units of the layer that connects the multiple layer percetron and the output. 64 quantitative uniform distribution in [4, 128), with a step size of 4 - 6 mlp_activation_func Activation function used in the multiple layer perceptron. relu - 7 vocab_size Size of vocabulary. 379 - 8 filters Number of filters in the 1D convolution layer. 3 - 9 kernel_size Number of kernel size in the 1D convolution layer. 3 - 10 strides Strides in the 1D convolution layer. 1 - 11 padding The padding mode in the convolution layer. It should be one of `same`, `valid`, and `causal`. 0 - 12 conv_activation_func Activation function in the convolution layer. relu - 13 dropout_rate The dropout rate. 0.3 -==== =========================== ============================================================================================= ===================================== ===================================================================== + 2 with_multi_layer_perceptron A flag of whether a multiple layer perceptron is used. Shouldn't be changed. True + 3 mlp_num_units Number of units in first `mlp_num_layers` layers. 128 quantitative uniform distribution in [8, 256), with a step size of 8 + 4 mlp_num_layers Number of layers of the multiple layer percetron. 3 quantitative uniform distribution in [1, 6), with a step size of 1 + 5 mlp_num_fan_out Number of units of the layer that connects the multiple layer percetron and the output. 64 quantitative uniform distribution in [4, 128), with a step size of 4 + 6 mlp_activation_func Activation function used in the multiple layer perceptron. relu + 7 vocab_size Size of vocabulary. 379 + 8 filters Number of filters in the 1D convolution layer. 3 + 9 kernel_size Number of kernel size in the 1D convolution layer. 3 + 10 conv_activation_func Activation function in the convolution layer. relu + 11 dropout_rate The dropout rate. 0.3 +==== =========================== ========================================================================================= ===================================== ===================================================================== DRMM #### @@ -382,6 +380,61 @@ Model Hyper Parameters 13 rnn_type Choose rnn type, lstm or gru. lstm ==== ==================== ========================================================================================= ============================================= ===================== +ArcI +#### + +Model Documentation +******************* + +ArcI Model. + +Examples: + >>> model = ArcI() + >>> model.params['left_filters'] = [32] + >>> model.params['right_filters'] = [32] + >>> model.params['left_kernel_sizes'] = [3] + >>> model.params['right_kernel_sizes'] = [3] + >>> model.params['left_pool_sizes'] = [2] + >>> model.params['right_pool_sizes'] = [4] + >>> model.params['conv_activation_func'] = 'relu' + >>> model.params['mlp_num_layers'] = 1 + >>> model.params['mlp_num_units'] = 64 + >>> model.params['mlp_num_fan_out'] = 32 + >>> model.params['mlp_activation_func'] = 'relu' + >>> model.params['dropout_rate'] = 0.5 + >>> model.guess_and_fill_missing_params(verbose=0) + >>> model.build() + +Model Hyper Parameters +********************** + +==== =========================== ========================================================================================= =================================== ========================================================================== + .. Name Description Default Value Default Hyper-Space +==== =========================== ========================================================================================= =================================== ========================================================================== + 0 model_class Model class. Used internally for save/load. Changing this may cause unexpected behaviors. + 1 task Decides model output shape, loss, and metrics. + 2 with_embedding A flag used help `auto` module. Shouldn't be changed. True + 3 embedding FloatTensor containing weights for the Embedding. + 4 embedding_input_dim Usually equals vocab size + 1. Should be set manually. + 5 embedding_output_dim Should be set manually. + 6 embedding_freeze `True` to freeze embedding layer training, `False` to enable embedding parameters. False + 7 with_multi_layer_perceptron A flag of whether a multiple layer perceptron is used. Shouldn't be changed. True + 8 mlp_num_units Number of units in first `mlp_num_layers` layers. 128 quantitative uniform distribution in [8, 256), with a step size of 8 + 9 mlp_num_layers Number of layers of the multiple layer percetron. 3 quantitative uniform distribution in [1, 6), with a step size of 1 + 10 mlp_num_fan_out Number of units of the layer that connects the multiple layer percetron and the output. 64 quantitative uniform distribution in [4, 128), with a step size of 4 + 11 mlp_activation_func Activation function used in the multiple layer perceptron. relu + 12 left_length Length of left input. 10 + 13 right_length Length of right input. 100 + 14 conv_activation_func The activation function in the convolution layer. relu + 15 left_filters The filter size of each convolution blocks for the left input. [32] + 16 left_kernel_sizes The kernel size of each convolution blocks for the left input. [3] + 17 left_pool_sizes The pooling size of each convolution blocks for the left input. [2] + 18 right_filters The filter size of each convolution blocks for the right input. [32] + 19 right_kernel_sizes The kernel size of each convolution blocks for the right input. [3] + 20 right_pool_sizes The pooling size of each convolution blocks for the right input. [2] + 21 dropout_rate The dropout rate. 0.0 quantitative uniform distribution in [0.0, 0.8), with a step size of 0.01 +==== =========================== ========================================================================================= =================================== ========================================================================== + ArcII ##### @@ -391,15 +444,15 @@ Model Documentation ArcII Model. Examples: ->>> model = ArcII() ->>> model.params['embedding_output_dim'] = 300 ->>> model.params['kernel_1d_count'] = 32 ->>> model.params['kernel_1d_size'] = 3 ->>> model.params['kernel_2d_count'] = [16, 32] ->>> model.params['kernel_2d_size'] = [[3, 3], [3, 3]] ->>> model.params['pool_2d_size'] = [[2, 2], [2, 2]] ->>> model.guess_and_fill_missing_params(verbose=0) ->>> model.build() + >>> model = ArcII() + >>> model.params['embedding_output_dim'] = 300 + >>> model.params['kernel_1d_count'] = 32 + >>> model.params['kernel_1d_size'] = 3 + >>> model.params['kernel_2d_count'] = [16, 32] + >>> model.params['kernel_2d_size'] = [[3, 3], [3, 3]] + >>> model.params['pool_2d_size'] = [[2, 2], [2, 2]] + >>> model.guess_and_fill_missing_params(verbose=0) + >>> model.build() Model Hyper Parameters ********************** @@ -414,8 +467,8 @@ Model Hyper Parameters 4 embedding_input_dim Usually equals vocab size + 1. Should be set manually. 5 embedding_output_dim Should be set manually. 6 embedding_freeze `True` to freeze embedding layer training, `False` to enable embedding parameters. False - 7 left_length Length of left input. 8 - 8 right_length Length of right input. 10 + 7 left_length Length of left input. 10 + 8 right_length Length of right input. 100 9 kernel_1d_count Kernel count of 1D convolution layer. 32 10 kernel_1d_size Kernel size of 1D convolution layer. 3 11 kernel_2d_count Kernel count of 2D convolution layer ineach block [32] @@ -425,3 +478,23 @@ Model Hyper Parameters 15 dropout_rate The dropout rate. 0.0 quantitative uniform distribution in [0.0, 0.8), with a step size of 0.01 ==== ==================== ========================================================================================= ===================================== ========================================================================== +Bert +#### + +Model Documentation +******************* + +Bert Model. + +Model Hyper Parameters +********************** + +==== ============ ========================================================================================= =================================== ========================================================================== + .. Name Description Default Value Default Hyper-Space +==== ============ ========================================================================================= =================================== ========================================================================== + 0 model_class Model class. Used internally for save/load. Changing this may cause unexpected behaviors. + 1 task Decides model output shape, loss, and metrics. + 2 mode Pretrained Bert model. bert-base-uncased + 3 dropout_rate The dropout rate. 0.0 quantitative uniform distribution in [0.0, 0.8), with a step size of 0.01 +==== ============ ========================================================================================= =================================== ========================================================================== + diff --git a/matchzoo/models/arcii.py b/matchzoo/models/arcii.py index 5aff2ca..b407480 100644 --- a/matchzoo/models/arcii.py +++ b/matchzoo/models/arcii.py @@ -18,15 +18,15 @@ class ArcII(BaseModel): ArcII Model. Examples: - >>> model = ArcII() - >>> model.params['embedding_output_dim'] = 300 - >>> model.params['kernel_1d_count'] = 32 - >>> model.params['kernel_1d_size'] = 3 - >>> model.params['kernel_2d_count'] = [16, 32] - >>> model.params['kernel_2d_size'] = [[3, 3], [3, 3]] - >>> model.params['pool_2d_size'] = [[2, 2], [2, 2]] - >>> model.guess_and_fill_missing_params(verbose=0) - >>> model.build() + >>> model = ArcII() + >>> model.params['embedding_output_dim'] = 300 + >>> model.params['kernel_1d_count'] = 32 + >>> model.params['kernel_1d_size'] = 3 + >>> model.params['kernel_2d_count'] = [16, 32] + >>> model.params['kernel_2d_size'] = [[3, 3], [3, 3]] + >>> model.params['pool_2d_size'] = [[2, 2], [2, 2]] + >>> model.guess_and_fill_missing_params(verbose=0) + >>> model.build() """ diff --git a/matchzoo/trainers/trainer.py b/matchzoo/trainers/trainer.py index de3da7a..7884897 100644 --- a/matchzoo/trainers/trainer.py +++ b/matchzoo/trainers/trainer.py @@ -69,7 +69,7 @@ def __init__( clip_norm: typing.Union[float, int] = None, patience: typing.Optional[int] = None, key: typing.Any = None, - data_parallel: bool = True, + data_parallel: bool = False, checkpoint: typing.Union[str, Path] = None, save_dir: typing.Union[str, Path] = None, save_all: bool = False, diff --git a/setup.py b/setup.py index 8019944..480fc6c 100644 --- a/setup.py +++ b/setup.py @@ -42,15 +42,16 @@ setup( - name="MatchZoo", + name="matchzoo-py", version=__version__, - author="MatchZoo Authors", + author="MatchZoo-py Authors", author_email="fanyixing@ict.ac.cn", description=(short_description), license="Apache 2.0", keywords="text matching models", url="https://github.com/NTMC-Community/MatchZoo-py", packages=find_packages(), + include_package_data=True, long_description=long_description, long_description_content_type='text/markdown', classifiers=[