D-rule

From UNL Wiki
(Difference between revisions)
Jump to: navigation, search
Line 9: Line 9:
 
STATEMENT is the left side (condition) of a [[L-rule]] or a [[S-rule]]; and<br />
 
STATEMENT is the left side (condition) of a [[L-rule]] or a [[S-rule]]; and<br />
 
P, which can range from 0 (impossible) to 255 (necessary), is the probability of occurrence of the STATEMENT<br />
 
P, which can range from 0 (impossible) to 255 (necessary), is the probability of occurrence of the STATEMENT<br />
 +
 +
== Scope of Disambiguation Rules ==
 +
Disambiguation rules may apply:
 +
*Only during [[tokenization]], in order to control the dictionary retrieval
 +
*Only during [[transformation]], in order to control the application of [[T-rule]]s
 +
*During tokenization and transformation
  
 
== Types of Disambiguation Rules ==
 
== Types of Disambiguation Rules ==
There are three types of disambiguation rules:
+
There are two types of disambiguation rules:
*Network disambiguation rules
+
*Linear disambiguation rules, when the rule applies over lists of nodes
*Tree disambiguation rules
+
*Non-linear disambiguation rules, when the rule applies over non-linear relations between nodes 
*List disambiguation rules
+
  
=== Network Disambiguation Rules ===
+
=== Linear Disambiguation Rules ===
Network disambiguation rules apply over the network structure of UNL graphs to constrain the application of Tree-to-Network (TN) and Network-to-Network (NN) Transformation Rules. They have the following format:
+
Linear disambiguation rules apply over the natural language list structure to constrain word selection (dictionary retrieval) or the application of both Tree-to-List (TL) and List-to-List (LL) Transformation Rules. They have the following format:
  SEM(A;B)=P;
+
  (A)(B)...=P;
Where SEM is a semantic relation, A and B are nodes, and P is an integer (from 0 to 255).
+
Where A and B are nodes, and P is an integer (from 0 to 255).
  
 
==== Examples ====
 
==== Examples ====
;agt(VER;ADJ)=0;  
+
;(ART)(VER)=0;  
:An adjective (ADJ) may not be an agent (agt) of a verb (VER).
+
:An article (ART) may not precede a verb (VER).
;agt(VER;NOU)=255;
+
;(ART)(NOU)=255;
:Agents (agt) of verbs (VER) are always nouns (NOU).
+
:Articles (ART) always precede nouns (NOU).
 
==== Use ====
 
==== Use ====
  
 
{|cellpadding="5" border="1" align="center"
 
{|cellpadding="5" border="1" align="center"
 +
|+ Rule Disambiguation
 
!INPUT
 
!INPUT
 
!TRANSFORMATION RULES
 
!TRANSFORMATION RULES
Line 34: Line 40:
 
!OUTPUT
 
!OUTPUT
 
|-
 
|-
|SYN(A,B,C;D,E,F)
+
|X(A,B,C;D,E,F)
|SYN(A;D)=agt(;); (higher priority)<br />SYN(A;E)=aoj(;); (lower priority)
+
|X(A;D)=(A)(D); (higher priority)<br />X(A;F)=(F)(A); (lower priority)
|agt(A;F)=0;
+
|(B)(E)=0;
|aoj(A,B,C;D,E,F)
+
|(D,E,F)(A,B,C)
 
|}
 
|}
  
=== Tree Disambiguation Rules ===
+
 
Tree disambiguation rules apply over the intermediate tree structure to constrain the application of List-to-Tree (LT), Network-to-Tree (NT) and Tree-to-Tree (TT) Transformation Rules. They have the following format:
+
 
  SYN(A;B)=P;
+
{|cellpadding="5" border="1" align="center"
Where SYN is a syntactic relation, A and B are nodes, and P is an integer (from 0 to 255).
+
|+ Word Disambiguation
 +
!INPUT
 +
!DICTIONARY
 +
!DISAMBIGUATION RULES
 +
!OUTPUT
 +
|-
 +
|the book
 +
|[book] "22222" (POS=VER); (higher priority)<br />[book] "11111" (POS=NOU); (lower priority)
 +
|(ART)(BLK)(VER)=0;
 +
|[book] "1111" (POS=NOU);
 +
|}
 +
 
 +
=== Non-Linear Disambiguation Rules ===
 +
Non-linear disambiguation rules apply over the syntactic or the network structure to constrain the application of List-to-Tree (LT), Tree-to-Tree (TT), Tree-to-Network (TN) and Network-to-Network (NN) Transformation Rules. They have the following format:
 +
  REL(A;B)=P;
 +
Where REL is either a syntactic or a semantic relation, A and B are nodes, and P is an integer (from 0 to 255).
  
 
==== Examples ====
 
==== Examples ====
Line 50: Line 71:
 
;NS(NOU;DET)=255;
 
;NS(NOU;DET)=255;
 
:Determiners (DET) are always specifiers (NS) of nouns (NOU).
 
