Grammar

From UNL Wiki
(Difference between revisions)
Jump to: navigation, search
Line 5: Line 5:
  
 
== Basic Concepts ==
 
== Basic Concepts ==
[[file:grammar.png|center]]
+
{{:Basic Concepts}}
 
+
=== [[Node]] ===
+
:''main article: [[Node]]''
+
A node is the most elementary unit in the graph. It is the result of the [[tokenization]] process, and corresponds to the notion of "lexical item". At the surface level, a natural language sentence is considered a list of nodes, and a UNL graph a set of relations between nodes.
+
 
+
=== [[Relation]] ===
+
:''main article: [[Relation]]''
+
In order to form a natural language sentence or a UNL graph, nodes are inter-related by relations. In the UNL framework, there are three different types of relations: the linear (list) relation, syntactic relations and semantic relations.
+
 
+
=== [[Hyper-Node]] ===
+
:''main article: [[Hyper-Node]]''
+
A hyper-node is a sub-graph, i.e., a node containing relations between nodes.
+
 
+
=== [[Hyper-Relation]] ===
+
:''main article: [[Hyper-Relation]]''
+
A hyper-relation is a relation between relations.
+
  
 
== Rules ==
 
== Rules ==

Revision as of 18:36, 19 August 2013

In the UNL framework, a grammar is a set of rules that is used to generate UNL out of natural language, and natural language out of UNL. Along with dictionaries, they constitute the basic resource for UNLization and NLization.

Contents

Basic Symbols

Basic symbols used in the UNL framework
Symbol Definition Example
( ) node (%a)
" " string "went"
[ ] natural language entry (headword) [go]
[[ ]] UW [[to go(icl>to move)]]
// regular expression /a{2,3}/ = aa,aaa
rel(x;y) relation agt(kill;Peter)
^ not ^a = not a
{ | } or {a|b} = a or b
% index for nodes, attributes and values %x
: scope ID :01
# index for sub-NLWs #01
= attribute-value assignment POS=NOU
! rule trigger !PLR
& merge operator %x&%y
? dictionary lookup operator ?[a]

Basic Concepts

Basic Concepts

Rules

main article: Rules

Grammars are sets of rules used to go from UNL into natural language, or from natural language into UNL. In the UNL framework, there can be two different types of rules:

  • T-rules, or transformation rules, are used to perform changes to nodes or relations
  • D-rules, or disambiguation rules, are used to control changes over nodes or relations

T-rules Follow the very general formalism

α:=β;

where the left side α is a condition statement, and the right side β is an action to be performed over α.

D-rules follow a slightly different formalism:

α=P;

where the left side α is a statement and the right side P is an integer from 0 to 255 that indicates the probability of occurrence of α.

Modules

In the UNL framework there are three types of grammar:

  • N-Grammar, or Normalization Grammar, is a set of T-rules used to segment the natural language text into sentences and to prepare the input for processing.
  • T-Grammar, or Transformation Grammar, is a set of T-rules used to transform natural language into UNL or UNL into natural language.
  • D-Grammar, or Disambiguation Grammar, is a set of D-rules used to to improve the performance of transformation rules by constraining or forcing their applicability.

Direction

In the UNL framework, grammars are not bidirectional, although they share the same syntax:

  • UNLization (NL>UNL)
    • The N-Grammar contains the normalization rules for natural natural analysis
    • The Analysis T-Grammar contains the transformation rules used for natural language analysis
    • The Analysis D-Grammar contains the disambiguation rules used for tokenization and for improving the results of the NL-UNL T-Grammar
  • NLization (UNL>NL)
    • The Generation T-Grammar contains the transformation rules used for natural language generation
    • The Generation D-Grammar contains the disambiguation rules used for improving the results of the UNL-NL T-Grammar

Processing Units

In the UNL framework, grammars may target different processing units:

  • Text-driven grammars process the source document as a single unit (i.e., without any internal subdivision)
  • Sentence-driven grammars process each sentence or graph separately
  • Word-driven grammars process words in isolation

Text-driven grammars are normally used in summarization and simplification, when the rhetorical structure of the source document is important. Sentence-driven grammars are used mostly in translation, when the source document can be treated as a list of non-semantically related units, to be processed one at a time. Word-driven grammars are used in information retrieval and opinion mining, when each word or node can be treated in isolation.

Recall

Grammars may target the whole source document or only parts of it (e.g. main clauses):

  • Chunk grammars target only a part of the source document
  • Full grammars target the whole source document

Precision

Grammars may target the deep or the surface structure of the source document:

  • Deep grammars focus on the deep dependency relations of the source document and normally have three levels (network, tree and list)
  • Shallow grammars focus only on the surface dependency relations of the source document and normally have only two levels (network and list)

Assessment

Main article: F-measure

Grammars are evaluated through a weighted average of precision and recall, the F-measure.

Software