• No results found

Towards Robust PATR

N/A
N/A
Protected

Academic year: 2020

Share "Towards Robust PATR"

Copied!
7
0
0

Loading.... (view fulltext now)

Full text

(1)

T o w a r d s R o b u s t P A T R

S h o n a D o u g l a s * a n d R o b e r t D a l e t C e n t r e f o r C o g n i t i v e S c i e n c e

U n i v e r s i t y o f E d i n b u r g h E d i n b u r g h E H 8 9LW, S c o t l a n d

A b s t r a c t

We r e p o r t on the initial stages of development of a robust parsing system, to be used as p a r t of The Editor's Assistant, a p r o g r a m t h a t detects a n d cor- rects textual errors a n d infelicities in the area of s y n t a x a n d style. O u r mechanism extends the stan- d a r d PATR-n formalism by indexing the constraints on rules a n d a b s t r a c t i n g away control of the appli- cation of these constraints. This allows independent specification of grouping a n d ordering of the con- straints, which can improve the efficiency of process- ing, a n d in conjunction with information specifying whether constraints are necessary or optional, allows detection of syntactic errors.

I n t r o d u c t i o n

The Editor's Assistant [Dale 1989, 1990] is a rule- based system which assists a copy editor in massag- ing a text to conform to a house style. The central idea is t h a t publishers' style rules can be maintained as rules in a knowledge base, a n d a special inference engine t h a t encodes strategies for examining text can be used to apply these rules. The program then op- erates by interactively detecting and, where possible, offering corrections for those aspects of a text which do not conform to the rules in the knowledge base. The expert-system-like architecture makes it easy to modify the system% behaviour by adding new rules or switching rule bases for specific purposes. O u r previous work in this area has been oriented to- wards the checking of low-level details in text: for example, the f o r m a t a n d p u n c t u a t i o n of dates, num- bers a n d numerical values; the p u n c t u a t i o n a n d use of abbreviations; and the typefaces a n d abbrevia- tions to be used for words from foreign languages. In this paper, we describe some recent work we have carried out in extending this mechanism to deal with s y n t a c t i c errors; this has led us to a general mecha- nism for r o b u s t parsing which is applicable outside the context of our own work.

° E-mail addeas is S. Douslaa@ed. ac. uk.

tAIso of the Department of Artificial Intelligence at the University of Edinburgh; e-mail address is R,Dale©ed. ac.uk.

S y n t a c t i c E r r o r s C a t e g o r i e s o f E r r o r s

Ultimately, the aim of The EdilorJs Assistant is to deal with real l a n g u a g e ~ u n r e s t r i c t e d n a t u r a l lan- guage text in all its richness, with all its idio~yn- cracies. The system is therefore a n experiment in w h a t we call i n t e l l i g e n t t e x t p r o c e s s i n g : a n in- tersection of techniques from n a t u r a l language pro- cossing a n d from more m u n d a n e text processing ap- plications, with t h e intelligence being derived from the addition of language sensitivity to the basic text processing mechanisms.

Many of the corrections m a d e routinely in the course of h u m a n proofreading require subleties of semantic a n d p r a g m a t i c expertise t h a t are simply b e y o n d cur- rent resources to emulate. However, examination of common syntactic errors a n d infelicities, b o t h as de- scribed in the literature (see, for example, [Miller 1986]) and es appearing in d a t a we have analysed, has led us to distinguish a n u m b e r of t r a c t a b l e er- ror types, a n d we have based the development of our system on the various requirements imposed by these classes. The error types are defined very much with processing requirements in mind; orthogonal cate- gorisations are of course possible. We give s u m m a r y descriptions of these c l a . ~ s here; examples are pro- vided in Figure 1.

C o n s t r a i n t V i o l a t i o n E r r o r s :

These involve what, in most c o n t e m p o r a r y syn- tactic theories, are best viewed as the violation of constraints on feature values. All errors in agree- ment fall into this category.

L e x l c a l C o n f u s i o n : These involve the confusion of one lexical item with another. We specifically in- clude in this category cases where a word contain- ing a n apostrophe is confused with a similar word t h a t does not, or vice versa.

S y n t a c t i c A w k w a r d n e s s : We include here cases where the problem is either stylistic or likely to cause processing problems for the reader. Note t h a t these 'errors' are not syntactically incorrect, but are constructions which, if overused, m a y re- sult in poor writing, a n d as such are often in- cluded in style-checker 'hit-lists'; thus, we would include multiple e m b e d d i n g constructions, poten-

