• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.github/H13-Aug-2020-7555

ci/H13-Aug-2020-2,8412,460

docs/H07-May-2022-10,6357,995

env/H13-Aug-2020-222217

examples/H13-Aug-2020-

mms/H13-Aug-2020-10766

scripts/H13-Aug-2020-29,37522,158

src/gluonnlp/H13-Aug-2020-27,58322,214

tests/H13-Aug-2020-7,2785,720

tools/H13-Aug-2020-459375

.coveragercH A D13-Aug-2020211 1613

.gitignoreH A D13-Aug-20201.5 KiB135104

.gitmodulesH A D13-Aug-2020475 1110

.pylintrcH A D13-Aug-202014.7 KiB426297

.pytype.cfgH A D13-Aug-2020237 97

CODEOWNERSH A D13-Aug-2020524 1310

CODE_OF_CONDUCT.mdH A D13-Aug-20203.3 KiB7858

CONTRIBUTING.mdH A D13-Aug-202091 21

LICENSEH A D13-Aug-202011.1 KiB202169

MANIFEST.inH A D13-Aug-2020120 55

MakefileH A D13-Aug-20204.2 KiB11683

README.rstH A D13-Aug-20208 KiB219146

codecov.ymlH A D13-Aug-2020431 3126

conftest.pyH A D13-Aug-20207.1 KiB208126

pytest.iniH A D13-Aug-2020773 1816

setup.pyH A D13-Aug-20202.4 KiB10084

README.rst

