Skip to content

Commit 04d0cfc

Browse files
committed
Add docs
1 parent 861746a commit 04d0cfc

File tree

9 files changed

+371
-0
lines changed

9 files changed

+371
-0
lines changed

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.http://sphinx-doc.org/
25+
exit /b 1
26+
)
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sphinx>=3.0

docs/source/conf.py

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
# import os
14+
# import sys
15+
# sys.path.insert(0, os.path.abspath('.'))
16+
17+
import supar
18+
19+
# -- Project information -----------------------------------------------------
20+
21+
project = 'SuPar'
22+
copyright = '2020, Yu Zhang'
23+
author = 'Yu Zhang'
24+
25+
# The short X.Y version
26+
version = supar.__version__
27+
# The full version, including alpha/beta/rc tags
28+
release = supar.__version__
29+
30+
31+
# -- General configuration ---------------------------------------------------
32+
33+
# Add any Sphinx extension module names here, as strings. They can be
34+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
35+
# ones.
36+
extensions = ['sphinx.ext.autodoc',
37+
'sphinx.ext.autosummary',
38+
'sphinx.ext.intersphinx',
39+
'sphinx.ext.mathjax',
40+
'sphinx.ext.napoleon',
41+
'sphinx.ext.todo',
42+
'sphinx.ext.viewcode']
43+
44+
# Add any paths that contain templates here, relative to this directory.
45+
templates_path = ['_templates']
46+
47+
# The suffix(es) of source filenames.
48+
# You can specify multiple suffix as a list of string:
49+
#
50+
# source_suffix = ['.rst', '.md']
51+
source_suffix = '.rst'
52+
53+
# The master toctree document.
54+
master_doc = 'index'
55+
56+
# The language for content autogenerated by Sphinx. Refer to documentation
57+
# for a list of supported languages.
58+
#
59+
# This is also used if you do content translation via gettext catalogs.
60+
# Usually you set "language" from the command line for these cases.
61+
language = None
62+
63+
# List of patterns, relative to source directory, that match files and
64+
# directories to ignore when looking for source files.
65+
# This pattern also affects html_static_path and html_extra_path.
66+
exclude_patterns = []
67+
68+
# The name of the Pygments (syntax highlighting) style to use.
69+
pygments_style = 'sphinx'
70+
71+
# -- Options for HTML output -------------------------------------------------
72+
73+
# The theme to use for HTML and HTML Help pages. See the documentation for
74+
# a list of builtin themes.
75+
#
76+
html_theme = 'sphinx_rtd_theme'
77+
78+
# Add any paths that contain custom static files (such as style sheets) here,
79+
# relative to this directory. They are copied after the builtin static files,
80+
# so a file named "default.css" will overwrite the builtin "default.css".
81+
html_static_path = []
82+
83+
# Example configuration for intersphinx: refer to the Python standard library.
84+
intersphinx_mapping = {
85+
'nltk': ('https://www.nltk.org', None),
86+
'numpy': ('https://numpy.org/doc/stable', None),
87+
'python': ('https://docs.python.org/3', None),
88+
'torch': ('https://pytorch.org/docs/stable', None)
89+
}
90+
91+
autodoc_member_order = 'bysource'

docs/source/index.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.. SuPar documentation master file, created by
2+
sphinx-quickstart on Sun Jul 26 00:02:20 2020.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
supar
7+
=================================
8+
The :mod:`supar` package provides a collection of state-of-the-art syntactic parsing models with Biaffine Parser as the basic architecture.
9+
10+
.. toctree::
11+
:maxdepth: 2
12+
:caption: Contents
13+
14+
self
15+
supar.parsers <parsers>
16+
supar.models <models>
17+
supar.modules <modules>
18+
supar.utils <utils>
19+
20+
Indices and tables
21+
==================
22+
23+
* :ref:`genindex`
24+
* :ref:`modindex`
25+
* :ref:`search`

docs/source/models.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
supar.models
2+
==================
3+
4+
.. currentmodule:: supar.models
5+
6+
BiaffineDependencyModel
7+
~~~~~~~~~~~~~~~~~~~~~~~~
8+
9+
.. autoclass:: BiaffineDependencyModel
10+
:members:
11+
12+
CRFNPDependencyModel
13+
~~~~~~~~~~~~~~~~~~~~~~~~
14+
15+
.. autoclass:: CRFNPDependencyModel
16+
:members:
17+
18+
CRFDependencyModel
19+
~~~~~~~~~~~~~~~~~~~~~~~~
20+
21+
.. autoclass:: CRFDependencyModel
22+
:members:
23+
24+
25+
CRF2oDependencyModel
26+
~~~~~~~~~~~~~~~~~~~~~~~~
27+
28+
.. autoclass:: CRF2oDependencyModel
29+
:members:
30+
31+
CRFConstituencyModel
32+
~~~~~~~~~~~~~~~~~~~~~~~~
33+
34+
.. autoclass:: CRFConstituencyModel
35+
:members:

