An Algorithm for Open Text Semantic

Lei Shi and Rada Mihalcea Department of Computer Science University of North Texas [email protected], [email protected]

Abstract duce the knowledge bases utilized by the parser, and show how we use this knowledge in the process of This paper describes an algorithm for open text shal- semantic parsing. Next, we describe the parsing low semantic parsing. The algorithm relies on a algorithm and elaborate on each of the three main frame dataset (FrameNet) and a steps involved in the process of semantic parsing: (WordNet), to identify semantic relations between (1) syntactic and shallow semantic analysis, (2) se- words in open text, as well as shallow semantic fea- mantic role assignment, and (3) application of de- tures associated with concepts in the text. Parsing fault rules. Finally, we illustrate the parsing process semantic structures allows semantic units and con- with several examples, and show how the semantic stituents to be accessed and processed in a more parsing algorithm can be integrated into other lan- meaningful way than syntactic parsing, moving the guage processing systems. automation of understanding natural language text to a higher level. 2 Semantic Structure 1 Introduction Semantics is the denotation of a string of symbols, either a sentence or a word. Similar to a syn- The goal of the semantic parser is to analyze the tactic parser, which shows how a larger string is semantic structure of a natural language sentence. formed by smaller strings from a formal point of Similar in spirit with the syntactic parser – whose view, the semantic parser shows how the denotation goal is to parse a valid natural language sentence of a larger string – sentence, is formed by deno- into a parse tree indicating how the sentence can tations of smaller strings – words. Syntactic rela- be syntactically decomposed into smaller syntactic tions can be described using a set of rules about how constituents – the purpose of the semantic parser is a sentence string is formally generated using word to analyze the structure of sentence meaning. Sen- strings. Instead, semantic relations between seman- tence meaning is composed by entities and interac- tic constituents depend on our understanding of the tions between entities, where entities are assigned world, which is across languages and syntax. semantic roles, and can be further modified by other We can model the sentence semantics as describ- modifiers. The meaning of a sentence is decom- ing entities and interactions between entities. Enti- posed into smaller semantic units connected by var- ties can represent physical objects, as well as time, ious semantic relations by the principle of compo- places, or ideas, and are usually formally realized sitionality, and the parser represents the semantic as nouns or noun phrases. Interactions, usually real- structure – including semantic units as well as se- ized as verbs, describe relationships or interactions mantic relations, connecting them into a formal for- between participating entities. Note that a partic- mat. ipant can also be an interaction, which can be re- In this paper, we describe the main components garded as an entity nominalized from an interaction. of the semantic parser, and illustrate the basic pro- We assign semantic roles to participants, and their cedures involved in parsing semantically open text. semantic relations are identifiedbythecaseframe We believe that such structures, reflecting various introduced by their interaction. In a sentence, par- levels of semantic interpretation of the text, can be ticipants and interactions can be further modified used to improve the quality of text processing appli- by various modifiers, including descriptive modi- cations, by taking into account the meaning of text. fiers that describe attributes such as drive slowly, The paper is organized as follows. We first de- restrictive modifiers that enforce a general denota- scribe the semantic structure of English sentences, tion to become more specificsuchasmusical in- as the basis for semantic parsing. We then intro- strument, referential modifiers that indicate partic- ular instances such as the pizza I ordered.Other accessible to the semantic parser. semantic relations can also be identified, such as coreference, complement, and others. Based on the 3.1 Frame Identification and Semantic Role principle of compositionality, the sentence semantic Assignment structure is recursive, similar to a tree. FrameNet (Johnson et al., 2002) provides the The semantic parser analyzes shallow-level se- knowledge needed to identify case frames and se- mantics, which is derived directly from linguis- mantic roles. FrameNet is based on the theory of tic knowledge, such as rules about semantic frame semantics, and defines a sentence level on- role assignment, lexical semantic knowledge, and tology. In frame semantics, a frame corresponds to syntactic-semantic mappings, without taking into an interaction and its participants, both of which account any context or common sense knowledge. denote a scenario, in which participants play some The parser can be used as an intermediate semantic kind of roles. A frame has a name, and we use this processing tool before higher levels of text under- name to identify the semantic relation that groups standing. together the semantic roles. In FrameNet, nouns, verbs and adjectives can be used to identify frames. 3 Knowledge Bases for Semantic Parsing Each annotated sentence in FrameNet exempli- fies a possible syntactic realization for the seman- One major problem faced by many natural language tic roles associated with a frame for a given target understanding applications that rely on syntactic word. By extracting the syntactic features and cor- analysis of text, is the fact that similar syntactic pat- responding semantic roles from all annotated sen- terns may introduce different semantic interpreta- tences in the FrameNet corpus, we are able to auto- tions. Likewise, similar meanings can be syntac- matically build a large set of rules that encode the tically realized in many different ways. The seman- possible syntactic realizations of semantic frames. tic parser attempts to solve this problem, and pro- In our implementation, we use only verbs as duces a syntax-independent representation of sen- target words for frame identification. Currently, tence meaning, so that semantic constituents can be FrameNet defines about 1700 verbs attached to 230 accessed and processed in a more meaningful and different frames. To extend the parser coverage to flexible way, avoiding the sometimes rigid interpre- a larger subset of English verbs, we are using Verb- tations produced by a syntactic analyzer. For in- Net (Kipper et al., 2000), which allows us to handle stance, the sentences I boil water and water boils a significantly larger set of English verbs. contain a similar relation between water and boil, VerbNet is a verb lexicon compatible with Word- even though they have different syntactic structures. Net, but with explicitly stated syntactic and se- To deal with the large number of cases where the mantic information using Levin’s verb classification same syntactic relation introduces different seman- (Levin, 1993). The fundamental assumption is that tic relations, we need knowledge about how to map the syntactic frames of a verb as an argument-taking syntax to semantics. To this end, we use two main element are a direct reflection of the underlying se- types of knowledge – about words, and about rela- mantics. Therefore verbs in the same VerbNet class tions between words. The first type of knowledge usually share common FrameNet frames, and have is drawn from WordNet – a large lexical database the same syntactic behavior. Hence, rules extracted with rich information about words and concepts. from FrameNet for a given verb can be easily ex- We refer to this as word-level knowledge. The lat- tended to verbs in the same VerbNet class. To en- ter is derived from FrameNet – a resource that con- sure a correct outcome, we have manually validated tains information about different situations, called the FrameNet-VerbNet mapping, and corrected the frames, in which semantic relations are syntacti- few discrepancies that were observed between Verb- cally realized in natural language sentences. We Net classes and FrameNet frames. call this sentence-level knowledge. In addition to these two lexical knowledge bases, the parser also 3.1.1 Rules Learned from FrameNet utilizes a set of manually defined rules, which en- FrameNet data “is meant to be lexicographically rel- code mappings from syntactic structures to seman- evant, not statistically representative” (Johnson et tic relations, and which are also used to handle those al., 2002), and therefore we are using FrameNet as structures not explicitly addressed by FrameNet or a starting point to derive rules for a rule-based se- WordNet. mantic parser. In this section, we describe the type of infor- To build the rules, we are extracting several syn- mation extracted from these knowledge bases, and tactic features. Some are explicitly encoded in show how this information is encoded in a format FrameNet, such as the grammatical function (GF) and phrase type (PT) features. In FrameNet, there are multiple annotated sen- In addition, other syntactic features are extracted tences for each frame to demonstrate multiple pos- from the sentence context. One such feature is the sible syntactic realizations. All possible realizations relative position (RP) to the target word. Sometimes of a frame are collected and stored in a list for that the same syntactic constituent may play different se- frame, which also includes the target word, its syn- mantic roles according to its position with respect tactic category, and the name of the frame. All the to the target word. For instance the sentences: I pay frames defined in FrameNet are transformed into you. and You pay me. have different roles assigned this format, so that they can be easily handled by to the same lexical unit you based on the relative the rule-based semantic parser. position with respect to the target word pay. Another feature is the voice of the sentence. Con- 3.2 Word Level Knowledge sider these examples: I paid Mary 500 dollars. and WordNet (Miller, 1995) is the resource used to iden- I was paid by Mary 500 dollars. In these two sen- tify shallow semantic features that can be attached tences, I has the same values for the features GF, PT to lexical units. For instance, attribute relations, and RP, but it plays completely different roles in the adjective/adverb classifications, and others, are se- same frame because of the difference of voice. mantic features extracted from WordNet and stored If the phrase type is prepositional phrase (PP), we together with the words, so that they can be directly also record the actual preposition that precedes the used in the parsing process. phrase. Consider these examples: I was paid for my All words are uniformly defined, regardless of work. and I was paid by Mary. The prepositional their class. Features are assigned to each word, in- phrases in these examples have the same values for cluding syntactic and shallow semantic features, in- the features GF, PT, and RP, but different preposi- dicating the functions played by the word. Syntactic tions differentiate the roles they should play. features are used by the feature-augmented syntac- After we extract all these syntactic features, the tic analyzer to identify grammatical errors and pro- semantic role is appended to the rule, which creates duce syntactic information for semantic role assign- a mapping from syntactic features to semantic roles. ment. Semantic features encode lexical semantic in- Feature sets are arranged in a list, the order of formation extracted from WordNet that is used to which is identical to that in the sentence. The or- determine semantic relations between words in var- der of sets within the list is important, as illustrated ious situations. by the following example: “I give the boy a ball.” Features can be arbitrarily defined, as long as Here, the boy and a ball have the same features there are rules to handle them. The features we as described above, but since the boy occurs be- define encode information about the syntactic fore a ball,thenthe boy plays the role of recipi- category of a word, number and countability for ent. Altogether, the rule for a possible realization nouns, transitivity and form for verbs, type, degree, of a frame exemplified by a tagged sentence is an and attribute for adjectives and adverbs, and others. ordered sequence of syntactic features with their se- Table 2 lists the main features used for content mantic roles. words. For instance, Table 1 lists the syntactic and se- mantic features extracted from FrameNet for the Feature Values sentence I had chased Selden over the moor. Nouns Number singular/plural I had chased Selden over the moor Countability countable/uncountable GF Ext obj comp Verbs PT NP Target NP PP Transitivity transitive/intransitive/double transitive Position before after after Form normal/infi nitive/present Vo ice active participle/past participle PP over Adjectives Role Theme Goal Path Type descriptive/restrictive/referential Attribute arbitrary Table 1: Example sentence with syntactic and se- Degree base/comparative/superlative mantic features Adverbs Type descriptive/restrictive/referential Attribute arbitrary The corresponding formalized rule for this sen- Degree base/comparative/superlative tence is: Table 2: Features for content words [active, [ext,np,before,theme], [obj,np, after,goal], [comp,pp,after,over,path]] For example, for the word dog, the entry in the lexicon is defined as: then translated into its corresponding semantic con- stituent, together with the relevant semantic infor- lex(dog,W):- W= [parse:dog, cat:noun, mation. num:singular, count:countable]. Some semantic relations can be directly derived Here, the category (cat)isdefined as noun, the from syntactic patterns. For example, a restrictive number (num) is singular, and we also record the relative clause such as “the man that you see”serves countability (count)1. as a referential modifier. An adverbial clause be- For adjectives, the value of the attribute feature ginning with “because” is a modifier describing the is also stored, which is provided by the attribute re- “reason” of the interaction. The inflection from lation in WordNet. This relation links a descriptive “apple” to “apples” adds an attributive modifier of adjective to the attribute (noun) it modifies, such as quantity to the entity “apple”. slow → speed. For example, for the adjective slow, However, syntactic relations may often introduce the entry in the lexicon is defined as: semantic ambiguity, with multiple possible interpre- tations. To handle these cases, we encode rules that lex(slow,W):- W= [parse:slow, cat:adj, describe all possible interpretations of any given attr:speed, degree:base, type:descriptive]. structure, and then use lexical semantic informa- tion as selectional restrictions for ambiguity reso- Here, the category (cat)isdefined as adjective, lution. For instance, in “a book on Chinese his- the type is descriptive, degree is base form. We also tory”, on Chinese history describes the topic of the record the attr feature, which is derived from the at- book and this interpretation can be uniquely deter- tribute relation in WordNet, and links a descriptive mined by noting that history is not a physical object, adjective to the attribute (noun) it modifies, such as and thus the interpretation of on Chinese history as slow → speed. describing location is semantically anomalous. In- We are also exploiting the transitional relations stead, in “a book on the computer”, on the computer from adverbs to adjectives and to nouns. We noticed may describe a location, but it could also describe that some descriptive adverbs have correspondence the book topic, and hence the correct interpretation to descriptive adjectives, which in turn are linked to of this sentence cannot be determined without ad- nouns by the attribute relation. Using these transi- ditional context. In such cases, the semantic parser tional links, we derive relations like: slowly → slow produces all possible interpretations, allowing sys- → speed. A typical descriptive adverb is defined as tems that use the semantic parser’s output to deter- follows: mine the right interpretation that best fits the appli- lex(slowly,W):- W= [parse:slowly, cat:adv, cation at hand. attr:speed, degree:base, type:descriptive]. Selectional restrictions – as part of the hand- coded knowledge – are used for both semantic In addition to incorporating semantic information role identification and syntax-semantics translation. from WordNet into the lexicon, this word level on- These additional rules are needed to supplement the tology is also used to derive default rules, as dis- information encoded in FrameNet, since FrameNet cussed later. only annotates syntactic features, which often times 3.3 Hand-coded Knowledge do not provide enough information for identifying correct semantic roles. The FrameNet database encodes various syntac- tic realizations only for semantic roles within a Consider for example “I break the window” vs. frame. Syntax-semantics mappings other than se- ”The hammer breaks the window”. According to our semantic parser, the participants in the interac- mantic roles are manually encoded as rules inte- grated in the syntactic-semantic analyzer. The an- tion “break” have exactly the same syntactic fea- alyzer determines the syntactic structure of the sen- tures in both sentences, but they play different se- tence, and once a particular syntactic constituent mantic roles (“I” plays the agent role while “ham- is identified, its corresponding mapping rules are mer” plays the instrument role), since they belong to different ontological categories: “I” refers to a immediately applied. The syntactic constituent is person and “hammer” refers to a tool. This interpre- 1The value for the feature (countability) is obtained tation is not possible using only FrameNet informa- from word properties stored in the Link parser dictionaries tion, and thus we fill the gap by attaching selectional (http://www.link.cs.cmu.edu/link/). The Link dictionaries are restrictions to the rules extracted from FrameNet. also used to derive the lists of words to be stored in the lexi- con. Note however that the Link parser itself is not used in the The definition of selectional restriction is based parsing process. on WordNet 2.0 noun hierarchy. We say that en- tity E belongs to the ontological category C if the syntactic relation is identified. Most semantic rela- noun E is a child node of C in the WordNet seman- tions (e.g. various modifiers) are identified in this tic hierarchy of nouns. For example, if we define step, except semantic role annotation and applica- the ontological category for the role “instrument” as tion of default rules, which are postponed for a later instrumentality, then all hyponyms of instrumental- stage. The analyzer generates an intermediate for- ity can play this role, while other nouns like “boy”, mat, where target words and arguments are explic- which are not part of the instrumentality category itly tagged with their syntactic and semantic fea- will be rejected. Selectional restrictions are defined tures, so that they can be matched against the rules using a Disjunctive Normal Form (DNF) in the fol- derived from FrameNet. We are using a feature- lowing format: based analyzer that accomplishes three main tasks: 4.1.1 Check if the sentence is grammatically [Onto(ID,P),Onto(ID,P),...],[Onto(ID,P),...],... correct Here, “Onto” is a noun and ID is its Word- The syntactic analyzer is based on a feature aug- Net sense, which uniquely identifies Onto as a mented grammar, and therefore has the capability of node in the semantic network. “P” can be set detecting if a sentence is grammatically correct (un- to p (positive) or n (negative), denoting if a noun like statistical parsers, which attempt to parse any should belong to the given category or not. For sentence, regardless of their well-formness). The example, [person(1,n),object(1,p)],[substance(1,p)] grammar consists of a set of rules defining how con- means that the noun should belong to object(sense stituents with different syntactic or semantic fea- #1) but not person(sense #1)2, or it should belong tures can unify with each other. to substance(sense #1). This information is added By defining a grammar in this way, using fea- to the rules derived from FrameNet, and therefore tures, once the right features are selected, the an- after this step, a complete FrameNet rule entry is: alyzer can reject some grammatically incorrect sen- tences such as: I have much apples., You has my [Voice,[GF,PT,SelectionalRestriction,Role],...]. car., and some semantically anomalous sentences: The technology is very military.4. 4 Semantic Parsing 4.1.2 Provide features for semantic role assignment The general procedure of semantic parsing consists of three main steps3: (1) The syntactic-semantic Through syntactic-semantic analysis in the first analyzer analyzes the syntactic structure, and uses step, sentences are transformed into a format hand-coded rules as well as lexical semantic knowl- in which target words and syntactic constituents edge to identify some semantic relations between are explicitly tagged with their features. Unlike constituents. It also prepares syntactic features for FrameNet – which may also assign roles to adverbs, semantic role assignment in the next step. (2) The we only use the subject, object(s) and prepositional role assigner uses rules extracted from FrameNet, phrases as potential participants in the interaction 5 and assigns semantic roles for identified partici- for . The analyzer marks pants, based on their syntactic features as produced verbs as target words for frame identification, iden- in the first step. (3) For those constituents not exem- tifies constituents for semantic role assignment, and plified in FrameNet, we apply default rules to decide produces features such as GF, PT, Voice, Preposi- their default meaning. tion, as well as ontological categories for each con- stituent, in a format identical to the rules extracted 4.1 Feature Augmented Syntactic-Semantic from FrameNet, so that they can be matched with Analyzer the frame definitions. The analyzer is implemented as a bottom-up chart The ontological categories of constituents are parsing algorithm based on features. We include used to match selectional restrictions, and are au- rules of syntax-semantics mappings in the unifica- tomatically derived from the head word of the noun tion based formalism. The parser analyzes syntac- phrase, or the head word of the noun phrase of the tic relations and immediately applies corresponding prepositional phrase. For other constituents that mapping rules to obtain semantic relations when a act like nouns, such as pronouns, infinitive forms, gerunds, or noun clauses, we have manually defined 2person(sense #1) is a child node of object(sense #1) in WordNet 4Since military is not a descriptive adjective, it cannot be 3The parsing algorithm is implemented as a rule-based sys- modifi ed by very and predicative use is forbidden. tem using a declarative programming language . 5Adverbs are treated as modifi ers. ontological categories. For example, “book” is the defined in FrameNet and VerbNet, we use Word- ontological category of the phrase “the interesting Net synonymy relation to check if any of its syn- book” and “on the book”. “person” is the ontolog- onyms is defined in FrameNet or VerbNet. If such ical category we manually define for the pronoun synonyms exist, their rules are applied to the tar- “he”. We have also defined several special onto- get word. This approach is based on the idea in- logical categories that are not in WordNet such as troduced by Levin that “what enables a speaker to any, which can be matched to any selectional re- determine the behavior of a verb is its meaning” striction, nonperson, which means everything ex- (Levin, 1993). Synonymous verbs always intro- cept person, and others. Note that this matching duce the same semantic frame and usually have the procedure also plays the role of a word sense dis- same syntactic behavior. To minimize information ambiguation tool, by selecting only those categories in the verb lexicon, non-frequently used verbs usu- that match the current frame constituents. After ally inherit a subset of the syntactic behavior of this step, target words and syntactic constituents can their frequently used synonyms. Since VerbNet has be assigned with the corresponding case frame and defined a framework of syntactic-semantic behav- semantic roles during the second step of semantic ior for these frequently used verbs, the behavior of parsing. other related verbs can be quite accurately predicted by using WordNet synonymy relations. Using this 4.1.3 Identify some semantic relations approach, we achieve a coverage of more than 3000 Some semantic relations can be identified in this verbal lexical units. phase. These semantic relations include word level semantic relations, and some semantic relations The matching algorithm relies on a scoring that have direct syntactic correspondence by using scheme to evaluate the similarity between two se- syntax-semantics mapping rules. This phase can quences of features. The matching starts from the also identify the function of the sentence such as first constituent of the sentence. It looks through assertion, query, yn-query, command etc, based on the list of entries in the rule and when a match is syntactic patterns of the sentence. found, it moves to the next constituent looking for The output of the analyzer is an intermediate for- a new match. A match involves match of syntactic mat suitable for the semantic parser, which contains features, as well as match of selectional restrictions. syntactic features and identified semantic relations. An exact match means that both syntactic features For example, the output for the sentence “He kicked and selectional restrictions are matched, which in- the old dog.” is: crements the score of matching by 3. We apply selectional restriction by looking up the WordNet noun hierarchies. If the node of the ontological cat- [assertion, [[tag, ext, np, person, egory is within the areas that the selectional restric- [[entity, [he], reference(third)], tion describes, this is regarded as a match. When [modification(attribute), quantity(single)], applying selectional restrictions, due to polysemy [modification(attribute), gender (male)]]], [target, v, kick, active, [kick]], of the ontological entries, we try all possible senses, [modification(attribute), time (past)], starting from the most frequently used sense accord- [tag, obj, np, dog, ing to WordNet, until one sense meets the selec- [[modification(reference), reference(the)], [modification(attribute), age(old)], tional restriction. If the syntactic features match ex- [target, n, dog, [dog]]]]] actly, but none of the possible word senses meet the ] selectional restrictions, this is regarded as a partial match, which increments the score by 2. 4.2 Semantic Role Assignment Partial matching is also possible, for a relaxed In the process of semantic role assignment, we first application of selectional restriction. This enables start by identifying all possible frames, according anaphora and metaphor resolution, in which the to the target word. Next, a matching algorithm is constituents have either unknown ontological cate- used to find the most likely match among all rules gory, or inherit features from other ontological cat- of these frames, to identify the correct frame (or egories (by applying high level knowledge such as frames if several are possible), and assign semantic personification). The number of subjects and ob- roles. jects as well as their relative positions should be In a sentence describing an interaction, we select strictly obeyed, since any variations may result in the verb as the target word, which triggers the sen- significant differences for semantic role labeling. tence level frame and uses the FrameNet rules of Prepositional phrases are free in their location be- that target word for matching. If the verb is not cause the preposition is already a unique identi- fier. Finally, after all constituents have found their rule 1 has an additional entry for a prepositional match, if there are still remaining entries in the phrase, which decrements the score by 1. It makes rule, the total score is decreased by 1. This is a a larger score of 6 for matching with rule 2. There- penalty paid by partial matches, since additional fore, for the second case, the role assigned to “the constituents may indicate different semantic role la- hammer” is instrument. Rule 3 is not applied to the beling, which may change the interpretation of the first two sentences since they have additional ob- entire sentence. jects; similarly, rule 1 and 2 cannot be applied to A polysemous verb may belong to multiple sentence C for the same reason. The first constituent frames, and a frame pertaining to a given target in C finds an exact match in rule 3 with a total score word may have multiple possible syntactic realiza- of 3, and hence “the window” is assigned the correct tions, exemplified by different sentences in the cor- role theme. The prepositional phrase “on the wall”, pus. We try to match the syntactic features in the in- for which no entry for labeling a role is found in rule termediate format with all the rules of all the frames 3, will be handled by default rules (see Section 4.3). available for the target word, and compare their Based on the principle of compositionality, mod- matching scores. The rule with the highest score ifiers and constituents assigned semantic roles can is selected, and used for semantic role assignment. describe interactions, so the semantic role assign- Through this scoring scheme, the matching algo- ment is performed recursively, until all roles within rithm tries to maximize the utilization of syntactic frames triggered by all target words are assigned. and semantic information available in the sentence, 4.3 Applying Default Rules to correctly identify case frames and semantic roles. We always assign semantic roles to subjects and ob- 4.2.1 Walk-Through Example jects6, but only some prepositional phrases can in- Assume the following two rules, triggered for the troduce semantic roles, as defined in the FrameNet target word break: case frames. Other prepositional phrases function

1: [active,[ext,np,[[person(1,p)]],agent], as modifiers; in order to handle these constituents, [obj,np,[[object(1,p)]],theme], and allow for a complete semantic interpretation of [comp,pp,with,[[instrumentality(3,p)]], the sentence, we have defined a set of default rules instrument]] that are applied as the last step of the semantic pars- 2: [[ext,np,[[instrumentality(3,p)]],instrument], ing process. For example, FrameNet defines a role [obj,np,[[person(1,n),object(1,p)]],theme]] for the prepositional phrase on him in “I depend on him” but not for on the street in “I walk on the 3: [[ext,np,[[person(1,n),object(1,p)]],theme]] street”, because it does not play a role, but it is a And the sentences: modifier describing a location. Since the role for A: I break the window with a hammer the prepositional phrase beginning with on is not de- B: The hammer breaks the window fined for the target word walk in FrameNet, we ap- C: The window breaks on the wall ply the default rule that “on something” modifies the The features identified by the analyzer are: location attribute of the interaction walk. Note that we include selectional restriction in the default rule A’:[[ext,np,active,person], since constituents with the same syntactic features [obj,np,active,window], such as “on Tuesday” and “on the table” may have [comp,pp,active,with,hammer]] obviously different semantic interpretations. An ex- B’:[[ext,np,active,hammer], ample of a default rule is shown below, indicating [obj,np,active,window]] that the interpretation of a prepositional phrase fol- C’:[[ext,np,active,window], lowed by a time period (where time period is an [comp,pp,on,wall]] ontological category from WordNet) is that of time modifier: Using the matching/scoring algorithm, the score DefaultRule([_,pp,_,on,Onto,_],time):- for matching A’ to rule 1 is determined as 9 since SelectionalRestriction there are 3 exact matches, and to rule 2 as 5 since (Onto,1, there is an exact match for “the window” but a par- [[time_period(1,p)]]) tial match for “I”. Hence, the matching algorithm selects rule 1, and the semantic role for “I” is agent. We have defined around 100 such default rules, Similarly, when we match B’ to rule 1, we obtain a which are applied during the last step of the seman- score of 4, since there is an exact match for “the 6Where a subject and object are usually realized by noun window”, a partial match for “the hammer”, and phrases, noun clauses, or infi nitive forms. tic parsing process. for semantic role assignment – since this is the only information available in FrameNet. The other se- 5 Parser Output and Evaluation mantic annotations produced by the parser (e.g. at- We illustrate here the output of the semantic parser tribute, gender, countability) are not evaluated at on a natural language sentence, and show the this point, since there are no hand-validated anno- corresponding semantic structure and tree7.For tations of this kind available in current resources. example, for the sentence I like to eat Mexican food Both frames and frame elements are automati- because it is spicy, the semantic parser produces the cally identified by the parser. Out of all the elements following encoding of sentence type, frames, se- correctly identified, we found that 74.5% were as- mantic constituents and roles, and various attributes signed with the correct role (this is therefore the and modifiers: accuracy of role assignment), which compares fa- vorably with previous results reported in the liter- ature for this task. Notice also that since this is a T = assertion rule-based approach, the parser does not need large P= [[experiencer, [[entity, [i], reference(first)], amounts of annotated data, and it works well the [modification(attribute), quantity(single)]]], same for words for which only one or two sentences [interaction(experiencer_subj),[love]], are annotated. [modification(attribute), time(present)], [content, [ [interaction(ingestion), [eat]], 6 Interface and Integration to Other [ingestibles, [entity, [food]] Systems [[modification(restriction), [mexican]], ]]]], The semantic algorithm uses linguistic knowledge, [reason, [[agent, [[entity, [it], reference(third)], such as syntactic realization of semantic roles in a [modification(attribute), quantity(single)]]], case frame, syntax-semantics mappings, and lexical [description, semantic knowledge, to parse the semantic structure [modification(attribute), time(present)]], [modification(attribute), of open text. It can be regarded as a shallow se- taste_property(spicy)]]] mantic analyzer, which provides partial results for ] higher level understanding systems that can effec- tively utilize context, commonsense, and other types The corresponding parse tree is shown in Figure 1. of knowledge, to achieve final accurate meaning in-

I love to eat Mexican food, because it is spicy. terpretations, or use custom defined rules for high S’[assertion] level processing in particular domains.

interaction( experiencer_subj ), [love] The matching/scoring scheme integrated in our experiencer reason algorithm can effectively identify the right semantic am content {[I], reference(first)} interaction( ingestion ), [eat] {[it], reference(third)} interpretation, but some semantic ambiguity cannot am am time(present) ingestibles be resolved without enough context and common- quantity(single) {food} taste_property(spicy) sense knowledge. For example, although the fa- sm {mexican} mous meaningless sentence “colorless green ideas sleep furiously” can be correctly identified as se- Figure 1: Semantic parse tree (am = attributive modifi er, mantically anomalous by the semantic parser, by rm = referential modifi er, sm = restrictive modifi er) analyzing the syntactic behavior of “sleep” and the selectional restrictions that we attach to this frame, the sentence “I saw the man in the park with the We have conducted evaluations of the semantic telescope” has several semantic interpretations. Ac- role assignment algorithm on 350 sentences ran- cording to the commonsense knowledge that we en- domly selected from FrameNet. The test sentences code in the semantic parser (mostly drawn from were removed from the FrameNet corpus, and the WordNet), telescope is defined as a tool to see some- rules-extraction procedure described earlier in the thing, and we may infer that “with telescope” in this paper was invoked on this reduced corpus. All test sentence describes an instrument of “see”. How- sentences were then semantically parsed, and full ever, without enough context, not even humans can semantic annotations were produced for each sen- rule out the possibility that the “telescope” is the tence. Notice that the evaluation is conducted only man’s possession, rather than an instrument for the 7The semantic parser was demonstrated in a major Natural interaction “see”. The semantic parser maintains all Language Processing conference, and can be also demonstrated possible interpretations that cannot be rejected by during the workshop. their syntactic and shallow semantic patterns, and rank all of them by their scores as the likelihood of 8 Conclusions being the correct interpretation. Other systems can In this paper, we proposed an algorithm for open use high level knowledge such as common sense, text shallow semantic parsing. The algorithm has context or user defined rules to choose the right in- the capability to analyze the semantic structure of terpretation. a sentence, and show how the meaning of the en- As an integral part of the parsing system, we pro- tire sentence is composed of smaller semantic units, vide several interfaces that allow other systems or linked by various semantic relations. The parsing additional modules to change the behavior of the process utilizes linguistic knowledge, consisting of parser based on their rules and knowledge. One rules derived from a frame dataset (FrameNet), a se- such interface is the ontochg predicate, which is mantic network (WordNet), as well as hand-coded called whenever the ontological category is identi- rules of syntax-semantics mappings, which encode fied for a constituent during the syntactic-semantic natural selectional restrictions. Parsing semantic analysis. By default, it outputs the same ontolog- structures allows semantic units and constituents to ical category as identified by the parser, but other be accessed and processed in a more meaningful systems can change the content of this predicate to way than syntactic parsing, and enables higher-level replace the ontological category identified by the text understanding applications. We believe that the parser with other categories, according to their rules semantic parser will prove useful for a range of lan- and knowledge. This is particularly useful for inte- guage processing applications that require knowl- grating add-ons capable of anaphora and metaphor edge of text meaning, including word sense disam- resolution. The adjatt predicate is another interface biguation, information retrieval, question answer- for add-ons that can resolve polysemy of descriptive ing, , and others. adjectives and adverbs. Due to polysemy, some de- scriptive adjectives and adverbs may modify differ- References ent attributes in different situations and sometimes M. Fleischman, N. Kwon, and E. Hovy. 2003. the resolution requires high level understanding us- Maximum entropy models for FrameNet classi- ing commonsense knowledge and context. These fication. In Proceedings of 2003 Conference on interfaces make the semantic parser more flexible, Empirical Methods in Natural Language Pro- robust, and easier to integrate into other systems that cessing EMNLP-2003, Sapporo, Japan. achieve high level meaning processing and under- D. Gildea and D. Jurafsky. 2000. Automatic label- standing. ing of semantic roles. In Proceedings of the 38th Annual Conference of the Association for Com- 7 Related Work putational Linguistics (ACL 2000), pages 512– 520, Hong Kong, October. There are several statistical approaches for auto- C. Johnson, C. Fillmore, M. Petruck, C. Baker, matic semantic role labeling based on PropBank M. Ellsworth, J. Ruppenhofer, and E. Wood. and FrameNet. (Gildea and Jurafsky, 2000) pro- 2002. FrameNet: Theory and Practice. posed a statistical approach based on FrameNet I http://www.icsi.berkeley.edu/ framenet. data for annotation of semantic roles. Fleischman K. Kipper, H.T.Dang, and M. Palmer. 2000. Class- (Fleischman et al., 2003) used FrameNet annota- based construction of a verb lexicon. In Proceed- tions in a maximum entropy framework. A more ings of Seventeenth National Conference on Arti- flexible generative model is proposed in (Thomp- ficial Intelligence AAAI 2000, Austin,TX, July. son et al., 2003), where null-instantiated roles can B. Levin. 1993. English Verb Classes and Alterna- be also identified, and frames are not assumed to be tion: A Preliminary Investigation.TheUniver- known a-priori. These approaches exclusively focus sity of Chicago Press. on semantic roles labeling based on statistical meth- G. Miller. 1995. Wordnet: A lexical database. ods, rather than analysis of the full structure of sen- Communication of the ACM, 38(11):39–41. tence semantics. However, a rule-based approach C. Thompson, R. Levy, and C. Manning. 2003. A is closer to the way humans interpret the semantic generative model for FrameNet semantic role la- structure of a sentence. Moreover, as mentioned beling. In Proceedings of the Fourteenth Euro- earlier, the FrameNet data is not meant to be “sta- pean Conference on Machine Learning ECML- tistically representative” (Johnson et al., 2002), but 2003, Croatia. rather illustrative for various language constructs, and therefore a rule-based approach is more suitable for this lexical resource.