:Determiners (DET) are always specifiers (NS) of nouns (NOU).
 +
;agt(VER;ADJ)=0;
 +
:An adjective (ADJ) may not be an agent (agt) of a verb (VER).
 +
;agt(VER;NOU)=255;
 +
:Agents (agt) of verbs (VER) are always nouns (NOU).
 
==== Use ====
 
==== Use ====
  
Line 57: Line 82:
 
!DISAMBIGUATION RULES
 
!DISAMBIGUATION RULES
 
!OUTPUT
 
!OUTPUT
 +
|-
 +
|SYN(A,B,C;D,E,F)
 +
|SYN(A;D)=agt(;); (higher priority)<br />SYN(A;E)=aoj(;); (lower priority)
 +
|agt(A;F)=0;
 +
|aoj(A,B,C;D,E,F)
 
|-
 
|-
 
|(A,B,C)(D,E,F)
 
|(A,B,C)(D,E,F)
Line 69: Line 99:
 
|}
 
|}
  
=== List Disambiguation Rules ===
 
List disambiguation rules apply over the natural language list structure to constrain the application of both Tree-to-List (TL) and List-to-List (LL) Transformation Rules. They are also used for word selection. They have the following format:
 
(A)(B)=P;
 
Where A and B are nodes, and P is an integer (from 0 to 255).
 
 
==== Examples ====
 
;(ART)(BLK)(VER)=0;
 
:An article (ART) may not precede a verb (VER).
 
;(ART)(BLK)(NOU)=255;
 
:Articles (ART) always precede nouns (NOU).
 
==== Use ====
 
 
{|cellpadding="5" border="1" align="center"
 
|+ Rule Disambiguation
 
!INPUT
 
!TRANSFORMATION RULES
 
!DISAMBIGUATION RULES
 
!OUTPUT
 
|-
 
|X(A,B,C;D,E,F)
 
|X(A;D)=(A)(D); (higher priority)<br />X(A;F)=(F)(A); (lower priority)
 
|(B)(E)=0;
 
|(D,E,F)(A,B,C)
 
|}
 
 
 
 
{|cellpadding="5" border="1" align="center"
 
|+ Word Disambiguation
 
!INPUT
 
!DICTIONARY
 
!DISAMBIGUATION RULES
 
!OUTPUT
 
|-
 
|the book
 
|[book] "22222" (POS=VER); (higher priority)<br />[book] "11111" (POS=NOU); (lower priority)
 
|(ART)(BLK)(VER)=0;
 
|[book] "1111" (POS=NOU);
 
|}
 
  
 
== Formal Syntax of Disambiguation Rules ==
 
== Formal Syntax of Disambiguation Rules ==
Line 133: Line 124:
 
**(ART)(BLK)(VER)=0;  (an article (ART) may not precede a verb (VER))
 
**(ART)(BLK)(VER)=0;  (an article (ART) may not precede a verb (VER))
 
**(ART)(BLK)(NOU)=255; (articles (ART) always precede nouns (NOU))
 
**(ART)(BLK)(NOU)=255; (articles (ART) always precede nouns (NOU))
*Syntactic structures
+
*Syntactic and semantic structures
 
**agt(VER;ADJ)=0;  (an adjective (ADJ) may not be an agent (agt) of a verb (VER))
 
**agt(VER;ADJ)=0;  (an adjective (ADJ) may not be an agent (agt) of a verb (VER))
 
**agt(VER;NOU)=255; (agents (agt) of verbs (VER) are always nouns (NOU))
 
**agt(VER;NOU)=255; (agents (agt) of verbs (VER) are always nouns (NOU))
 
**VS(VER;ADJ)=0; (an adjective (ADJ) may not be an specifier (VS) of a verb (VER))
 
**VS(VER;ADJ)=0; (an adjective (ADJ) may not be an specifier (VS) of a verb (VER))
 
**NS(NOU;DET)=255; (determiners (DET) are always specifiers (NS) of nouns (NOU))
 
**NS(NOU;DET)=255; (determiners (DET) are always specifiers (NS) of nouns (NOU))

Revision as of 19:56, 19 August 2013

D-rules or disambiguation rules are used to prevent wrong lexical choices, to provoke best matches and to check the consistency of graphs, trees and lists. The set of D-rules form the Disambiguation grammar, or D-Grammar.

Contents

Syntax

D-rules follow the general syntax:

STATEMENT=P;

Where
STATEMENT is the left side (condition) of a L-rule or a S-rule; and
P, which can range from 0 (impossible) to 255 (necessary), is the probability of occurrence of the STATEMENT

Scope of Disambiguation Rules

Disambiguation rules may apply:

  • Only during tokenization, in order to control the dictionary retrieval
  • Only during transformation, in order to control the application of T-rules
  • During tokenization and transformation

Types of Disambiguation Rules

There are two types of disambiguation rules:

  • Linear disambiguation rules, when the rule applies over lists of nodes
  • Non-linear disambiguation rules, when the rule applies over non-linear relations between nodes