(2)

C o n s t r a i n t V i o l a t i o n Errors:

(l) Subject-verb number disagreement: a. *John and Mary runs. b. *The dogs runs.

(2) Premodifier-noun number disagreement:

a. *This dogs runs. b. *All the dog run.

(3) Subject-complement number disagreement: a. *There is live dogs here.

h. *There are a dog. (4) Wrong pronoun case.:

a. *llc and me ran to the dog. b, *This stays between you and I, (5) Wrong indelblitc article:

a. *A apple and an rotten old pear. b. A NeXT workstation and *a NEC laptop. 1

Le.xical C o n f o s i o n :

(6) Confusion of its and it's: a. *Its late.

b. *Tim dog ate it's bone. (7) Confusion of that,, their, and they're:

a. *Their is a dog here. b, *They're is a dog here. e. *Ttmrc dog was cohi. d. *They're dog was cold. e. *There }lere now. f. *Ttmir here now.

(8) Confusion of p ~ i v c ' s and plural s: a. *The dog's are cold.

b. *3'lie boy ate the dogs biscuit.

S y n t a c t i c A w k w a r d n e s s :

(9) ~[bo many prepositional phraees:

a. Tile boy gave the dog in the window at the end with tile red collar with the address on the back of it a biscuit.

(10) i)a~'~ive constructions: a. The boy wa.s seen by the dog.

M i s s i n g or e x t r a e l e m e n t s :

(11) Unpaired delimiters:

a. *The dog, wllich was in tile garden was quiet. (12) Missing delimiters:

a. *The dog, I think was in the garden. b. *In the garden dog,s arc a menace. (13) Missing list ~parators:

a. *There were two dog~ three cats and a canary. (ld) Double syntactic function:

a. *it s~,cms to be is a dog.

b. *l think know Fve been there before.

F i g u r e 1 : Example's o f S y n t a c t i c E r r o r s

:tally a n l b i g u o u s s y n t a c t i c s t r u c t u r e s , a n d g a r d e n p a t h sentence~s in t h i s category. T h e s e p r o b l e m s are d e t e c t a b l e by s i m p l e c o u n t i n g or r e c o g n i t i o n of s y n t a c t i c f o r m s .

M i s s i n g o r E x t r a E l e m e n t s :

T h e s e a r c c~mes w h e r e e l e m e n t s ( e i t h e r w o r d s o r p t m c t u a t i o n s y m b o l s ) arc o m i t t e d or mistakelfly included in a t e x t . A n i n t e r e s t i n g s u b - c a t e g o r y here, which is s u r p r i s i n g l y frequent, is t h e pres~ ence of two c o n s t i t u e n t s w h i c h s e r v e t h e s a m e or a s i m i l a r purpose; by a n a l o g y w i t h double-word e r r o r s ( w h e r e a word a p p e a r s twice it, succession when only o n e o c c u r r e n c e w a s i n t e n d e d ) , we refer to these as c a s ~ of d o u l ) l e s y n t a c t i c f u n c t i o n .

T h e crrors dealt w i t h in t h i s p a p e r all fall into t h e first class, i.e, thorn t h a t c a n be s e e n as b r e a k i n g constraint.s on f e a t u r e values. A t t h e e n d of t h e p a p e r we s l a k e sonte o b s e r v a t i o n s on h o w t h e m e c h a n i s m can bc. e x t e n d e d lx) t h e o t h e r classes.

: P r e v i o u s W o r k

