diff --git a/docs/about/contributing.md b/docs/about/contributing.md index 50891f4f..39a3dd18 100644 --- a/docs/about/contributing.md +++ b/docs/about/contributing.md @@ -1,4 +1,4 @@ -# Contributing & Support +# Contributing & Support We are happy to accept contributions that make `Kashgari` better and more awesome! You could contribute in various ways: diff --git a/docs/about/release-notes.md b/docs/about/release-notes.md index 25769141..260d1f9a 100644 --- a/docs/about/release-notes.md +++ b/docs/about/release-notes.md @@ -17,6 +17,19 @@ pip show kashgari ## Current Release +### [2.0.0.alpha] - 2020.06.10 + +This is a fully re-implemented version with TF2. + +- ✨ Embeddings +- ✨ Text Classification Task +- ✨ Text Labeling Task +- ✨ Seq2Seq Task +- ✨ Examples + - ✨ Neural machine translation with Seq2Seq + - ✨ Benchmarks + + ### [1.1.1] - 2020.03.13 - ✨ Add BERTEmbeddingV2. diff --git a/docs/apis/generators.rst b/docs/apis/generators.rst index dbb17577..072a8027 100644 --- a/docs/apis/generators.rst +++ b/docs/apis/generators.rst @@ -10,7 +10,7 @@ CorpusGenerator .. autoclass:: kashgari.generators.CorpusGenerator :members: -BatchDataGenerator -================== -.. autoclass:: kashgari.generators.BatchDataGenerator +BatchDataSet +============ +.. autoclass:: kashgari.generators.BatchDataSet :members: diff --git a/docs/conf.py b/docs/conf.py index a205b502..ffccf673 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -78,7 +78,9 @@ def __getattr__(cls, name): 'sphinx.ext.intersphinx', 'sphinx.ext.autodoc', 'sphinx.ext.napoleon', - 'sphinx_autodoc_typehints' + 'sphinx_autodoc_typehints', + 'nbsphinx', + 'sphinx.ext.mathjax', ] # sphinx_autodoc_typehints settings @@ -325,12 +327,23 @@ def setup(app): from m2r import convert import typing + import shutil + typing.TYPE_CHECKING = True docs_path = pathlib.Path(__file__).parent original_readme = os.path.join(docs_path.parent, 'README.md') rst_readme = os.path.join(docs_path, 'README.rst') + # Copy Examples to docs folder for rendering + original_examples_folder = os.path.join(docs_path.parent, 'examples') + target_examples_folder = os.path.join(docs_path, 'examples') + shutil.rmtree(target_examples_folder, ignore_errors=True) + + shutil.copytree(original_examples_folder, + target_examples_folder, + symlinks=True) + # Change readme to rst file, and include in Sphinx index with open(rst_readme, 'w') as f: md_content = open(original_readme, 'r').read() diff --git a/docs/index.rst b/docs/index.rst index 28736f2c..03706d0a 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -18,10 +18,10 @@ :maxdepth: 2 :caption: Embeddings - embeddings/index.rst - embeddings/bare-embedding.rst - embeddings/word-embedding.rst - embeddings/bert-embedding.rst + embeddings/index + embeddings/bare-embedding + embeddings/word-embedding + embeddings/bert-embedding .. toctree:: :maxdepth: 3 @@ -33,9 +33,15 @@ apis/processors.rst apis/generators.rst +.. toctree:: + :maxdepth: 3 + :caption: Examples + + examples/translate_with_seq2seq.ipynb + .. toctree:: :maxdepth: 2 :caption: About - about/contributing.rst - about/release-notes.rst + about/contributing + about/release-notes diff --git a/docs/requirements.txt b/docs/requirements.txt index f0853aa2..e6e99e80 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -6,6 +6,7 @@ sphinx-markdown-tables sphinx-autodoc-typehints recommonmark m2r +nbsphinx # dependence numpy==1.18.1 diff --git a/examples/translate_with_seq2seq.ipynb b/examples/translate_with_seq2seq.ipynb index 2ed2308f..2fda5c1d 100644 --- a/examples/translate_with_seq2seq.ipynb +++ b/examples/translate_with_seq2seq.ipynb @@ -7,7 +7,8 @@ "id": "lY2BrIyFKbAP" }, "source": [ - "# Install dependences" + "# Neural machine translation with Seq2Seq\n", + "## Install dependences" ] }, { @@ -433,8 +434,8 @@ "\n", "%matplotlib inline\n", "\n", - "font_name = 'SIMHEI' \n", - "plt.rcParams['font.family'] = font_name #用来正常显示中文标签 \n", + "font_name = 'SIMHEI'\n", + "plt.rcParams['font.family'] = font_name #用来正常显示中文标签\n", "plt.rcParams['axes.unicode_minus']=False #用来正常显示负号\n", "zhfont = font_manager.FontProperties(fname='/usr/share/fonts/truetype/SimHei.ttf')\n", "\n", @@ -480,7 +481,7 @@ "plt.figure(figsize=(5,5))\n", "plt.plot(history.history['loss'])\n", "plt.xlabel('Epoch')\n", - "plt.ylabel('Loss') \n", + "plt.ylabel('Loss')\n", "plt.show()" ] }, @@ -776,4 +777,4 @@ }, "nbformat": 4, "nbformat_minor": 4 -} +} \ No newline at end of file diff --git a/requirements.dev.txt b/requirements.dev.txt index f15c2703..4f14dbd9 100644 --- a/requirements.dev.txt +++ b/requirements.dev.txt @@ -14,6 +14,7 @@ sphinx-markdown-tables sphinx-autodoc-typehints recommonmark m2r +nbsphinx # develop jupyterlab