• Keine Ergebnisse gefunden

4.2 The WCDG Parser

4.2.2 Grammar

WCDG’s grammar primarily contains a collection of the constraints defined on the space of permissible parse structures. Each constraint c is weighted by a penalty score φ(c) whereφ is a function

(4.1) φ:C 7→[0,1]

that assigns each constraint from the set of all constraints C its penalty.

When a solution candidateSC violates a given constraintci, the resulting constraint penaltyφ(ci) is aggregated into the candidate’s overall score Φ(SC). In WCDG, the aggregation function Φ is multiplicative and a candidate’s overall score is defined as the product of the penalties associated with the constraints it violates.1

(4.2) Φ(SC) =Y

i

φ(ci)

The violation of a constraint with a penalty score of 0 results in the rejection of the corresponding solution candidate as unacceptable. Constraints with a penalty score of 0 are referred to as hard constraints. All other constraints can, in principle, be violated by an acceptable solution candidate and are referred to as soft constraints.

Observe that the violation of constraintsci with weight ci =1.0 has no effect upon the overall score of the solution candidate Φ(SC). Such constraints hence effectively do not constrain the space of acceptable solutions and should, strictly speaking, not be referred to asconstraints. For simplicity, however, we will use the termconstraint to denote every well-formedness rule in the grammar, irrespective of its numerical penalty score.

For each input sentence WCDG creates a directed acyclic graph of labelled depen-dency edges joining each dependant with its regent. With the exception of theROOT node, every node in a WCDG dependency graph represents a word in the input sen-tence. Dependencies are assigned between nodes. In contrast to phrase-structure formalisms, dependency parsing requires that higher syntactic structures such as prepositional phrases be modelled by assigning the corresponding dependency to a particular node. With the exception of the S-node a dependency tree hence has no internal nodes that do not map to a word in the input sentence. This property constitutes the most significant representational difference between dependency and phrase-structure grammars.

Each dependant can only have one regent per level of analysis. For some aspects of linguistic analysis such as syntax, relative clause reference or semantics, it can be helpful to build up separate dependency structures for the same input sentence.

WCDG achieves this by defining a separate level of analysis for each one of these structures. Attachment rules are defined individually for each level. In a constraint definition we therefore need to declare explicitly which level of analysis the con-straint body refers to. WCDG1 provides two levels of analysis, the SYNlevel for the assignment of syntactic dependencies and the REF level for reference resolution of relative pronouns. WCDG1 does not provide any levels – and thus no constraints – for semantic analysis.

Constraints on the properties of a single edge are referred to as unary while con-straints on the properties of two edges are referred to asbinary. As will be discussed further in Section5.6, the edge properties checked for in a constraint may indeed be complex. An example for a more complex edge property is its adjacency to other

1For a comprehensive and rigorous description of the WCDG formalism cf. Schr¨oder(2002).

edges with specific properties. The constraint that an edgeXbe above another edge with label PP, say, is still considered a unary constraint — even if the reach of the constraint has effectively been extended and the properties of two edges need to be evaluated in order to assess the satisfaction of this constraint. In the view of WCDG, the adjacency condition is still considered a property of edge X. Observe that this view also effects a shift of blame for constraint violations. Since the constraint is formulated as a property of X,Xis also responsible for violating the above adjacency constraint, even if the violation occurs because of an edge below X that does not bear the requiredPP label.

In first approximation, solving a constraint satisfaction problem in WCDG breaks down into three major steps, namely:

1. the application of unary constraints to individual dependency edges,

2. the application of binary constraints to larger dependency structures com-prising more than one edge,

3. the search for the optimal solution.

Let us attempt to formulate an expression to describe the time complexity of this parsing problem. As we have just seen, dividing constraint evaluation into the application of unary and binary constraints is a simplification (cf. Section 4.2.4).

Certain unary constraints also need to be evaluated on dependencies that extend over more than one edge and – analogously to binary constraints – need to be applied to larger dependency structures. Such constraints are referred to as context-sensitive. For the purpose of this derivation, however, we neglect the differentiation between context-sensitive and non-context-sensitive constraints. We make the simplifying assumption that every n-ary constraint contributes equally to the time complexity of n-ary constraint evaluation, regardless of whether it is context-sensitive or not.