O f course, there e x i s t s a s i g n i i i c a n t b o d y of work d e a l i n g w i t h ( x m l p u t a t i o n a l a p p r o a c h e s to s y n t a c t i c e r r o r s like t h o s e j u s t discu~.scd. Broadly, work deal- ing w i t h u n g r a m m a t i c a l i n p u t falls into t w o cate- g o r i c : a p p r o a c h e s w h e r e t h e p r i n c i p a l o b j e c t i v e is to d e t e r m i n e w h a t m e a n i n g t h e s p e a k e r i n t e n d e d , a n d a p p r o a c h ~ w h e r e t h e p r i n c i p a l o b j e c t i v e is to o o n s t r u c t ml a p p r o p r i a t e correction. T h e first k i n d of a p p r o a c h is m o s t a p p r o p r i a t e in t h e d e v e l o p m e n t of n a t u r a l l a n g u a g e inLcrfaces, w h e r e s y n t a c t i c dys- flueneies c a n often be i g n o r e d if tile ~mer~s intentions c a n be d e t e r m i n e d by m e a n s of o t h e r evidence, tIow- ever, these, a p p r o a c h ~ (in t h e s i m p l e s t cases, b a s e d on d e t e c t i n g c o n t e n t words) a r c i n a p p r o p r i a t e where t h e sysLma m u s t al.,~o p r o p o s e a correction for t h e h y p o t h c s i s e d error.

O f t h e different t e d m i q u c s t h a t h a v e b e e n propo.~md u n d e r t h e s e c o n d category, t h e m o s t useful is t h a t usually referred t o as r e l a x a t i o n . Tiffs is a r a t h e r e l e g a n t m e t h o d for e x t e n d i n g a g r a m m a r ' s coverage to include ill-formed i n p u t , while r e t a i n i n g a princi- pled c o n n e c t i o n b e t w e e n t h c c o n s t r u c t i o n s a c c e p t e d by t h e m o r e r e s t r i c t i v e g r a m m a r a n d t h o s e a c c e p t e d by t h e e x t e n d e d one. I f a g r a m m a r exprt.~ses in- formaLion ill t e r m s of c o n s t r a i n t s o r c o n d i t i o n s on features, a slightly leas re,~trietivc g r a m m a r can be c o n s t r u c t e d by r e l a x i n g s o m e s u b s e t of t h e s e con- strainLs. W o r k c o m m o n l y r e f e r r e d t o in t h i s corn t e x t i n e l u d ~ K w a s n y a n d S o n d h e i m e r [1981] a n d Weischedel a n d Black [1980], b u t v e r y m a n y s y s t e m s u.~e .some k i n d of r e l a x a t i o n process, w h e t h e r o f s y n - t a c t i c or s e m a n t i c c o n s t r a i n t s . T h e m o s t well k n o w n is lnM'~q w o r k on t h e Epistle a n d C r i t i q u e s y s t e m s [tleidorn ct el. 1982; J e n s e n et at. 1983; R i c h a r d s o n a n d B r a d e n - t I a r d e r 1988].

lln British English, NEC is spelled out, rather than being pronolmeed like the word neei4 thus, the correct form here is an NEC,

(3)

Epistle parses t e x t in a left-to-right, b o t t o m - u p fash- ion, using g r a m m a r rules written using an augmented

phrase structure grammar (APSG). In APSG, each

g r a m m a r rule looks like a conventional context-free phrase s t r u c t u r e rule, b u t m a y have a r b i t r a r y tests a n d actions specified on b o t h sides of the rule. So, for example, we might have a rule like the follow- ing:

(15) NO VP (NUMB.AGREE.NUMB(NP)) -~

VP(SUBJECT = NP)

This rule states t h a t a noun p h r a s e followed b y a verb phrase together form a VP, 2 provided the n u m b e r of the N [ a n d the original VP agree. The resulting VP structure then has the original NP as the value of its SUBJECT attribute.

Using rules like the~e, the system a t t e m p t s to parse a sentence as if it were completely grammatical. Then, if no parse is found, the system relaxes some condi- tions on the rules a n d tries again; if a parse is now obtained, the system can hypothesise the n a t u r e of the problem on the basis of the particular condition t h a t was relaxed. Thus, if the above rule was used in analysing the sentence Either of the models are acceptable, no parse would b e obtained, since the n u m b e r of the NP Either of the models is singular whereas the n u m b e r of the VP are acceptable is plu- ral. However, if the n u m b e r agreement constraint is relaxed, a parse will be obtained; the system can then suggest t h a t the source of the ungran]matical- ity is the lack of n u m b e r agreement between subject and verb.

One thing t h a t must be borne in mind when con- sidering the merits a n d demerits of relaxation meth- ods is t h a t they depend crucially on how much of the particular grammar2s information is expressed as constraints on feature values. Where the basic form of a g r a m m a r is, say, complex phrase struc- ture rules, the use of features m a y be confined to checking of number a n d person agreement. If, on the other hand, more of the informative content of the g r a m m a r is represented as constraints, as in re- cently p o p u l a r unification-based g r a m m a r s [Sheibcr 1986], relaxation can be used to transform g r a m m a r s to less closely related ones.

In the remainder of this paper, we show how a unification-based formalism, PATR-II, m a y be ex- tended by a declarative specification of relaxations so t h a t it can be used flexibly for detecting syntactic errors. Under one view, w h a t we are doing here is rationally reconstructing the Epistle system within a unification-based framework. A useful consequence of this exercise is t h a t the adoption of a declarative approach to the specification of relaxations makes it much easier to explore different processing regimes for handling syntactic errors.

~This second, higher-level VP plays the role of what we would normally think of as an S node.

Y,O Xl X2

(XO cat) = VP (Xl cat) = NP

(X2 cat) = VP

(X0subject) = Xl

(Xl hum) = (X2 hum)

Figure 2: PATti version of the Epistle rule

M a k i n g P A T R R o b u s t T h e B a s i c M e c h a n i s m

In this section, we describe a n experimental system, written in Prolog, t h a t is designed to s u p p o r t the mechanisms necessary t o apply PATR-type rules to solve constraints selectively. The m a j o r components of the system are (a) the parsing mechanism; (b) the underlying P^TR system; a n d (c) the rule application mechanism t h a t mediates between these two. The parser encodes the chosen s t r a t e g y for applying particular g r a m m a r rules in a p a r t i c u l a r order. At this stage, the p a r s e r is n o t a crucial component of the system; all we require is t h a t it a p p l y rules in a b o t t o m - u p fashion. Accordingly, we use a simple shift-reduce mechanism. T h e parser will be the focus for m a n y of the proposed extensions discussed later; in particular, we are in the process of implementing a chart-based mechanism to allow handling of errors resulting from missing or extra elements.

The basic PATR system provides a unification based mechanism for solving sets of constraints on feature structures. A PATR rule corresponding to the gram- m a r rule discussed in the context of Epistle above is shown in Figure 2.

It is fairly obvious t h a t , given some mechanism t h a t allows us to remove the final constraint in this rule, we can emulate the behaviour of t h e Epistle system. In our model, the rule application mechanism pro- vides the interface between the parsing mechanism, which accesses the lexicon a n d decides the order in which to t r y rules, a n d the PATR. system. To see how this works, we will consider a slightly morn complex rule, shown in Figure 3; t h e use of t h e n u m b e r s on the constraints will be explained below.

Given this rule, a constituent of c a t e g o r y NP will be found given two lexical items which axe respectively a determiner and a noun, provided all the constraints numbered 1 t h r o u g h 6 are found to hold. Note the constraint n u m b e r e d 4: we suppose t h a t the features addressed by (X1 agr precedes) a n d (X2 agr

begins)

m a y have the values vowel a n d consonant. This al- lows us to specify the a p p r o p r i a t e restrictions o n the use of the two forms a a n d an. 3

aOf course, the imp]ication here that a is used be- fore words beginning with a vowel and an is used before words beginning with a consonant is an oversimplification. There are aiso, of course, other means by which this con-