docs/source/modules.rst

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
supar.modules
2+
==================
3+
4+
.. currentmodule:: supar.modules
5+
6+
Affine
7+
~~~~~~~~~~~~~~~~~~~~~~~~
8+
9+
.. autoclass:: Biaffine
10+
:members:
11+
12+
.. autoclass:: Triaffine
13+
:members:
14+
15+
BertEmbedding
16+
~~~~~~~~~~~~~~~~~~~~~~~~
17+
18+
.. autoclass:: BertEmbedding
19+
:members:
20+
21+
.. autoclass:: ScalarMix
22+
:members:
23+
24+
BiLSTM
25+
~~~~~~~~~~~~~~~~~~~~~~~~
26+
27+
.. autoclass:: BiLSTM
28+
:members:
29+
30+
CharLSTM
31+
~~~~~~~~~~~~~~~~~~~~~~~~
32+
33+
.. autoclass:: CharLSTM
34+
:members:
35+
36+
Dropout
37+
~~~~~~~~~~~~~~~~~~~~~~~~
38+
39+
.. autoclass:: IndependentDropout
40+
:members:
41+
42+
.. autoclass:: SharedDropout
43+
:members:
44+
45+
MLP
46+
~~~~~~~~~~~~~~~~~~~~~~~~
47+
48+
.. autoclass:: MLP
49+
:members:
50+
51+
TreeCRF
52+
~~~~~~~~~~~~~~~~~~~~~~~~
53+
54+
.. autoclass:: MatrixTree
55+
:members:
56+
57+
.. autoclass:: CRFDependency
58+
:members:
59+
60+
.. autoclass:: CRF2oDependency
61+
:members:
62+
63+
.. autoclass:: CRFConstituency
64+
:members:

docs/source/parsers.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
supar.parsers
2+
==================
3+
4+
.. currentmodule:: supar.parsers
5+
6+
Parser
7+
~~~~~~~~~~~~~~~~~~~~~~~~
8+
9+
.. autoclass:: Parser
10+
:members:
11+
12+
BiaffineDependencyParser
13+
~~~~~~~~~~~~~~~~~~~~~~~~
14+
15+
.. autoclass:: BiaffineDependencyParser
16+
:members:
17+
18+
CRFNPDependencyParser
19+
~~~~~~~~~~~~~~~~~~~~~~~~
20+
21+
.. autoclass:: CRFNPDependencyParser
22+
:members:
23+
24+
CRFDependencyParser
25+
~~~~~~~~~~~~~~~~~~~~~~~~
26+
27+
.. autoclass:: CRFDependencyParser
28+
:members:
29+
30+
CRF2oDependencyParser
31+
~~~~~~~~~~~~~~~~~~~~~~~~
32+
33+
.. autoclass:: CRF2oDependencyParser
34+
:members:
35+
36+
CRFConstituencyParser
37+
~~~~~~~~~~~~~~~~~~~~~~~~
38+
39+
.. autoclass:: CRFConstituencyParser
40+
:members:

docs/source/utils.rst

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
supar.utils
2+
==================
3+
4+
.. currentmodule:: supar.utils
5+
6+
Algorithms
7+
~~~~~~~~~~~~~~~~~~~~~~~~
8+
9+
.. autofunction:: supar.utils.alg.kmeans
10+
11+
.. autofunction:: supar.utils.alg.tarjan
12+
13+
.. autofunction:: supar.utils.alg.chuliu_edmonds
14+
15+
.. autofunction:: supar.utils.alg.mst
16+
17+
.. autofunction:: supar.utils.alg.eisner
18+
19+
.. autofunction:: supar.utils.alg.eisner2o
20+
21+
.. autofunction:: supar.utils.alg.cky
22+
23+
Dataset
24+
~~~~~~~~~~~~~~~~~~~~~~~~
25+
26+
.. autoclass:: Dataset
27+
:members:
28+
29+
Field
30+
~~~~~~~~~~~~~~~~~~~~~~~~
31+
32+
.. autoclass:: RawField
33+
:members:
34+
35+
.. autoclass:: Field
36+
:members:
37+
38+
.. autoclass:: SubwordField
39+
:members:
40+
41+
.. autoclass:: ChartField
42+
:members:
43+
44+
Transform
45+
~~~~~~~~~~~~~~~~~~~~~~~~
46+
47+
.. autoclass:: Transform
48+
:members:
49+
50+
.. autoclass:: CoNLL
51+
:members:
52+
53+
.. autoclass:: Tree
54+
:members:
55+
56+
Vocab
57+
~~~~~~~~~~~~~~~~~~~~~~~~
58+
59+
.. autoclass:: Vocab
60+
:members:

0 commit comments

Comments
 (0)