The time complexity of unary constraint evaluation then depends on the number of constraint evaluations that need to be performed, which is equal to the product of the number of constraints and the total number of edge constellations to be evaluated for a given sentence. An upper bound for the number of unary constraint evaluations,Nunary, is given by Equation (4.3). A brief derivation of Equation (4.3) is given in AppendixIII.1.

(4.3) Nunary =|Cunary| ·n2max·s2·X

i

λi

where

Cunary is the set of all unary constraints in the grammar,

nmax is the maximum number of homonyms per slot in the sentence, s is the number of slots in the sentence, and

λi is the number of dependency labels on level of analysis i.

For binary constraint evaluation, constraint application is typically combined with search such as to avoid computation of the entire hypothesis space H . With this approach, binary constraints are not applied to solution structures that lie in pruned sections ofH . For reasons of processing efficiency – especially with longer sentences as are typically encountered in unrestricted natural language input – no WCDG search heuristic in practical use evaluates binary constraints for the entire hypo-thesis space. In cases where binary constraint evaluation and search are combined, time complexity for the combined step depends on the size of H and the algorithm employed to search it. Due to the strong dependency on the efficiency of search, no implementation-independent prediction of time complexity is possible in this case.

If all binary constraints were to be evaluated prior to the search on H, the time complexity of binary constraint evaluation would be proportional to the number of constraint evaluations. The upper bound for the number of binary constraint evalu-ations, Nbinary, is given by Equation (4.4). For a brief derivation of Equation (4.4) see Appendix III.2.

(4.4) Nbinary=|Cbinary| ·n4max·s4·

X

i

λi 2

In practice, the actual number of binary constraints evaluated is less than Nbinary

since WCDG does not evaluate binary constraints in solution candidates that con-tain edges which violate a hard unary constraint. The number of solution candidates violating one or more hard unary constraints, however, depends on the actual formu-lation of the unary constraints and thus cannot be predicted by an implementation-independent expression.

In summary we conclude that in WCDG the number of constraints in the grammar, the number of homonyms in each slot, the number of slots in the sentence and the number of labels in the grammar have a bearing on the number of constraint evalu-ations and thus on processing time. An understanding of the factors that influence the number of constraint evaluations will become important when trying to assess the effect of implementation changes between WCDG1 an WCDG2 upon processing time (cf. Section 5.7).

After this brief excursus into the computational complexity of the constraint satis-faction problem, let us return to the overview over WCDG’s grammar. In addition to the constraint and level definitions outlined so far, the grammar also may con-tain some further information most of which, however, is of lesser importance in the context of modelling cross-modal interaction:

Pragmas

Pragmas permit to define macros on the basis of WCDG commands. A pragma is executed when WCDG loads the file containing the pragma into memory.

The main use of pragmas is to set parameters for the current WCDG session.

Hierarchies

Named hierarchies provide a simple way of defining subsumption relations be-tween hierarchically structured symbols in WCDG.

Word Templates

To improve WCDG’s robustness to unknown input the grammar contains tem-plates describing typical word-formation patterns in a regular expression syn-tax. These patterns are effectively functions that assign a set of lexical features to any matching string. They are extremely useful for recognising systemati-cally generated words which are either too specific or too infrequent to warrant their inclusion as a full-form entry into the lexicon. One of these templates, e.g., recognises all words of the family n-fold such as ‘zw¨olffach’twelvefold.

Datamaps

WCDG provides a limited number of functions and predicates most of which take a fixed number of input arguments. Datamaps permit to map an arbi-trary number of input arguments n to a single return value. They have been employed to model subsumption hierarchies of lexical and syntactic features and as a work-around to extend the number of input arguments in WCDG functions and predicates. By including the return value of a datamap as an ar-gument into an existing function, the number of input arar-guments of a function can formally be maintained while, effectively, extending its number of input arguments byn-1. In terms of data structures, a datamap can be considered a hash table which takes the concatenation of the input argument strings as key and returns a hash value.