(4)

X0 Xl X2

1 (X0 cat)

2 (Xl cat)

3 (X2 cat) 4 (Xl agr precedes) 5 (Xl agr num)

6 (X0 agr num)

:~ NP

- - Det - - N

(X2 agr begins)

- - (X2 agr hum)

= (X2 agr hum)

Figure 3: Simple NP tale in the PATR formalism

R e l a x i n g C o n s t r a i n t s

Given the rule in Figure 3, and a standard parsing mechanism, there will be no problem in parsing cor- rect NPS like these dogs. tlowever, consider our target errors in (16a-e):

(16) a. *this dogs b. *an dog c. *an dogs

Exmnple (16a) exhibits premodifier noun number disgrecment; (16b) exhibits use of the wrong indefi- nite article; and (16c) cxmtains both of these errors. If the parser is to make any sense of thcse strings, we must introduce a more elaborate control structure. Premodifier-noun number agreement is enforced by constraint 5; constraint 4 enforces the use of the proper indefinite article. We need to be able to relax constraint 5 to parse (16a), and to relax constraint 4 to parse (16t)); to parse (16c), we want to relax both (xmstralnts 5 arid 4 at once.

"[b deal with this, we make use of the notion of a r e l a x a t i o n l e v e l Instead of applying all con strafers associated with a rule, we specify for evcry rule, at any given relaxation level, those constraints that are n e c e s s a r y and those t h a t are o p t i o n a l . At relaxation level 0, which is equivalent to thc bo- haviour of the standard PATR system, all constraints are deemed nece.~ary. At relaxation level 1, how- ever, constraints 4 and 5 are optional. Optional con- straints, if violated, need not result in a failed parse, but do correspond to particular errors.

The algorithm in Figure 4 applies all constraints ap- propriately, given a specification as just dcscribed. Here, N is the set of nccessary constraints and O is the set of optional constraints, both for a given relaxation level L; R is the set of constraints which have to be relaxed in order for the rule to he used. R will always be a subset of O, of course; we r(.~ turn the actual vahm of 1~ as a result of parsing with the rule. The outer conditional ensures t h a t all the necessary constraints are satisfied. The inner conditional takes appropriate action for each relax- able constraint whether or not it is satisfied: if the straint could be d~eckcd; however, we include it here as a constraint on the application of the rule for expository purp~c~.

When applying rule r at relaxation level L: N ~- necessary constraints on r at L O *-- optional constraints on r a t L

;~ ~ {}

if all n (: N can be solved

t h e n incorporate any instantiations required for eadl oi r 5 0 d o

if o, can be solved

t h e n incorporate instantiations e l s e R ¢-- O ~ O o ~

e n d i f n e x t else r e t u r n failure e n d i f

r e t u r n C

Figure 4: The relaxation algorithm, version 1

l~.claxation level 0:

necessary constraints = {1,2,3,4,5,6} optional constraints = { }

Relaxation level t:

n e c ~ s a r y coustraints -- {1,2,3,6} optional constraints = {5,4}

Figure 5: The relaxation specification for the NP rule, version l: optional constraints

Relaxation level 1:

necessary constraints: {1,2,3} relaxation packages:

(a) {5, 6}: Premodifier-noun munber disagreement

(b) {4}:

~ / ~ e r r o r

Figure 6: T h e relaxation specification for the NP rule, version 2: grouped constraints

constraint is satisfied, it has exactly thc same effect as a n e c c ~ a r y constraint; if not, the constraint is recorded as having been relaxed.

Once paining is complete, the information in R can then be used to generate an appropriate error mes- sage.

The operation of this algorithm is supported by ex- plicitly indexing each constraint within a tale, as in Figure 3, and absl.racting out the specification of whieh vonstraint.s may be relaxed at a given r e l a y ation lewfl. The constraint application specification for the NP rule is given ill Figure 5.

G r o u p i n g C o n s t r a i n t s

This is not the whole story, however. Consider the NP this dogs, which would be correctly parsed at re-

[image:4.432.51.213.33.99.2] [image:4.432.228.382.42.209.2]
(5)

laxation level 1 as exhibiting premodifier-noun num- ber disagreement under the system described so far. The instantiation of X0 resulting from this rule ap- plication would be as follows:

° °

]]

x0: I:;:: 0,u

Note in particular t h a t (X0 agr num) has the value plu. This results from the solution of constraint 6, which is one of the necessary constraints a t relax- ation level 1 as specified in Figure 5. This 'feature t r a n s p o r t ' constraint p r o p a g a t e s the n u m b e r of the tread noun to tile s u p e r o r d i n a t e noun phrase. It is not a p p r o p r i a t e to perform such a p r o p a g a t i o n under the current, cirolmstances, however, because once a case of prcmodifier-noun n u m b e r disagreement has been identified, we c a n n o t tell whether it is the num- ber of the noun or the n u m b e r of the determiner t h a t is in error. One might argue t h a t one of the two is more likely t h a n the other, b u t such a heuristic belongs in the mechanism t h a t offers replacements r a t h e r t h a n in the relaxation mechanism itself. If the n u m b e r of the noun is always p r o p a g a t e d to the noun phrase, spurious error reports m a y emerge in subsequent parsing: for example, in the text Th/s doys runs, a subject-verb n u m b e r disagreement will be flagged in addition to the premodifier-noun num- ber disagreement error. This will be at best mislead- ing.

We would like to be able to express the intuition t h a t it is not really meaningful to apply constraint 5 if constraint 5 has failed; these constraints should be g r o u p e d together, to be applied together or not a t all. So we introduce a n addition to the specification for relaxation level 1, shown in Figure 6.

We refer to a group of constraints to be relaxed to- gether or not at all, plus the error message t h a t cor- responds to the failure of the group of constraints, as a r e l a x a t i o n p a c k a g e . The algorithm of Figure 4 has been a d a p t e d to apply such relaxation packages, resulting in the algorithm in Figure 7. Here, R is the set of relaxation packages required in order to complete the parse.

Note t h a t if all the constraints in a relaxation pack- age can be applied successfully, they have exactly the same effect as necessary ones, in terms of contribut- ing to the building of structure. Thus, if the n u m b e r agremnent condition constraint 5 is satisfied, as in the case of the text an dogs, then the associated fea- ture percolation constraint, 6, will a d d the feature (agr nmn) to XO, with value (X2 agr hum).

O r d e r i n g C o n s t r a i n t s

In the previous section, we altered the mechanism to allow for the fact t h a t it is not meaningful to apply some coustraints if others have failed; in the worst case, this avoided confusing error diagnoses. Even if no such confusion would result, however, con-

When applying rule r a t relaxation level L: N *- necessary constraints on r a t L O 4- relaxation packages for r at L

R ~ -

{}

if all n • N c a n be solved t h e n incorporate a n y instantiations

f o r each relaxation package P~ E O d o i f all constraints c4 • Pi can be solved t h e n incorporate any instantiations e l s e R *-- R + P~:

e n d i f n e x t e l s e r e t u r n failure e n d i f

r e t u r n R

Figure 7: The relaxation algorithm, version 2

siderable efficiency gains can be m a d e by ordering constraints in such a way as to minimise unneces- sary structure building. A similar point is made by Uszkoriet [1991], who talks of the need for a flex* ible control s t r a t e g y for efficient unification based parsers, to ensure t h a t the conditions t h a t are most likely to fall are tried first.

Ideally, the ordering of constraints would be derived a u t o m a t i c a l l y from other information; b u t it is un- clear how this would be done. Currently, we make use of one central ordering principle:

(18) C a t e g o r y constraints on RnS items come first. In the b o t t o m - u p parsing system we use, all RrlS items will be instantiated with feature structures cor- responding to lexical entries, or to s y n t a c t i c cate- gories built u p b y rule from lexical entries; it is a discipline on our lexicon a n d our s t r u c t u r e build- ing rules t h a t all such feature structures will have a cat feature. This means t h a t a query a b o u t the cat value will involve no s t r u c t u r e building. However, if, before checking the category, we were to enquire a b o u t the (agr num) feature, we might involve our- selves in some unnecessary s t r u c t u r e building, be- cause if applied to a feature s t r u c t u r e t h a t does not have an (agr num) feature, w h a t was t h o u g h t of as a conditional constraint will in fact result in s t r u c t u r e building. For example, the constraint in (19) ap- plied against the s t r u c t u r e in (20) will result in the structure shown in (21); this is clearly not desirable. (19) (Xl agr n u m ) = plu

conjunction] (20) X1 = [l':xt:: and J

cat: conjunction]

