Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit 42664ad

Browse files
authored
Fixed tests (#345)
* Fixed tests by setting package versions * Documentation fixes
1 parent 86504a9 commit 42664ad

21 files changed

+84
-75
lines changed

doc/source/CONTRIBUTING.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ Contribution Process
1919

2020
1. File an issue (to track your contribution):
2121

22-
* Create an issue on github:
22+
* Create an issue on GitHub:
2323
https://github.com/NervanaSystems/nlp-architect/issues
2424

25-
2. Clone and/or update your checked out copy of nlp-achitect to ensure you have the
25+
2. Clone and/or update your checked out copy of nlp-architect to ensure you have the
2626
most recent commits from the master branch:
2727

2828
.. code-block:: bash
@@ -59,8 +59,8 @@ Contribution Process
5959
6060
nlp_architect doc # builds the doc and starts a local server directly
6161
62-
6. Commit your changes and push your feature branch to your github fork. Be
63-
sure to add a descriptive message and reference the github issue associated
62+
6. Commit your changes and push your feature branch to your GitHub fork. Be
63+
sure to add a descriptive message and reference the GitHub issue associated
6464
with your task (ex. #1). You will also want to rebase your commits down to
6565
a single sensible commit to make things clean for the merge process:
6666

doc/source/chunker.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ We used the CONLL2000_ shared task dataset in our example for training a phrase
4141
The CONLL2000_ dataset has a ``train_set`` and ``test_set`` sets consisting of 8926 and 2009 sentences annotated with Part-of-speech and chunking information.
4242
We implemented a dataset loader, :py:class:`CONLL2000 <nlp_architect.data.sequential_tagging.CONLL2000>`, for loading and parsing :py:class:`CONLL2000 <nlp_architect.data.sequential_tagging.CONLL2000>` data into numpy arrays ready to be used sequential tagging models. For full set of options please see :py:class:`CONLL2000 <nlp_architect.data.sequential_tagging.CONLL2000>`.
4343

44-
NLP Architect has a dataloader to easily load CONLL2000 which can be found in :py:class:`CONLL2000 <nlp_architect.data.sequential_tagging.CONLL2000>`. The loader supports the following feature generation when loading the dataset:
44+
NLP Architect has a data loader to easily load CONLL2000 which can be found in :py:class:`CONLL2000 <nlp_architect.data.sequential_tagging.CONLL2000>`. The loader supports the following feature generation when loading the dataset:
4545

4646
1. Sentence words in sparse int representation
4747
2. Part-of-speech tags of words
@@ -53,7 +53,7 @@ To get the dataset follow these steps:
5353

5454
1. download train and test files from dataset website.
5555
2. unzip files: ``gunzip *.gz``
56-
3. provide ``CONLL2000`` dataloader or ``train.py`` sample below the directory containing the files.
56+
3. provide ``CONLL2000`` data loader or ``train.py`` sample below the directory containing the files.
5757

5858
Model
5959
=====
@@ -76,7 +76,7 @@ Running Modalities
7676

7777
We provide a simple example for training and running inference using the :py:class:`SequenceChunker <nlp_architect.models.chunker.SequenceChunker>` model.
7878

79-
``examples/chunker/train.py`` will load CONLL2000 dataset and train a model using given training parameters (batch size, epochs, external word embedding, etc.), save the model once done training and print the performance of the model on the test set. The example supports loading GloVe/Fasttext word embedding models to be used when training a model. The training method used in this example trains on both POS and Chunk labels concurently with equal targer loss weights, this is different than what is described in the paper_.
79+
``examples/chunker/train.py`` will load CONLL2000 dataset and train a model using given training parameters (batch size, epochs, external word embedding, etc.), save the model once done training and print the performance of the model on the test set. The example supports loading GloVe/Fasttext word embedding models to be used when training a model. The training method used in this example trains on both POS and Chunk labels concurrently with equal target loss weights, this is different than what is described in the paper_.
8080

8181
``examples/chunker/inference.py`` will load a saved model and a given text file with sentences and print the chunks found on the stdout.
8282

doc/source/crosslingual_emb.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This model uses a GAN to learn mapping between two language embeddings without s
1010

1111
Files
1212
=====
13-
- **nlp_architect/data/fasttext_emb.py**: Defines fasttext object for loading fasttext embeddings
13+
- **nlp_architect/data/fasttext_emb.py**: Defines Fasttext object for loading Fasttext embeddings
1414
- **nlp_architect/models/crossling_emb.py**: Defines GAN for learning crosslingual embeddings
1515
- **examples/crosslingembs/train.py**: Trains the model and writes final crosslingual embeddings to weight_dir directory.
1616
- **examples/crosslingembs/evaluate.py**: Defines graph for evaluating the quality of crosslingual embeddings
@@ -19,7 +19,7 @@ Usage
1919
=====
2020
Main arguments which need to be passed to train.py are
2121

22-
- **emb_dir**: Directory where fasttext embeddings are present or need to be downloaded
22+
- **emb_dir**: Directory where Fasttext embeddings are present or need to be downloaded
2323
- **eval_dir**: Directory where evaluation dictionary is downloaded
2424
- **weight_dir**: Directory where final crosslingual dictionaries are defined
2525

doc/source/identifying_semantic_relation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ Examples
187187
188188
* Using Wikipedia Relation identifier for mentions of *'IBM'* and *'International Business Machines'* will result with the following relation types: ```WIKIPEDIA_CATEGORY, WIKIPEDIA_ALIASES, WIKIPEDIA_REDIRECT_LINK```
189189
190-
* Using WordNet Relation idenfieir for mentions of *'lawyer'* and *'attorney'* will result with the following relations types: ```WORDNET_SAME_SYNSET, WORDNET_DERIVATIONALLY```
190+
* Using WordNet Relation identifier for mentions of *'lawyer'* and *'attorney'* will result with the following relations types: ```WORDNET_SAME_SYNSET, WORDNET_DERIVATIONALLY```
191191
192192
* Using Referent-Dict Relation identifier for mentions of *'company'* and *'apple'* will result with ```REFERENT_DICT``` relation type.
193193

doc/source/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ Tensorflow has a guide `guide <https://www.tensorflow.org/install/install_source
112112

113113
Alternatively, follow the instructions below to compile and install the latest version of Tensorflow with MKL-DNN:
114114

115-
* Clone Tensorflow repository from github:
115+
* Clone Tensorflow repository from GitHub:
116116

117117
.. code::
118118

doc/source/intent.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ Models
3737
Multi-task Intent and slot tagging model
3838
----------------------------------------
3939

40-
:py:class:`MultiTaskIntentModel <nlp_architect.models.intent_extraction.MultiTaskIntentModel>` is a Multi-task model that is similar to the joint intent/slot tagging model. The model has 2 sources of input: 1 - words, 2 - characters of words. The model has 3 main features when compared to the other models, character information embedding acting as a feature extractor of the words, a CRF classifier for slot labels, and a cascasing structure of the intent and tag classificaion.
40+
:py:class:`MultiTaskIntentModel <nlp_architect.models.intent_extraction.MultiTaskIntentModel>` is a Multi-task model that is similar to the joint intent/slot tagging model. The model has 2 sources of input: 1 - words, 2 - characters of words. The model has 3 main features when compared to the other models, character information embedding acting as a feature extractor of the words, a CRF classifier for slot labels, and a cascading structure of the intent and tag classification.
4141
The intent classification is done by encoding the context of the sentences (words ``x_1, .., x_n``), using word embeddings (denoted as ``W``), by a bi-directional LSTM layer, and training a classifier on the last hidden state of the LSTM layer (using ``softmax``).
4242
Word-character embeddings (denoted as ``C``) are created using a bi-directional LSTM encoder which concatenates the last hidden states of the layers.
43-
The encoding of the word-context, in each time step (word location in the sentence) is concatenated with the word-charcter embeddings and pushed in another bi-directional LSTM which provides the final context encoding that a CRF layer uses for slot tag classification.
43+
The encoding of the word-context, in each time step (word location in the sentence) is concatenated with the word-character embeddings and pushed in another bi-directional LSTM which provides the final context encoding that a CRF layer uses for slot tag classification.
4444

4545
.. image :: assets/mtl_model.png
4646
@@ -72,7 +72,7 @@ We provide an additional dataset loader :py:class:`TabularIntentDataset <nlp_ar
7272
- each word encoded in a separate line: ``<token> <token_tag> <intent_type>``
7373
- sentences are separated with an empty line
7474

75-
The dataset loader extracts word and character sparse encoding and label/intent tags per sentence. This dataloader is useful for many intent extraction datasets that can be found on the web and used in academic literature (such as ATIS [3]_ [4]_, Conll, etc.).
75+
The dataset loader extracts word and character sparse encoding and label/intent tags per sentence. This data-loader is useful for many intent extraction datasets that can be found on the web and used in academic literature (such as ATIS [3]_ [4]_, Conll, etc.).
7676

7777
Files
7878
=====

doc/source/memn2n.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ End-to-End Memory Networks for Goal Oriented Dialogue
1919

2020
Overview
2121
========
22-
This directory contains an implementation of an End-to-End Memory Network for goal oriented dialogue in ngraph.
22+
This directory contains an implementation of an End-to-End Memory Network for goal oriented dialogue in TensorFlow.
2323

2424
Goal oriented dialogue is a subset of open-domain dialogue where an automated agent has a specific
2525
goal for the outcome of the interaction. At a high level, the system needs to understand a user

doc/source/ner_crf.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ In the above format each sentence is separated by an empty line. Each line consi
4949
Data loader
5050
-----------
5151

52-
Loading data into the model can be done using the :py:class:`SequentialTaggingDataset <nlp_architect.data.sequential_tagging.SequentialTaggingDataset>` data loader which can be used with the preprared train and test data sets described above.
52+
Loading data into the model can be done using the :py:class:`SequentialTaggingDataset <nlp_architect.data.sequential_tagging.SequentialTaggingDataset>` data loader which can be used with the prepared train and test data sets described above.
5353

54-
The data loader returns 2 numpy matrices:
54+
The data loader returns 2 Numpy matrices:
5555
1. sparse word representation of the sentence words
5656
2. sparse word character representation of sentence words
5757

@@ -83,7 +83,7 @@ Prediction layer
8383

8484
The main tagger model consists of a bidirectional LSTM layers. The input of the LSTM layers consists of a concatenation of the word embedding vector and the character embedding vector (provided by the character embedding network).
8585

86-
Finally, the output of the LSTM layers are merged into a fully-connected layer (for each token) and fed into a `Conditional Random Field classifier`_. CRF prediction layers have been empirically proved to provide more accuract models when compared to single token prediction (when using a `softmax` layer).
86+
Finally, the output of the LSTM layers are merged into a fully-connected layer (for each token) and fed into a `Conditional Random Field classifier`_. Using CRF has been empirically shown to provide more accurate models when compared to single token prediction layers (such as a `softmax` layer).
8787

8888
Running Modalities
8989
==================

doc/source/np2vec.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ This code consists in training a word embedding's model for Noun NP's using word
2424
It assumes that the NP's are already extracted and marked in the input corpus.
2525
All the terms in the corpus are used as context in order to train the word embedding's model; however,
2626
at the end of the training, only the word embedding's of the NP's are stored, except for the case of
27-
fasttext training with word_ngrams=1; in this case, we store all the word embedding's,
27+
Fasttext training with word_ngrams=1; in this case, we store all the word embedding's,
2828
including non-NP's in order to be able to estimate word embeddings of out-of-vocabulary NP's
2929
(NP's that don't appear in the training corpora).
3030

@@ -69,7 +69,7 @@ To run inference with a saved model, the following command can be used:
6969
python examples/np2vec/inference.py --np2vec_model_file sample_np2vec.model --np <noun phrase>
7070
7171
72-
More details about the hyperparameters at https://radimrehurek.com/gensim/models/word2vec.html#gensim.models.word2vec.Word2Vec for word2vec and https://radimrehurek.com/gensim/models/fasttext.html#gensim.models.fasttext.FastText for fasttext.
72+
More details about the hyperparameters at https://radimrehurek.com/gensim/models/word2vec.html#gensim.models.word2vec.Word2Vec for word2vec and https://radimrehurek.com/gensim/models/fasttext.html#gensim.models.fasttext.FastText for Fasttext.
7373

7474
.. _word2vec: https://code.google.com/archive/p/word2vec/
7575
.. _fasttext: https://github.com/facebookresearch/fastText

doc/source/publications.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ Blog posts
2424
- `Revolutionizing Personal Assistant Through Understanding Actionable Requests in Human-to-Human Interactions <https://ai.intel.com/revolutionizing-personal-assistant-through-understanding-actionable-requests-in-human-to-human-interactions/>`_
2525
- `Introducing NLP Architect by Intel AI Lab <https://ai.intel.com/introducing-nlp-architect-by-intel-ai-lab/>`_
2626
- `Deep Learning Foundations to Enable Natural Language Processing Solutions <https://ai.intel.com/deep-learning-foundations-to-enable-natural-language-processing-solutions/>`_
27+
- `NLP Architect by Intel AI Lab: Release 0.2 <https://ai.intel.com/nlp-architect-by-intel-ai-lab-release-0-2/>`_
28+
- `NLP Architect Version 0.3 Release <https://ai.intel.com/nlp-architect-version-0-3-release/>`_
29+
- `Compressing GNMT Models <https://ai.intel.com/compressing-gnmt-models/>`_
2730

2831
Conference Proceedings
2932
======================
@@ -37,7 +40,7 @@ Tutorials
3740

3841
- Natural Language Question/Answer Systems: Hands on Workshop - Andy Keller, Anna Bethke (`video <http://aidc.gallery.video/detail/videos/day-1:-hands-on-labs/video/5789368925001/natural-language-question-answer-systems:-hands-on-workshop?autoStart=false>`_, `slides <https://simplecore.intel.com/nervana/wp-content/uploads/sites/53/2018/06/AI-Devcon-Session-Natural-Language_AnnaBethkeAndyKeller_Interstellar_523_Final.pdf>`_)
3942
- Using Deep Learning for Entity Detection and Intent Extraction in Natural Language: Hands on Workshop - Peter Izsak (`video <http://aidc.gallery.video/detail/videos/day-2:-hands-on-labs/video/5790623335001/using-deep-learning-for-entity-detection-and-intent-extraction-in-natural-language?autoStart=false>`_, `slides <https://simplecore.intel.com/nervana/wp-content/uploads/sites/53/2018/06/IntelAIDC18_Izsak_Odyessey_524_Final.pdf>`_)
40-
43+
4144
- Classifying NLP with Deep Learning: webinar - Anna Bethke (`video <https://software.intel.com/en-us/videos/deep-learning-and-natural-language-processing>`_)
4245

4346
Demos

doc/source/reading_comprehension.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ After training starts, you will see outputs similar to this:
9696
creating training and development sets
9797
Match LSTM Pass
9898
Answer Pointer Pass
99-
Settting up Loss
100-
Set up optmizer
99+
Setting up Loss
100+
Set up optimizer
101101
Begin Training
102102
Epoch Number: 0
103103
iteration = 1, train loss = 13.156427383422852

doc/source/service.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ The request content has the following format:
7676
]
7777
}
7878
79-
In the example above, ``model_name`` is the desirted model to run the documents through and each input document is marked with an id and content.
79+
In the example above, ``model_name`` is the desired model to run the documents through and each input document is marked with an id and content.
8080

