@@ -1,7 +0,0 @@ | |||||
fastNLP.io.config\_io | |||||
===================== | |||||
.. automodule:: fastNLP.io.config_io | |||||
:members: | |||||
:undoc-members: | |||||
:show-inheritance: |
@@ -1,7 +0,0 @@ | |||||
fastNLP.io.file_utils | |||||
===================== | |||||
.. automodule:: fastNLP.io.file_utils | |||||
:members: | |||||
:undoc-members: | |||||
:show-inheritance: |
@@ -9,20 +9,11 @@ fastNLP.io | |||||
子模块 | 子模块 | ||||
---------- | ---------- | ||||
.. toctree:: | |||||
fastNLP.io.data_loader | |||||
Submodules | |||||
---------- | |||||
.. toctree:: | .. toctree:: | ||||
:maxdepth: 1 | :maxdepth: 1 | ||||
fastNLP.io.base_loader | fastNLP.io.base_loader | ||||
fastNLP.io.config_io | |||||
fastNLP.io.dataset_loader | |||||
fastNLP.io.embed_loader | fastNLP.io.embed_loader | ||||
fastNLP.io.file_utils | |||||
fastNLP.io.dataset_loader | |||||
fastNLP.io.data_loader | |||||
fastNLP.io.model_io | fastNLP.io.model_io | ||||
fastNLP.io.utils |
@@ -1,7 +0,0 @@ | |||||
fastNLP.io.utils | |||||
================ | |||||
.. automodule:: fastNLP.io.utils | |||||
:members: | |||||
:undoc-members: | |||||
:show-inheritance: |
@@ -181,7 +181,7 @@ FastNLP 完全支持使用 pyTorch 编写的模型,但与 pyTorch 中编写模 | |||||
) | ) | ||||
) | ) | ||||
FastNLP 中包含的各种模块如下表,您可以点击具体的名称查看详细的 API: | |||||
FastNLP 中包含的各种模块如下表,您可以点击具体的名称查看详细的 API,也可以通过 :doc:`/fastNLP.modules` 进行了解。 | |||||
.. csv-table:: | .. csv-table:: | ||||
:header: 名称, 介绍 | :header: 名称, 介绍 | ||||
@@ -189,7 +189,6 @@ FastNLP 中包含的各种模块如下表,您可以点击具体的名称查看 | |||||
:class:`~fastNLP.modules.ConvolutionCharEncoder` , char级别的卷积 encoder | :class:`~fastNLP.modules.ConvolutionCharEncoder` , char级别的卷积 encoder | ||||
:class:`~fastNLP.modules.LSTMCharEncoder` , char级别基于LSTM的 encoder | :class:`~fastNLP.modules.LSTMCharEncoder` , char级别基于LSTM的 encoder | ||||
:class:`~fastNLP.modules.ConvMaxpool` , 结合了Convolution和Max-Pooling于一体的模块 | :class:`~fastNLP.modules.ConvMaxpool` , 结合了Convolution和Max-Pooling于一体的模块 | ||||
:class:`~fastNLP.modules.Embedding` , 基础的Embedding模块 | |||||
:class:`~fastNLP.modules.LSTM` , LSTM模块, 轻量封装了PyTorch的LSTM | :class:`~fastNLP.modules.LSTM` , LSTM模块, 轻量封装了PyTorch的LSTM | ||||
:class:`~fastNLP.modules.StarTransformer` , Star-Transformer 的encoder部分 | :class:`~fastNLP.modules.StarTransformer` , Star-Transformer 的encoder部分 | ||||
:class:`~fastNLP.modules.TransformerEncoder` , Transformer的encoder模块,不包含embedding层 | :class:`~fastNLP.modules.TransformerEncoder` , Transformer的encoder模块,不包含embedding层 | ||||
@@ -198,8 +197,11 @@ FastNLP 中包含的各种模块如下表,您可以点击具体的名称查看 | |||||
:class:`~fastNLP.modules.VarGRU` , Variational Dropout GRU 模块 | :class:`~fastNLP.modules.VarGRU` , Variational Dropout GRU 模块 | ||||
:class:`~fastNLP.modules.MaxPool` , Max-pooling模块 | :class:`~fastNLP.modules.MaxPool` , Max-pooling模块 | ||||
:class:`~fastNLP.modules.MaxPoolWithMask` , 带mask矩阵的max pooling。在做 max-pooling的时候不会考虑mask值为0的位置。 | :class:`~fastNLP.modules.MaxPoolWithMask` , 带mask矩阵的max pooling。在做 max-pooling的时候不会考虑mask值为0的位置。 | ||||
:class:`~fastNLP.modules.AvgPool` , Average-pooling模块 | |||||
:class:`~fastNLP.modules.AvgPoolWithMask` , 带mask矩阵的average pooling。在做 average-pooling的时候不会考虑mask值为0的位置。 | |||||
:class:`~fastNLP.modules.MultiHeadAttention` , MultiHead Attention 模块 | :class:`~fastNLP.modules.MultiHeadAttention` , MultiHead Attention 模块 | ||||
:class:`~fastNLP.modules.MLP` , 简单的多层感知器模块 | :class:`~fastNLP.modules.MLP` , 简单的多层感知器模块 | ||||
:class:`~fastNLP.modules.ConditionalRandomField` , 条件随机场模块 | :class:`~fastNLP.modules.ConditionalRandomField` , 条件随机场模块 | ||||
:class:`~fastNLP.modules.viterbi_decode` , 给定一个特征矩阵以及转移分数矩阵,计算出最佳的路径以及对应的分数 (与 :class:`~fastNLP.modules.ConditionalRandomField` 配合使用) | :class:`~fastNLP.modules.viterbi_decode` , 给定一个特征矩阵以及转移分数矩阵,计算出最佳的路径以及对应的分数 (与 :class:`~fastNLP.modules.ConditionalRandomField` 配合使用) | ||||
:class:`~fastNLP.modules.allowed_transitions` , 给定一个id到label的映射表,返回所有可以跳转的列表(与 :class:`~fastNLP.modules.ConditionalRandomField` 配合使用) | :class:`~fastNLP.modules.allowed_transitions` , 给定一个id到label的映射表,返回所有可以跳转的列表(与 :class:`~fastNLP.modules.ConditionalRandomField` 配合使用) | ||||
:class:`~fastNLP.modules.TimestepDropout` , 简单包装过的Dropout 组件 |
@@ -2,10 +2,10 @@ | |||||
fastNLP 由 :mod:`~fastNLP.core` 、 :mod:`~fastNLP.io` 、:mod:`~fastNLP.embeddings` 、 :mod:`~fastNLP.modules`、 | fastNLP 由 :mod:`~fastNLP.core` 、 :mod:`~fastNLP.io` 、:mod:`~fastNLP.embeddings` 、 :mod:`~fastNLP.modules`、 | ||||
:mod:`~fastNLP.models` 等子模块组成,你可以查看每个模块的文档。 | :mod:`~fastNLP.models` 等子模块组成,你可以查看每个模块的文档。 | ||||
- :mod:`~fastNLP.core` 是fastNLP 的核心模块,包括 DataSet、 Trainer、 Tester 等组件。详见文档 :doc:`fastNLP.core` | |||||
- :mod:`~fastNLP.io` 是实现输入输出的模块,包括了数据集的读取,模型的存取等功能。详见文档 :doc:`fastNLP.io` | |||||
- :mod:`~fastNLP.embeddings` 提供用于构建复杂网络模型所需的各种embedding。详见文档 :doc:`fastNLP.embeddings` | |||||
- :mod:`~fastNLP.modules` 包含了用于搭建神经网络模型的诸多组件,可以帮助用户快速搭建自己所需的网络。详见文档 :doc:`fastNLP.modules` | |||||
- :mod:`~fastNLP.core` 是fastNLP 的核心模块,包括 DataSet、 Trainer、 Tester 等组件。详见文档 :doc:`/fastNLP.core` | |||||
- :mod:`~fastNLP.io` 是实现输入输出的模块,包括了数据集的读取,模型的存取等功能。详见文档 :doc:`/fastNLP.io` | |||||
- :mod:`~fastNLP.embeddings` 提供用于构建复杂网络模型所需的各种embedding。详见文档 :doc:`/fastNLP.embeddings` | |||||
- :mod:`~fastNLP.modules` 包含了用于搭建神经网络模型的诸多组件,可以帮助用户快速搭建自己所需的网络。详见文档 :doc:`/fastNLP.modules` | |||||
- :mod:`~fastNLP.models` 包含了一些使用 fastNLP 实现的完整网络模型,包括 :class:`~fastNLP.models.CNNText` 、 :class:`~fastNLP.models.SeqLabeling` 等常见模型。详见文档 :doc:`fastNLP.models` | - :mod:`~fastNLP.models` 包含了一些使用 fastNLP 实现的完整网络模型,包括 :class:`~fastNLP.models.CNNText` 、 :class:`~fastNLP.models.SeqLabeling` 等常见模型。详见文档 :doc:`fastNLP.models` | ||||
fastNLP 中最常用的组件可以直接从 fastNLP 包中 import ,他们的文档如下: | fastNLP 中最常用的组件可以直接从 fastNLP 包中 import ,他们的文档如下: | ||||
@@ -3,36 +3,40 @@ | |||||
1. 用于读入 embedding 的 :doc:`EmbedLoader <fastNLP.io.embed_loader>` 类, | 1. 用于读入 embedding 的 :doc:`EmbedLoader <fastNLP.io.embed_loader>` 类, | ||||
2. 用于读入数据的 :doc:`DataSetLoader <fastNLP.io.dataset_loader>` 类 | |||||
2. 用于读入不同格式数据的 :doc:`DataSetLoader <fastNLP.io.dataset_loader>` 类 | |||||
3. 用于保存和载入模型的类, 参考 :doc:`/fastNLP.io.model_io` | |||||
3. 用于保存和载入模型的类, 参考 :doc:`model_io文档</fastNLP.io.model_io>` | |||||
4. 用于读入特定数据并进行处理的 :doc:`DataLoader <fastNLP.io.data_loader>` 类 | |||||
这些类的使用方法如下: | 这些类的使用方法如下: | ||||
""" | """ | ||||
__all__ = [ | __all__ = [ | ||||
'EmbedLoader', | 'EmbedLoader', | ||||
'DataBundle', | |||||
'DataSetLoader', | |||||
'CSVLoader', | 'CSVLoader', | ||||
'JsonLoader', | 'JsonLoader', | ||||
'ModelLoader', | 'ModelLoader', | ||||
'ModelSaver', | 'ModelSaver', | ||||
'DataBundle', | |||||
'DataSetLoader', | |||||
'ConllLoader', | 'ConllLoader', | ||||
'Conll2003Loader', | 'Conll2003Loader', | ||||
'IMDBLoader', | 'IMDBLoader', | ||||
'MatchingLoader', | 'MatchingLoader', | ||||
'PeopleDailyCorpusLoader', | |||||
'SNLILoader', | 'SNLILoader', | ||||
'SSTLoader', | |||||
'SST2Loader', | |||||
'MNLILoader', | 'MNLILoader', | ||||
'MTL16Loader', | |||||
'PeopleDailyCorpusLoader', | |||||
'QNLILoader', | 'QNLILoader', | ||||
'QuoraLoader', | 'QuoraLoader', | ||||
'RTELoader', | 'RTELoader', | ||||
'SSTLoader', | |||||
'SST2Loader', | |||||
'YelpLoader', | |||||
] | ] | ||||
from .embed_loader import EmbedLoader | from .embed_loader import EmbedLoader | ||||
@@ -1,13 +1,14 @@ | |||||
""" | """ | ||||
用于读数据集的模块, 可以读取文本分类、序列标注、Matching任务的数据集 | 用于读数据集的模块, 可以读取文本分类、序列标注、Matching任务的数据集 | ||||
这些模块的使用方法如下: | |||||
这些模块的具体介绍如下,您可以通过阅读 :doc:`教程</tutorials/tutorial_2_load_dataset>` 来进行了解。 | |||||
""" | """ | ||||
__all__ = [ | __all__ = [ | ||||
'ConllLoader', | 'ConllLoader', | ||||
'Conll2003Loader', | 'Conll2003Loader', | ||||
'IMDBLoader', | 'IMDBLoader', | ||||
'MatchingLoader', | 'MatchingLoader', | ||||
'SNLILoader', | |||||
'MNLILoader', | 'MNLILoader', | ||||
'MTL16Loader', | 'MTL16Loader', | ||||
'PeopleDailyCorpusLoader', | 'PeopleDailyCorpusLoader', | ||||
@@ -16,7 +17,6 @@ __all__ = [ | |||||
'RTELoader', | 'RTELoader', | ||||
'SSTLoader', | 'SSTLoader', | ||||
'SST2Loader', | 'SST2Loader', | ||||
'SNLILoader', | |||||
'YelpLoader', | 'YelpLoader', | ||||
] | ] | ||||
@@ -58,7 +58,7 @@ class ConllLoader(DataSetLoader): | |||||
class Conll2003Loader(ConllLoader): | class Conll2003Loader(ConllLoader): | ||||
""" | """ | ||||
别名::class:`fastNLP.io.Conll2003Loader` :class:`fastNLP.io.dataset_loader.Conll2003Loader` | |||||
别名::class:`fastNLP.io.Conll2003Loader` :class:`fastNLP.io.data_loader.Conll2003Loader` | |||||
读取Conll2003数据 | 读取Conll2003数据 | ||||
@@ -7,7 +7,7 @@ from ...core.const import Const | |||||
class PeopleDailyCorpusLoader(DataSetLoader): | class PeopleDailyCorpusLoader(DataSetLoader): | ||||
""" | """ | ||||
别名::class:`fastNLP.io.PeopleDailyCorpusLoader` :class:`fastNLP.io.dataset_loader.PeopleDailyCorpusLoader` | |||||
别名::class:`fastNLP.io.PeopleDailyCorpusLoader` :class:`fastNLP.io.data_loader.PeopleDailyCorpusLoader` | |||||
读取人民日报数据集 | 读取人民日报数据集 | ||||
""" | """ | ||||
@@ -17,7 +17,7 @@ | |||||
""" | """ | ||||
__all__ = [ | __all__ = [ | ||||
"BertModel", | |||||
# "BertModel", | |||||
"ConvolutionCharEncoder", | "ConvolutionCharEncoder", | ||||
"LSTMCharEncoder", | "LSTMCharEncoder", | ||||
@@ -1,5 +1,5 @@ | |||||
__all__ = [ | __all__ = [ | ||||
"BertModel", | |||||
# "BertModel", | |||||
"ConvolutionCharEncoder", | "ConvolutionCharEncoder", | ||||
"LSTMCharEncoder", | "LSTMCharEncoder", | ||||