lex: and

/

[image:5.432.231.391.38.172.2]
(6)

Relaxation level 0:

necessary c~mstraints: {2,3,5,4,1,6} relaxation packages: {}

Relaxation level 1 :

necessary constraints: {2,3,1 relaxation packages:

(a) {5, 6}: Premodifier-noun number disagreement

(b) {4}:

a/a,,

e r r o r

Figure 8: The relaxation specification for the N r rule, version 3: constraint ordering

These considerations give r i ~ to the ordering of con- straints given in Figure 8; we assume that when the algorithm in Figure 7 tests whether all members of a constraint set can be solved, the constraints are solved in the order given in the specification, and the test halts as soon o.s any m e m b e r of the constraint set cannot be solve&

D i s c u s s i o n

Wc have argued t h a t combining the relaxation tech- nique for syntactic error correction with a g r a m m a r (such a.s is found in recent unification formalisms) that expresses most of its information in the form of constraints provides a good starting point for a llexi- ble mechanism for detecting and correcting syntactic errors. Our work in this area so far raises a number of interesting (lUt.~tions which need to be pursued lurther.

D e p e n d e n c i e s b e t w c e n C o n s t r a i n t s : As we have seen, the ordering of constraints in the relaxation specifications is very important. How- ever, the particular role a specific constraint per- h)rms will of course depend on the particular pars- ing strategy being used. Ideally, we would like to generate the ordering information antx)matically, although it is not entirely clear how this might be (lone. One source of some ordering constraints might come from using typed feature structures in tile lexicon, so t h a t the rule application mech- anism can deterniine abead of time what the pri m a r y source of information is. Another approach might lie to require the g r a m m a r writer to spec- ify the c, onstraints on rules as belonging to specific categories, and then to allow the rule application mechanisni to impose a predefined ordering be- tween categories; in particular, the most trouble- ~)mc constraints are those which transport feature values around a structure, since ttmy may trans- port the wrong values, ms we saw in the example discussed earlier.