Linear Disambiguation Rules

Linear disambiguation rules apply over the natural language list structure to constrain word selection (dictionary retrieval) or the application of both Tree-to-List (TL) and List-to-List (LL) Transformation Rules. They have the following format:

(A)(B)...=P;

Where A and B are nodes, and P is an integer (from 0 to 255).

Examples

(ART)(VER)=0;
An article (ART) may not precede a verb (VER).
(ART)(NOU)=255;
Articles (ART) always precede nouns (NOU).

Use

Rule Disambiguation
INPUT TRANSFORMATION RULES DISAMBIGUATION RULES OUTPUT
X(A,B,C;D,E,F) X(A;D)=(A)(D); (higher priority)
X(A;F)=(F)(A); (lower priority)
(B)(E)=0; (D,E,F)(A,B,C)


Word Disambiguation
INPUT DICTIONARY DISAMBIGUATION RULES OUTPUT
the book [book] "22222" (POS=VER); (higher priority)
[book] "11111" (POS=NOU); (lower priority)
(ART)(BLK)(VER)=0; [book] "1111" (POS=NOU);

Non-Linear Disambiguation Rules

Non-linear disambiguation rules apply over the syntactic or the network structure to constrain the application of List-to-Tree (LT), Tree-to-Tree (TT), Tree-to-Network (TN) and Network-to-Network (NN) Transformation Rules. They have the following format:

REL(A;B)=P;

Where REL is either a syntactic or a semantic relation, A and B are nodes, and P is an integer (from 0 to 255).

Examples

VS(VER;ADJ)=0;
An adjective (ADJ) may not be an specifier (VS) of a verb (VER).
NS(NOU;DET)=255;
Determiners (DET) are always specifiers (NS) of nouns (NOU).
agt(VER;ADJ)=0;
An adjective (ADJ) may not be an agent (agt) of a verb (VER).
agt(VER;NOU)=255;
Agents (agt) of verbs (VER) are always nouns (NOU).

Use

INPUT TRANSFORMATION RULES DISAMBIGUATION RULES OUTPUT
SYN(A,B,C;D,E,F) SYN(A;D)=agt(;); (higher priority)
SYN(A;E)=aoj(;); (lower priority)
agt(A;F)=0; aoj(A,B,C;D,E,F)
(A,B,C)(D,E,F) (A)(D)=X(A;D); (higher priority)
(A)(E)=X(E;A); (lower priority)
X(F;A)=255; X(D,E,F;A,B,C)
agt(A,B,C;D,E,F) agt(A;D)=X(A;D); (higher priority)
agt(A;E)=Y(A;E); (lower priority)
X(B;F)=0; Y(A,B,C;D,E,F)


Formal Syntax of Disambiguation Rules

Disambiguation rules must comply with the following syntax

<DISAMBIGUATION RULE> ::= <NN RULE> | <TT RULE> | <LL RULE> 
<NN RULE>             ::= (<SEM>)+ "=" [0-255]";"
<TT RULE>             ::= (<SYN>)+ "=" [0-255]";"
<LL RULE>             ::= "(" <NODE> ")" ( "(" <NODE> ")" )+ "=" [0-255]";"
<SEM>                 ::= <TEXT> "(" <NODE> ";" <NODE> ")"
<SYN>                 ::= <TEXT> "(" <NODE> ";" <NODE> ")"
<NODE>                ::= ( (<DESCRIPTION>)( "," <DESCRIPTION> )* )?
<DESCRIPTION>         ::= <STRING> | <ENTRY> | <FEATURE> | <RELATION>
<STRING>              ::= """<text>"""
<ENTRY>               ::= "["<entry>"]"
<FEATURE>             ::= <VALUE> | <ATTRIBUTE> | <ATTRIBUTE>"="<VALUE>
<RELATION>            ::= <SEM>|<SYN>
<VALUE>               ::= <TEXT>
<ATTRIBUTE>           ::= <TEXT>
<TEXT>                ::= any sequence of characters except whitespace | <REGULAR EXPRESSION>
<REGULAR EXPRESSION>  ::= "/"<PERL COMPATIBLE REGULAR EXPRESSIONS>"/"

Examples

  • List structures
    • (ART)(BLK)(VER)=0; (an article (ART) may not precede a verb (VER))
    • (ART)(BLK)(NOU)=255; (articles (ART) always precede nouns (NOU))
  • Syntactic and semantic structures
    • agt(VER;ADJ)=0; (an adjective (ADJ) may not be an agent (agt) of a verb (VER))
    • agt(VER;NOU)=255; (agents (agt) of verbs (VER) are always nouns (NOU))
    • VS(VER;ADJ)=0; (an adjective (ADJ) may not be an specifier (VS) of a verb (VER))
    • NS(NOU;DET)=255; (determiners (DET) are always specifiers (NS) of nouns (NOU))
Software