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

Commit 80a4f5c

Browse files
author
Alon Eirew
committed
Merge branch 'master' into alon/master_local
2 parents e3919d9 + de2fda8 commit 80a4f5c

File tree

82 files changed

+626
-502
lines changed

Some content is hidden

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

82 files changed

+626
-502
lines changed

.gitignore

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,28 @@
1-
*.sublime-project
2-
*.sublime-workspace
31
*.pyc
42
*.pkl
53
*.prm
64
.DS_Store
7-
*@eaDir
85
.pkgs
96
*.egg-info
107
.venv
11-
.venv[23]
128
.styleenv
139
.coverage
14-
build
10+
/build/
1511
generated
16-
*.ropeproject
17-
*.cubin
12+
/dist/
1813
*.hdf5
1914
*.h5
20-
*.html
21-
!solutions/set_expansion/ui/templates/*.html
15+
#!nlp_architect/server/angular-ui/dist/angular-ui/*.html
16+
#*.html
17+
doc/build/**
18+
!nlp_architect/solutions/set_expansion/ui/templates/*.html
2219
.vscode
2320
!tests/fixtures/data/server/*.gz
24-
!server/angular-ui/src/
25-
!server/angular-ui/dist/**/*.html
2621
*.log
2722
.idea/
2823
.nlp_architect_env/
2924
src/
3025
pylint.html
3126
pylint.txt
3227
flake8.txt
33-
nlp_architect/pipelines/bist-pretrained/*
34-
venv
35-
nlp_architect/api/ner-pretrained/*
36-
tests/fixtures/data/chunker/
28+
tests/fixtures/data/chunker/(

README.md

Lines changed: 24 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<p align="center"><img src="doc/source/assets/nlp_architect_header.png" width="400"/></p>
1+
<p align="center"><img src="https://raw.githubusercontent.com/NervanaSystems/nlp-architect/master/doc/source/assets/nlp_architect_header.png" width="400"/></p>
22
<p align="center">
33
<a href="https://github.com/NervanaSystems/nlp-architect/blob/master/LICENSE"><img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"/></a> <a href="http://nlp_architect.nervanasys.com"><img src="https://img.shields.io/readthedocs/pip/stable.svg"/></a> <a href="https://doi.org/10.5281/zenodo.1477518"><img src="https://zenodo.org/badge/DOI/10.5281/zenodo.1477518.svg" alt="DOI"></a> <a href="https://github.com/NervanaSystems/nlp-architect/blob/master/LICENSE"><img src="https://img.shields.io/badge/release-v0.3-blue.svg"/></a>
44
</p>
@@ -27,7 +27,7 @@ interesting from both research perspectives and practical applications:
2727
* Solutions using one or more models: Set Term expansion which
2828
uses the included word chunker as a noun phrase extractor and NP2Vec, Topics and trend analysis for analyzing temporal corpora.
2929

30-
<center> <img src="doc/source/assets/nlp_architect_diag.png"></center>
30+
<center> <img src="https://raw.githubusercontent.com/NervanaSystems/nlp-architect/master/doc/source/assets/nlp_architect_diag.png"></center>
3131

3232
The library consists of core modules (topologies), data pipelines, utilities
3333
and end-to-end model examples with training and inference scripts. We look at
@@ -44,7 +44,7 @@ detailed documentation see this
4444
[page](http://nlp_architect.nervanasys.com/service.html).
4545

4646
NLP Architect server in action
47-
<center> <img src="doc/source/assets/service_cards.png"></center>
47+
<center> <img src="https://raw.githubusercontent.com/NervanaSystems/nlp-architect/master/doc/source/assets/service_cards.png"></center>
4848

4949
NLP Architect utilizes the following open source deep learning frameworks:
5050

@@ -58,41 +58,40 @@ on how to contribute can be found at our main [documentation] site.
5858

5959
## Installation
6060
### Prerequisites
61-
To get started, clone our repository:
6261

63-
git clone https://github.com/NervanaSystems/nlp-architect.git
64-
cd nlp-architect
62+
Make sure `pip` and `setuptools` and `venv` are up to date before installing.
63+
64+
pip3 install -U pip setuptools
65+
66+
We recommend installing NLP Architect in a virtual environment to self-contain
67+
the work done using the library.
6568

66-
Installing NLP Architect within a virtual environment to ensure a self-contained
67-
environment is recommended.
6869
To create and activate a new virtual environment:
6970

7071
python3 -m venv .nlp_architect_env
7172
source .nlp_architect_env/bin/activate
7273

73-
Make sure `pip` and `setuptools` and `venv` are up to date before installing.
74-
75-
pip3 install -U pip setuptools
74+
### Installing using `pip`
7675

77-
### Backend
76+
To install NLP Architect using `pip` package manager:
7877

79-
NLP Architect supports CPU, GPU and Intel Optimized Tensorflow (MKL-DNN).
80-
Select the desired backend using a dedicated environment variable.
78+
pip install nlp-architect
79+
80+
### Installing from source
8181

82-
CPU (default):
83-
84-
export NLP_ARCHITECT_BE=CPU
85-
86-
MKL-DNN (Linux OS only):
82+
To get started, clone our repository:
8783

88-
export NLP_ARCHITECT_BE=MKL
84+
git clone https://github.com/NervanaSystems/nlp-architect.git
85+
cd nlp-architect
8986

90-
GPU (Linux OS only):
87+
#### Selecting a backend
9188

92-
export NLP_ARCHITECT_BE=GPU
89+
NLP Architect supports CPU, GPU and Intel Optimized Tensorflow (MKL-DNN) backends.
90+
Users can select the desired backend using a dedicated environment variable (default: CPU). (MKL-DNN and GPU backends are supported only on Linux)
9391

92+
export NLP_ARCHITECT_BE=CPU/MKL/GPU
9493

95-
### Installation
94+
#### Installation
9695
NLP Architect is installed using `pip` and it is recommended to install in development mode.
9796

9897
Default:
@@ -115,23 +114,11 @@ Once installed, the `nlp_architect` command provides additional options to work
115114
| nlp_architect.data | Datasets, data loaders and data classes |
116115
| nlp_architect.models | NLP, NLU and End-to-End neural models |
117116
| nlp_architect.pipelines | End-to-end NLP apps |
117+
| nlp_architect.server | API Server and demos UI |
118+
| nlp_architect.solutions | Solution applications |
118119
| nlp_architect.utils | Misc. I/O, metric, pre-processing and text utilities |
119120
| examples | Example files for each model |
120-
| solutions | Solution applications |
121-
| server | API Server and demos UI |
122121
| tutorials | Misc. Jupyter tutorials |
123-
<!--
124-
Below are examples of NLP Architect server in action
125-
126-
BIST Parser UI
127-
<center> <img src="doc/source/assets/bist_service.png"></center>
128-
129-
NER Parser UI
130-
<center> <img src="doc/source/assets/ner_service.png"></center>
131-
132-
Spacy NER Parser UI
133-
<center> <img src="doc/source/assets/spacy_ner_service.png"></center>-->
134-
135122

136123
NLP Architect is an active space of research and development; Throughout future
137124
releases new models, solutions, topologies and framework additions and changes

doc/source/_quick_install.rst

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
.. limitations under the License.
1515
.. ---------------------------------------------------------------------------
1616
17-
Quick Installation wizard
18-
-------------------------
17+
Quick Install
18+
-------------
1919
Select the desired configuration of your system:
2020

2121
.. raw:: html
@@ -26,6 +26,18 @@ Select the desired configuration of your system:
2626
<col class="description">
2727
</colgroup><tbody valign="top">
2828
<tr><td class="option-group">
29+
<kbd><span class="option">
30+
<strong>Install from</strong>
31+
</span></kbd></td>
32+
<td>
33+
<label class="radio">
34+
<input v-model="form.source" type="radio" value="1">Pip
35+
</label>
36+
<label class="radio">
37+
<input v-model="form.source" type="radio" value="0" checked>GitHub
38+
</label>
39+
</td></tr>
40+
<tr><td class="option-group">
2941
<kbd><span class="option">
3042
<strong>Create virtualenv?</strong>
3143
</span></kbd></td>
@@ -72,9 +84,7 @@ Run the following commands to install NLP Architect:
7284
.. raw:: html
7385

7486
<div class="code python highlight-default notranslate"><div class="highlight">
75-
<pre><span class="n" v-html="get_env()"></span>
76-
<span class="n">export NLP_ARCHITECT_BE={{ get_be() }}</span>
77-
<span class="n">pip3 install {{ get_mode() }}.</span>
87+
<pre v-html="get_commands()">
7888
</pre></div>
7989
</div>
8090
<script src="https://cdn.jsdelivr.net/npm/vue"></script>

doc/source/api.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Dataset implementations and data loaders (check deep learning framework compatib
9494
---------------------------
9595
.. currentmodule:: nlp_architect.pipelines
9696

97-
NLP pipelines modules using models implemented from ``nlp_architect.models``
97+
NLP pipelines modules using NLP Architect models
9898

9999
.. autosummary::
100100
:toctree: generated/
@@ -132,5 +132,7 @@ Common types of data structures used by NLP models
132132
:toctree: generated/
133133
:nosignatures:
134134

135+
nlp_architect.common.core_nlp_doc.CoreNLPDoc
136+
nlp_architect.common.high_level_doc.HighLevelDoc
135137
nlp_architect.common.cdc.mention_data.MentionDataLight
136138
nlp_architect.common.cdc.mention_data.MentionData

doc/source/chunker.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Running inference on a trained model using an input file (text based, each line
126126

127127
.. code:: python
128128
129-
python examples/chunker/inference.py --model_name <model_name> --input <input_file>.txt
129+
python examples/chunker/inference.py --model_name <model_name> --input <input_file>.txt
130130
131131
132132
.. _CONLL2000: https://www.clips.uantwerpen.be/conll2000/chunking/

doc/source/code_docs/nlp_architect.api.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@
2323

2424
.. autoclass:: nlp_architect.api.ner_api.NerApi
2525

26-
.. autoclass:: nlp_architect.api.spacy_ner_api.SpacyNerApi
26+
.. autoclass:: nlp_architect.api.intent_extraction.IntentExtractionApi
27+
28+
.. autoclass:: nlp_architect.api.machine_comprehension.MachineComprehensionApi

doc/source/code_docs/service.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
Service class documentation
1818
###########################
1919

20-
.. autoclass:: server.service.Service
20+
.. autoclass:: nlp_architect.server.service.Service
2121

2222
.. autoclass:: nlp_architect.common.core_nlp_doc.CoreNLPDoc
2323

doc/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# If extensions (or modules to document with autodoc) are in another directory,
2121
# add these directories to sys.path here. If the directory is relative to the
2222
# documentation root, use os.path.abspath to make it absolute, like shown here.
23-
from nlp_architect.version import nlp_architect_version
23+
from nlp_architect.version import NLP_ARCHITECT_VERSION
2424

2525
sys.path.insert(0, os.path.abspath('../..'))
2626

@@ -87,7 +87,7 @@
8787
# built documents.
8888
#
8989
# The short X.Y.Z version.
90-
version = nlp_architect_version()
90+
version = NLP_ARCHITECT_VERSION
9191
# The full version, including git-hash and alpha/beta/rc tags.
9292
release = version
9393

doc/source/cross_doc_coref.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ The system achieved the following:
4949
* Best in class results achieve on ECB+ Event Cross Document Co-Reference (**79.0% F1**) using the sieves set *[Head Lemma, Exact Match, Wikipedia Redirect, Wikipedia Disambiguation and Fuzzy Head]*
5050

5151
.. [1] ECB+: Agata Cybulska and Piek Vossen. 2014. Using a sledgehammer to crack a nut? Lexical diversity and event coreference resolution.
52+
5253
In Proceedings of the 9th international conference on Language Resources and Evaluation (LREC2014)
5354
ECB+ annotation is held copyright by Agata Cybulska, Piek Vossen and the VU University of Amsterdam.
5455

doc/source/identifying_semantic_relation.rst

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -270,35 +270,38 @@ Generate Scripts
270270
271271
::
272272
273-
python nlp_architect/data/cdc_resources/gen_scripts/create_reference_dict_dump.py --ref_dict=<ref.dict1.tsv downloaded file> --mentions=<in_mentions.json> --output=<output.json>
273+
python -m nlp_architect.data.cdc_resources.gen_scripts.create_reference_dict_dump.py --ref_dict=<ref.dict1.tsv downloaded file> --mentions=<in_mentions.json> --output=<output.json>
274274
275275
**Generate VerbOcean:**
276276
277277
::
278278
279-
python nlp_architect/data/cdc_resources/gen_scripts/create_verbocean_dump.py --vo=<verbocean.unrefined.2004-05-20.txt downloaded file> --mentions=<in_mentions.json> --output=<output.json>
279+
python -m nlp_architect.data.cdc_resources.gen_scripts.create_verbocean_dump.py --vo=<verbocean.unrefined.2004-05-20.txt downloaded file> --mentions=<in_mentions.json> --output=<output.json>
280280
281281
**Generate WordEmbedding Glove:**
282282
283283
::
284284
285-
python nlp_architect/data/cdc_resources/gen_scripts/create_word_embed_glove_dump.py --mentions=<in_mentions.json> --glove=glove.840B.300d.txt --output=<output.pickle>
285+
python -m nlp_architect.data.cdc_resources.gen_scripts.create_word_embed_glove_dump.py --mentions=<in_mentions.json> --glove=glove.840B.300d.txt --output=<output.pickle>
286286
287287
**Generate Wordnet:**
288288
289289
::
290290
291-
python nlp_architect/data/cdc_resources/gen_scripts/create_wordnet_dump.py --mentions=<in_mentions.json> --output=<output.json>
291+
python -m nlp_architect.data.cdc_resources.gen_scripts.create_wordnet_dump.py --mentions=<in_mentions.json> --output=<output.json>
292292
293293
**Generate Wikipedia:**
294294
295295
::
296296
297-
python nlp_architect/data/cdc_resources/gen_scripts/create_wiki_dump.py --mentions=<in_mentions.json> --output=<output.json>``
297+
python -m nlp_architect.data.cdc_resources.gen_scripts.create_wiki_dump.py --mentions=<in_mentions.json> --output=<output.json>``
298298
299299
.. note::
300+
300301
**For a fast evaluation using Wikipedia at run time**, on live data, there is an option to generate a local ElasticSearch database of the entire Wiki site using this resource: `Wiki to Elastic <https://github.com/AlonEirew/wikipedia-to-elastic/>`_, It is highly recommended since using online evaluation against Wikipedia site can be very slow.
301302
In case you adopt elastic local database, Initiate ``WikipediaRelationExtraction`` relation extraction using ``WikipediaSearchMethod.ELASTIC``
302303
**Generate Wikipedia Snapshot using Elastic data instead of from online wikipedia site:**
303-
::
304-
python nlp_architect/data/cdc_resources/gen_scripts/create_wiki_dump.py --mentions=<in_mentions.json> --host=<elastic_host eg:localhost> --port=<elastic_port eg:9200> --index=<elastic_index> --output=<output.json>``
304+
305+
::
306+
307+
python -m nlp_architect.data.cdc_resources.gen_scripts.create_wiki_dump.py --mentions=<in_mentions.json> --host=<elastic_host eg:localhost> --port=<elastic_port eg:9200> --index=<elastic_index> --output=<output.json>``

0 commit comments

Comments
 (0)