From c9dc7022e4e8142dd113632c52d218e5f70dcb8f Mon Sep 17 00:00:00 2001 From: ChenXin Date: Mon, 6 May 2019 15:16:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=BA=86=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E6=96=87=E4=BB=B6=20*.rst?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fastNLP.component.bert_tokenizer.rst | 7 +++ docs/source/fastNLP.component.rst | 15 ++++++ docs/source/fastNLP.core.batch.rst | 7 +++ docs/source/fastNLP.core.callback.rst | 7 +++ docs/source/fastNLP.core.const.rst | 7 +++ docs/source/fastNLP.core.dataset.rst | 7 +++ docs/source/fastNLP.core.field.rst | 7 +++ docs/source/fastNLP.core.instance.rst | 7 +++ docs/source/fastNLP.core.losses.rst | 7 +++ docs/source/fastNLP.core.metrics.rst | 7 +++ docs/source/fastNLP.core.optimizer.rst | 7 +++ docs/source/fastNLP.core.rst | 28 ++++++++++ docs/source/fastNLP.core.sampler.rst | 7 +++ docs/source/fastNLP.core.tester.rst | 7 +++ docs/source/fastNLP.core.trainer.rst | 7 +++ docs/source/fastNLP.core.utils.rst | 7 +++ docs/source/fastNLP.core.vocabulary.rst | 7 +++ docs/source/fastNLP.io.base_loader.rst | 7 +++ docs/source/fastNLP.io.config_io.rst | 7 +++ docs/source/fastNLP.io.dataset_loader.rst | 7 +++ docs/source/fastNLP.io.embed_loader.rst | 7 +++ docs/source/fastNLP.io.file_reader.rst | 7 +++ docs/source/fastNLP.io.model_io.rst | 7 +++ docs/source/fastNLP.io.rst | 20 +++++++ docs/source/fastNLP.models.base_model.rst | 7 +++ docs/source/fastNLP.models.bert.rst | 7 +++ .../source/fastNLP.models.biaffine_parser.rst | 7 +++ .../fastNLP.models.char_language_model.rst | 7 +++ ...fastNLP.models.cnn_text_classification.rst | 7 +++ .../source/fastNLP.models.enas_controller.rst | 7 +++ docs/source/fastNLP.models.enas_model.rst | 7 +++ docs/source/fastNLP.models.enas_trainer.rst | 7 +++ docs/source/fastNLP.models.enas_utils.rst | 7 +++ docs/source/fastNLP.models.rst | 26 ++++++++++ .../fastNLP.models.sequence_modeling.rst | 7 +++ docs/source/fastNLP.models.snli.rst | 7 +++ .../fastNLP.models.star_transformer.rst | 7 +++ .../fastNLP.modules.aggregator.attention.rst | 7 +++ .../fastNLP.modules.aggregator.pooling.rst | 7 +++ docs/source/fastNLP.modules.aggregator.rst | 16 ++++++ docs/source/fastNLP.modules.decoder.CRF.rst | 7 +++ docs/source/fastNLP.modules.decoder.MLP.rst | 7 +++ docs/source/fastNLP.modules.decoder.rst | 17 ++++++ docs/source/fastNLP.modules.decoder.utils.rst | 7 +++ docs/source/fastNLP.modules.dropout.rst | 7 +++ docs/source/fastNLP.modules.encoder.bert.rst | 7 +++ .../fastNLP.modules.encoder.char_encoder.rst | 7 +++ .../fastNLP.modules.encoder.conv_maxpool.rst | 7 +++ .../fastNLP.modules.encoder.embedding.rst | 7 +++ .../source/fastNLP.modules.encoder.linear.rst | 7 +++ docs/source/fastNLP.modules.encoder.lstm.rst | 7 +++ docs/source/fastNLP.modules.encoder.rst | 23 ++++++++ ...stNLP.modules.encoder.star_transformer.rst | 7 +++ .../fastNLP.modules.encoder.transformer.rst | 7 +++ ...astNLP.modules.encoder.variational_rnn.rst | 7 +++ docs/source/fastNLP.modules.other_modules.rst | 7 +++ docs/source/fastNLP.modules.rst | 18 +++++++ docs/source/fastNLP.modules.utils.rst | 7 +++ docs/source/fastNLP.rst | 19 +++++++ docs/source/index.rst | 52 +++++++++++++------ docs/source/modules.rst | 7 +++ docs/source/user/installation.rst | 22 ++++---- docs/source/user/quickstart.rst | 14 ++--- docs/source/user/task2.rst | 3 ++ fastNLP/__init__.py | 11 +++- fastNLP/models/__init__.py | 5 ++ fastNLP/models/cnn_text_classification.py | 18 +++---- fastNLP/modules/__init__.py | 14 +++-- fastNLP/modules/aggregator/__init__.py | 3 +- fastNLP/modules/aggregator/attention.py | 6 +-- fastNLP/modules/decoder/CRF.py | 21 ++++---- fastNLP/modules/decoder/__init__.py | 1 + 72 files changed, 643 insertions(+), 66 deletions(-) create mode 100644 docs/source/fastNLP.component.bert_tokenizer.rst create mode 100644 docs/source/fastNLP.component.rst create mode 100644 docs/source/fastNLP.core.batch.rst create mode 100644 docs/source/fastNLP.core.callback.rst create mode 100644 docs/source/fastNLP.core.const.rst create mode 100644 docs/source/fastNLP.core.dataset.rst create mode 100644 docs/source/fastNLP.core.field.rst create mode 100644 docs/source/fastNLP.core.instance.rst create mode 100644 docs/source/fastNLP.core.losses.rst create mode 100644 docs/source/fastNLP.core.metrics.rst create mode 100644 docs/source/fastNLP.core.optimizer.rst create mode 100644 docs/source/fastNLP.core.rst create mode 100644 docs/source/fastNLP.core.sampler.rst create mode 100644 docs/source/fastNLP.core.tester.rst create mode 100644 docs/source/fastNLP.core.trainer.rst create mode 100644 docs/source/fastNLP.core.utils.rst create mode 100644 docs/source/fastNLP.core.vocabulary.rst create mode 100644 docs/source/fastNLP.io.base_loader.rst create mode 100644 docs/source/fastNLP.io.config_io.rst create mode 100644 docs/source/fastNLP.io.dataset_loader.rst create mode 100644 docs/source/fastNLP.io.embed_loader.rst create mode 100644 docs/source/fastNLP.io.file_reader.rst create mode 100644 docs/source/fastNLP.io.model_io.rst create mode 100644 docs/source/fastNLP.io.rst create mode 100644 docs/source/fastNLP.models.base_model.rst create mode 100644 docs/source/fastNLP.models.bert.rst create mode 100644 docs/source/fastNLP.models.biaffine_parser.rst create mode 100644 docs/source/fastNLP.models.char_language_model.rst create mode 100644 docs/source/fastNLP.models.cnn_text_classification.rst create mode 100644 docs/source/fastNLP.models.enas_controller.rst create mode 100644 docs/source/fastNLP.models.enas_model.rst create mode 100644 docs/source/fastNLP.models.enas_trainer.rst create mode 100644 docs/source/fastNLP.models.enas_utils.rst create mode 100644 docs/source/fastNLP.models.rst create mode 100644 docs/source/fastNLP.models.sequence_modeling.rst create mode 100644 docs/source/fastNLP.models.snli.rst create mode 100644 docs/source/fastNLP.models.star_transformer.rst create mode 100644 docs/source/fastNLP.modules.aggregator.attention.rst create mode 100644 docs/source/fastNLP.modules.aggregator.pooling.rst create mode 100644 docs/source/fastNLP.modules.aggregator.rst create mode 100644 docs/source/fastNLP.modules.decoder.CRF.rst create mode 100644 docs/source/fastNLP.modules.decoder.MLP.rst create mode 100644 docs/source/fastNLP.modules.decoder.rst create mode 100644 docs/source/fastNLP.modules.decoder.utils.rst create mode 100644 docs/source/fastNLP.modules.dropout.rst create mode 100644 docs/source/fastNLP.modules.encoder.bert.rst create mode 100644 docs/source/fastNLP.modules.encoder.char_encoder.rst create mode 100644 docs/source/fastNLP.modules.encoder.conv_maxpool.rst create mode 100644 docs/source/fastNLP.modules.encoder.embedding.rst create mode 100644 docs/source/fastNLP.modules.encoder.linear.rst create mode 100644 docs/source/fastNLP.modules.encoder.lstm.rst create mode 100644 docs/source/fastNLP.modules.encoder.rst create mode 100644 docs/source/fastNLP.modules.encoder.star_transformer.rst create mode 100644 docs/source/fastNLP.modules.encoder.transformer.rst create mode 100644 docs/source/fastNLP.modules.encoder.variational_rnn.rst create mode 100644 docs/source/fastNLP.modules.other_modules.rst create mode 100644 docs/source/fastNLP.modules.rst create mode 100644 docs/source/fastNLP.modules.utils.rst create mode 100644 docs/source/fastNLP.rst create mode 100644 docs/source/modules.rst create mode 100644 docs/source/user/task2.rst diff --git a/docs/source/fastNLP.component.bert_tokenizer.rst b/docs/source/fastNLP.component.bert_tokenizer.rst new file mode 100644 index 00000000..ccfc50c6 --- /dev/null +++ b/docs/source/fastNLP.component.bert_tokenizer.rst @@ -0,0 +1,7 @@ +fastNLP.component.bert\_tokenizer module +======================================== + +.. automodule:: fastNLP.component.bert_tokenizer + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.component.rst b/docs/source/fastNLP.component.rst new file mode 100644 index 00000000..3e15fa47 --- /dev/null +++ b/docs/source/fastNLP.component.rst @@ -0,0 +1,15 @@ +fastNLP.component package +========================= + +.. automodule:: fastNLP.component + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + + fastNLP.component.bert_tokenizer + diff --git a/docs/source/fastNLP.core.batch.rst b/docs/source/fastNLP.core.batch.rst new file mode 100644 index 00000000..b0294bac --- /dev/null +++ b/docs/source/fastNLP.core.batch.rst @@ -0,0 +1,7 @@ +fastNLP.core.batch module +========================= + +.. automodule:: fastNLP.core.batch + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.core.callback.rst b/docs/source/fastNLP.core.callback.rst new file mode 100644 index 00000000..075712e8 --- /dev/null +++ b/docs/source/fastNLP.core.callback.rst @@ -0,0 +1,7 @@ +fastNLP.core.callback module +============================ + +.. automodule:: fastNLP.core.callback + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.core.const.rst b/docs/source/fastNLP.core.const.rst new file mode 100644 index 00000000..288fcf50 --- /dev/null +++ b/docs/source/fastNLP.core.const.rst @@ -0,0 +1,7 @@ +fastNLP.core.const module +========================= + +.. automodule:: fastNLP.core.const + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.core.dataset.rst b/docs/source/fastNLP.core.dataset.rst new file mode 100644 index 00000000..24e1ab4e --- /dev/null +++ b/docs/source/fastNLP.core.dataset.rst @@ -0,0 +1,7 @@ +fastNLP.core.dataset module +=========================== + +.. automodule:: fastNLP.core.dataset + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.core.field.rst b/docs/source/fastNLP.core.field.rst new file mode 100644 index 00000000..23eb47bc --- /dev/null +++ b/docs/source/fastNLP.core.field.rst @@ -0,0 +1,7 @@ +fastNLP.core.field module +========================= + +.. automodule:: fastNLP.core.field + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.core.instance.rst b/docs/source/fastNLP.core.instance.rst new file mode 100644 index 00000000..db731fe9 --- /dev/null +++ b/docs/source/fastNLP.core.instance.rst @@ -0,0 +1,7 @@ +fastNLP.core.instance module +============================ + +.. automodule:: fastNLP.core.instance + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.core.losses.rst b/docs/source/fastNLP.core.losses.rst new file mode 100644 index 00000000..7f4e02b6 --- /dev/null +++ b/docs/source/fastNLP.core.losses.rst @@ -0,0 +1,7 @@ +fastNLP.core.losses module +========================== + +.. automodule:: fastNLP.core.losses + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.core.metrics.rst b/docs/source/fastNLP.core.metrics.rst new file mode 100644 index 00000000..d700a525 --- /dev/null +++ b/docs/source/fastNLP.core.metrics.rst @@ -0,0 +1,7 @@ +fastNLP.core.metrics module +=========================== + +.. automodule:: fastNLP.core.metrics + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.core.optimizer.rst b/docs/source/fastNLP.core.optimizer.rst new file mode 100644 index 00000000..737fc430 --- /dev/null +++ b/docs/source/fastNLP.core.optimizer.rst @@ -0,0 +1,7 @@ +fastNLP.core.optimizer module +============================= + +.. automodule:: fastNLP.core.optimizer + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.core.rst b/docs/source/fastNLP.core.rst new file mode 100644 index 00000000..01c59e21 --- /dev/null +++ b/docs/source/fastNLP.core.rst @@ -0,0 +1,28 @@ +fastNLP.core package +==================== + +.. automodule:: fastNLP.core + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + + fastNLP.core.batch + fastNLP.core.callback + fastNLP.core.const + fastNLP.core.dataset + fastNLP.core.field + fastNLP.core.instance + fastNLP.core.losses + fastNLP.core.metrics + fastNLP.core.optimizer + fastNLP.core.sampler + fastNLP.core.tester + fastNLP.core.trainer + fastNLP.core.utils + fastNLP.core.vocabulary + diff --git a/docs/source/fastNLP.core.sampler.rst b/docs/source/fastNLP.core.sampler.rst new file mode 100644 index 00000000..a827d49c --- /dev/null +++ b/docs/source/fastNLP.core.sampler.rst @@ -0,0 +1,7 @@ +fastNLP.core.sampler module +=========================== + +.. automodule:: fastNLP.core.sampler + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.core.tester.rst b/docs/source/fastNLP.core.tester.rst new file mode 100644 index 00000000..30cebe28 --- /dev/null +++ b/docs/source/fastNLP.core.tester.rst @@ -0,0 +1,7 @@ +fastNLP.core.tester module +========================== + +.. automodule:: fastNLP.core.tester + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.core.trainer.rst b/docs/source/fastNLP.core.trainer.rst new file mode 100644 index 00000000..648feb9d --- /dev/null +++ b/docs/source/fastNLP.core.trainer.rst @@ -0,0 +1,7 @@ +fastNLP.core.trainer module +=========================== + +.. automodule:: fastNLP.core.trainer + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.core.utils.rst b/docs/source/fastNLP.core.utils.rst new file mode 100644 index 00000000..2bec7f62 --- /dev/null +++ b/docs/source/fastNLP.core.utils.rst @@ -0,0 +1,7 @@ +fastNLP.core.utils module +========================= + +.. automodule:: fastNLP.core.utils + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.core.vocabulary.rst b/docs/source/fastNLP.core.vocabulary.rst new file mode 100644 index 00000000..98d8d24d --- /dev/null +++ b/docs/source/fastNLP.core.vocabulary.rst @@ -0,0 +1,7 @@ +fastNLP.core.vocabulary module +============================== + +.. automodule:: fastNLP.core.vocabulary + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.io.base_loader.rst b/docs/source/fastNLP.io.base_loader.rst new file mode 100644 index 00000000..b3375f74 --- /dev/null +++ b/docs/source/fastNLP.io.base_loader.rst @@ -0,0 +1,7 @@ +fastNLP.io.base\_loader module +============================== + +.. automodule:: fastNLP.io.base_loader + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.io.config_io.rst b/docs/source/fastNLP.io.config_io.rst new file mode 100644 index 00000000..c6bf4bae --- /dev/null +++ b/docs/source/fastNLP.io.config_io.rst @@ -0,0 +1,7 @@ +fastNLP.io.config\_io module +============================ + +.. automodule:: fastNLP.io.config_io + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.io.dataset_loader.rst b/docs/source/fastNLP.io.dataset_loader.rst new file mode 100644 index 00000000..89f9b165 --- /dev/null +++ b/docs/source/fastNLP.io.dataset_loader.rst @@ -0,0 +1,7 @@ +fastNLP.io.dataset\_loader module +================================= + +.. automodule:: fastNLP.io.dataset_loader + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.io.embed_loader.rst b/docs/source/fastNLP.io.embed_loader.rst new file mode 100644 index 00000000..1f135155 --- /dev/null +++ b/docs/source/fastNLP.io.embed_loader.rst @@ -0,0 +1,7 @@ +fastNLP.io.embed\_loader module +=============================== + +.. automodule:: fastNLP.io.embed_loader + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.io.file_reader.rst b/docs/source/fastNLP.io.file_reader.rst new file mode 100644 index 00000000..233ee399 --- /dev/null +++ b/docs/source/fastNLP.io.file_reader.rst @@ -0,0 +1,7 @@ +fastNLP.io.file\_reader module +============================== + +.. automodule:: fastNLP.io.file_reader + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.io.model_io.rst b/docs/source/fastNLP.io.model_io.rst new file mode 100644 index 00000000..75f1df69 --- /dev/null +++ b/docs/source/fastNLP.io.model_io.rst @@ -0,0 +1,7 @@ +fastNLP.io.model\_io module +=========================== + +.. automodule:: fastNLP.io.model_io + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.io.rst b/docs/source/fastNLP.io.rst new file mode 100644 index 00000000..5af9d538 --- /dev/null +++ b/docs/source/fastNLP.io.rst @@ -0,0 +1,20 @@ +fastNLP.io package +================== + +.. automodule:: fastNLP.io + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + + fastNLP.io.base_loader + fastNLP.io.config_io + fastNLP.io.dataset_loader + fastNLP.io.embed_loader + fastNLP.io.file_reader + fastNLP.io.model_io + diff --git a/docs/source/fastNLP.models.base_model.rst b/docs/source/fastNLP.models.base_model.rst new file mode 100644 index 00000000..2537f75f --- /dev/null +++ b/docs/source/fastNLP.models.base_model.rst @@ -0,0 +1,7 @@ +fastNLP.models.base\_model module +================================= + +.. automodule:: fastNLP.models.base_model + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.models.bert.rst b/docs/source/fastNLP.models.bert.rst new file mode 100644 index 00000000..7ac64ad7 --- /dev/null +++ b/docs/source/fastNLP.models.bert.rst @@ -0,0 +1,7 @@ +fastNLP.models.bert module +========================== + +.. automodule:: fastNLP.models.bert + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.models.biaffine_parser.rst b/docs/source/fastNLP.models.biaffine_parser.rst new file mode 100644 index 00000000..448dff09 --- /dev/null +++ b/docs/source/fastNLP.models.biaffine_parser.rst @@ -0,0 +1,7 @@ +fastNLP.models.biaffine\_parser module +====================================== + +.. automodule:: fastNLP.models.biaffine_parser + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.models.char_language_model.rst b/docs/source/fastNLP.models.char_language_model.rst new file mode 100644 index 00000000..8cfc9e6e --- /dev/null +++ b/docs/source/fastNLP.models.char_language_model.rst @@ -0,0 +1,7 @@ +fastNLP.models.char\_language\_model module +=========================================== + +.. automodule:: fastNLP.models.char_language_model + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.models.cnn_text_classification.rst b/docs/source/fastNLP.models.cnn_text_classification.rst new file mode 100644 index 00000000..31807494 --- /dev/null +++ b/docs/source/fastNLP.models.cnn_text_classification.rst @@ -0,0 +1,7 @@ +fastNLP.models.cnn\_text\_classification module +=============================================== + +.. automodule:: fastNLP.models.cnn_text_classification + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.models.enas_controller.rst b/docs/source/fastNLP.models.enas_controller.rst new file mode 100644 index 00000000..7977de81 --- /dev/null +++ b/docs/source/fastNLP.models.enas_controller.rst @@ -0,0 +1,7 @@ +fastNLP.models.enas\_controller module +====================================== + +.. automodule:: fastNLP.models.enas_controller + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.models.enas_model.rst b/docs/source/fastNLP.models.enas_model.rst new file mode 100644 index 00000000..518f56b7 --- /dev/null +++ b/docs/source/fastNLP.models.enas_model.rst @@ -0,0 +1,7 @@ +fastNLP.models.enas\_model module +================================= + +.. automodule:: fastNLP.models.enas_model + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.models.enas_trainer.rst b/docs/source/fastNLP.models.enas_trainer.rst new file mode 100644 index 00000000..45f77f31 --- /dev/null +++ b/docs/source/fastNLP.models.enas_trainer.rst @@ -0,0 +1,7 @@ +fastNLP.models.enas\_trainer module +=================================== + +.. automodule:: fastNLP.models.enas_trainer + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.models.enas_utils.rst b/docs/source/fastNLP.models.enas_utils.rst new file mode 100644 index 00000000..5f05a4fc --- /dev/null +++ b/docs/source/fastNLP.models.enas_utils.rst @@ -0,0 +1,7 @@ +fastNLP.models.enas\_utils module +================================= + +.. automodule:: fastNLP.models.enas_utils + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.models.rst b/docs/source/fastNLP.models.rst new file mode 100644 index 00000000..ae4abf7a --- /dev/null +++ b/docs/source/fastNLP.models.rst @@ -0,0 +1,26 @@ +fastNLP.models package +====================== + +.. automodule:: fastNLP.models + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + + fastNLP.models.base_model + fastNLP.models.bert + fastNLP.models.biaffine_parser + fastNLP.models.char_language_model + fastNLP.models.cnn_text_classification + fastNLP.models.enas_controller + fastNLP.models.enas_model + fastNLP.models.enas_trainer + fastNLP.models.enas_utils + fastNLP.models.sequence_modeling + fastNLP.models.snli + fastNLP.models.star_transformer + diff --git a/docs/source/fastNLP.models.sequence_modeling.rst b/docs/source/fastNLP.models.sequence_modeling.rst new file mode 100644 index 00000000..7fa7e450 --- /dev/null +++ b/docs/source/fastNLP.models.sequence_modeling.rst @@ -0,0 +1,7 @@ +fastNLP.models.sequence\_modeling module +======================================== + +.. automodule:: fastNLP.models.sequence_modeling + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.models.snli.rst b/docs/source/fastNLP.models.snli.rst new file mode 100644 index 00000000..b24bc196 --- /dev/null +++ b/docs/source/fastNLP.models.snli.rst @@ -0,0 +1,7 @@ +fastNLP.models.snli module +========================== + +.. automodule:: fastNLP.models.snli + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.models.star_transformer.rst b/docs/source/fastNLP.models.star_transformer.rst new file mode 100644 index 00000000..f2185935 --- /dev/null +++ b/docs/source/fastNLP.models.star_transformer.rst @@ -0,0 +1,7 @@ +fastNLP.models.star\_transformer module +======================================= + +.. automodule:: fastNLP.models.star_transformer + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.modules.aggregator.attention.rst b/docs/source/fastNLP.modules.aggregator.attention.rst new file mode 100644 index 00000000..46251e73 --- /dev/null +++ b/docs/source/fastNLP.modules.aggregator.attention.rst @@ -0,0 +1,7 @@ +fastNLP.modules.aggregator.attention module +=========================================== + +.. automodule:: fastNLP.modules.aggregator.attention + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.modules.aggregator.pooling.rst b/docs/source/fastNLP.modules.aggregator.pooling.rst new file mode 100644 index 00000000..f6730430 --- /dev/null +++ b/docs/source/fastNLP.modules.aggregator.pooling.rst @@ -0,0 +1,7 @@ +fastNLP.modules.aggregator.pooling module +========================================= + +.. automodule:: fastNLP.modules.aggregator.pooling + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.modules.aggregator.rst b/docs/source/fastNLP.modules.aggregator.rst new file mode 100644 index 00000000..b9b331c3 --- /dev/null +++ b/docs/source/fastNLP.modules.aggregator.rst @@ -0,0 +1,16 @@ +fastNLP.modules.aggregator package +================================== + +.. automodule:: fastNLP.modules.aggregator + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + + fastNLP.modules.aggregator.attention + fastNLP.modules.aggregator.pooling + diff --git a/docs/source/fastNLP.modules.decoder.CRF.rst b/docs/source/fastNLP.modules.decoder.CRF.rst new file mode 100644 index 00000000..8d980bbd --- /dev/null +++ b/docs/source/fastNLP.modules.decoder.CRF.rst @@ -0,0 +1,7 @@ +fastNLP.modules.decoder.CRF module +================================== + +.. automodule:: fastNLP.modules.decoder.CRF + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.modules.decoder.MLP.rst b/docs/source/fastNLP.modules.decoder.MLP.rst new file mode 100644 index 00000000..787a3c33 --- /dev/null +++ b/docs/source/fastNLP.modules.decoder.MLP.rst @@ -0,0 +1,7 @@ +fastNLP.modules.decoder.MLP module +================================== + +.. automodule:: fastNLP.modules.decoder.MLP + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.modules.decoder.rst b/docs/source/fastNLP.modules.decoder.rst new file mode 100644 index 00000000..10fdbd90 --- /dev/null +++ b/docs/source/fastNLP.modules.decoder.rst @@ -0,0 +1,17 @@ +fastNLP.modules.decoder package +=============================== + +.. automodule:: fastNLP.modules.decoder + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + + fastNLP.modules.decoder.CRF + fastNLP.modules.decoder.MLP + fastNLP.modules.decoder.utils + diff --git a/docs/source/fastNLP.modules.decoder.utils.rst b/docs/source/fastNLP.modules.decoder.utils.rst new file mode 100644 index 00000000..b829baf7 --- /dev/null +++ b/docs/source/fastNLP.modules.decoder.utils.rst @@ -0,0 +1,7 @@ +fastNLP.modules.decoder.utils module +==================================== + +.. automodule:: fastNLP.modules.decoder.utils + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.modules.dropout.rst b/docs/source/fastNLP.modules.dropout.rst new file mode 100644 index 00000000..f525e08f --- /dev/null +++ b/docs/source/fastNLP.modules.dropout.rst @@ -0,0 +1,7 @@ +fastNLP.modules.dropout module +============================== + +.. automodule:: fastNLP.modules.dropout + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.modules.encoder.bert.rst b/docs/source/fastNLP.modules.encoder.bert.rst new file mode 100644 index 00000000..6f811792 --- /dev/null +++ b/docs/source/fastNLP.modules.encoder.bert.rst @@ -0,0 +1,7 @@ +fastNLP.modules.encoder.bert module +=================================== + +.. automodule:: fastNLP.modules.encoder.bert + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.modules.encoder.char_encoder.rst b/docs/source/fastNLP.modules.encoder.char_encoder.rst new file mode 100644 index 00000000..12431c70 --- /dev/null +++ b/docs/source/fastNLP.modules.encoder.char_encoder.rst @@ -0,0 +1,7 @@ +fastNLP.modules.encoder.char\_encoder module +============================================ + +.. automodule:: fastNLP.modules.encoder.char_encoder + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.modules.encoder.conv_maxpool.rst b/docs/source/fastNLP.modules.encoder.conv_maxpool.rst new file mode 100644 index 00000000..c40a5f39 --- /dev/null +++ b/docs/source/fastNLP.modules.encoder.conv_maxpool.rst @@ -0,0 +1,7 @@ +fastNLP.modules.encoder.conv\_maxpool module +============================================ + +.. automodule:: fastNLP.modules.encoder.conv_maxpool + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.modules.encoder.embedding.rst b/docs/source/fastNLP.modules.encoder.embedding.rst new file mode 100644 index 00000000..abdd5fd2 --- /dev/null +++ b/docs/source/fastNLP.modules.encoder.embedding.rst @@ -0,0 +1,7 @@ +fastNLP.modules.encoder.embedding module +======================================== + +.. automodule:: fastNLP.modules.encoder.embedding + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.modules.encoder.linear.rst b/docs/source/fastNLP.modules.encoder.linear.rst new file mode 100644 index 00000000..7a479ca2 --- /dev/null +++ b/docs/source/fastNLP.modules.encoder.linear.rst @@ -0,0 +1,7 @@ +fastNLP.modules.encoder.linear module +===================================== + +.. automodule:: fastNLP.modules.encoder.linear + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.modules.encoder.lstm.rst b/docs/source/fastNLP.modules.encoder.lstm.rst new file mode 100644 index 00000000..897e7a5f --- /dev/null +++ b/docs/source/fastNLP.modules.encoder.lstm.rst @@ -0,0 +1,7 @@ +fastNLP.modules.encoder.lstm module +=================================== + +.. automodule:: fastNLP.modules.encoder.lstm + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.modules.encoder.rst b/docs/source/fastNLP.modules.encoder.rst new file mode 100644 index 00000000..3ee246c2 --- /dev/null +++ b/docs/source/fastNLP.modules.encoder.rst @@ -0,0 +1,23 @@ +fastNLP.modules.encoder package +=============================== + +.. automodule:: fastNLP.modules.encoder + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + + fastNLP.modules.encoder.bert + fastNLP.modules.encoder.char_encoder + fastNLP.modules.encoder.conv_maxpool + fastNLP.modules.encoder.embedding + fastNLP.modules.encoder.linear + fastNLP.modules.encoder.lstm + fastNLP.modules.encoder.star_transformer + fastNLP.modules.encoder.transformer + fastNLP.modules.encoder.variational_rnn + diff --git a/docs/source/fastNLP.modules.encoder.star_transformer.rst b/docs/source/fastNLP.modules.encoder.star_transformer.rst new file mode 100644 index 00000000..57cd6dcf --- /dev/null +++ b/docs/source/fastNLP.modules.encoder.star_transformer.rst @@ -0,0 +1,7 @@ +fastNLP.modules.encoder.star\_transformer module +================================================ + +.. automodule:: fastNLP.modules.encoder.star_transformer + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.modules.encoder.transformer.rst b/docs/source/fastNLP.modules.encoder.transformer.rst new file mode 100644 index 00000000..4b63686e --- /dev/null +++ b/docs/source/fastNLP.modules.encoder.transformer.rst @@ -0,0 +1,7 @@ +fastNLP.modules.encoder.transformer module +========================================== + +.. automodule:: fastNLP.modules.encoder.transformer + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.modules.encoder.variational_rnn.rst b/docs/source/fastNLP.modules.encoder.variational_rnn.rst new file mode 100644 index 00000000..4472d5c2 --- /dev/null +++ b/docs/source/fastNLP.modules.encoder.variational_rnn.rst @@ -0,0 +1,7 @@ +fastNLP.modules.encoder.variational\_rnn module +=============================================== + +.. automodule:: fastNLP.modules.encoder.variational_rnn + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.modules.other_modules.rst b/docs/source/fastNLP.modules.other_modules.rst new file mode 100644 index 00000000..c1bba5fb --- /dev/null +++ b/docs/source/fastNLP.modules.other_modules.rst @@ -0,0 +1,7 @@ +fastNLP.modules.other\_modules module +===================================== + +.. automodule:: fastNLP.modules.other_modules + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.modules.rst b/docs/source/fastNLP.modules.rst new file mode 100644 index 00000000..23f5523a --- /dev/null +++ b/docs/source/fastNLP.modules.rst @@ -0,0 +1,18 @@ + + +fastNLP.modules package +======================= + +.. automodule:: fastNLP.modules + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + + fastNLP.modules.aggregator + fastNLP.modules.decoder + fastNLP.modules.encoder \ No newline at end of file diff --git a/docs/source/fastNLP.modules.utils.rst b/docs/source/fastNLP.modules.utils.rst new file mode 100644 index 00000000..b7eb672e --- /dev/null +++ b/docs/source/fastNLP.modules.utils.rst @@ -0,0 +1,7 @@ +fastNLP.modules.utils module +============================ + +.. automodule:: fastNLP.modules.utils + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/fastNLP.rst b/docs/source/fastNLP.rst new file mode 100644 index 00000000..30f405f0 --- /dev/null +++ b/docs/source/fastNLP.rst @@ -0,0 +1,19 @@ +fastNLP package +=============== + +.. automodule:: fastNLP + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + + fastNLP.component + fastNLP.core + fastNLP.io + fastNLP.models + fastNLP.modules + diff --git a/docs/source/index.rst b/docs/source/index.rst index 9f410f41..b08c2b2d 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,13 +1,21 @@ -fastNLP documentation +fastNLP 中文文档 ===================== -A Modularized and Extensible Toolkit for Natural Language Processing. Currently still in incubation. +fastNLP 是一款轻量级的 NLP 处理套件。你既可以使用它快速地完成一个命名实体识别(NER)、中文分词或文本分类任务; +也可以使用他构建许多复杂的网络模型,进行科研。它具有如下的特性: -Introduction +- 代码简洁易懂,有着详尽的中文文档以供查阅; +- 深度学习的各个阶段划分明确,配合 fitlog 使用让科研更轻松; +- 内置多种常见模型 (TODO); +- 基于 PyTorch ,方便从原生 PyTorch 代码迁入,并能使用 PyTorch 中的各种组件; +- 便于 seq2seq; +- 便于 fine-tune + +内置的模块 ------------ -FastNLP is a modular Natural Language Processing system based on -PyTorch, built for fast development of NLP models. +(TODO) + A deep learning NLP model is the composition of three types of modules: @@ -33,31 +41,41 @@ For example: +各个任务上的结果 +----------------------- + +(TODO) + +快速入门 +------------- + +TODO + + +用户手册 +--------------- -User's Guide ------------- .. toctree:: - :maxdepth: 2 + :maxdepth: 1 - user/installation - user/quickstart + 安装指南 + 快速入门 + 使用 fastNLP 分类 + 使用 fastNLP 分词 -API Reference +API 文档 ------------- -If you are looking for information on a specific function, class or -method, this part of the documentation is for you. +除了用户手册之外,你还可以通过查阅 API 文档来找到你所需要的工具。 .. toctree:: :maxdepth: 2 - fastNLP API - - + fastNLP -Indices and tables +索引与搜索 ================== * :ref:`genindex` diff --git a/docs/source/modules.rst b/docs/source/modules.rst new file mode 100644 index 00000000..e9a92cb7 --- /dev/null +++ b/docs/source/modules.rst @@ -0,0 +1,7 @@ +fastNLP +======= + +.. toctree:: + :maxdepth: 4 + + fastNLP diff --git a/docs/source/user/installation.rst b/docs/source/user/installation.rst index 5dfe4a11..e22c4202 100644 --- a/docs/source/user/installation.rst +++ b/docs/source/user/installation.rst @@ -1,17 +1,21 @@ -============ -Installation -============ +=============== +安装指南 +=============== .. contents:: :local: -Make sure your environment satisfies https://github.com/fastnlp/fastNLP/blob/master/requirements.txt . +fastNLP 依赖如下包:: -Run the following commands to install fastNLP package: + torch>=0.4.0 + numpy + tensorboardX + tqdm + nltk -.. code:: shell - - pip install fastNLP - +其中torch的安装可能与操作系统及 CUDA 的版本相关,请参见 `PyTorch 官网 `_ 。 +在依赖包安装完成的情况,您可以在命令行执行如下指令完成安装 +.. code:: shell + >>> pip install fitlog diff --git a/docs/source/user/quickstart.rst b/docs/source/user/quickstart.rst index a5eb9402..599254e9 100644 --- a/docs/source/user/quickstart.rst +++ b/docs/source/user/quickstart.rst @@ -1,11 +1,3 @@ -Quickstart -========== - -.. toctree:: - :maxdepth: 1 - - ../tutorials/fastnlp_1_minute_tutorial - ../tutorials/fastnlp_10tmin_tutorial - ../tutorials/fastnlp_advanced_tutorial - ../tutorials/fastnlp_developer_guide - +=============== +快速入门 +=============== \ No newline at end of file diff --git a/docs/source/user/task2.rst b/docs/source/user/task2.rst new file mode 100644 index 00000000..73ee014b --- /dev/null +++ b/docs/source/user/task2.rst @@ -0,0 +1,3 @@ +===================== +用 fastNLP 分词 +===================== \ No newline at end of file diff --git a/fastNLP/__init__.py b/fastNLP/__init__.py index e7975c9b..25d7ea82 100644 --- a/fastNLP/__init__.py +++ b/fastNLP/__init__.py @@ -1,5 +1,14 @@ """ -fastNLP 由 :mod:`~fastNLP.core` 、 :mod:`~fastNLP.io` 、:mod:`~fastNLP.modules` 等子模块组成,但常用的组件都可以直接 import ,常用组件如下: +fastNLP 由 :mod:`~fastNLP.core` 、 :mod:`~fastNLP.io` 、:mod:`~fastNLP.modules`、:mod:`~fastNLP.models` +和 :mod:`~fastNLP.component` 等子模块组成。 + +- :mod:`~fastNLP.core` fastNLP 的核心模块,包括 DataSet、 Trainer、 Tester 等组件 +- :mod:`~fastNLP.io` fastNLP 的输入输出模块,实现了数据集的读取,模型的存取等功能 +- :mod:`~fastNLP.modules` TODO 如何介绍 +- :mod:`~fastNLP.models` 使用 fastNLP 实现的一些常见模型,具体参见 :doc:`fastNLP.models` +- :mod:`~fastNLP.component` TODO + +fastNLP 中最常用的组件可以直接从 fastNLP 包中 import ,他们的文档如下: """ __all__ = ["Instance", "FieldArray", "Batch", "Vocabulary", "DataSet", "Trainer", "Tester", "Callback", diff --git a/fastNLP/models/__init__.py b/fastNLP/models/__init__.py index a83c3936..657f67ec 100644 --- a/fastNLP/models/__init__.py +++ b/fastNLP/models/__init__.py @@ -1,3 +1,8 @@ +""" +使用 fastNLP 实现的一系列常见模型,具体有: +TODO 详细介绍的表格,与主页相对应 + +""" from .base_model import BaseModel from .biaffine_parser import BiaffineParser, GraphParser from .char_language_model import CharLM diff --git a/fastNLP/models/cnn_text_classification.py b/fastNLP/models/cnn_text_classification.py index 86848d0c..7d7c3878 100644 --- a/fastNLP/models/cnn_text_classification.py +++ b/fastNLP/models/cnn_text_classification.py @@ -12,6 +12,14 @@ class CNNText(torch.nn.Module): """ 使用CNN进行文本分类的模型 'Yoon Kim. 2014. Convolution Neural Networks for Sentence Classification.' + + :param tuple(int,int),torch.FloatTensor,nn.Embedding,numpy.ndarray init_embed: Embedding的大小(传入tuple(int, int), + 第一个int为vocab_zie, 第二个int为embed_dim); 如果为Tensor, Embedding, ndarray等则直接使用该值初始化Embedding + :param int num_classes: 一共有多少类 + :param int,tuple(int) out_channels: 输出channel的数量。如果为list,则需要与kernel_sizes的数量保持一致 + :param int,tuple(int) kernel_sizes: 输出channel的kernel大小。 + :param int padding: + :param float dropout: Dropout的大小 """ def __init__(self, init_embed, @@ -20,16 +28,6 @@ class CNNText(torch.nn.Module): kernel_sizes=(3, 4, 5), padding=0, dropout=0.5): - """ - - :param tuple(int,int),torch.FloatTensor,nn.Embedding,numpy.ndarray init_embed: Embedding的大小(传入tuple(int, int), - 第一个int为vocab_zie, 第二个int为embed_dim); 如果为Tensor, Embedding, ndarray等则直接使用该值初始化Embedding - :param int num_classes: 一共有多少类 - :param int,tuple(int) out_channels: 输出channel的数量。如果为list,则需要与kernel_sizes的数量保持一致 - :param int,tuple(int) kernel_sizes: 输出channel的kernel大小。 - :param int padding: - :param float dropout: Dropout的大小 - """ super(CNNText, self).__init__() # no support for pre-trained embedding currently diff --git a/fastNLP/modules/__init__.py b/fastNLP/modules/__init__.py index 37223394..6ff356f1 100644 --- a/fastNLP/modules/__init__.py +++ b/fastNLP/modules/__init__.py @@ -1,13 +1,19 @@ +""" +modules 模块是 fastNLP 的重要组成部分,它实现了神经网络构建中常见的组件, +具体包括 TODO + +可以和 PyTorch 结合使用?TODO + +TODO __all__ 里面多暴露一些 + +""" from . import aggregator from . import decoder from . import encoder from .aggregator import * from .decoder import * +from .other_modules import * from .dropout import TimestepDropout from .encoder import * __version__ = '0.0.0' - -__all__ = ['encoder', - 'decoder', - 'aggregator'] diff --git a/fastNLP/modules/aggregator/__init__.py b/fastNLP/modules/aggregator/__init__.py index 51106a76..dbf53662 100644 --- a/fastNLP/modules/aggregator/__init__.py +++ b/fastNLP/modules/aggregator/__init__.py @@ -1,3 +1,5 @@ +__all__ = ["MaxPool", "MaxPoolWithMask", "AvgPool", "MeanPoolWithMask", "KMaxPool", "Attention", "BiAttention", + "SelfAttention"] from .pooling import MaxPool from .pooling import MaxPoolWithMask from .pooling import AvgPool @@ -7,4 +9,3 @@ from .pooling import KMaxPool from .attention import Attention from .attention import BiAttention from .attention import SelfAttention - diff --git a/fastNLP/modules/aggregator/attention.py b/fastNLP/modules/aggregator/attention.py index 67f68ff2..fb6f5dc5 100644 --- a/fastNLP/modules/aggregator/attention.py +++ b/fastNLP/modules/aggregator/attention.py @@ -117,11 +117,11 @@ class BiAttention(nn.Module): .. math:: - \begin{array}{ll} \\ - e_ij = {a}^{\mathbf{T}}_{i}{b}_{j} \\ + \\begin{array}{ll} \\\\ + e_ij = {a}^{\\mathbf{T}}_{i}{b}_{j} \\\\ a_i = b_j = - \end{array} + \\end{array} """ diff --git a/fastNLP/modules/decoder/CRF.py b/fastNLP/modules/decoder/CRF.py index 4c3ac122..59efbd53 100644 --- a/fastNLP/modules/decoder/CRF.py +++ b/fastNLP/modules/decoder/CRF.py @@ -144,18 +144,19 @@ def _is_transition_allowed(encoding_type, from_tag, from_label, to_tag, to_label class ConditionalRandomField(nn.Module): + """条件随机场。 + 提供forward()以及viterbi_decode()两个方法,分别用于训练与inference。 + + :param int num_tags: 标签的数量 + :param bool include_start_end_trans: 是否考虑各个tag作为开始以及结尾的分数。 + :param List[Tuple[from_tag_id(int), to_tag_id(int)]] allowed_transitions: 内部的Tuple[from_tag_id(int), + to_tag_id(int)]视为允许发生的跃迁,其他没有包含的跃迁认为是禁止跃迁,可以通过 + allowed_transitions()函数得到;如果为None,则所有跃迁均为合法 + :param str initial_method: 初始化方法。见initial_parameter + """ def __init__(self, num_tags, include_start_end_trans=False, allowed_transitions=None, initial_method=None): - """条件随机场。 - 提供forward()以及viterbi_decode()两个方法,分别用于训练与inference。 - - :param int num_tags: 标签的数量 - :param bool include_start_end_trans: 是否考虑各个tag作为开始以及结尾的分数。 - :param List[Tuple[from_tag_id(int), to_tag_id(int)]] allowed_transitions: 内部的Tuple[from_tag_id(int), - to_tag_id(int)]视为允许发生的跃迁,其他没有包含的跃迁认为是禁止跃迁,可以通过 - allowed_transitions()函数得到;如果为None,则所有跃迁均为合法 - :param str initial_method: 初始化方法。见initial_parameter - """ + super(ConditionalRandomField, self).__init__() self.include_start_end_trans = include_start_end_trans diff --git a/fastNLP/modules/decoder/__init__.py b/fastNLP/modules/decoder/__init__.py index a72b7cd0..7e247c70 100644 --- a/fastNLP/modules/decoder/__init__.py +++ b/fastNLP/modules/decoder/__init__.py @@ -1,2 +1,3 @@ +__all__ = ["MLP", "ConditionalRandomField"] from .CRF import ConditionalRandomField from .MLP import MLP