G e n e r a t i o n o f R e p l a c e m e n t T e x t : A topic we have not addressed in the p r ~ e n t paper is the gen- eration of corrections for hypothesiscd errors. The result of parsing using relaxatkm provides sufli-

cleat information to generate such replacements, but once again we need to maintain infurmatiou about the dependencies between elements of a structure so that, when a new structure is created, any conflicts t h a t a r i ~ can be re=solved: for exam- ple, if generating a correction involves changing tile num feature of a noun from plural to singw lar, we need to encode the information t h a t the lex feature is dependent upon the hum feature and some specification of the root form, so t h a t the re- tfiaeement mechanism knows which features take priority and which m a y be overridden.

D e c i d i n g b e t w e e n E r r o r l t : y p o t h e s e s : When a constraint unifying two incompatible values vl mid v~ has to be relaxed, then in tile absence of further infi)rmation there are two equally likely error hy- p o t h e r s : one, t h a t vl is the correct value and t~a is wrong, mid the other t h a t v~ is correct and Vl is wrong. However, there are two t y p ~ of situa- tion in which further information available dm5ng parsing may ratable one hypothesis to be preferred. The first is where the absolute likelihood of one error seems greater t h a u t h a t of the other, l, br ex- ample, in the case of the noun phro.¢¢c these dog it might prove to be much more likely for a writer to mistakenly omit the single letter s than to choose the wrong determiner, which involvee a change of two letters there may be quantifiable difference between the assumptious behind the two hypothe- ses. The second is where a number of possible er- rors are linked, for example if the whole sentence w~m "llJese dog are fie~vze, llere, two possible errors involving different rules are interdependent, mid once again it is possible to argue t h a t one error hypothesis r e q u i r ~ a quantiliably dilferent set of ~ u m p t i o n s ; here, both these and ant would have to be wrong if dog were to be a.~sumed COrrect,. "lb a certain extent, it m a y be possible to rely on unilication to deal with these confliet.~. The relax- ation package dealing with the noun p h r ~ num- ber disagreement might 'hold its f i r e ' - n o t signal an error immediately- -leaving the number feature of the noun phrase uninstantiatcd. Then there will be no clash with the number of the verb phrmse, which will be propagated down to the noun phrase. It may be pix~sible to hook this value up to the s u b sequent t)rocc~ing el the error suggestion from the nolin phrase rule.