8181
Responses
8282
---------

doc/source/spacy_np_annotator.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The annotator implementation can be found in :py:class:`NPAnnotator <nlp_archite
2828

2929
Usage example
3030
-------------
31-
Loading a spacy pipeline and adding a sentence breaker (required) and :py:class:`NPAnnotator <nlp_architect.pipelines.spacy_np_annotator.NPAnnotator>` annotator as the last annotator in the pipeline:
31+
Loading a Spacy pipeline and adding a sentence breaker (required) and :py:class:`NPAnnotator <nlp_architect.pipelines.spacy_np_annotator.NPAnnotator>` annotator as the last annotator in the pipeline:
3232

3333
.. code:: python
3434
@@ -47,12 +47,12 @@ Parse documents regularly and get the noun phrase annotations using a dedicated
4747
Standalone Spacy-NPAnnotator
4848
============================
4949

50-
For usecases in which the user is not interested in specialized Spacy pipelines we have implemented :py:class:`SpacyNPAnnotator <nlp_architect.pipelines.spacy_np_annotator.SpacyNPAnnotator>` which will run a spacy pipeline internally and provide string based noun phrase chunks given documents in string format.
50+
For use cases in which the user is not interested in specialized Spacy pipelines we have implemented :py:class:`SpacyNPAnnotator <nlp_architect.pipelines.spacy_np_annotator.SpacyNPAnnotator>` which will run a Spacy pipeline internally and provide string based noun phrase chunks given documents in string format.
5151

5252
Usage example
5353
-------------
5454

55-
Just as in :py:class:`NPAnnotator <nlp_architect.pipelines.spacy_np_annotator.NPAnnotator>`, we need to provide a trained :py:class:`SequenceChunker <nlp_architect.models.chunker.SequenceChunker>` model and its parameters file. It is also possible to provide a specific spacy model to base the pipeline on.
55+
Just as in :py:class:`NPAnnotator <nlp_architect.pipelines.spacy_np_annotator.NPAnnotator>`, we need to provide a trained :py:class:`SequenceChunker <nlp_architect.models.chunker.SequenceChunker>` model and its parameters file. It is also possible to provide a specific Spacy model to base the pipeline on.
5656

5757
The following example shows how to load a model/parameters using the default Spacy English model (`en`) and how to get the noun phrase annotations.
5858

0 commit comments

Comments
 (0)