Skip to content

Commit

Permalink
Update installation instructions and how to use
Browse files Browse the repository at this point in the history
  • Loading branch information
Janneke van der Zwaan committed Feb 27, 2017
1 parent 0f7a3f2 commit 9bc98b2
Showing 1 changed file with 52 additions and 12 deletions.
64 changes: 52 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ with Python 3) and [pip](https://pip.pypa.io/en/stable/installing/).
We recommend installing `nlppln` in a
[virtual environment](https://virtualenv.pypa.io/en/stable/) (`pip install virtualenv`).

```
pip install nlppln
```

Tools can be run by using the Python -m option, e.g. `python -m nlppln.apachetika <INPUTDIR> <OUTPUTDIR>`.

To run CWL workflows created with `nlppln`, install a cwl-runner (`pip install
cwlref-runner`) and [Docker](https://docs.docker.com/engine/installation/).

### For development

```
git clone https://github.com/WhatWorksWhenForWhom/nlppln.git
cd nlppln
Expand All @@ -25,17 +36,11 @@ virtualenv /path/to/env
source /path/to/env/bin/activate
git checkout develop
pip install cython
pip install -r requirements.txt
python setup.py develop
```

If you get an error while installing `nlppln`, it is most likely due to requirements
for xtas that are missing. Please have a look at the
[xtas installation instructions](http://xtas.net/setup.html#installation). We
are working on removing the dependency on xtas.

For the GUI:
For the GUI (currently, the GUI is available only in development mode):

Install [nodejs](https://nodejs.org/en/download/) (or via
[package manager](https://nodejs.org/en/download/package-manager/)) and
Expand All @@ -52,11 +57,6 @@ npm install
bower install
```

Tools can be run by using the Python -m option, e.g. `python -m nlppln.guess_language <INPUTDIR> <OUTPUTFILE>`.

To run CWL workflows created with `nlppln`, install a cwl-runner (`pip install
cwlref-runner`) and [Docker](https://docs.docker.com/engine/installation/).

## Generating command line NLP tool boilerplate and cwl steps

NLP Pipeline contains functionality to generate command line NLP tools and CWL
Expand All @@ -81,6 +81,46 @@ Save metadata to? [metadata_out.csv]:
Save cwl step to [cwl/steps/command.cwl]:
```

## Creating workflows

Workflows can be created by writing a Python script.

```
from nlppln import WorkflowGenerator
wf = WorkflowGenerator()
wf.load(steps_dir='/path/to/dir/with/cwl/steps/')
txt_dir = wf.add_inputs(txt_dir='Directory')
frogout = wf.frog_dir(dir_in=txt_dir)
saf = wf.frog_to_saf(in_files=frogout)
ner_stats = wf.save_ner_data(in_files=saf)
new_saf = wf.replace_ner(metadata=ner_stats, in_files=saf)
txt = wf.saf_to_txt(in_files=new_saf)
wf.add_outputs(ner_stats=ner_stats, txt=txt)
wf.save('anonymize.cwl')
```

Additional processing steps can be loaded using:

```
from nlppln import WorkflowGenerator
wf = WorkflowGenerator()
wf.load(steps_dir='/path/to/dir/with/cwl/steps/')
```

To load a single cwl file, do:
```
wf.load(steps_dir='/path/to/dir/with/cwl/steps/')
```

See [scriptcwl](https://github.com/NLeSC/scriptcwl) for more information on creating
workflows.

## Workflows

### Anonymize
Expand Down

0 comments on commit 9bc98b2

Please sign in to comment.