Alternatively, the idea t h a t there are a number of a~sumptious behind a given error hypothc'sis could be formalised, perhaps by 1L~ing an A'rMS [de Kleer 1986a, 1986b] to keep track of inconsistencies. Ily- potimses could be weighted both by their absolute likelihood and the contextual evidence (i.e., the number mid weight of related errors eonsis£ent mid inco~mistent with the hypotheses).

Much depends on where during the parsing pro~ eess errors arise and are notified, and so detailed consideration of this issue h~.u been deferred until our eht~rt parser extension to this system has been explored.

(7)

L e v e l s o f R e l a x a t i o n : The examples we have pro- vided have only explicitly mentioned one level of relaxation, One can imagine situations where other, further levels of relaxation are available. In particular, note t h a t , since categorial informa- tion can be specified by means of constraints, we can also consider handling instances of words mis- spelled as words of other syntactic categories by means of the same mechanism; relaxing category feature constraints might be a n a p p r o p r i a t e can- didate for a further level of relaxation. There is of course the question of how one decides w h a t re- laxations should be available a t w h a t levels; deter- mining this requires more detailed statistical anal- ysis of the frequencies of different kinds of errors. It is also likely to b c required t h a t individual error rules, spread across a n u m b e r of g r a m m a r rules, be capable of being t r e a t e d as a unit, t h a t is, switched on or off together, orthogonal to the idea of relax- ation levels.

D i f f e r e n t K i n d s o f R e l a x a t i o n : In the forego- ing, we a~qumed t h a t relaxing a constraint sim- ply meant removing it. There are other notions of constraint relaxation t h a t could be used, of course; for example, if a constraint assigns a value to some feature, we could relax this constraint by assigning a less specific value to t h a t feature. There m a y be other cases where we would want to generalise the notion of relaxation to include the possibility t h a t a constraint could be replaced by a quite different constraint.

C o n c l u s i o n s a n d F u t u r e W o r k We have described a simple extension to the PATR- n fornndism which allows us to provide declarative specifications of possible relaxations on rules. This provides a good starting point for a flexible mech- anism for detecting and c~rrecting syntactic errors. One rea.~on for this is t h a t relaxation provides a pre- cise and systematic way of specifying the relation- ship t)etweeu errorflfl a n d 'CorrecU forms, making it easier to generate suggestions for corrections. A sec- ond reason is t h a t the very uniform representation of linguistic information will allow flexible strategies for relaxation to be applied; this is particularly im- p o r t a n t when dealing with text t h a t m a y contain unpredictable errors.

