Commit 9117850c authored by Bruno Guillaume's avatar Bruno Guillaume

Change multigraph representations

parent 908d64f3
......@@ -11,8 +11,13 @@ Description = ""
# Multigraph representation
A multigraph is used to encode in the same structure several alternative annotations of the same sentence.
All the annotated graphs are put in the same graph and a special copy of the graph (called the *skeleton*) is added.
The skeleton encodes the parallelism between subgraphs.
We always suppose that there is no tokenization difference amongst the annotations.
All the annotated graphs are put in the same graph.
Each node in the multigraph has two special features:
* `user` which explicitly states to which user the node belongs
* `position` a numerical value which is such that two parallel nodes have the same `position`
With the two annotations of the sentence *Je suis une licorne*:
......@@ -22,9 +27,12 @@ With the two annotations of the sentence *Je suis une licorne*:
The figure below shows the multigraph encoding these two annotations:
| `mutligraph` |
| `multigraph` |
|:---:|
| ![mugraph.svg](/multigraph/multigraph.png) |
| <img src="/multigraph/multigraph.png" alt="multigraph" width="800"/> |
# Searching in multigraphs
......@@ -32,27 +40,27 @@ The figure below shows the multigraph encoding these two annotations:
```grew
pattern {
NS -[user=*]-> N1; NS -[user=*]-> N2; % N1 and N2 are parallel
N1.upos <> N2.upos; % N1 and N2 have ≠ upos features
id(N1) < id(N2); % force internal identifiers ordering to avoid duplicates
N1[]; N2[]; N1.position = N2.position; N1.user <> N2.user; % N1 and N2 are parallel
N1.upos <> N2.upos; % N1 and N2 have ≠ upos features
id(N1) < id(N2); % force internal identifiers ordering to avoid duplicates
}
```
output:
```json
{ "nodes": { "NS": "_2_", "N2": "marine_2", "N1": "kim_2" }, "edges": {} }
{ "nodes": { "N2": "marine_2", "N1": "kim_2" }, "edges": {} }
```
## Parallel edges with different labels
```grew
pattern {
NS -[user=*]-> N1; NS -[user=*]-> N2; % N1 and N2 are parallel
MS -[user=*]-> M1; MS -[user=*]-> M2; % M1 and M2 are parallel
e1: M1 -> N1; e2: M2 -> N2; % M and N are linked by parallel edges
label(e1) <> label(e2); % labels must be different
id(N1) < id(N2); % avoid duplicates (1/2 switching)
N1[]; N2[]; N1.position = N2.position; N1.user <> N2.user; % N1 and N2 are parallel
M1[]; M2[]; M1.position = M2.position; M1.user <> M2.user; % M1 and M2 are parallel
e1: M1 -> N1; e2: M2 -> N2; % M and N are link by parallel edges
label(e1) <> label(e2); % ask to different labels
id(N1) < id(N2); % avois duplicate (1/2 switching)
}
```
......@@ -61,10 +69,8 @@ output:
```json
{
"nodes": {
"NS": "_3_",
"N2": "marine_3",
"N1": "kim_3",
"MS": "_4_",
"M2": "marine_4",
"M1": "kim_4"
},
......@@ -79,13 +85,11 @@ output:
```grew
pattern {
NS -[user=*]-> N1; NS -[user=*]-> N2; % N1 and N2 are parallel
e1: G1 -> N1; % G1 is the governor of N1
e2: G2 -> N2; % G2 is the governor of N2
id(G1) < id(G2); % avoid duplicates (1/2 switching)
}
without {
GS -> G1; GS -> G2 % G1 and G2 are not parallel
N1[]; N2[]; N1.position = N2.position; N1.user <> N2.user; % N1 and N2 are parallel
e1: G1 -> N1; % G1 is the governor of N1
e2: G2 -> N2; % G2 is the governor of N2
id(G1) < id(G2); % avoid duplicates (1/2 switching)
G1.position <> G2.position; % G1 and G2 are not parallel
}
```
......@@ -94,7 +98,6 @@ outputs 2 solutions:
```json
{
"nodes": {
"NS": "_4_",
"N2": "marine_4",
"N1": "kim_4",
"G2": "marine_2",
......@@ -110,7 +113,6 @@ outputs 2 solutions:
```json
{
"nodes": {
"NS": "_2_",
"N2": "marine_2",
"N1": "kim_2",
"G2": "marine_ROOT",
......@@ -132,6 +134,7 @@ pattern { N[upos=NOUN]; e: N -> M; }
```
outputs 3 solutions:
```json
{
"nodes": { "N": "marine_4", "M": "marine_3" },
......@@ -154,4 +157,3 @@ outputs 3 solutions:
```
pattern {
NS -[user=*]-> N1; NS -[user=*]-> N2; % N1 and N2 are parallel
e1: G1 -> N1; % G1 is the governor of N1
e2: G2 -> N2; % G2 is the governor of N2
id(G1) < id(G2); % avoid duplicates (1/2 switching)
}
without {
GS -> G1; GS -> G2 % G1 and G2 are not parallel
N1[]; N2[]; N1.position = N2.position; N1.user <> N2.user; % N1 and N2 are parallel
e1: G1 -> N1; % G1 is the governor of N1
e2: G2 -> N2; % G2 is the governor of N2
id(G1) < id(G2); % avoid duplicates (1/2 switching)
G1.position <> G2.position; % G1 and G2 are not parallel
}
pattern {
NS -[user=*]-> N1; NS -[user=*]-> N2; % N1 and N2 are parallel
MS -[user=*]-> M1; MS -[user=*]-> M2; % M1 and M2 are parallel
e1: M1 -> N1; e2: M2 -> N2; % M and N are link by parallel edges
label(e1) <> label(e2); % ask to different labels
id(N1) < id(N2); % avois duplicate (1/2 switching)
N1[]; N2[]; N1.position = N2.position; N1.user <> N2.user; % N1 and N2 are parallel
M1[]; M2[]; M1.position = M2.position; M1.user <> M2.user; % M1 and M2 are parallel
e1: M1 -> N1; e2: M2 -> N2; % M and N are link by parallel edges
label(e1) <> label(e2); % ask to different labels
id(N1) < id(N2); % avois duplicate (1/2 switching)
}
pattern {
NS -[user=*]-> N1; NS -[user=*]-> N2; % N1 and N2 are parallel
N1.upos <> N2.upos; % N1 and N2 have ≠ upos features
id(N1) < id(N2); % force internal identifiers ordering to avoid duplicates
N1[]; N2[]; N1.position = N2.position; N1.user <> N2.user; % N1 and N2 are parallel
N1.upos <> N2.upos; % N1 and N2 have ≠ upos features
id(N1) < id(N2); % force internal identifiers ordering to avoid duplicates
}
static/multigraph/multigraph.png

10.7 KB | W: | H:

static/multigraph/multigraph.png

354 KB | W: | H:

static/multigraph/multigraph.png
static/multigraph/multigraph.png
static/multigraph/multigraph.png
static/multigraph/multigraph.png
  • 2-up
  • Swipe
  • Onion skin
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