1.. raw:: html
2
3   <a href="http://gluon-nlp.mxnet.io/master/index.html"><p align="center"><img width="25%" src="https://github.com/dmlc/gluon-nlp/raw/be3bc8852155e935d68d397e0743715c54c3ce76/docs/_static/gluon_s2.png" /></a>
4   </p>
5
6.. raw:: html
7
8   <h3 align="center">
9
10GluonNLP: Your Choice of Deep Learning for NLP
11
12.. raw:: html
13
14   </h3>
15
16.. raw:: html
17
18   <a href='http://ci.mxnet.io/job/gluon-nlp/job/master/'><img src='https://img.shields.io/badge/python-3.5%2C3.7-blue.svg'></a>
19   <a href='https://codecov.io/gh/dmlc/gluon-nlp'><img src='https://codecov.io/gh/dmlc/gluon-nlp/branch/master/graph/badge.svg'></a>
20   <a href='http://ci.mxnet.io/job/gluonnlp-py3-master-gpu-doc/job/master/'><img src='http://ci.mxnet.io/buildStatus/icon?job=gluonnlp-py3-master-gpu-doc%2Fmaster'></a>
21   <a href='https://pypi.org/project/gluonnlp/#history'><img src='https://img.shields.io/pypi/v/gluonnlp.svg'></a>
22
23GluonNLP is a toolkit that enables easy text preprocessing, datasets
24loading and neural models building to help you speed up your Natural
25Language Processing (NLP) research.
26
27- `Quick Start Guide <https://github.com/dmlc/gluon-nlp#quick-start-guide>`__
28- `Resources <https://github.com/dmlc/gluon-nlp#resources>`__
29
30News
31====
32
33- Tutorial proposal for GluonNLP is accepted at `EMNLP 2019 <https://www.emnlp-ijcnlp2019.org>`__, Hong Kong.
34
35- GluonNLP was featured in:
36
37  - **KDD 2019 Alaska**! Check out our tutorial: `From Shallow to Deep Language Representations: Pre-training, Fine-tuning, and Beyond <http://kdd19.mxnet.io>`__.
38  - **JSALT 2019 in Montreal, 2019-6-14**! Checkout **https://jsalt19.mxnet.io**.
39  - **AWS re:invent 2018 in Las Vegas, 2018-11-28**! Checkout `details <https://www.portal.reinvent.awsevents.com/connect/sessionDetail.ww?SESSION_ID=88736>`_.
40  - **PyData 2018 NYC, 2018-10-18**! Checkout the `awesome talk <https://pydata.org/nyc2018/schedule/presentation/76/>`__ by Sneha Jha.
41  - **KDD 2018 London, 2018-08-21, Apache MXNet Gluon tutorial**! Check out **https://kdd18.mxnet.io**.
42
43Installation
44============
45
46Make sure you have Python 3.5 or newer and a recent version of MXNet (our CI
47server runs the testsuite with Python 3.5).
48
49You can install ``MXNet`` and ``GluonNLP`` using pip.
50
51``GluonNLP`` is based on the most recent version of ``MXNet``.
52
53
54In particular, if you want to install the most recent ``MXNet`` release:
55
56::
57
58    pip install --upgrade mxnet>=1.6.0
59
60Else, if you want to install the most recent ``MXNet`` nightly build:
61
62::
63
64    pip install --pre --upgrade mxnet
65
66Then, you can install ``GluonNLP``:
67
68::
69
70    pip install gluonnlp
71
72Please check more `installation details <https://github.com/dmlc/gluon-nlp/blob/master/docs/install.rst>`_.
73
74Docs ��
75=======
76
77GluonNLP documentation is available at `our
78website <http://gluon-nlp.mxnet.io/master/index.html>`__.
79
80Community
81=========
82
83GluonNLP is a community that believes in sharing.
84
85For questions, comments, and bug reports, `Github issues <https://github.com/dmlc/gluon-nlp/issues>`__ is the best way to reach us.
86
87We now have a new Slack channel `here <https://apache-mxnet.slack.com/messages/CCCDM10V9>`__.
88(`register <https://join.slack.com/t/apache-mxnet/shared_invite/enQtNDQyMjAxMjQzMTI3LTkzMzY3ZmRlNzNjNGQxODg0N2Y5NmExMjEwOTZlYmIwYTU2ZTY4ZjNlMmEzOWY5MGQ5N2QxYjhlZTFhZTVmYTc>`__).
89
90How to Contribute
91=================
92
93GluonNLP community welcomes contributions from anyone!
94
95There are lots of opportunities for you to become our `contributors <https://github.com/dmlc/gluon-nlp/graphs/contributors>`__:
96
97- Ask or answer questions on `GitHub issues <https://github.com/dmlc/gluon-nlp/issues>`__.
98- Propose ideas, or review proposed design ideas on `GitHub issues <https://github.com/dmlc/gluon-nlp/issues>`__.
99- Improve the `documentation <http://gluon-nlp.mxnet.io/master/index.html>`__.
100- Contribute bug reports `GitHub issues <https://github.com/dmlc/gluon-nlp/issues>`__.
101- Write new `scripts <https://github.com/dmlc/gluon-nlp/tree/master/scripts>`__ to reproduce
102  state-of-the-art results.
103- Write new `examples <https://github.com/dmlc/gluon-nlp/tree/master/docs/examples>`__ to explain
104  key ideas in NLP methods and models.
105- Write new `public datasets <https://github.com/dmlc/gluon-nlp/tree/master/gluonnlp/data>`__
106  (license permitting).
107- Most importantly, if you have an idea of how to contribute, then do it!
108
109For a list of open starter tasks, check `good first issues <https://github.com/dmlc/gluon-nlp/labels/good%20first%20issue>`__.
110
111Also see our `contributing
112guide <http://gluon-nlp.mxnet.io/master/how_to/contribute.html>`__ on simple how-tos,
113contribution guidelines and more.
114
115Resources
116=========
117
118Check out how to use GluonNLP for your own research or projects.
119
120If you are new to Gluon, please check out our `60-minute crash course
121<http://gluon-crash-course.mxnet.io/>`__.
122
123For getting started quickly, refer to notebook runnable examples at
124`Examples. <http://gluon-nlp.mxnet.io/master/examples/index.html>`__
125
126For advanced examples, check out our
127`Scripts. <http://gluon-nlp.mxnet.io/master/scripts/index.html>`__
128
129For experienced users, check out our
130`API Notes <http://gluon-nlp.mxnet.io/master/api/index.html>`__.
131
132Quick Start Guide
133=================
134
135`Dataset Loading <http://gluon-nlp.mxnet.io/master/api/notes/data_api.html>`__
136-------------------------------------------------------------------------------
137
138Load the Wikitext-2 dataset, for example:
139
140.. code:: python
141
142    >>> import gluonnlp as nlp
143    >>> train = nlp.data.WikiText2(segment='train')
144    >>> train[0:5]
145    ['=', 'Valkyria', 'Chronicles', 'III', '=']
146
147`Vocabulary Construction <http://gluon-nlp.mxnet.io/master/api/modules/vocab.html>`__
148-------------------------------------------------------------------------------------
149
150Build vocabulary based on the above dataset, for example:
151
152.. code:: python
153
154    >>> vocab = nlp.Vocab(counter=nlp.data.Counter(train))
155    >>> vocab
156    Vocab(size=33280, unk="<unk>", reserved="['<pad>', '<bos>', '<eos>']")
157
158`Neural Models Building <http://gluon-nlp.mxnet.io/master/api/modules/model.html>`__
159------------------------------------------------------------------------------------
160
161From the models package, apply a Standard RNN language model to the
162above dataset:
163
164.. code:: python
165
166    >>> model = nlp.model.language_model.StandardRNN('lstm', len(vocab),
167    ...                                              200, 200, 2, 0.5, True)
168    >>> model
169    StandardRNN(
170      (embedding): HybridSequential(
171        (0): Embedding(33280 -> 200, float32)
172        (1): Dropout(p = 0.5, axes=())
173      )
174      (encoder): LSTM(200 -> 200.0, TNC, num_layers=2, dropout=0.5)
175      (decoder): HybridSequential(
176        (0): Dense(200 -> 33280, linear)
177      )
178    )
179
180`Word Embeddings Loading <http://gluon-nlp.mxnet.io/master/api/modules/embedding.html>`__
181-----------------------------------------------------------------------------------------
182
183For example, load a GloVe word embedding, one of the state-of-the-art
184English word embeddings:
185
186.. code:: python
187
188    >>> glove = nlp.embedding.create('glove', source='glove.6B.50d')
189    # Obtain vectors for 'baby' in the GloVe word embedding
190    >>> type(glove['baby'])
191    <class 'mxnet.ndarray.ndarray.NDArray'>
192    >>> glove['baby'].shape
193    (50,)
194
195
196Reference Paper
197===============
198
199The bibtex entry for the `reference paper <https://arxiv.org/abs/1907.04433>`__ of GluonNLP is:
200
201.. code::
202
203   @article{gluoncvnlp2020,
204     author  = {Jian Guo and He He and Tong He and Leonard Lausen and Mu Li and Haibin Lin and Xingjian Shi and Chenguang Wang and Junyuan Xie and Sheng Zha and Aston Zhang and Hang Zhang and Zhi Zhang and Zhongyue Zhang and Shuai Zheng and Yi Zhu},
205     title   = {GluonCV and GluonNLP: Deep Learning in Computer Vision and Natural Language Processing},
206     journal = {Journal of Machine Learning Research},
207     year    = {2020},
208     volume  = {21},
209     number  = {23},
210     pages   = {1-7},
211     url     = {http://jmlr.org/papers/v21/19-429.html}
212   }
213
214
215New to Deep Learning or NLP?
216============================
217
218For background knowledge of deep learning or NLP, please refer to the open source book `Dive into Deep Learning <http://en.diveintodeeplearning.org/>`__.
219