Skip to content
This repository was archived by the owner on Jan 15, 2024. It is now read-only.

Commit adc3046

Browse files
authored
Improve Documentation (#1374)
1 parent b994b25 commit adc3046

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+806
-566
lines changed

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ docs/html
115115

116116
# release
117117
scripts/*.zip
118-
docs/examples/*.zip
119-
docs/examples/*/*.ipynb
118+
docs/tutorials/*.zip
119+
docs/tutorials/*/*.ipynb
120120

121121
conda
122122

Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ROOTDIR = $(CURDIR)
1919
MD2IPYNB = $(ROOTDIR)/docs/md2ipynb.py
2020

2121
docs: docs_local
22-
for f in $(shell find docs/examples -type f -name '*.md' -print) ; do \
22+
for f in $(shell find docs/tutorials -type f -name '*.md' -print) ; do \
2323
FILE=`echo $$f | sed 's/docs\///g'` ; \
2424
DIR=`dirname $$FILE` ; \
2525
BASENAME=`basename $$FILE` ; \
@@ -54,7 +54,7 @@ clean:
5454
git clean -ff -d -x --exclude="$(ROOTDIR)/tests/data/*" --exclude="$(ROOTDIR)/conda/" --exclude="$(ROOTDIR)/.idea/"
5555

5656
compile_notebooks:
57-
for f in $(shell find docs/examples -type f -name '*.md' -print) ; do \
57+
for f in $(shell find docs/tutorials -type f -name '*.md' -print) ; do \
5858
DIR=$$(dirname $$f) ; \
5959
BASENAME=$$(basename $$f) ; \
6060
TARGETNAME=$${BASENAME%.md}.ipynb ; \
@@ -73,7 +73,7 @@ dist_scripts:
7373
find * -type d -prune | grep -v 'tests\|__pycache__' | xargs -t -n 1 -I{} zip -r {}.zip {}
7474

7575
dist_notebooks:
76-
cd docs/examples && \
76+
cd docs/tutorials && \
7777
find * -type d -prune | grep -v 'tests\|__pycache__' | xargs -t -n 1 -I{} zip -r {}.zip {} -x "*.md" -x "__pycache__" -x "*.pyc" -x "*.txt" -x "*.log" -x "*.params" -x "*.npz" -x "*.json"
7878

7979
distribute: dist_scripts dist_notebooks

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
<h2 align="center">
2+
<a href="https://github.com/dmlc/gluon-nlp"><img src="https://raw.githubusercontent.com/dmlc/gluon-nlp/master/docs/_static/gluon-logo.svg" alt="GluonNLP Logo" width="500"/></a>
3+
</h2>
4+
15
<h2 align="center">
26
GluonNLP: Your Choice of Deep Learning for NLP
37
</h2>

docs/README.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
The documentation of gluonnlp is generated with recommonmark and sphinx.
1+
The documentation of GluonNLP is generated with recommonmark and sphinx.
22

33
- pip install sphinx>=1.5.5 sphinx-gallery sphinx_rtd_theme matplotlib Image recommonmark
4+
5+
For more details, refer to [website/configuration.rst](website/configuration.rst)

docs/api/attention.rst

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
gluonnlp.attention_cell
2+
=======================
3+
4+
GluonNLP Toolkit provides ways to implement the attention mechanism that is prevailing in NLP models.
5+
6+
.. currentmodule:: gluonnlp.attention_cell
7+
8+
Attention Mechanism
9+
-------------------
10+
11+
.. automodule:: gluonnlp.attention_cell
12+
:members:
13+
:imported-members:
14+
:special-members: __contains__, __getitem__, __setitem__
15+

docs/api/data.rst

+32-4
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,39 @@ GluonNLP Toolkit provides tools for building efficient data pipelines for NLP ta
55

66
.. currentmodule:: gluonnlp.data
77

8+
Tokenizers
9+
----------
10+
.. automodule:: gluonnlp.data.tokenizers
11+
:members:
12+
:imported-members:
13+
:special-members: __contains__, __getitem__, __setitem__
814

9-
API Reference
10-
-------------
11-
12-
.. automodule:: gluonnlp.data
15+
Vocabulary
16+
----------
17+
.. automodule:: gluonnlp.data.vocab
1318
:members:
1419
:imported-members:
1520
:special-members: __contains__, __getitem__, __setitem__
21+
22+
Batchify Function
23+
-----------------
24+
.. automodule:: gluonnlp.data.batchify
25+
:members:
26+
27+
Data Sampler
28+
------------
29+
.. automodule:: gluonnlp.data.sampler
30+
:members:
31+
:imported-members:
32+
33+
Text Filtering
34+
--------------
35+
.. automodule:: gluonnlp.data.filtering
36+
:members:
37+
:imported-members:
38+
39+
Data Loading
40+
------------
41+
.. automodule:: gluonnlp.data.loading
42+
:members:
43+
:imported-members:

docs/api/index.rst

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ API Documentation
22
=================
33

44
.. toctree::
5-
:maxdepth: 2
5+
:maxdepth: 3
66

77
data
88
embedding
99
models
10+
attention
11+
layers
12+
operators
13+
sequence_sampler
1014
utils

docs/api/layers.rst

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
gluonnlp.layers
2+
===============
3+
4+
GluonNLP Toolkit provides some common layers that can help you build NLP models.
5+
6+
.. currentmodule:: gluonnlp.layers
7+
8+
Layers
9+
------
10+
11+
.. automodule:: gluonnlp.layers
12+
:members:
13+
:imported-members:
14+
:special-members: __contains__, __getitem__, __setitem__
15+

docs/api/models.rst

+5-4
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ gluonnlp.models
22
===============
33

44
GluonNLP Toolkit supplies models for common NLP tasks with pre-trained weights. By default,
5-
all requested pre-trained weights are downloaded from public repo and stored in ~/.mxnet/models/.
5+
all requested pre-trained weights are downloaded from public repo and stored in `~/.gluonnlp/models/`.
66

77
.. currentmodule:: gluonnlp.models
8+
.. autosummary::
89

9-
API Reference
10-
-------------
11-
10+
Models
11+
------
1212
.. automodule:: gluonnlp.models
1313
:members:
14+
:no-inherited-members:
1415
:imported-members:
1516
:special-members: __contains__, __getitem__, __setitem__

docs/api/operators.rst

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
gluonnlp.op
2+
===============
3+
4+
GluonNLP Toolkit provides some functions that can help you build NLP architectures and training pipelines.
5+
6+
.. currentmodule:: gluonnlp.op
7+
8+
Layers
9+
------
10+
11+
.. automodule:: gluonnlp.op
12+
:members:
13+
:imported-members:
14+
:special-members: __contains__, __getitem__, __setitem__
15+

docs/api/sequence_sampler.rst

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
gluonnlp.sequence_sampler
2+
=========================
3+
4+
GluonNLP Toolkit provides ways to sample from a sequence generator.
5+
6+
.. currentmodule:: gluonnlp.sequence_sampler
7+
8+
Sequence Sampler
9+
----------------
10+
11+
.. automodule:: gluonnlp.sequence_sampler
12+
:members:
13+
:imported-members:
14+
:special-members: __contains__, __getitem__, __setitem__
15+

docs/conf.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@
122122

123123
# List of patterns, relative to source directory, that match files and
124124
# directories to ignore when looking for source files.
125-
exclude_patterns = ['_build', '**.ipynb_checkpoints', 'examples/*/*/**.rst', 'model_zoo/*/*/**.rst',
126-
'model_zoo/word_embeddings/tools/extern/*/**.md', 'examples/*/**.md',
125+
exclude_patterns = ['_build', '**.ipynb_checkpoints', 'tutorials/*/*/**.rst', 'model_zoo/*/*/**.rst',
126+
'model_zoo/word_embeddings/tools/extern/*/**.md', 'tutorials/*/**.md',
127127
'model_zoo/*/**.md', 'model_zoo/*/*/**.md', 'model_zoo/*/*/**.rst']
128128

129129
# The reST default role (used for this markup: `text`) to use for all
+12-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
Model Zoo
2-
---------
1+
Examples
2+
--------
33

44
.. container:: cards
55

66
.. card::
77
:title: Benchmarking the Performance of NLP Backbones
88
:link: model_zoo/benchmarks/index.html
99

10-
Placeholder.
10+
Benchmarking the performance of NLP models.
11+
We released the benchmarking script that compares different NLP packages.
1112

1213
.. card::
1314
:title: Conversion Scripts
@@ -19,35 +20,37 @@ Model Zoo
1920
:title: Datasets
2021
:link: model_zoo/datasets/index.html
2122

22-
Placeholder.
23+
Example about the datasets supported by `nlp_data`
2324

2425
.. card::
2526
:title: Generation
2627
:link: model_zoo/generation/index.html
2728

28-
Placeholder.
29+
Example about how to generate from a pretrained GPT-2 model with GluonNLP.
30+
We provided the generation script and tried to compare different sampling methods.
2931

3032
.. card::
3133
:title: Machine Translation
3234
:link: model_zoo/machine_translation/index.html
3335

34-
From "Hello" to "Bonjour".
36+
Train machine translation model with GluonNLP.
3537

3638
.. card::
3739
:title: Data Preprocessing Toolkit in GluonNLP
3840
:link: model_zoo/processing/index.html
3941

40-
Placeholder.
42+
Example about the data processing toolkit (`nlp_process`) offered in GluonNLP.
4143

4244
.. card::
4345
:title: Pretraining Model
4446
:link: model_zoo/pretraining/index.html
4547

46-
Placeholder.
48+
Examples about pretraining your own backbones.
4749

4850
.. card::
4951
:title: Question Answering Examples
5052
:link: model_zoo/question_answering/index.html
5153

52-
Placeholder.
54+
Run SQuAD 1.1 and 2.0 finetuning with GluonNLP. You will know how to run the models with
55+
mixed-precision training (AMP) and Horovod.
5356

docs/index.rst

+7-8
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ computes the cosine similarity between two words.
3737
</script>
3838

3939

40-
.. include:: model_zoo.rst
40+
.. include:: examples.rst
4141

42-
And more in :doc:`tutorials <examples/index>`.
42+
And more in :doc:`tutorials <tutorials/index>`.
4343

4444

4545
.. include:: install.rst
@@ -50,18 +50,17 @@ About GluonNLP
5050

5151
.. hint::
5252

53-
You can find our the doc for our master development branch `here <http://gluon-nlp.mxnet.io/master/index.html>`_.
53+
You can find out the doc for our master development branch `here <http://nlp.gluon.ai/master/index.html>`_.
5454

5555
GluonNLP provides implementations of the state-of-the-art (SOTA) deep learning
5656
models in NLP, and build blocks for text data pipelines and models.
5757
It is designed for engineers, researchers, and students to fast prototype
5858
research ideas and products based on these models. This toolkit offers five main features:
5959

60-
1. Training scripts to reproduce SOTA results reported in research papers.
60+
1. Carefully designed APIs that greatly reduce the implementation complexity.
6161
2. Pre-trained models for common NLP tasks.
62-
3. Carefully designed APIs that greatly reduce the implementation complexity.
63-
4. Tutorials to help get started on new NLP tasks.
64-
5. Community support.
62+
3. Tutorials to help get started on new NLP tasks.
63+
4. Community support.
6564

6665
This toolkit assumes that users have basic knowledge about deep learning and
6766
NLP. Otherwise, please refer to an introductory course such as
@@ -76,8 +75,8 @@ You may find the 60-min Gluon crash course linked from there especially helpful.
7675
:hidden:
7776
:maxdepth: 2
7877

78+
tutorials/index
7979
model_zoo/index
80-
examples/index
8180
api/index
8281
website/index
8382
genindex

0 commit comments

Comments
 (0)