As we have shown, the mechanism described here can be applied straightforwarly to Constraint Violation Errors as described at the beginning of the paper. At the m o m e n t wc have a r a t h e r ad hoe mechanism t h a t deals with cases of Lexical Confusion by pro- viding alternative lexical entries in the case of parse failure, b u t this needs to be integrated b e t t e r with the relaxation mechanism. Cases of Stylistic Awk- wardness simply require the addition of a critic t h a t walks over the structures p r o d u c e d b y the parser. The m Q o r focus of our current work is the replace- ment of the shift-reduce parser by a c h a r t parser, to enable us to handle cases of Missing or E x t r a Ele- ments.

A c k n o w l e d g e m e n t s

This work was carried o u t as p a r t of lED Project 1679, The EditorJ8 Assistan~ Douglas is supported by SERC grant GRF 35654. Much of our thinking on this topic was inspired by conversations with Pablo Romero-Mares, who constructed a n early version of the parser as an MSe project.

R e f e r e n c e s

t t Dale [1989] Computer-based Editorial Aids. Pages 12-20 in Recent Developments and Applications of Natural Language Understanding, edited by Jeremy Peckham. Kogan Page, London.

It Dale [1990] A Rule-based a p p r o a c h to Computer- Assisted Copy Editing. Computer Assisted Language Learning, 2, 59-67.

G E Heidorn, K Jensen, L A Miller, R J Byrd, a n d M S Chodorow [1982]] The Epistle text-critiquing system. IBM Systems Journal, 21, 305-326. J de Kleer {1986a] An Assumption-based Truth Maintenance System. Artificial Intelligence, 28, 127-162.

J de Kleer [1986b] Extending the TMS. Artificial Intelligence, 28, 163-196.

S C Kwasny a n d N K Sondheimer [1981] Relaxation Theories for Parsing Ill-Formed Input. American Journal of Computational Linguistics, 7, 99-108. K Jensen, G E Heidorn, L A Miller, a n d Y Ravin [1983] Parse fitting a n d prose fixing: getting a hold on ill-formedness. American Journal of Computa- tional Linguistics, 9, 147-160.

L A Miller [1986] Computers for Composition: A Stage Model Approach to Helping. Visible Lan- guage, X X ( 2 ) , 188 218.

S D Richardson a n d L C B r a d e n - H a r d e r [1988] The ILxperience of Developing a Large-Scale N a t u r a l Lan- guage Text Processing System: CRITIQUE, In Pro- ceedings of the 2nd Applied Natural Lan ouage proH cessing Conference, pp195-202.

S M Shiebcr I1986] An Introduction to Unification- based Approaches to Grammar. The University of Chicago Press, Chicago, Illinois.

H Uszkoreit [1990] Strategies for A d d i n g Control In- formation t o Declarative G r a m m a r s . In Proceedings of the 29th Annual Meeting of the Association for Computational Linguistics, pp237-245,

R M Weischedcl a n d J E Black [1980] Responding In- telligently to Unparsable Inputs. American Journal of Computational Linguistics, 6, 87-109.

Figure

Figure 4: The relaxation algorithm, version 1
Figure 7: The relaxation algorithm, version 2

References

Related documents

In seeking to catalyse urban theory, this special issue builds on three related steps we suggest could help with transcending dualisms in the understanding of informality: first,

The primary objective of this research was not necessarily to “fix” or remedy specific leadership issues or capability gaps. Instead, this research described why leadership

The HistoryMakers is a national 501(c)(3) non profit educational institution founded in 1999, committed to preserving, developing and providing easy access to an

Like birds and mammals, all reptiles breathe using their lungs.. Even aquatic

Dean Row Road Twinnies Road Styal Road Barlow Road Colshaw Drive Countess Avenue Countess Avenue Wilmslow Dean Row Lacey Green Handforth Kitt’s Moss Bramhall Park Bramhall

Most often, issue deed of navy is used instead seeing a mortgage, acting as security against given loan include a trustor has transferred to a trustee.. Lender and its agents

India stands out for its comprehensive rural water database known as Integrated Management Information System (IMIS), which conducts annual monitoring of drinking water coverage,

Fish, Chicken, Sausage or Vegetable Spring Roll with chips delivered directly to the boat from the best supplier in town - served with roll & butter All Cruises in the section