@@ -66,12 +66,13 @@ def create_rst_file(modules, name, children): | |||||
fout.write(t + "\n") | fout.write(t + "\n") | ||||
fout.write("\n") | fout.write("\n") | ||||
fout.write(".. automodule:: " + name + "\n") | fout.write(".. automodule:: " + name + "\n") | ||||
if len(m.__all__) > 0: | |||||
if name != "fastNLP.core" and len(m.__all__) > 0: | |||||
fout.write(" :members: " + ", ".join(m.__all__) + "\n") | fout.write(" :members: " + ", ".join(m.__all__) + "\n") | ||||
fout.write(" :inherited-members:\n") | |||||
if not (name.startswith('fastNLP.models') or name.startswith('fastNLP.modules')): | |||||
fout.write(" :inherited-members:\n") | |||||
fout.write("\n") | fout.write("\n") | ||||
if name in children: | if name in children: | ||||
fout.write("子模块\n------\n\n.. toctree::\n\n") | |||||
fout.write("子模块\n------\n\n.. toctree::\n :maxdepth: 1\n\n") | |||||
for module in children[name]: | for module in children[name]: | ||||
fout.write(" " + module + "\n") | fout.write(" " + module + "\n") | ||||
@@ -168,10 +168,12 @@ texinfo_documents = [ | |||||
# -- Extension configuration ------------------------------------------------- | # -- Extension configuration ------------------------------------------------- | ||||
def maybe_skip_member(app, what, name, obj, skip, options): | def maybe_skip_member(app, what, name, obj, skip, options): | ||||
if name.startswith("_"): | |||||
return True | |||||
if obj.__doc__ is None: | if obj.__doc__ is None: | ||||
return True | return True | ||||
if name == "__init__": | |||||
return False | |||||
if name.startswith("_"): | |||||
return True | |||||
return False | return False | ||||
@@ -2,13 +2,12 @@ fastNLP.core | |||||
============ | ============ | ||||
.. automodule:: fastNLP.core | .. automodule:: fastNLP.core | ||||
:members: DataSet, Instance, FieldArray, Padder, AutoPadder, EngChar2DPadder, Vocabulary, DataSetIter, BatchIter, TorchLoaderIter, Const, Tester, Trainer, cache_results, seq_len_to_mask, get_seq_len, logger, Callback, GradientClipCallback, EarlyStopCallback, FitlogCallback, EvaluateCallback, LRScheduler, ControlC, LRFinder, TensorboardCallback, WarmupCallback, SaveModelCallback, EchoCallback, TesterCallback, CallbackException, EarlyStopError, LossFunc, CrossEntropyLoss, L1Loss, BCELoss, NLLLoss, LossInForward, AccuracyMetric, SpanFPreRecMetric, ExtractiveQAMetric, Optimizer, SGD, Adam, AdamW, SequentialSampler, BucketSampler, RandomSampler, Sampler | |||||
:inherited-members: | |||||
子模块 | 子模块 | ||||
------ | ------ | ||||
.. toctree:: | .. toctree:: | ||||
:maxdepth: 1 | |||||
fastNLP.core.batch | fastNLP.core.batch | ||||
fastNLP.core.callback | fastNLP.core.callback | ||||
@@ -9,6 +9,7 @@ fastNLP.embeddings | |||||
------ | ------ | ||||
.. toctree:: | .. toctree:: | ||||
:maxdepth: 1 | |||||
fastNLP.embeddings.bert_embedding | fastNLP.embeddings.bert_embedding | ||||
fastNLP.embeddings.char_embedding | fastNLP.embeddings.char_embedding | ||||
@@ -9,6 +9,7 @@ fastNLP.io | |||||
------ | ------ | ||||
.. toctree:: | .. toctree:: | ||||
:maxdepth: 1 | |||||
fastNLP.io.data_bundle | fastNLP.io.data_bundle | ||||
fastNLP.io.embed_loader | fastNLP.io.embed_loader | ||||
@@ -3,5 +3,4 @@ fastNLP.models.biaffine_parser | |||||
.. automodule:: fastNLP.models.biaffine_parser | .. automodule:: fastNLP.models.biaffine_parser | ||||
:members: BiaffineParser, GraphParser | :members: BiaffineParser, GraphParser | ||||
:inherited-members: | |||||
@@ -3,5 +3,4 @@ fastNLP.models.cnn_text_classification | |||||
.. automodule:: fastNLP.models.cnn_text_classification | .. automodule:: fastNLP.models.cnn_text_classification | ||||
:members: CNNText | :members: CNNText | ||||
:inherited-members: | |||||
@@ -3,12 +3,12 @@ fastNLP.models | |||||
.. automodule:: fastNLP.models | .. automodule:: fastNLP.models | ||||
:members: CNNText, SeqLabeling, AdvSeqLabel, ESIM, StarTransEnc, STSeqLabel, STNLICls, STSeqCls, BiaffineParser, GraphParser | :members: CNNText, SeqLabeling, AdvSeqLabel, ESIM, StarTransEnc, STSeqLabel, STNLICls, STSeqCls, BiaffineParser, GraphParser | ||||
:inherited-members: | |||||
子模块 | 子模块 | ||||
------ | ------ | ||||
.. toctree:: | .. toctree:: | ||||
:maxdepth: 1 | |||||
fastNLP.models.biaffine_parser | fastNLP.models.biaffine_parser | ||||
fastNLP.models.cnn_text_classification | fastNLP.models.cnn_text_classification | ||||
@@ -3,5 +3,4 @@ fastNLP.models.sequence_labeling | |||||
.. automodule:: fastNLP.models.sequence_labeling | .. automodule:: fastNLP.models.sequence_labeling | ||||
:members: SeqLabeling, AdvSeqLabel | :members: SeqLabeling, AdvSeqLabel | ||||
:inherited-members: | |||||
@@ -3,5 +3,4 @@ fastNLP.models.snli | |||||
.. automodule:: fastNLP.models.snli | .. automodule:: fastNLP.models.snli | ||||
:members: ESIM | :members: ESIM | ||||
:inherited-members: | |||||
@@ -3,5 +3,4 @@ fastNLP.models.star_transformer | |||||
.. automodule:: fastNLP.models.star_transformer | .. automodule:: fastNLP.models.star_transformer | ||||
:members: StarTransEnc, STNLICls, STSeqCls, STSeqLabel | :members: StarTransEnc, STNLICls, STSeqCls, STSeqLabel | ||||
:inherited-members: | |||||
@@ -3,5 +3,4 @@ fastNLP.modules.decoder | |||||
.. automodule:: fastNLP.modules.decoder | .. automodule:: fastNLP.modules.decoder | ||||
:members: MLP, ConditionalRandomField, viterbi_decode, allowed_transitions | :members: MLP, ConditionalRandomField, viterbi_decode, allowed_transitions | ||||
:inherited-members: | |||||
@@ -3,5 +3,4 @@ fastNLP.modules.encoder | |||||
.. automodule:: fastNLP.modules.encoder | .. automodule:: fastNLP.modules.encoder | ||||
:members: ConvolutionCharEncoder, LSTMCharEncoder, ConvMaxpool, LSTM, StarTransformer, TransformerEncoder, VarRNN, VarLSTM, VarGRU, MaxPool, MaxPoolWithMask, AvgPool, AvgPoolWithMask, MultiHeadAttention | :members: ConvolutionCharEncoder, LSTMCharEncoder, ConvMaxpool, LSTM, StarTransformer, TransformerEncoder, VarRNN, VarLSTM, VarGRU, MaxPool, MaxPoolWithMask, AvgPool, AvgPoolWithMask, MultiHeadAttention | ||||
:inherited-members: | |||||
@@ -3,12 +3,12 @@ fastNLP.modules | |||||
.. automodule:: fastNLP.modules | .. automodule:: fastNLP.modules | ||||
:members: ConvolutionCharEncoder, LSTMCharEncoder, ConvMaxpool, LSTM, StarTransformer, TransformerEncoder, VarRNN, VarLSTM, VarGRU, MaxPool, MaxPoolWithMask, AvgPool, AvgPoolWithMask, MultiHeadAttention, MLP, ConditionalRandomField, viterbi_decode, allowed_transitions, TimestepDropout | :members: ConvolutionCharEncoder, LSTMCharEncoder, ConvMaxpool, LSTM, StarTransformer, TransformerEncoder, VarRNN, VarLSTM, VarGRU, MaxPool, MaxPoolWithMask, AvgPool, AvgPoolWithMask, MultiHeadAttention, MLP, ConditionalRandomField, viterbi_decode, allowed_transitions, TimestepDropout | ||||
:inherited-members: | |||||
子模块 | 子模块 | ||||
------ | ------ | ||||
.. toctree:: | .. toctree:: | ||||
:maxdepth: 1 | |||||
fastNLP.modules.decoder | fastNLP.modules.decoder | ||||
fastNLP.modules.encoder | fastNLP.modules.encoder | ||||
@@ -3,5 +3,4 @@ fastNLP.modules.utils | |||||
.. automodule:: fastNLP.modules.utils | .. automodule:: fastNLP.modules.utils | ||||
:members: initial_parameter, summary | :members: initial_parameter, summary | ||||
:inherited-members: | |||||
@@ -9,6 +9,7 @@ fastNLP | |||||
------ | ------ | ||||
.. toctree:: | .. toctree:: | ||||
:maxdepth: 1 | |||||
fastNLP.core | fastNLP.core | ||||
fastNLP.embeddings | fastNLP.embeddings | ||||