Commit 9e69c53c authored by Bruno Guillaume's avatar Bruno Guillaume

update doc to versions 0.46

parent a730293b
......@@ -29,13 +29,13 @@ The GRS used to build the mixed **deep_and_surf** structure can be obtained by:
git clone https://gitlab.inria.fr/grew/SSQtoDSQ.git
```
The input of the GRS which produced the **deep_and_surf** structure is the **surf** structure.
We recall here the surface structure (see [Dependency parsing](../parsing) page) for our example sentence and we suppose that the file [`test.surf.melt`](/deep_syntax/test.surf.melt) contains the Conll description below:
We recall here the surface structure (see [Dependency parsing](../parsing) page) for our example sentence and we suppose that the file [`test.surf.conll`](/deep_syntax/test.surf.conll) contains the Conll description below:
{{< input file="/static/deep_syntax/test.surf.conll" >}}
The mixed structure is then computed with the command:
```
grew -det -grs deep_syntax/grs/deep_synt_main.grs -i test.surf.conll -f test.mix.conll
grew transform -grs SSQtoDSQ/grs/main_dsq.grs -i test.surf.conll -o test.mix.conll
```
which produces the file [`test.deep_and_surf.melt`](/deep_syntax/test.deep_and_surf.melt) which contains the code below corresponding the next figure
......
......@@ -12,6 +12,12 @@ Categories = ["Development","GoLang"]
**Grew** is a Graph Rewriting tool dedicated to applications in Natural Language Processing (NLP). It can manipulate many kinds of linguistic representation. It has been used on POS-tagged sequence, surface dependency syntax, deep dependency syntax, semantic representation (AMR, DMRS) but it can be used to represent any graph-based structure.
## News
**2017/12/14:** New release of version **0.46**. Main changes are:
* GTK interface is proposed as a separate package and so Grew without GUI is much more easy to install
* Command line arguments were revisited (see [Run Grew page](../run))
## A first taste of Grew
The easiest way to try and test **Grew** is to use one of the two online interfaces.
......
......@@ -5,46 +5,76 @@ title = "installation"
# Grew installation
**Grew** is implemented with the [Ocaml](http://ocaml.org) language. The Graphical User Interface is based on [GTK](http://gtk.org), **Grew** is then easy to install on Linux or MAC OS&nbsp;X (installation on Windows should be possible, but this is untested).
**Grew** is implemented with the [Ocaml](http://ocaml.org) language.
**Grew** is easy to install on Linux or Mac OS&nbsp;X (installation on Windows should be possible, but this is untested).
:warning: If you run into trouble using the instruction of this page, feel free to open an issue on [GitLab](https://gitlab.inria.fr/grew/grew_doc/issues).
A GTK interface is available (again on Linux and Mac OS&nbsp;X, untested on Windows) separately.
## Step 1: Prerequisites, install non-ocaml needed packages
:warning: If you run into trouble using the instructions of this page, feel free to open an issue on [GitLab](https://gitlab.inria.fr/grew/grew_doc/issues).
### On Linux
On Debian/Ubuntu based Linux installation, the following command installs the prerequisites.
* If needed, install `aptitude` with the command `apt get install aptitude`
* for all usage: `aptitude install graphviz pkg-config librsvg2-dev m4 automake librsvg2-bin python-software-properties opam`
* for GUI, run also: ``aptitude install libwebkitgtk-dev libglade2-dev libgtk2.0-dev`
## Option 1: Basic installation without GTK interface
### On Linux
* First installation
* `apt-get install wget opam m4 aspcud` # Prerequisite
* `opam init -a -y --comp 4.06.0` # Download and install Ocaml (4.06.0)
* ```eval `opam config env` ``` # Make Ocaml ready to use know
* `opam remote add talc "http://talc2.loria.fr/semagramme/opam"` # Add the talc OPAM repository
* `opam install grew` # Install Grew
* Test
* Try the command `grew version`
* In case of trouble, make sure that your PATH contains `~/.opam/4.06.0/bin` and try again
* In trouble persists, please [fill an issue](https://gitlab.inria.fr/grew/grew_doc/issues)
* Updating when **Grew** is already installed:
* `apt-get update && apt-get upgrade`
* `opam update && opam upgrade`
### On Mac OS&nbsp;X
1. Install [XCode](https://developer.apple.com/xcode/)
2. Install [XQuartz](http://www.xquartz.org/)
3. Install [MacPorts](http://www.macports.org/)
* Prerequisite Mac applications
* Install [XCode](https://developer.apple.com/xcode/)
* Install [MacPorts](http://www.macports.org/)
The following command install the prerequisites
* First installation
* `sudo port install wget opam aspcud` # Prerequisite
* `opam init -a -y --comp 4.06.0` # Download and install Ocaml (4.06.0)
* ```eval `opam config env` ``` # Make Ocaml ready to use know
* `opam remote add talc "http://talc2.loria.fr/semagramme/opam"` # Add the talc OPAM repository
* `opam install grew` # Install Grew
* for all usages: `sudo port install graphviz librsvg libglade2 wget opam`
* for GUI, run also: `sudo port install webkit-gtk`
* Test
* Try the command `grew version`
* In case of trouble, make sure that your PATH contains `~/.opam/4.06.0/bin` and try again
* In trouble persists, please [fill an issue](https://gitlab.inria.fr/grew/grew_doc/issues)
## Step 2: Initialize OPAM
* `opam init --comp 4.05.0` # Download and install the last version of Ocaml (4.05.0)
* Updating when **Grew** is already installed:
* `sudo port sync && sudo port upgrade`
* `opam update && opam upgrade`
* `opam config setup -a` # Update configuration file
## Option 2: Installation of the GTK interface
* ```eval `opam config env` ``` # Make Ocaml ready to use know
We suppose that the basic version (Option 1) is already installed.
### Linux
* Install GUI interface
* `apt-get install graphviz pkg-config librsvg2-dev libwebkitgtk-dev libglade2-dev libgtk2.0-dev`
* `opam install grew_gui`
* Test
* Run `Grew gui` to run the GTk interface
* In case of trouble, [fill an issue](https://gitlab.inria.fr/grew/grew_doc/issues)
### On Mac OS&nbsp;X
* Prerequisite Mac application for running X11 GUI.
* Install [XQuartz](http://www.xquartz.org/)
## Step 3: Add the talc local OPAM repository
* `opam remote add talc "http://talc2.loria.fr/semagramme/opam"`
* Install GUI interface
* `sudo port install graphviz librsvg libglade2 webkit-gtk`
* `opam install grew_gui`
## Step 4: Install grew
* **Grew** GUI: `opam install grew`
* **Grew** daemon: `opam install grew_daemon` (see [grew daemon](https://gitlab.inria.fr/grew/grew_daemon) gitlab page)
* Test
* Run `Grew gui` to run the GTk interface
* In case of trouble, [fill an issue](https://gitlab.inria.fr/grew/grew_doc/issues)
# Update to the latest versions
1. update prerequisites:
* Linux :arrow_right: `aptitude update && aptitude upgrade`
* Mac OS&nbsp;X :arrow_right: `sudo port sync && sudo port upgrade`
1. update **Grew**: `opam update && opam upgrade`
......@@ -52,8 +52,7 @@ produces the file [`test.melt`](/parsing/test.melt):
With the file `test.melt` described above, the following command produces the Conll code of the parsed sentence:
`grew -det -grs POStoSSQ/grs/surf_synt_main.grs -strat full -i test.melt -f test.conll`
`grew transform -grs POStoSSQ/grs/surf_synt_main.grs -i test.melt -o test.conll`
The output file is [`test.conll`](/parsing/test.conll):
{{< input file="/static/parsing/test.conll" >}}
......@@ -64,7 +63,7 @@ which encodes the syntactic structure:
It is also possible to runs a GTK interface in which you can explore step by step rewriting of the input sentence:
`grew -grs POStoSSQ/grs/surf_synt_main.grs -strat full -gr test.melt`
`grew gui -grs POStoSSQ/grs/surf_synt_main.grs -i test.melt`
## Parsing a set of sentence
No explicit linking with a sentence tokenizer is provided.
......@@ -77,5 +76,5 @@ Suppose that the file [`tdm80_ch01.txt`](/parsing/tdm80_ch01.txt) contains the f
The parsing can be done with the same two steps process:
1. POS-tagging with melt: `cat tdm80_ch01.txt | MElt -L -T > tdm80_ch01.melt`
2. Building the dependency syntax structure: `grew -det -grs POStoSSQ/grs/surf_synt_main.grs -strat full -i tdm80_ch01.melt -f tdm80_ch01.conll`
2. Building the dependency syntax structure: `grew transform -grs POStoSSQ/grs/surf_synt_main.grs -i tdm80_ch01.melt -o tdm80_ch01.conll`
......@@ -7,56 +7,47 @@ Categories = ["Development","GoLang"]
Tags = ["Development","golang"]
+++
# Grew running modes
The command to run **Grew** is: `grew <subcommand> [<args>]`
There are 3 main running modes for **Grew**:
Available subcommands are:
* **GUI** mode (this is the default mode): `grew`
* **Deterministic** mode for one-to-one graph transformation: `grew -det`
* **Grep** mode searches for occurrences of grew pattern in a corpus `grew -grep`
Options available in all modes:
```
-grs <grs_file> chose the grs file to load
-seq <seq> set the module sequence to use
-timeout <float> set a timeout on rewriting
-main_feat <feat_name_list> set the list of feature names used in dep format to set the "main word"
```
* `transform`: **Grew** transform mode, see below
* `grep`: **Grew** grep mode, see below
* `gui`: **Grew** GTK interface, see below
* `version`: Print current version number
* `help`: Print help
* `help <sub>`: Print help for the given subcommand
---
# Transform mode
In this mode, **Grew** apply a Graph Rewrinting System to a graph of a set of graphs.
The full command for this mode:
## Graphical User Interface
The following option is available only for the GUI mode:
```
-gr <gr_file> set the graph file (.gr or .conll) to use
-doc force to generate the GRS doc
```
`grew transform -grs <grs_file> -i <input_file> -o <output_file>`
The documentation generation takes some time and it is disabled by default.
The documentation given in the GUI can be outdated if the GRS has changed since the last documentation generation.
Required arguments for this mode are:
## Deterministic corpus rewriting
When the GRS file describes a one-to-one transformation, the ''**-det**'' option can be used to transform all graphs of a corpus.
where:
The command below rewrite each graph found in ''**input**'' (a conll file).
The output is written in a file.
* `<grs_file>` is the main file which describes Graph Rewriting System
* `<input_file>`: describes the input data (CONLL file of gr file)
* `<output_file>`: is the name of the output file (CONLL file)
```grew -det -i input_file -f output_file ```
Optional argument is:
**Note**:
In the current version it is possible to use a folder as a corpus (both in input and output) but this will be remove soon, you should avoid to use this.
* `-strat <name>`: the strategy used in transformation (default value: `main`)
NB: One way to ensure that a GRS is deterministic is to declare all modules as `deterministic`.
---
## Grep mode
# Grep mode
This mode corresponds to the command line version of the [Online graph matching](http://grew.loria.fr/demo) tool.
The command is:
`grew -grep -pattern <pattern_file> -node_id <id> -i <corpus_file>`
`grew grep -pattern <pattern_file> -node_id <id> -i <corpus_file>`
where:
......@@ -66,7 +57,7 @@ where:
The output is a list of lines, one for each occurrence of the pattern in the corpus.
### Example
## Example
With the following files:
......@@ -74,7 +65,7 @@ With the following files:
* A pattern file with the code below: `subcat.pat` ([Download](https://gitlab.inria.fr/grew/grew_doc/raw/master/static/examples/grep/subcat.pat))
```
match {
pattern {
V [cat=V];
V -[a_obj]-> A;
V -[de_obj]-> DE;
......@@ -83,7 +74,7 @@ match {
The command:
`grew -grep -pattern subcat.pat -node_id V -i sequoia.surf.conll`
`grew grep -pattern subcat.pat -node_id V -i sequoia.surf.conll`
produces the following output:
......@@ -96,4 +87,16 @@ emea-fr-test_00478 31
Europar.550_00496 14
```
This means that the pattern descibed in the file `subcat.pat` was found 6 times in the corpus, each line gives the sentence identifier and the position of node matched by the node `V` of the pattern.
This means that the pattern described in the file `subcat.pat` was found 6 times in the corpus, each line gives the sentence identifier and the position of node matched by the node `V` of the pattern.
# GTK interface
The command to run the GTK interface: `grew gui <args>`.
It supposes that you have installed the `grew_gui` opam packages (see [option 2 in Installation page](../installation#option-2-installation-of-the-gtk-interface)).
Optional arguments:
* `-grs <grs_file>`: load the given file
* `-i <input_file>`: input data (graph or corpus) loaded in GUI
* `-strat <name>`: the strategy selected in the interface (default: `main`)
* `-main_feat <feat_name_list>` set the list of feature names used ad the *main* feat in graph visualisation
......@@ -8,9 +8,24 @@ menu = "main"
+++
The symbol ":warning:" indicates changes that may break backward compatibility.
* The version numbers `x.y.z` are synchronized such that `x`and `y`are identical for the 3 main sub-projects (`grew`, `grew_gui`, `libcaml-grew`). `z` is linked to bug fixes and may vary.
* The symbol ":warning:" indicates changes that may break backward compatibility.
---
# **last release** Version 0.46 on December, 14 2017
* GTK interface is proposed as a separate package and so Grew without GUI is much more easy to install
* Command line arguments were revisited (see [Run Grew page](../run))
More detailled informations in files `CHANGES.md` for each sub-project: [libcaml-grew](https://gitlab.inria.fr/grew/libcaml-grew/blob/master/CHANGES.md),
[grew](https://gitlab.inria.fr/grew/grew/blob/master/CHANGES.md),
[grew_gui](https://gitlab.inria.fr/grew/grew_gui/blob/master/CHANGES.md)
---
# Version 0.45 on October 10, 2017
# **last release** Version 0.45 on October 10, 2017
* features structures given in column 10 of ConLL are kept in the output
* :warning: new grs syntax ([grs](../grs)) is required; old syntax can be used with the command line argument `-old_grs`
* :warning: in patterns, implicit node declaration is available only for nodes in edge (see below)
......
......@@ -15,8 +15,8 @@
<hr/>
<li class="section">Use Grew</li>
<li><a href="/installation">Installation</a></li>
<li><a href="/run">Run Grew</a></li>
<li><a href="/whats">version 0.45: what's new</a></li>
<li><a href="/run">Run</a></li>
<li><a href="/whats">What's new</a></li>
<hr/>
<li class="section">Available GRS</li>
......@@ -33,9 +33,10 @@
<li><a href="/grs">GRS syntax</a></li>
<hr/>
<li class="section">Developper corner</li>
<li><a href="https://gitlab.inria.fr/grew/libcaml-grew">Gitlab for Grew library</a></li>
<li><a href="https://gitlab.inria.fr/grew/grew">Gitlab for Grew GUI</a></li>
<li class="section">Grew on GitLab</li>
<li><a href="https://gitlab.inria.fr/grew/grew">Main interface</a></li>
<li><a href="https://gitlab.inria.fr/grew/grew_gui">GTK interface</a></li>
<li><a href="https://gitlab.inria.fr/grew/libcaml-grew">Ocaml library</a></li>
</ul>
</div>
......
This diff is collapsed.
match {
pattern {
V [cat=V];
V -[a_obj]-> A;
V -[de_obj]-> DE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment