科学网

 找回密码
  注册

tag 标签: unification

相关帖子

版块 作者 回复/查看 最后发表

没有相关内容

相关日志

Handling Chinese NP predicate in HPSG
liwei999 2016-9-16 09:59
Handling Chinese NP predicate in HPSG (old paper in Proceedings of the Second Conference of the Pacific Association for Computational Linguistics, Brisbane, 1995) Wei Li Paul McFetridge Department of Linguistics Simon Fraser University Burnaby, B.C. CANADA V5A 1S6 Key words: HPSG; knowledge representation, Chinese processing Abstract This paper addresses a type of Chinese NP predicate in the framework of HPSG 1994 (Pollard Sag 1994). The special emphasis is laid on knowledge representation and the interaction of syntax and semantics in natural language processing. A knowledge based HPSG model is designed. This design not only lays a foundation for effectively handling Chinese NP predicate problem, but has theoretical and methodological significance on NLP in general. In Section 1, the data are analyzed. Both structural and semantic constraints for this pattern are defined. Section 2 discusses the semantic constraints in the wider context of the conceived knowledge-based model. The aim of natural language analysis is to reach interpretations, i.e. correctly assigning semantic roles to the constituents. We indicate that without being able to resort to some common sense knowledge, some structures cannot get interpreted. We present a way on how to organize and utilize knowledge in HPSG lexicon. In Section 3, a lexical rule for this pattern is proposed in our HPSG model for Chinese, whose prototype is being implemented. Problem We will show the data of Chinese NP predicate first. Then we will investigate what makes it possible for an NP to behave like a predicate. We will do this by defining both the syntactic and semantic constraints for this Chinese pattern. 1.1. Data: one type of Chinese NP predicate 1) 他好身体。 ta hao shenti. he good body He is of good health. 2) 张三高个子。 Zhangsan gao gezi Zhangsan tall figure. Zhangsan is tall. 3) 李四圆圆的脸。 Lisi Lisi yuanyuan de lian. Lisi round-round DE face. Lisi has a quite round face. 4) 这件大衣红颜色。 zhe jian dayi hong yanse. this (cl.) coat red colour. This coat is of red colour. 5) 明天小雨。 mingtian xiao yu. tomorrow little rain. Tomorrow it will drizzle. 6) 那张桌子三条腿。 na zhang zhuozi san tiao tui. that (cl.) table three (cl.) leg That table is three-legged. Note: (cl.) for classifier. DE for Chinese attribute particle. The relation between the subject NP and the predicate NP is not identity. The NP predicate in Chinese usually describes a property the subject NP has, corresponding to English be-of/have NP . In identity constructions, the linking verb SHI (be) cannot normally be omitted. 7a) 他是学者。 ta shi xuezhe. he be scholar He is a scholar. 8b) ?他学者。 ta xuezhe. 他学者。 he scholar 1.2. Problem analysis 1.2.1. We first investigate the structural characteristics of the Chinese NP predicate pattern. A single noun cannot act as predicate. More restrictively, not every NP can become a predicate. It seems that only the NP with the following configuration has this potential: NP . In other words, a predicate NP consists of a lexical N with a modifying sister. Structures of this sort should not be further modified. Thus, the following patterns are predicted. 8a) 那张桌子三条腿。 na zhang zhuozi san tiao tui. that (cl.) table three (cl.) leg That table is three-legged. 8b) 那张桌子塑料腿。 na zhang zhuozi suliao tui. that (cl.) table plastic leg That table is of plastic legs. 8c) * 那张桌子三条塑料腿。 * na zhang zhuozi san tiao suliao tui. 8d) * 那张桌子腿。 * na zhang zhuozi tui. 1.2.2. What is the semantic constraint for the Chinese predicate pattern? Although there is no syntactic agreement between subject and predicate in Chinese, there is an obvious semantic agreement between the two: hao shenti (good body) requires a HUMAN as its subject; san tiao tui (three leg) demands that the subject be FURNITURE or ANIMATE. Therefore, the following are unacceptable: 9) * 这杯茶好身体。 * zhe bei cha hao shenti. this cup tea good body 10) * 空气三条腿。 * kongqi san tiao tui. air three (cl.) leg Obviously,. it is not hao (good) or san tiao (three) which poses this semantic selection of subject. The semantic restriction comes from the noun shenti (body) or tui (leg). There is an internal POSSESS relationship between them: shenti (body) belongs to human beings and tui (leg) is one part of an animal or some furniture. This common sense relation is a crucial condition for the successful interpretation of the Chinese NP predicate sentences. There are a number of issues involved here. First, what is the relationship of this type of knowledge to the syntactic structures and semantic interpretations? Second, where and how would this knowledge be represented? Third, how will the system use the knowledge when it is needed? More specifically, how will the introduction of this knowledge coordinate with the other parts of the well established HPSG formalism? Those are the questions we attempt to answer before we proceed to provide a solution to the Chinese NP predicate. Let us look at some more examples: 11a) 桌子坏了。 zhuozi huai le. table bad LE The table went wrong. 11b) 腿坏了。 tui huai le.leg bad LE leg bad LE The leg went wrong. 11c) 桌子的腿坏了。 zhuozi de tui huai le. table DE leg bad LE The table's leg went wrong. 12a) 他好。 ta hao. he good He is good. 12b) 身体好。 shenti hao. body good The health is good. 12c) 他的身体好。 ta de shenti hao. he DE body good His health is good. note: LE for Chinese perfect aspect particle. When people say 11b) tui huai le (leg went wrong), we know something (the possessor) is omitted. For 11a), however, we have no such feel of incompleteness. Although we may also ask whose table , this possessive relation between who and table is by no means innate. Similarly, ta (he) in 12a) is a complete notion denoting someone while shenti (body) in 12b) is not. In 11c) and 12c), the possessor appears in the possessive structure DE-construction, the expectation of tui (leg) and shenti (body) is realized. These examples show that some words (concepts) have conceptual expectation for some other words (concepts) although the expected words do not necessarily show up in a sentence and the expectation might not be satisfied. In fact, this type of expectation forms part of our knowledge (common sense). One way to represent the knowledge is to encode it with the related word in the lexicon. Therefore we propose an underlying SYNSEM feature KNOWLEDGE to store some of our common sense knowledge by capturing the internal relation between concepts. KNOWLEDGE parallels to syntactic SUBCAT and semantic RELATION. KNOWLEDGE imposes semantic constraints on their expected arguments no matter what syntactic forms the arguments will take (they may take null form, i.e. the underlying arguments are not realized). In contrast, SUBCAT only defines syntactic requirement for the complements and gets interpreted in RELATION. Following this design, syntactic form and semantic constraints are kept apart. When necessary, the interaction between them can be implemented by lexical rules, or directly coindexed in the lexicon. For example, the following KNOWLEDGE information will be enforced as the necessary semantic constraints when we handle Chinese NP predicates by a lexical rule (see 3.3). PHON shenti SYNSEM | KNOWLEDGE | PRED possess SYNSEM | KNOWLEDGE | POSSESSOR human SYNSEM | KNOWLEDGE | POSSESSED SYNSEM | LOCAL | CONTENT | INDEX SYNSEM | LOCAL | CONTENT | RESTRICTION { RELATION body } SYNSEM | LOCAL | CONTENT | RESTRICTION { INSTANCE } Agreement revisited This section relates semantic constraints which embody common sense to the conventional linguistic notion of agreement. We will show that they are essentially the same thing from different perspectives. We only need slight expansion for the definition of agreement to accommodate some of our basic knowledge. This is important as it accounts for the feasibility of coding knowledge in linguistic ways. Linguistic lexicon seems to be good enough to house some general knowledge in addition to linguistic knowledge. Some possible problems with this knowledge-based approach are also discussed. Let's first consider the following two parallel agreement problems in English: 13) * The boy drink. 14) ? The air drinks. 13) is ungrammatical because it violates the syntactic agreement between the subject and predicate. 14) is conventionally considered as grammatical although it violates the semantic agreement between the agent and the action. Since the approach taken in this paper is motivated by semantic agreement, some elaboration and comment on agreement seem to be in need. The agreement in person , gender and number are included in CONTENT | INDEX features (Pollard Sag 1994, Chapter 2). It follows that any two signs co-indexed naturally agree with each other. That is desirable because co-indexed signs refer to the same entity. However, person, gender and number seem to be only part of the story of agreement. We may expand the INDEX feature to cope with the semantic agreement for handling Chinese and for in-depth semantic analysis for other languages as well. Note that to accommodate semantic agreement in HPSG, we first need features to represent the result of semantic classification of lexical meanings like HUMAN, FOOD, FURNITURE, etc. We therefore propose a ROGET feature (named after the thesaurus dictionary) and put it into the INDEX feature. Semantic agreement, termed sometimes as semantic constraint or semantic selection restriction in literature, is not a new conception in natural language processing. Hardly any in-depth language analysis can go smoothly without incorporating it to a certain extent. For languages like Chinese with virtually no inflection, it is more important. We can hardly imagine how the roles can be correctly assigned without the involvement of semantic agreement in the following sentences of the form NP1 NP2 Vt: 15a) 点心我吃了。 dianxin wo chi le. Dim-Sum I eat LE The Dim Sum I have eaten. 15b) 我点心吃了。 wo dianxin chi le. I Dim-Sum eat LE I have eaten the Dim Sum. Who eats what? There is no formal way but to resort to semantic agreement enforced by eat to correctly assign the roles. In HPSG 1994, it was pointed out (Pollard Sag 1994, p81), ... there is ample independent evidence that verbs specify information about the indices of their subject NPs. Unless verbs 'had their hands on' (so to speak) their subjects' indices, they would be unable to assign semantic roles to their subjects. The Chinese data show that sometimes verbs need to have their hands on the semantic categories (ROGET) of both their external argument (subject) and internal arguments to be able to correctly assign roles. Now we have expanded the INDEX feature to cover both ROGET and the conventional agreement features number, person and gender, the above claim of Pollard and Sag becomes more general. It is widely agreed that knowledge is bound to play an important role in natural language analysis and disambiguation. The question is how to build a knowledge-based system which is manageable. Knowledge consists of linguistic knowledge (phonology, morphology, syntax, semantics, etc.) and extra-linguistic knowledge (common sense, professional knowledge, etc.). Since semantics is based on lexical meanings, lexical meanings represent concepts and concepts are linked to each other in a way to form knowledge, we can well regard semantics as a link between linguistics and beyond-linguistics in terms of knowledge. In other words, some extra-linguistic knowledge may be represented in linguistic ways. In fact, lexicon, if properly designed, can be a rich source of knowledge, both linguistic and extra-linguistic. A typical example of how concepts are linked in a network (a sophisticated concept lexicon) is seen in the representation of drink ((*ANI SUBJ) (((FLOW STUFF) OBJE) ((SELF IN) (((*ANI (THRU PART)) TO) (BE CAUSE))))) in Wilks 1975b. While for various reasons we will not go as far as Wilks, we can gain enlightenment from this type of AI approach to knowledge. Lexicon-driven systems like the one in HPSG can, of course, make use of this possibility. Take the Chinese role-assignment problem, for example, the common sense that ANIMATE being eats FOOD can be seamlessly incorporated in the lexical entry chi (eat) as a semantic agreement requirement. PHON chi SYNSEM | KNOWLEDGE | PRED eat SYNSEM | KNOWLEDGE | AGENT animate SYNSEM | KNOWLEDGE | PATIENT food SYNSEM | LOCAL | CATEGORY | SUBCAT | EXTERNAL_ARGUMENT ] SYNSEM | LOCAL | CATEGORY | SUBCAT | INTERNAL_ARGUMENTS ] SYNSEM | LOCAL | CONTENT | RELATION SYNSEM | LOCAL | CONTENT | EATER | INDEX | ROGET SYNSEM | LOCAL | CONTENT | EATEN | INDEX | ROGET Note: Following the convention, the part after the colon is SYNSEM | LOCAL | CONTENT information. One last point we would like to make in this context is that semantic agreement, like syntactic agreement, should be able to loosen its restriction, in other words, agreement is just a canonical, in Wilk's term preference , requirement (Wilks 1975a). In practice of communication, deviation in different degrees is often seen and people often relax the preference restriction in order to understand. With semantic agreement, the deliberate deviation is one of the handy means to help render rhetorical expression. In a certain domain, Chomsky's famous sentence Colorless green ideas sleep furiously is well imaginable. On the other hand, the syntactic agreement deviation will not affect the meaning if no confusion is caused, which may or may not happen depending on context and the structure of the language. In English, lack of syntactic agreement for the present third person singular between subject and predicate usually causes no problem. Sentence 15) The boy drink therefore can be accepted and correctly interpreted. There is much more to say on the interaction of the two types of agreement deviation, how a preference model might be conceived, what computational complexities it may cause and how to handle them effectively. We plan to address it in another paper. The interested reader is referred to one famous approach in this direction. (Wilks 1975a, 1978). Solution We will set some requirements first and then present a lexical rule to see how well it meets our requirements. 3.1. Based on the discussion in Section 1, the solution to the Chinese predicate NP problem should meet the following 4 requirements: (1) It should enforce the syntactic constraints for this pattern: one and only one modifier XP in the form of NP1 XP NP2. (2) It should enforce the semantic constraints for this pattern: N2 must expect NP1 as its POSSESSOR with semantic agreement. (3) It should correctly assign roles to the constituents of the pattern: NP1 POSSESS NP2 (where NP2 consists of XP N2). (4) It should be implementable in HPSG formalism. 3.2. What mechanisms can we use to tackle a problem in HPSG formalism? HPSG grammar consists of two components: a general grammar (ID schemata and principles) and a lexical grammar (in the lexicon). The lexicon houses lexical entries with their linguistic description and knowledge representation in feature structures. The lexicon also contains generalizations captured by inheritance of lexical hierarchy and by a set of lexical rules . Roughly speaking, lexical hierarchy covers static redundancy between related potential structures. Just because the lexicon can reflect different degrees of lexical redundancy in addition to idiosyncrasy, the general grammar can desirably be kept to minimum. The Chinese NP predicate pattern should be treated in the lexicon. There are two arguments for that. First, this pattern covers only restricted phenomena (see 3.4). Second, it relies heavily on the semantic agreement, which in our model is specified in the lexicon by KNOWLEDGE. We need somehow to link the semantic expectation KNOWLEDGE and the syntactic expectation SUBCAT or MOD. The general mechanism to achieve that is structure sharing by coindexing the features either directly in the lexical entries (see the representation of the entry chi in Section 2) or through lexical rules (see 3.3). 3.3. Lexical Rule Lexical rules are applied to lexical signs (words, not phrases) which satisfy the condition. The result of the application is an expanded lexicon to be used during parsing. Since the pattern is of the form NP1 XP N2, the only possible target is N2, i.e. shenti (body) or tui (leg). This is due to the fact that among the three necessary signs in this form, the first two are phrases and only the final N2 is a lexical sign. We assume the following structure for our proposed lexical rule: NP ] hao ] , XP shenti ]] NP Predicate Lexical Rule SYNSEM | KNOWLEDGE | PRED possess SYNSEM | KNOWLEDGE | POSSESSOR SYNSEM | LOCAL | CATEGORY | HEAD | MAJ n SYNSEM | LOCAL | CATEGORY | PREDICATE - SYNSEM | LOCAL | CONTENT | INDEX SYNSEM | LOCAL | CONTENT | RESTRICTION { } ...| CATEGORY | PREDICATE + ...| CATEGORY | SUBCAT | EXTERNAL_ARGUMENT ] ...| CATEGORY | SUBCAT | INTERNAL_ARGUMENTS ] ...| CATEGORY | SUBCAT | INTERNAL_ARGUMENTS ] == ...| CATEGORY | SUBCAT | INTERNAL_ARGUMENTS } ] ...| CATEGORY | SUBCAT | INTERNAL_ARGUMENTS ...| CONTENT | RELATION possess ...| CONTENT | POSSESSOR | INDEX | ROGET ...| CONTENT | POSSESSED | INDEX ...| CONTENT | POSSESSED | RESTRICTION { | } For complicated information flow like this, it is best to explain the indices one by one with regards to the example ta hao shenti (he is of good body) in the form of NP1 XP N2. The index links the underlying PRED feature of N2 to the semantic RELATION feature; in other words, the predicate in the underlying KNOWLEDGE of shenti (body) now surfaces as the relation for the whole sentence. The index enforces the semantic constraint for this pattern, i.e. shenti (body) expects a human (ROGET) possessor as the subject (EXTERNAL_ARGUMENT) for this sentence. The index is the restriction relation of N2. links the INDEX features of XP and N2, and indicates that the internal argument is a de-facto modifier of N2, i.e. XP mods-for N2. Note that the part of speech of the internal argument (INTERNAL_ARGUMENT | SYNSEM | LOCAL | CATEGORY | HEAD | MAJ) is deliberately not specified in the rule because Chinese modifiers (XP) are not confined to one class, as can be seen in our linguistic data. Finally, defines the restriction relation of the XP to the INDEX of N2. The indices , and all contribute to artificially creating a semantic interpretation for . As is interpreted, XP is, in fact, a modifier of N2 and they would form an NP2, or constituent. In normal circumstances, the building of NP2 interpretation is taken care of by HPSG Semantics Principle . But in this special pattern, we have treated XP as a complement of N2, yet semantically they are still understood as one instance: hao shenti (good body) is an instance of good and body . This interpretation of NP2 serves as POSSESSED of the sentence predicate, indicated by the structure-sharing of , and . Finally, is the interpretation of NP1 and is assigned the role of POSSESSOR for the sentence predicate. Let's see how well this lexical rule meets the 4 requirements set in 3.1. (1) It enforces the syntactic constraints by treating XP as the internal argument and NP1 as the external argument. (2) It enforces the semantic constraints through structure sharing by the index . (3) It correctly assigns roles to the constituents of the pattern. The following interpretation will be established for ta hao shenti (he is of good body) by the parser. CONTENT | RELATION possess CONTENT | POSSESSOR | INDEX | PERSON 3 CONTENT | POSSESSOR | INDEX | NUMBER singular CONTENT | POSSESSOR | INDEX | GENDER male CONTENT | POSSESSOR | INDEX | ROGET human CONTENT | POSSESSOR | RESTRICTION { } CONTENT | POSSESSED | INDEX | PERSON 3 CONTENT | POSSESSED | INDEX | NUMBER singular CONTENT | POSSESSED | INDEX | GENDER nil CONTENT | POSSESSED | INDEX | ROGET organ CONTENT | POSSESSED | RESTRICTION { , } CONTENT | POSSESSED | RESTRICTION { ], ] } In prose, it says roughly that a third person male human he possesses something which is an instance of good body . We believe that this is the adequate interpretation for the original sentence. (4) Last, this rule has been implemented in our Chinese HPSG-style grammar using ALE and Prolog. The results meet our objective. But there is one issue we have not touched yet, word order . At first sight, Chinese seems to have similar LP constraints as those in English. For example, the internal argument(s) of a Chinese transitive verb by default appear on the right side of the head. It seems that our formulation contradicts this constraint in grammar. But in fact, there are many other examples with the internal argument(s), especially PP argument(s), appearing on the left side of the head. 服务 fuwu (serve): NP, PP(wei) 16a) 为人民服务 wei renmin fuwu for people serve Serve the people. 16b) ? 服务为人民。 fuwu wei renmin. serve for people 有益 youyi (of benefit): NP, PP(dui yu) 17a) 这对我有益。 zhe dui wo youyi this to I have-benefit This is of benefit to me. 17b) * 这有益对我。 zhe youyi dui wo this have-benefit to I 18a) 这于我有益。 zhe yu wo youyi this to I have-benefit This is of benefit to me. 18b) 这有益于我。 zhe youyi yu wo this have-benefit to I This is of benefit to me. Word order and its place in grammar are important issues in formulating Chinese grammar. To play safe and avoid generalization too soon, we assume a lexicalized view on Chinese LP constraint, encoding word order information in LEXICON through SUBCAT and MOD features. This proves to be a realistic and precise approach to Chinese word order phenomena. 3.4. As a final note, we will briefly compare the NP Predicate Pattern with one of the Chinese Topic Constructions: NP1 NP2 Vi/A (topic + (subject + predicate)) In Chinese, this is a closely related but much more productive form than this NP Predicate Pattern. And their structures are different. 19) 他身体好。 ta shenti hao he body good He is good in health. For topic constructions, we propose a new feature CONTEXT | TOPIC, whose index in this case is token identical to the INDEX value of ta . Please be advised that in the above structure, the CONTEXT | TOPIC ta is considered as a sentential adjunct instead of a complement subcated-for by shenti . Why? First, ta is highly optional: topic-less sentence is still a sentence. Second, and more convincingly, ta cannot always be predicted by its following noun. Compare: 20a) 他身体好。 ta shenti hao he body good He is good in health. 20b) 他好身体。 ta hao shenti he good body He is of good health. 21a) 他脾气好。 ta piqi hao he disposition good He is good in disposition. 21b) 他好脾气。 ta hao piqi he good disposition He is of good disposition. but: 22a) 她学习好。 ta xuexi hao. he study good He is good in study. 22b) * 他好学习。 ta hao xuexi he good study What this shows is that for topic sentences like ta shenti hao (He is good in health), ta xuexi hao (He is good in study), etc., there is no requirement to regard topic ta (he) as a necessary semantic possessor of shenti / xuexi , the relation is rather in-aspect: something (NP1) is good (A) in some aspect (NP2), or for something (NP1), some aspect (NP2) is good (A). Finally, it needs to be mentioned that our proposed lexical rule requires modification to accommodate sentence 6). That is already beyond what we can reach in this paper because it is integrated with the way we handle Chinese classifiers in HPSG framework. References Pollard, Carl Sag, Ivan A. (1994): Head-Driven Phrase Structure Grammar , Centre for the Study of Language and Information, Stanford University, CA Pollard, Carl Sag, Ivan A. (1987): Information‑based Syntax and Semantics Vol. 1: Fundamentals. Centre for the Study of Language and Information, Stanford University, CA Wilks, Y.A. (1975a): A Preferential Pattern-Seeking Semantics for Natural Language Interference. Artificial Intelligence , Vol. 6, pp.53-74. Wilks, Y.A. (1975b): An Intelligent Analyzer and Understander of English, in Communications of the ACM , Vol. 18, No.5, pp.264-274 Wilks, Y.A. (1978): Making Preferences More Active. Artificial Intelligence , Vol. 11, pp. 197-223 ~~~~~~~~~~~~~~~ footnotes ~~~~~~~~~~~~~~~~ This is not absolute, we do have the following examples: Ia) 约翰是纽约人。 Yuehan shi Niuyue ren John be New-York person John is a New Yorker. Ib) 约翰纽约人。 Yuehan Niuyue ren. John New-York person John is a New Yorker. IIa) 今天是星期天。 jintian shi xingqi-tian. today be Sun-day Today is Sunday. IIb) 今天星期天。 jintian xingqi-tian. today Sun-day Today is Sunday. It seems to be that the subject NP stands for some individual element(s), and the predicate NP describes a set (property) where the subject belongs. But it is not clear how to capture Ib) and IIb) while excluding 7b). We leave this question open. We realize that the syntactic constraint defined here is only a rough approximation to the data from syntactic angle. It seems to match most data, but there are exceptions when yi (one) appears in a numeral-classifier phrase: IIIa) 他一副好身体。 ta yi fu hao shenti. he one (cl.) good body He is of good health. (He is of a good body.) IIIb) * 他三副好身体。 ta san fu hao shenti he three (cl.) good body IIIc) 他好身体。 ta hao shenti. IVa) 李四一张圆圆的脸。 Lisi yi zhang yuanyuan de lian. Lisi one (cl.) round-round DE face Lisi has a quite round face. IVb) * 李四两张圆圆的脸。 Lisi liang zhang yuanyuan de lian. Lisi two (cl.) round-round DE face IVc) 李四圆圆的脸。 Lisi yuanyuan de lian. Another reading for 22a) is ], where ta xuexi is a subject clause: That he studies is good. This is another issue. Notes for An HPSG-style Chinese Reversible Grammar Outline of an HPSG-style Chinese reversible grammar PhD Thesis: Morpho-syntactic Interface in CPSG (cover page) PhD Thesis: Chapter I Introduction PhD Thesis: Chapter II Role of Grammar PhD Thesis: Chapter III Design of CPSG95 PhD Thesis: Chapter IV Defining the Chinese Word PhD Thesis: Chapter V Chinese Separable Verbs PhD Thesis: Chapter VI Morpho-syntactic Interface Involving Derivation PhD Thesis: Chapter VII Concluding Remarks Overview of Natural Language Processing Dr. Wei Li’s English Blog on NLP
个人分类: 立委科普|4470 次阅读|0 个评论
钩沉:博士阶段的汉语HPSG研究
liwei999 2015-11-2 17:09
【立委按】博士阶段趟了这趟合一(unification)文法HPSG(Head-driven Phrase Structure Grammar)的浑水。这一条路子当年炒得火热,合一看上去也的确很美好,但却终于没成气候,for a good reason。从旧档案中翻出这篇论文,也算是一个足迹。 F_SGP99.doc W. Li. 1996. Interaction of Syntax and Semantics in Parsing Chinese Transitive Patterns. In Proceedings of International Chinese Computing Conference (ICCC'96). Singapore Keywords: Chinese processing, transitive pattern, syntax, semantics, lexical rule, HPSG Abstract This paper addresses the problem of parsing Chinese transitive verb patterns (including the BA construction and the BEI construction) and handling the related phenomena of semantic deviation (i.e. the violation of the semantic constraint). We designed a syntax-semantics combined model of Chinese grammar in the framework of Head-driven Phrase Structure Grammar . Lexical rules are formulated to handle both the transitive patterns which allow for semantic deviation and the patterns which disallow it. The lexical rules ensure the effective interaction between the syntactic constraint and the semantic constraint in analysis. The contribution of our research can be summarized as: (1) the insight on the interaction of syntax and semantics in analysis; (2) a proposed lexical rule approach to semantic deviation based on (1); (3) the application of (2) to the study of the Chinese transitive patterns; (4) the implementation of (3) in a unification based Chinese HPSG prototype. Interaction of syntax and semantics in parsing Chinese transitive verb patterns 1* 1. Background When Chomsky proposed his Syntactic Structures in fifties, he seemed to indicate that syntax should be addressed independently of semantics. As a convincing example, he presented a famous sentence: 1) Colorless green ideas sleep furiously. Weird as it sounds, the grammaticality of this sentence is intuitively acknowledged: (1) it follows the English syntax; (2) it can be interpreted. In fact, there is only one possible interpretation, solely decided by its syntactic structure. In other words, without the semantic interference, our linguistic knowledge about the English syntax is sufficient to assign roles to each constituent to produce a reading although the reading does not seem to make sense. However, things are not always this simple. Compare the following Chinese sentences of the same form 2a) dianxin wo chi le. Dim-Sum I eat LE. The Dim Sum I have eaten. Note: LE is a particle for perfect aspect. 2b) wo dianxin chi le. I have eaten the Dim Sum. Who eats what? There is no formal way but to resort to the semantic constraint imposed by the notion eat to reach the correct interpretation . Of course, if we want to maintain the purity of syntax, it could be argued that syntax will only render possible interpretations and not the interpretation. It is up to other components (semantic filter and/or other filters) of grammar to decide which interpretation holds in a certain context or discourse. The power of syntax lies in the ability to identify structural ambiguities and to render possible corresponding interpretations. We call this type of linguistic design a syntax-before-semantics model. While this is one way to organize a grammar, we found it unsatisfactory for two reasons. First, it does not seem to simulate the linguistic process of human comprehension closely. For human listeners, there are no ambiguities involved in sentences 2a) and 2b). Secondly, there is considerable cost on processing efficiency in terms of computer implementation. This efficiency problem can be very serious in the analysis of languages like Chinese with virtually no inflection. Head-driven Phrase Structure Grammar (HPSG) assumes a lexicalist approach to linguistic analysis and advocates an integrated model of syntax and the other components of grammar. It serves as a desirable framework for the integration of the semantic constraint in establishing syntactic structures and interpretations. Therefore, we proposed to enforce the semantic constraint that animate being eats food directly in the lexical entry chi (eat) : chi (eat) requires an animate NP subject and a food NP object. It correctly addresses who-eats-what problem for sentences like 2a) and 2b). In fact, this type of semantic constraint (selection restriction) has been widely used for disambiguation in NLP systems. The problem is, the constraint should not always be enforced. In practice of communication, deviation from the constraint is common and deviation is often deliberately applied to help render rhetorical 3) xiang chi yueliang, ni gou de3 zhao me? want eat moon, you reach DE3 -able ME? Wanting to eat the moon, but can you reach it?Note: DE3 is a particle, introducing a postverbal adjunct of result or capability. ME is a sentence final particle for yes-no question. 4) dajia dou chi shehui zhuyi, neng bu qiong me? people all eat social -ism, can not poor ME? Everyone is eating socialism, can it not be poor? yueliang (moon) is not food, of course. It is still some physical object, though. But in 4), shehui zhuyi (socialism) is a purely abstract notion. If a parser enforces the rigid semantic constraint, there are many such sentences that will be rejected without getting a chance to be interpreted. The fact is, we do have interpretations for 3) and 4). Hence an adequate grammar should be able to accommodate those To capture such deviation, Wilks came up with his Preference Semantics . A sophisticated mechanism is designed to calculate the semantic weight for each possible interpretation, i.e. how much it deviates from the preference semantic constraint. The final choice will be given to the interpretation with the most semantic weight in total. His preference model simulates the process of how human comprehends language more closely than most previous approaches. The problem with this design is the serious computational complexities involved in the model . In order to calculate the semantic weight, the preference semantic constraint is loosened step by step. Each possible substructure has to be re-tried with each step of loosening. It may well lead to combinatorial explosion. What we are proposing here is to look at semantic deviation in the light of the interaction of the syntactic constraint and the semantic constraint. In concrete terms, the loosening of the semantic constraint is conditioned by syntactic patterns. Syntactic pattern is defined as the representation of an argument structure in surface form. A pattern consists of 2 parts: a structure's syntactic constraint (in terms of the syntactic categories and configuration, word order, function words and/or inflections) and its interpretation (role assignment). For example, for Chinese transitive structure, NP V NP: SVO is one pattern, NP NP V:SOV is another pattern, and NP V: SOV (the BA construction) is still another. The expressive power of a language is indicated by the variety of patterns used in that language. Our design will account for some semantic deviation or rhetorical phenomena seen in everyday Chinese without the overhead of computational complexities. We will focus on Chinese transitive verb patterns for illustration of this 2. Chinese transitive patterns Assuming three notional signs wo (I), chi (eat) and dianxin (Dim Sum), there are maximally 6 possible combinations in surface word order, out of which 3 are grammatical in Chinese.2 5a) wo chi le dianxin. SVO 5b) wo dianxin chi le. SOV 5c) dianxin wo chi le. OSV SVO is the canonical word order for Chinese transitive structure. When a string of signs matches the order NP V NP, the semantic constraint has to yield to syntax for interpretation. 6) daodi shi ni zai du shu ne, haishi shu zai du ni ne? on-earth be you ZAI read book NE, or book ZAI read you NE Are you reading the book, or is the book reading you, anyway? Note: ZAI is a particle for continuous aspect. NE is a sentence final particle for or-question. Same as in the English equivalent, the interpretation of 6) can only be SVO, no matter how contradictory it might be to our common sense. In other words, in the form of NP V NP, syntax plays a ??? In contrast, to interpret the form NP NP V as SOV in 2b), the semantic constraint is critical. Without the enforcement of the semantic constraint, the interpretation of SOV does not hold. In fact, this SOV pattern (NP1 NP2 V: SOV) has been regarded as ungrammatical in a Case Theory account for Chinese transitive structure in the framework of GB. According to their analysis, something similar to this pattern constitutes the DStructure for transitive pattern and Chinese is an underlying SOV language (called SOV Hypothesis: see the survey in Gao 1993). In the surface structure, NP2 is without case on the assumption that V assigns its CASE only to the right. One has to either insert the case-marker ba to assign CASE to it (the BA construction) or move it to the right of V to get its CASE (the SVO pattern). This analysis suffers from not being able to account for the grammaticality of sentences like 2b). However, by distinguishing the deep pattern SOV from the 2 surface patterns (the SVO and the BA construction), the theory has its merit to alert us that the SOV pattern seems to be syntactically problematic (crippled, so to speak). This is an insightful point, but it goes one step too far in totally rejecting the SOV pattern in surface structure. If we modify this idea, we can claim that SOV is a syntactically unstable pattern, and that SOV tends to (not must) transform to the SVO or the BA construction unless it is reinforced by semantic coherence (i.e. the enforcement of the semantic constraint). This argument in the light of syntax-semantics interaction is better supported by the Chinese data. In essence, our account is close to this reformulated argument, but in our theory, we do not assume a deep structure and transformation. All patterns are surface constructions. If no sentences can match a construction, it is not considered as a pattern by our definition. This type of unstable pattern which depends on the semantic constraint is not limited to the transitive phenomena. For example, the type of Chinese NP predicate defined in is also a semantics dependent pattern. Compare: 7a) zhe zhang zhuozi san tiao tui. this Cl. table(furniture) three Cl. leg This table is three-legged. Note: Cl for classifier. 2 The other combinations are: 5d1) * dianxin chi le wo. OVS 5d2) dianxin chi le wo. The Dim Sum ate me. Note: It is OK with the 5d2) reading in the pattern NP V NP: SVO. 5e1) * chi le wo dianxin. VSO 5e2) chi le wo dianxin. (Somebody) ate my Dim Sum. Note: It is OK with the 5e2) reading of in the pattern V : VO where NP1 modifies NP2. 5f1) * chi le dianxin wo. VOS 5f2) chi le dianxin, wo. Eaten the Dim Sum, I have. Note: It is OK in Spoken Chinese, with a short pause before wo, in a pattern like V NP, NP: VOS.. 7b) * zhe zhang ditu san tiao tui. this Cl. map(non-furniture) three Cl. leg There is clearly a semantic constraint of the NP predicate on its subject: it should be furniture (or animate). Without this semantic agreement, Chinese NP is normally not capable of functioning as a predicate, as shown in 7b). Between semantics dependent and semantics independent patterns, we may have partially dependent patterns. For example, in NP NP V: OSV, it seems that the semantic constraint on the initial object is less important than the semantic constraint on the subject. 8) shitou wo ye xiang chi, kexi yao bu dong. stone(non-food) I(animate) also want eat, pity chew not -able Even stones I also want to eat, but it's such a pity that I am not able to chew them. If the constraint on the object matches well, is the subject allowed to be semantically deviant? 9) ? dianxin zhuozi chi le. Dim-Sum(food) table(non-animate) eat LE. Those are the marginal cases, a grammar may choose to be more tolerable to accept it or to be more restrained to reject it. Unlike SOV, but similar to its English counterpart, OSV is one type of Chinese topic constructions and the relationship between the initial O and V is of long distance dependency. 10a) dianxin wo xiangxin ni yiwei Lisi chi le. Dim-Sum I believe you think Lisi eat LE The Dim Sum I believe you think that Lisi ate. 10b) * Lisi wo xiangxin ni yiwei dianxin chi le. 10b) will not be accepted in our model because (1) it cannot be interpreted as OSV since it violates the semantic constraint on S: dianxin is not animate; (2) it can neither be interpreted as SOV since it violates the configurational constraint: SOV is simply not of a long distance pattern. In fact, NP NP V: SOV is such a restricted pattern in Chinese that it not only excludes any long distance dependency but even disallows some adjuncts. Compare 11a) in the OSV pattern and 11b) and 11c) in the SOV pattern: 11a) dianxin wo jinjinyouwei de2 chi le. Dim-Sum I with-relish DE2 eat LE The Dim Sum I ate with relish. Note: DE2 is a particle introducing a preverbal adjunct of manner. 11b) * wo dianxin jinjinyouwei de2 chi le. 11c) * wo jinjinyouwei de2 dianxin chi le. There is another pattern of the linear order SOV, the Chinese notorious BA construction. ba is usually regarded as a preposition which introduces a preverbal object for transitive verbs. 12a) wo ba dianxin jinjinyouwei de2 chi le. I BA Dim-Sum with-relish DE2 eat LE I ate the Dim Sum with relish. 12b) wo jinjinyouwei de2 ba dianxin chi le. With relish, I ate the Dim Sum. 12c) dianxin ba wo jinjinyouwei de2 chi le. The Dim Sum ate me with relish. 12d) dianxin jinjinyouwei de2 ba wo chi le. With relish, the Dim Sum ate me. For the OSV order, there is another so-called BEI construction. The BEI construction is usually regarded as an explicit passive pattern in Chinese. NP V: OSV 13a) dianxin bei wo chi le. Dim-Sum BEI I eat LE The Dim Sum was eaten by me. 13b) wo bei dianxin chi le. I was eaten by the Dim Sum. The BEI construction and the BA construction are both semantics independent. In fact, any pattern resorting to the means of function words in Chinese seems to be sufficiently independent of the semantic To conclude, semantic deviation often occurs in some more independent patterns, as seen in 5d2), 6), 8), 12c), 12d), 13b). Close study reveals that different patterns result in different reliance on the semantic constraint, as summarized in the following table. It should be emphasized that this observation constitutes the rationale behind our approach. 3. Formulation of lexical rules Based on the above observation, we have designed a syntax-semantics combined model. In this model, we take a lexical rule approach to Chinese patterns and the related problem of semantic deviation. A lexical rule takes as its input a lexical entry which satisfies its condition and generates another entry. Lexical rules are usually used to cover lexical redundancy between related patterns. The design of lexical rules is preferred by many grammarians over the more conventional use of syntactic transformation, especially for lexicalist theories. Our general design is as follows, still using chi (eat) for illustration: (1) Syntactically, chi (eat) as a transitive verb subcategorizes for a left NP as its subject and a right NP as its object. (2) Semantically, the corresponding notion eat expects an entity of category animate as its logical subject and an entity of category food as its logical object. Therefore the common sense (knowledge) that animate being eats food is represented. (3) The interaction of syntax and semantics is implemented by lexical rules. The lexical rules embody the linguistic generalizations about the transitive patterns. They will decide to enforce or waive the semantic constraint based on different patterns. As seen, syntax only stipulates the requirement of two NPs as complements for chi and does not care about the NPs' semantic constraint. Semantics sets its own expectation of animate entity and food entity as arguments for eat and does not care what syntactic forms these entities assume on the surface. It is up to lexical rules to coordinate the two. In our model, the information in (1) and (2) is encoded in the corresponding lexical entry and the lexical rules in (3) will then be applied to expand the lexicon before parsing begins. Driven by the expanded lexicon, analysis is implemented by a lexicalist parser to build the interpretation structure for the input sentence. Following this design, there will be sufficient interaction between syntax and semantics as desired while syntax still remains to be a self-contained component from semantics in the lexicon. More importantly, this design does not add any computational complexities to parsing because in order to handle different patterns, the similar lexical rules are also required even for a pure syntax model. Before we proceed to formulate lexical rules for transitive patterns, we should make sure what a transitive pattern is. As we defined before, a pattern consists of 2 parts: a structure's syntactic constraint and the corresponding interpretation. Word order is important constraint for Chinese syntax. In addition to word order, we have categories and function words (preposition, particle, etc.). As for interpretation, transitive structure involves 3 elements: V (predicate) and its arguments S (logical subject) and O (logical object). There is a further factor to take into account: Chinese complements are often optional. In many cases, subject and/or object can be omitted either because they can be recovered in the discourse or they are unknown. We call those patterns elliptical patterns (with some complement(s) omitted), in contrast to full patterns. With these in mind, we can define 10 patterns for Chinese transitive structure: 5 full patterns and 5 elliptical patterns. We now investigate these transitive patterns one by one and try to informally formulate the corresponding lexical rules to capture them. Please note that the basic input condition is the same with all the lexical rules. This is because they share one same argument structure - transitive structure. V ((NP1, NP2), (constr1, constr2)) -- NP1 V NP2: SVO The above notation for the lexical rule should be quite obvious. The input of the rule is a transitive verb which subcategorizes for two NPs: NP1 and NP2 and whose corresponding notion expects two arguments of constr1 and constr2. NP is syntactic category, and constr is semantic category (human, animate, food, etc.). The output pattern is in a defined word order SVO and waives the semantic constraint. V ((NP1, NP2), (constr1, constr2)) -- V: SOV Please note that the semantic constraint is enforced for this SOV pattern. Since this pattern shares the form NP NP V with the OSV pattern, it would be interesting to see what happens if a transitive verb has the same semantic constraint on both its subject and object. For example, qingjiao (consult) expects a human subject and a human object. 14) ta ni qingjiao guo me? he(human) you(human) consult GUO ME Him, have you ever consulted? Note: GUO is a particle for experience aspect. 15) ni ta qingjiao guo me? You, has he ever consulted? In both cases, the interpretation is OSV instead of SOV. Therefore, we need to reformulate Lexical rule 2 to exclude the case when the subject constraint is the same as the object constraint. Lexical rule 2' (refined version): V ((NP1, NP2), (constr1, constr2), (constr1 not = constr2)) -- V: SOV V ((NP1, NP2), (constr1, constr2)) -- NP1 V: SOV This is the typical BA construction. But not every transitive verb can assume the BA pattern. In fact, ba is one of a set of prepositions to introduce the logical object. There are other more idiosyncratic prepositions (xiang, dao, dui, etc.) required by different verbs to do the same job. 16a) ni qingjiao guo ta me? you consult GUO he ME Have you ever consulted him? 16b) ni xiang ta qingjiao guo me? you XIANG he consult GUO ME Have you ever consulted him? 16c) * ni ba ta qingjiao guo me? you BA he consult GUO ME 17a) ta qu guo Beijing. he go-to GUO Beijing He has been to Beijing. 17b) ta dao Beijing qu guo. he DAO Beijing go-to GUO He has been to Beijing. 17c) * ta ba Beijing qu guo. he BA Beijing go-to GUO 18a) ta hen titie zhangfu. she very tenderly-care-for husband She cares for her husband very tenderly. 18b) ta dui zhangfu hen titie. she DUI husband very tenderly-care-for She cares for her husband very tenderly. 18c) * ta ba zhangfu hen titie. she BA husband very tenderly-care-for This originates from different theta-roles assumed by different verb notions on their object argument: patient, theme, destination, to name only a few. These theta-roles are further classification of the more general semantic role logical object. We can rely on the subcategorization property of the verb for the choice of the preposition literal (so-called valency preposition). With the valency information in place, wenow reformulate Lexical rule 3 to make it more general: Lexical rule 3' (refined version): V ((NP1, NP2), (constr1, constr2), (valency_preposition=P), (P not = null)) -- NP1 V: SOV V ((NP1, NP2), (constr1, constr2)) -- NP2 ... V: OSV This is a topic pattern of long distance dependency. It is up to different formalisms to provide different approaches to long distance phenomena. In our present implementation, NP2 is placed in a feature called BIND to indicate the nature of long distance dependency. One phrase structure rule Topic Rule is designed to use this information and handle the unification of the long distance complement properly. Following the topic pattern, the passive BEI construction is formulated in Lexical rule 5. V ((NP1, NP2), (constr1, constr2)) -- NP2 V: OSV We now turn to elliptical patterns. V ((NP1, NP2), (constr1, constr2)) -- V NP2: VO 19) chi guo jiaozi me? eat GUO dumpling ME Have (you) ever eaten dumpling? V ((NP1, NP2), (constr1, constr2)) -- V: SV 21) ji chi le. chicken1(animate) eat LE The chicken has eaten (it). Like its English counterpart, ji (chicken) has two senses: (1) chicken1 as animate; (2) chicken2 as food. We code this difference in two lexical entries. Only the first entry matches the semantic constraint on the subject in the pattern and reaches the above SV interpretation in 21). Interestingly enough, the same sentence will get another parse with a different interpretation OV in 23) because the second entry also satisfies the semantic constraint on the object in the OV pattern in Lexical rule 8. 22) ni qingjiao guo me? you consult GUO ME Have you consulted (someone)? 22) indicates that the SV interpretation is preferred over the OV interpretation when the semantic constraint on the subject and the semantic constraint on the object happen to be the same. Hence the added condition in Lexical rule 8. V ((NP1, NP2), (constr1, constr2), (constr1 not = constr2)) -- V: OV 23) ji chi le. chicken2(food) eat LE The chicken has been eaten. V ((NP1, NP2), (constr1, constr2)) -- NP2 : OV 24) dianxin bei chi le. Dim-Sum BEI eat LE The Dim Sum has been eaten. Lexical rule 10: V ((NP1, NP2), (constr1, constr2)) -- V: V (Have you) eaten (it)? 4. Implementation We begin with a discussion of some major feature structures in HPSG related to handling the transitive patterns. Then, we will show how our proposal works and discuss some related implementation issues. HPSG is a highly lexicalist theory. Most information is housed in the lexicon. The general grammar is kept to minimum: only a few phrase structure rules (called ID Schemata) associated with a couple of principles. The data structure is typed feature structure. The necessary part for a typed feature structure is the type information. A simple feature structure contains only the type information, but a complex feature structure can introduce a set of feature/value pairs in addition to the type information. In a feature/value pair, the value is itself a feature structure (simple or complex). The following is a sample implementation of the lexical entry chi for our Chinese HPSG grammar using the ALE formalism . Note: (1) Uppercase notation for feature; Leaving the notational details aside, what this roughly says is: (1) for the semantic constraint, the arguments of the notion eat are an animate entity and a food entity; (2) for the syntactic constraint, the complements of the verb chi are 2 NPs: one on the left and the other on the right; (3) the interpretation of the structure is a transitive predicate with a subject and an object. The three corresponding features are: (1) KNOWLEDGE; (2) SUBCAT; (3) CONTENT. KNOWLEDGE stores some of our common sense by capturing the internal relation between concepts. Such common sense knowledge is represented in linguistic ways, i.e. it is represented as a semantic expectation feature, which parallels to the syntactic expectation feature SUBCAT. KNOWLEDGE defines the semantic constraint on the expected arguments no matter what syntactic forms the arguments will take. In contrast, SUBCAT only defines the syntactic constraint on the expected complements. The syntactic constraint includes word order (LEFT feature), syntactic category (CATEGORY feature) and configurational information (LEX feature). Finally, CONTENT feature assigns the roles SUBJECT and OBJECT for the represented structure. A more important issue is the interaction of the three feature structures. Among the three features, only KNOWLEDGE is our add-on. The relationship between SUBCAT and CONTENT has been established in all HPSG versions: SUBCAT resorts to CONTENT for interpretation. This interaction corresponds to our definition of pattern. Everything goes fine as far as the syntactic constraint alone can decide interpretation. When the semantic constraint (in KNOWLEDGE) has to be involved in the interpretation process, we need a way to access this information. In unification based theories, information flow is realized by unification (i.e. structure sharing, which is represented by the co-index of feature values). In general, we have two ways to ensure structure sharing in the lexicon. It is either directly co-indexed in the lexical entries, or it resorts to lexical rules. The former is unconditional, and the latter is conditional. As argued before, we cannot directly enforce the semantic constraint for every transitive pattern in Chinese, for otherwise our grammar will not allow for any semantic deviation. We are left with lexical rules which we have informally formulated in Section 3 and implemented in the ALE formalism. CATEGORY is another major feature for a sign. The CATEGORY feature in our implementation includes functional category which can specify functional literal (function word) as its value. Function words belong to closed categories. Therefore, they can be classified by enumeration of literals. Like word order, function words are important form for Chinese syntactic constraint. Grammars for other languages also resort to some functional literals for constraint. In most HPSG grammars for English, for example, a preposition literal is specified in a feature called P_FORM. There are two problems involved there. First, at representation level, there is redundancy: P_FORM:x -- CATEGORY:p (where x is not null). In other words, there exists feature dependency between P_FORM and CATEGORY which is not captured in the formalism. Second, if P_FORM is designed to stipulate a preposition literal, we will ultimately need to add features like CL_FORM for classifier specification, CO_FORM for conjunction specification, etc. In fact, for each functional category, literal specification may be required for constraint in a non-toy grammar. That will make the feature system of the grammar too cumbersome. These problems are solved in our grammar implementation in ALE. One significant mechanism in ALE is its type inheritance and appropriateness specifications for feature structures . (Similar design is found in the new software paradigm of Object Oriented Programming.) Thanks to ALE, we can now use literals (ba, xiang, dao, dui, etc) as well as major categories (n, v, a, p, etc.) to define the CATEGORY feature. In fact, any intermediate level of subclassification between these two extremes, major categories and literals, can all be represented in CATEGORY just as handily. They together constitute a type hierarchy of CATEGORY. The same mechanism can also be applied to semantic categories (human, animate, food, etc.) to capture the thesaurus inference like human -- animate. This makes our knowledge representation much more powerful than in those formalisms without this mechanism. We will address this issue in depth in another paper Typology for syntactic category and semantic category in Chinese grammar. In the following, we give a brief description on how our grammar works. The grammar consists of several phrase structure rules and a lexicon with lexical entries and lexical rules. First, ALE compiles the grammar into a Prolog parser. During this process (at compile time), lexical rules are applied to lexical entries. In the case of transitive patterns, this means that one entry of chi will evolve into 10 entries. Please note that it is this expanded lexicon that is used for parsing (at run time). At the level of implementation, we do not need to presuppose an abstract transitive structure as input of the lexical rules and from there generates 10 new entries for each transitive verb. What is needed is one pattern as the basic pattern for transitive structure and derives the other patterns. In fact, we only need 4 lexical rules to derive the other 4 full patterns from 1 basic full pattern. Elliptical patterns can be handled more elegantly by other means than lexical rules.3 The basic pattern constitutes the common condition for lexical rules. Although in theory any one of the 5 full patterns can be seen as the basic pattern, the choice is not arbitrarily made. The pattern we chose is the valency preposition pattern (the BA-type construction) NP1 V: SOV (see Lexical rule 3').4 This is justified as follows. The valency preposition P (ba, xiang, dao, dui, etc.) is idiosyncratically associated with the individual verb. To derive a more general pattern from a specific pattern is easier than the other way round, for example, NP1 V: SOV -- NP1 V NP2: SVO is easier than NP1 V NP2: SVO -- NP1 V: SOV. This is because we can then directly code the valency preposition under CATEGORY in the SUBCAT feature and do not have to design a specific feature to store this valency The ultimate aim for natural language analysis is to reach interpretation, i.e. to assign roles to the constituents. An old question is how syntax (form) and semantics (meaning) interact in this interpretation process. More specifically, which is a more important factor in Chinese analysis, the syntactic constraint or the semantic constraint? For the linguistic data we have investigated, it seems that sometimes syntax plays a decisive role and other times semantics has the final say. The essence is how to adequately handle the interface between syntax and semantics. In our proposal, the syntactic constraint is seen as a more fundamental factor. It serves as the frame of reference for the semantic constraint. The involvement of the semantic constraint seems to be most naturally conditioned by syntactic patterns. In order to ensure their effective interaction, we accommodate syntax and semantics in one model. The model is designed to be based on syntax and resorts to semantic information only when necessary. In concrete terms, the system will selectively enforce or waive the semantic constraint, depending on syntactic patterns. It needs to be advised that there are other factors involved in reaching a correct interpretation. For example, in order to recover the omitted complements in elliptical patterns, information from discourse and pragmatics may be vital. We leave this for future research.3 The conventional configurational approach is based on the assumption that complements are obligatory and should be saturated. If saturation of complements were not taken as a precondition for a phrase, serious problems might arise in structural overgeneration. On the other hand, optionality of complement(s) is a real life fact. Elliptical patterns are seen in many languages and especially commonplace in Chinese. In order to ensure obligatoriness of complements, the lexical rule approach can be applied to elliptical patterns, as shown in Section 3. This approach maintains configurational constraint in tree building to block structural overgeneration, but the cost is great: each possible elliptical pattern for a head will have to be accommodated by a new lexical entry. With the type mechanism provided by ALE, we have developed a technique to allow for optionality of complement(s) and still maintain proper configurational constraint. We will address this issue in another paper Configurational constraint in Chinese grammar. 4 This choice is coincidental to the base generated account of the BA construction in , but that does not mean much. First, our so-called basic pattern is not their D-Structure. Second, our choice is based on more practical considerations. Their claim involves more theoretical arguments in the context of the generative grammar. References Carpenter, B. Penn, G. (1994): ALE, The Attribute Logic Engine, User's Guide, Version 2.0 Gao, Qian (1993): “Chinese BA-Construction: Its Syntax and Semantics”, OSU Working Papers in Linguistics 1993, Kathol A. Pollard C. (eds.) Huang, Xiuming (1987): “XTRA: The Design and Implementation of A Fully Automatic Machine Translation System”, Ph.D. dissertation. Li, Audry (1990): Chapter 6 “Passive, BA, and topic constructions”, Order Constituency in Mandarin Chinese. Kluwer Academic Publishers Li, Wei McFetridge, Paul (1995): “Handling Chinese NP predicate in HPSG”, Proceedings of PACLING-II, Brisbane, Australia Pollard, Carl Sag, Ivan A. (1994): Head-Driven Phrase Structure Grammar, Centre for the Study of Language and Information, Stanford University, CA Pollard, Carl Sag, Ivan A. (1987): Information-based Syntax and Semantics. Vol. 1: Fundamentals. Centre for the Study of Language and Information, Stanford University, CA Wilks, Y.A. (1978): “Making Preferences More Active”, Artificial Intelligence, Vol. 11 Wilks, Y.A. (1975): “A Preferential Pattern-Seeking Semantics for Natural Language Interference”, Artificial Intelligence, Vol. 6 * This research is part of my Ph.D. project on a Chinese HPSG-style grammar, supported by the Science Council of British Columbia, Canada under G.R.E.A.T. award (code: 61). I thank my supervisor Dr. Paul McFetridge for his supervision. He introduced me into the HPSG theory and provided me with his sample grammars. Without his help, I would not have been able to implement the Chinese grammar in a relatively short time. Thanks also go to Prof. Dong Zhen Dong and Dr. Ping Xue for their comments. 【置顶:立委科学网博客NLP博文一览(定期更新版)】
个人分类: 立委其人|4778 次阅读|0 个评论
类型系统 和unification/semi-unification算法-3
热度 1 qizhwei 2011-12-11 10:21
正好 CS 15-417 HOT Compilation 这门课本周结束,最后一课 Karl Crary 教授讲到了 type inference 。 结合这个主题,将 unification 算法再 review 一边。 Karl Crary 教授说到了不能确定 SML 的 type inference 算法是否 decidable 。因为它对 HM 算法进行了扩展。 Unification 算法主要分为一阶( first order )和高阶( higher order )。 一阶的算法主要处理变量类型,例如,我们可以推导某个函数的参数的类型。而函数符号本身是不可变量化的,是常量,在重写逻辑里面也称为项代数( term algebra ),也称为语法 Unification ;在 SMT 模型求解器里面称为未解释的函数符号( EUF, equality with uninterpreted function ),是非常重要的一类等式模型。 如果加上等式理论,称为 E-unification ,也称为语义 Unification ,因为用到等式推导来确定两个项是否相等(或函数)。一阶 Unification 也比较简单,也是一个 decidable 的算法。 Higher order 对应的是带类型的 lambda 演算,因为函数本身也是一个变量,这就引入了自由变量与受限变量, scoping 以及α、β、η等规约规则,这些概念的引入一方面大大增加了 Unification 的复杂性,但同时也能刻画更复杂的系统,现在的推理证明系统( λProlog 和 Twelf )就是建立在高阶 Unification 的基础上。一般说来,这算法是 undecidable 。但在实践中用得很好,也可以采用某些限制(例如,规定两个项中必须有一个是 closed 的),得到一个受限的 decidable 算法。 关于算法的一般说明就到这里,回到 Unification 算法,其难点主要在于两点, 1 是多态, polymorphism ; 2 是递归, recursion 。对于一阶 unification ,如果同时引入这两点,就成为一个 undecidable 算法,也成为 semi-unification ,也对应上文提到的 Microft-Milner 类型系统。计算机科学家一开始没有意识到这一点,因为毕竟都在一阶系统里面,从直观上看也很想象存在一个 undecidable 算法。 具体一个例子可以在 Andrew W. Appel 的编译器“虎书”《现代编译原理》可以找到 let function blowupe (i:int, x:e) :e = if i = 0 then x else blowupliste(i-1, liste {head = x, tail =nil}).head in blowupint (N,0) 这里的 e 类型变量,一开始是 int ,然后是 listint, list listint 等类型递归展开。因为是静态无法确定 N 的大小,所以我们无法确定应该展开多少次。 对于这个问题,一般的做法是不允许同时有多态和递归,这样就避免这个问题,但对于一般的类型系统,如果确实存在类似的类型,算法本身就不会终止,从而得到了一个 semi-unification 算法。( semi-unification 算法的本身定义是包括等式和不等式的 unification 算法,但也正好等价于 MM 类型系统。) 由此,我们得到了类型系统的三个基本算法( first order 、 semi-unification , higher-order )。这也说明了类型系统在计算机科学里面的重要地位,同时在逻辑、人工智能、定理证明、自然语言处理里面, unification 也有十分重要的应用。
个人分类: 学术探讨|6053 次阅读|2 个评论
类型系统 和unification/semi-unification算法-1
热度 1 qizhwei 2011-5-8 05:04
类型系统是比较偏理论的,但随着函数式语言( Ocaml, F# )以及动态语言( Python, PHP )等逐步流行,其重要性也逐步凸显。 常规的类型系统大家是很熟悉的,例如: 3 : int , false : Boolean ,其难点在于函数和对象类型,一般的静态语言,将函数看成一个可调用的特殊变量, 例如,用 python 的语言来讲: add = lambda x,y: x+y 那么 add ( 3,4 )的类型就是 int * int - int ,而不再仅仅是一个函数。 那么类型理论到此为止也没有很复杂,而且很直观。 那么,其难点在什么地方呢? 首先,我们把目前的类型可以定义为 T :: = c | x | T - T ( C: 类型常量,如 int boolean 等, x, 类型变量, T - T : 函数类型,“ - ”前是参数,“ - ”后是返回类型) 这个是个简单的类型化 lambda 演算的类型系统,和我们常见的语言的类型是一致的,只不过对函数的类型进行了刻画。 我们要做的第一个扩展是支持高阶函数( higher order )函数,即支持函数本身作为变量,例如: Id = lambda x : x 。 这个是个简单的返回自身的函数, 类型可以定义为: Id : t - t 那么, f= Id(Id), Id 本身作为参数,那么 f 的类型是什么呢? 按照前面的定义, f 输入一个函数,返回一个函数,则可定义为 f: (t - t) - (t - t) 。 到目前为止,似乎也没有问题, 但是 , 不幸的是,并不是所有的函数都有类型的,例如: foo = lambda x : x(x), 那么 g = foo(foo), 这个函数是没有类型的,确切地说,是一个不会终止的递归函数,那么类型系统应该能够判断出这个函数是不能被类型化的,并且不应该在实际的系统中采用,否则运行时会抛出异常。 大家可以在 python 的环境中尝试这个函数。 如果说 higher order 是第一个重要扩展,那么多态 (polymorphic) 就是第二个重要扩展,多态在面向对象和动态语言中随处可见,例如前面的 add 函数,完全可以写成这样 add(“hello”, “word”), 其类型是 string*string - string. 那么 add 的类型到底是什么呢? 不同的参数有不同的类型,通用一点就是这样: Π t: t*t - t. 解释为对所有的类型参数,输入两个 t 类型,返回一个 t 类型。 这样,我们的类型系统扩展为 t :: = c | x | t- t σ :: = t | Π t. σ 目前支持多态和高阶函数,已经能够应付很多语言的类型了。那么如何推导这个系统的类型呢? 这就需要用到 Unification 算法。 例如 : lambda x,y,z : x(y(z)) , 其对应的类型是什么呢? 其类型是: (( a-b ) * ( c-a ) *c ) - b 。你能推导出来吗? 有空 下次再讲,:-)
个人分类: 学术探讨|4404 次阅读|1 个评论

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-5-23 15:56

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部