Controlled Natural Language Generation from a Multilingual FrameNet-based Grammar
This paper presents a currently bilingual but potentially multilingual FrameNet-based grammar library implemented in Grammatical Framework. The contribution of this paper is two-fold. First, it offers a methodological approach to automatically generate the grammar based on semantico-syntactic valence patterns extracted from FrameNet-annotated corpora. Second, it provides a proof of concept for two use cases illustrating how the acquired multilingual grammar can be exploited in different CNL applications in the domains of arts and tourism.
Keywords:Controlled Natural Language, FrameNet, Natural Language Generation, Multilinguality, Grammatical Framework
Two years ago, at CNL 2012, a conception of a general-purpose semantic grammar based on FrameNet (FN) was proposed  to facilitate the development of multilingual controlled natural language (CNL) applications in Grammatical Framework (GF). GF , a type-theoretical grammar formalism and a toolkit, provides a wide-coverage resource grammar library (RGL) for nearly 30 languages that implement a shared syntactic API . The idea behind the FN-based grammar is to provide a frame semantic abstraction layer, a shared semantic API, over the syntactic RGL.
Following this proposal, a shared abstract syntax of wide-coverage English and Swedish semantic grammars has been recently extracted from FN-annotated corpora . In this work, we take this approach one step further, and the contribution of this paper is two-fold. First, we offer a methodological approach to automatically generate concrete syntaxes based on the extracted abstract syntax. Second, we provide a proof of concept for two use cases illustrating how the acquired multilingual grammar can be exploited in different CNL applications in the domains of arts and tourism. Although we focus on English and Swedish, the same approach is intended to be applicable to other languages as well.
The future potential of our work is to provide a means for multilingual verbalization of FN-annotated databases that have been populated in information extraction processes by FN-based semantic parsers and that potentially can be mapped with the FN-based API automatically .
2.1 FrameNet (FN)
FrameNet is a lexico-semantic resource based on the theory of frame semantics . According to this theory, a semantic frame representing a cognitive scenario is characterized in terms of frame elements (FE) and is evoked by target words called lexical units (LU). An LU entry carries semantic and syntactic valence information about the possible realizations of FEs. The syntactic and semantic valence patterns are derived from FN-annotated corpora. FEs are classified in core and non-core FEs. A set of core FEs uniquely characterize the frame and syntactically correspond to verb arguments, in contrast to non-core FEs (adjuncts) which can be instantiated in many other frames. In this paper, we consider only those frames for which there is at least one corpus example where the frame is evoked by a verb. The frame-based grammar currently covers only core FEs.
The FrameNet approach provides a benchmark for representing large amounts of word senses and word usage patterns through the linguistic annotation of corpus examples, therefore the exploitation of FN-like resources has been appealing for a range of advanced NLP applications such as semantic parsing , information extraction  and natural language generation . There are available computationally oriented FNs for German, Japanese, Spanish  and Swedish . More initiatives exist for other languages. In this paper, we consider two FNs: the original Berkeley FrameNet (BFN)  and the Swedish FrameNet (SweFN) .
BFN version 1.5 defines more than 1,000 frames,
SweFN mostly uses the BFN frame inventory, however, around 50 additional frames have been introduced in SweFN, and around 15 BFN frames have been modified (in terms of FEs). The SweFN development version contains more than 900 frames of which 638 are evoked by around 2,300 verb LUs in more than 3,700 annotated sentences .
2.2 Grammatical Framework (GF)
The presented grammar is implemented in GF, a categorial grammar formalism specialized for multilingual (parallel) grammars . One of the key features of GF grammars is the separation between an abstract syntax and concrete syntaxes. The abstract syntax defines the language-independent structure, the semantics of a domain-specific application grammar or a general-purpose grammar library, while the concrete syntaxes define the language-specific syntactic and lexical realization of the abstract syntax.
Remarkably, GF is not only a grammar formalism or programming language. It also provides a general-purpose resource grammar library (RGL) for nearly 30 languages that implement the same abstract syntax, a shared syntactic API . The use of the shared syntactic types and functions allows for rapid and rather flexible development of multilingual application grammars without the need of specifying low-level details like inflectional paradigms and syntactic agreement.
3 FrameNet-based Grammar
The language-independent conceptual layer of FrameNet, i.e. frames and FEs, is defined in the abstract syntax of the multilingual FN-based grammar, while the language-specific lexical layers, i.e. the surface realization of frames and LUs, are defined in concrete syntaxes.
3.1 Abstract Syntax
Following a recently proposed approach , we have extracted a set of shared semantico-syntactic frame valence patterns from the annotated sentences in BFN and SweFN. For instance, the shared valence patterns for the frame are:
which correspond, for instance, to these annotated examples in BFN:
[Dexter] [YEARNED] [for a cigarette]
[she] [WANTS] [a protector]
[I] would n’t [WANT] [to know]
In contrast to the previous experiment , where the focus was on the abstract grammar, here we generate the concrete syntaxes taking the syntactic roles for FEs of type into account: subject (), direct object () and indirect object (). Thus, we also consider the grammatical voice (/) in the pattern comparison, as well as the target verb type deduced from the syntactic types and roles of involved FEs. Additionally, we handle FEs of common types of subclauses (generalized to , embedded sentences), as well as finite and gerundive VPs, and PPs where the preposition governs a wh-clause or a gerundive VP, so that the fraction of skipped BFN examples is reduced form 14% to 4%, and no SweFN examples are skipped.
The extracted sets of valence patterns usually vary across languages depending on corpora. For multilingual applications we are primarily interested in valence patterns whose implementation can be generated for all considered languages. Thus, we focus on valence patterns that are shared between FNs. The multilingual criteria also help in reducing the number of incorrect patterns due to annotation errors introduced by the automatic POS tagging and syntactic parsing. However, patterns that are not verified across FNs could be separated into FN-specific extra modules of the grammar.
To find a representative yet condensed set of shared valence patterns, we compare the extracted patterns by subsumption instead of exact match . Pattern subsumes pattern if , , , and (taking into account the syntactic types and roles). If a pattern of is subsumed by a pattern of , it is added to the shared set (and vice versa). In the final set, patterns which are subsumed by other shared patterns are removed. To reduce the propagation of annotation errors even more, we filter out once used BFN valence patterns before performing the cross-FN pattern comparison.
In the result, from around 66,800 annotated sentences in BFN and around 4,100 annotated sentences in SweFN, we have extracted a set of 717 shared semantico-syntactic valence patterns covering 423 frames.
Frame valence patterns are declared in the grammar as functions (henceforth called frame functions) that take one or more core FEs and one verb as arguments. For each frame, the set of core FEs is often split into several alternative functions according to the corpus evidence.
In GF, constituents and features of phrases are stored in objects of record types, and functions are applied to such objects to construct phrase trees. In the abstract syntax, both argument types and the value type of a function are separated by right associative arrows, i.e. all functions are curried. Arguments of a frame function are combined into an object of type that differs form the RGL type . A whose linearization type is comprises two constituents of RGL types. It is a deconstructed where the subject NP is separated from the rest of the clause. The motivation for this is to allow for nested frames (see Section 4.1) and for adding non-core FEs before combining the NP and VP parts into a clause (see Section 4.2).
In the FN-based grammar, FEs are declared as semantic categories (types) that are subcategorized by RGL types, and these discriminators are also encoded by suffixes in FE names to keep the names unique, for instance:
Note that the FE is typically realized as a noun phrase (NP), but some intransitive verbs require it as a prepositional phrase (PP), hence this FE is subcategorized using the RGL types and (adverbial modifier). In GF, the type covers both adverbs and PPs, and there is no separate type for PPs. Also note that the word order is not specified in the abstract syntax (FEs in the function type signatures are given alphabetically), and all FE arguments are specified in concrete syntaxes as optional, i.e. any FE can be an empty phrase if it is not expressed in the sentence.
The frame-evoking target verb, either intransitive (), transitive () or ditransitive (), is always given as the last, mandatory argument. We additionally differentiate two special cases of transitive verbs: verb-phrase-complement verbs () and sentence-complement verbs (), as well as a special case for each of them allowing also for an indirect object ( and respectively).
LUs are represented as functions that take no arguments. To distinguish between different senses and types of LUs, the verb type and the frame name is added to lexical function names, for instance:
However, LUs between BFN and SweFN are not directly aligned, therefore an FN-specific lexicon is generated for each language containing more than 3,300 entries for English and more than 1,100 entries for Swedish. The domain-specific translation equivalents can be aligned in application grammars.
We assume that verbs of the same type evoking the same frame share a set of generalized syntactic valence patterns. Patterns requiring, for instance, a transitive verb cannot be evoked by an intransitive verb. Otherwise, the current approach does not limit the set of verbs that can evoke a frame, and the set of prepositions that can be used for an FE if it is realized as a PP. We expect that appropriate verbs and prepositions are specified by the application grammar that uses the FN-based grammar as an API. Hence, this approach allows to evoke a frame by a metaphor, i.e. an LU that normally evokes another frame.
3.2 Concrete Syntaxes
The exact behaviour of the types and functions declared in the abstract syntax is defined in the concrete syntax for each language.
The mapping from the semantic FN types to the syntactic RGL types is straightforward and is shared for all languages in a functor, for instance:
To allow for optional FEs (verb arguments that might not be expressed in the sentence), all linearization types are of type whose behaviour is similar to the analogous type in Haskell: a value of type either contains a value of type (represented as ), or it is empty (represented as ).
To implement the frame functions, particularly to fill the VP part of objects, RGL constructors are applied to the arguments depending on their RGL types and syntactic roles. The implementation of functions declared in the previous section is systematically generated for English and Swedish as follows:
Apart from RGL constructors (, , , , etc.
The RGL-based code templates used to implement the above functions can be reused for many other frame functions. Given the 717 extracted shared semantico-syntactic valence patterns, there are only 25 syntactic valence patterns that match all 717 patterns if we consider only the syntactic types and roles of FEs, and the grammatical voice the roles depend on. These patterns (except 5 once used) are listed in Table 1 that shows that the syntactic patterns underlying functions , , and already cover 55% of all shared patterns. For the same verb types, similar syntactic patterns (RGL-based code templates) cover another 39% of frame functions. The similar templates can be derived in several (incl. combined) ways:
more adverbial modifiers can be added by recursive calls of the respective constructor, or modifiers can be removed at all;
the NP part of the return values can be fixed to an empty NP if no FE is expected to fill the subject role (e.g. due to examples in the imperative mood; however, a missing subject FE could be often automatically added);
in the passive voice, the direct object can be possibly fixed to an empty NP.
|Verb||Voice||FE types and roles||Freq.||Verb||Voice||FE types and roles||Freq.|
|V||Act||Adv NPSubj||138||V2||Act||Adv NPDObj||8|
|V2||Pass||NPSubj||70||V2V||Act||NPIObj NPSubj VP||5|
|V2||Act||Adv NPDObj NPSubj||62||V||Act||Adv Adv Adv NPSubj||2|
|V2||Pass||Adv NPSubj||31||V2||Act||Adv Adv NPDObj NPSubj||2|
|VV||Act||NPSubj VP||18||V2||Pass||Adv Adv NPSubj||2|
|V||Act||Adv Adv NPSubj||14||V3||Act||NPIObj NPSubj||2|
|V2||Act||NPDObj||14||VS||Act||Adv NPSubj S||2|
The remaining 6% of the shared patterns represent the use of other verb types: , , and . Basic code templates that are reused to implement the corresponding frame functions (VP parts) are illustrated by these examples:
-- : [she] [handed] [him] [the ring]
-- : [we] [heard] [it was a good school]
-- : [UK] [urges] [Savimbi] [to keep the peace]
-- : [he] [persuaded] [himself] [that they helped]
Note that the RGL type , embedded declarative sentence, is used only if the subclause can be verbalized using the subjunction that; otherwise such FEs are subcategorized as , and the application grammar developer has to specify the subjunction by applying the RGL constructor . Also note that FEs of type or , or encapsulating an represent nested frames. We use the type instead of to allow for specifying sentence level parameters like tense, anteriority and polarity of the nested frames.
The implementation of frame functions, although currently kept separate for each language, mostly could be shared due to the syntactic abstraction provided by RGL. In general, however, the order of FEs can differ across languages.
4 Case Studies
We illustrate the use of the FrameNet-based API to GF RGL by re-engineering two existing multilingual GF application grammars: one for translating standard tourist phrases  and another for generating descriptions of paintings , both developed in the MOLTO project.
Although the Phrasebook grammar covers many idiomatic expressions that cannot be translated using the same frame or for which the FN-based approach would not be suitable at all, it includes around 20 complex clause-building functions that can be handled by the FN-based grammar. To illustrate the use of the semantic API, we re-implement the following Phrasebook functions:
ALive : Person -> Country -> Action -- e.g. `we live in Sweden' AWant : Person -> Object -> Action -- e.g. `I want a pizza' AWantGo : Person -> Place -> Action -- e.g. `I want to go to a museum'
by applying the frame functions and introduced in Section 3, and some additional functions:
Motion_V_2 : Goal_Adv -> Source_Adv -> Theme_NP -> Clause Possession_V2 : Owner_NP -> Possession_NP -> Clause Residence_V : Location_Adv -> Resident_NP -> Clause
By using RGL constructors, is implemented for English, Swedish and other languages in the same way, except that different verbs are used:
ALive p co = mkCl p.name (mkVP (mkVP (mkV "live")) (mkAdv in_Prep co)) ALive p co = mkCl p.name (mkVP (mkVP (mkV "bo")) (mkAdv in_Prep co))
First, the language-specific verbs can be factored out by introducing a shared abstract verb in the domain lexicon (e.g. that links and ). Second, the implementation of can be done in a shared functor by using the FN-based API:
ALive p co = let cl : Clause = Residence_V (Just Adv (mkAdv in_Prep co)) (Just NP p.name) live_V in mkCl cl.np cl.vp
For , neither the RGL-based nor the current FN-based implementation can be done in the functor because, in Swedish, the verb vilja (‘to want’) evoking requires the auxiliary verb ha (‘to have’). This can be seen as a nested auxiliary frame :
AWant p obj = mkCl p.name (mkV2 (mkV "want")) obj -- Eng Desiring_V2_Act (Just NP p.name) (Just NP obj) want_V2
AWant p obj = mkCl p.name want_VV (mkVP L.have_V2 obj) -- Swe Desiring_VV (Just VP (Possession_V2 (Nothing NP) (Just NP obj) have_V2).vp) (Just NP p.name) want_VV
Assuming that the auxiliary verb can be optionally used also with other Swedish verbs when applying this frame function, the nested frame could be hidden in the Swedish implementation of . This, however, is not the case with which in both languages requires a main nested frame and, thus, can be put in the functor:
AWantGo p place = mkCl p.name want_VV (mkVP (mkVP go_V) place.to)
Desiring_VV (Just VP (Motion_V_2 (Just Adv place.to) (Nothing Adv) (Nothing NP) go_V).vp) (Just NP p.name) want_VV
At first gleam, the new code might look more complex, but it does not specify how the VP is built, and the same uniform code template is used in all cases. The re-implemented version of Phrasebook accepts and generates the same set of sentences as before.
4.2 Painting Grammar
The Painting grammar is a part of a large scale Natural Language Generation (NLG) grammar developed for the cultural heritage (CH) domain in order to verbalize data about museum objects stored in an RDF-based ontology . A set of RDF triples (subject-predicate-object expressions) forms the input to the application. As an example, a simplified set of triples representing information about the artwork Le Général Bonaparte is:
<LeGeneralBonaparte> <createdBy> <JacquesLouisDavid> <LeGeneralBonaparte> <hasDimension> <LeGeneralBonaparteDimesion> <LeGeneralBonaparte> <hasCreationDate> <LeGeneralBonaparteCreationDate> <LeGeneralBonaparte> <hasCurrentLocation> <MuseeDuLouvre>
This information is combined by the grammar to generate a coherent text. The function in the abstract syntax that combines the triples is the following:
DPainting : Painting -> Painter -> Year -> Size -> Museum -> Description
Each argument of the function corresponds to a class in the ontology. Below we show how the arguments are linearized in the original concrete syntax for English and how this syntax has been adapted to generate from the FN-based grammar. To adapt the grammar, we first identified the frames that match the target verbs in the linearization rules. Then we matched the core FEs of the identified frames with the verb arguments.
The original grammar: Using the FrameNet-based API: -------------------------------- ------------------------------------- DPainting painting painter DPainting painting painter year size museum = year size museum = let let s1 : Text = mkText (mkS cl1 : Clause = pastTense (mkCl painting (mkVP Create_physical_artwork_V2_Pass (mkVP (passiveVP paint_V2) (Just NP painter.long) (mkAdv by8agent_Prep (Just NP painting) painter.long)) year.s))) ; paint_V2 ; s2 : Text = mkText cl2 : Clause = Dimension_V (mkCl it_NP (mkVP (mkVP (Just Adv size.s) (mkVPSlash measure_V2) (Just NP it_NP) (mkNP (mkN ""))) size.s) ; measure_V2 ; s3 : Text = mkText cl3 : Clause = Being_located_V (mkCl (mkNP this_Det painting) (Just Adv museum.s) (mkVP (passiveVP display_V2) (Just NP (mkNP this_Det painting)) museum.s)) display_V2 in mkText s1 (mkText s2 s3) ; in mkText (mkText (mkS pastTense (mkCl cl1.np (mkVP cl1.vp year.s))) (mkText (mkCl cl2.np cl2.vp) (mkText (mkCl cl1.np cl3.vp))) ;
The grammar exploits patterns of frames , and . Since the FN-based grammar currently does not cover non-core FEs, the adjunct Year is associated with no FE in . Instead, it is attached to the corresponding clause in the final linearization rule () illustrating how non-core FEs can be incorporated.
The Swedish syntax was adapted in a similar way. The only difference in comparison to English and to the original Swedish syntax is the choice of verbs and pronouns. The descriptions generated by the new version of are semantically equivalent to the descriptions produced by the original grammar:
Eng: Le Général Bonapart was painted by Jacques-Louis David in 1510. It measures 81 by 65 cm. This work is displayed at the Musée du Louvre.
Swe: Le Général Bonapart målades av Jacques-Louis David år 1510. Den mäter 81 gånger 65 cm. Det här verket hänger på Louvren.
We have conducted a simple intrinsic and extrinsic evaluation of the acquired FN-based grammar. For an initial intrinsic evaluation, we count the number of examples in the source corpora that belong to the set of shared frames and that are covered by the set of shared semantico-syntactic valence patterns. Corpus examples are represented by sentence patterns disregarding non-core FEs, word order and prepositions, but including syntactic roles and the grammatical voice. There are 55,837 examples in BFN that belong to the shared set of 423 frames, and 69.4% of them are covered by the shared valence patterns despite the modest size of SweFN. In SweFN, 2,434 examples belong to the shared set of frames, and 68.9% of them are covered by the shared patterns. Note that the original sentences are, in general, covered by paraphrasing.
For an initial extrinsic evaluation, we compare the original application grammars with their FN-based counterparts in terms of code complexity. Since we do not modify the abstract syntax of application grammars, the amount of linearization rules remains the same. Therefore we count the number of constructors used to linearize the functions. In the Painting grammar, the number of constructors is considerably reduced from 21 to 13. In the case of Phrasebook, the number is slightly reduced from 10 in English and 11 in Swedish to 8 in both languages.
6 Related Work
The main difference between this work and the previous approaches to CNL grammars is that we present an effort to exploit a robust and well established semantic model in the grammar development. Our approach can be compared with the work on multilingual verbalisation of modular ontologies using GF and lemon, the Lexicon Model for Ontologies . We use additional lexical information about syntactic arguments for building the concrete syntax.
The grounding of NLG using the frame semantics theory has been addressed in the work on text-to-scene generation  and in the work on text generation for navigational tasks . In that research, the content of frames is utilized through alignment between the frame-semantic structure and the domain-semantic representation. Discourse is supported by applying aggregation and pronominalization techniques. In the CH use case, we also show how an application which utilizes the FN-based grammar can become more discourse-oriented; something that is necessary in actual NLG applications and that has been demonstrated for the CH domain in GF before . In our current approach, the semantic representation of the domain and the linguistic structures of the grammar are based on FN-annotated data.
As suggested before , a FN-like approach can be used to deal with polysemy in CNL texts. Although we consider lexicalisation alternatives and restrictions for LUs and FEs, we do not address the problem of selectional restrictions and word sense disambiguation in general.
In this paper we demonstrated the advantages of utilizing a FrameNet-based grammar to facilitate the development of multilingual CNL applications. We presented an approach to generating semantic grammar library from two FN-annotated corpora. We tested the feasibility of this grammar as a semantic API for developing application grammars in GF. The major advantage is that language-dependent clause-level specifications to a large extent are hidden by the API, making the application grammars more robust and flexible.
This research has been supported by the Swedish Research Council under Grant No. 2012-5746 (Reliable Multilingual Digital Communication: Methods and Applications) and by the Centre for Language Technology in Gothenburg.
- email: firstname.lastname@example.org, email@example.com
- email: firstname.lastname@example.org, email@example.com
- http://spraakbanken.gu.se/swefn/ (a snapshot taken in February 2014)
- The actual BFN phrase types are generalized by RGL types.
- A similar pre-filtering is currently not reasonable for SweFN due to its small size.
- It is often unlikely that all core FEs can be used in the same sentence.
- Note that is not directly acquired from a shared pattern; missing passive voice patterns could be derived from the corresponding active voice patterns. Also note that the syntactic roles are not reflected in the abstract syntax; they are used to generate the implementation of frame functions in the concrete syntaxes.
- Gruzitis, N., Paikens, P., Barzdins, G.: FrameNet resource grammar library for GF. In: Proc. of the 3rd Workshop on CNL. Volume 7427 of LNCS. (2012) 121–137
- Ranta, A.: Grammatical Framework, a type-theoretical grammar formalism. Journal of Functional Programming 14(2) (2004) 145–189
- Ranta, A.: The GF resource grammar library. LILT 2(2) (2009)
- Dannélls, D., Gruzitis, N.: Extracting a bilingual semantic grammar from FrameNet-annotated corpora. In: Proceedings of the 9th International Language Resources and Evaluation Conference (LREC). (2014) 2466–2473
- Barzdins, G.: FrameNet CNL: A knowledge representation and information extraction language. In: Proc. of the 4th Workshop on CNL. (2014) (this volume)
- Fillmore, C.J., Johnson, C.R., Petruck, M.R.L.: Background to Framenet. International Journal of Lexicography 16(3) (2003) 235–250
- Das, D., Chen, D., Martins, A.F.T., Schneider, N., Smith, N.A.: Frame semantic parsing. Computational Linguistics 40(1) (2014) 9–56
- Moschitti, A., Morarescu, P., Harabagiu, S.M.: Open domain information extraction via automatic semantic labeling. In: Proc. of the 16th IFLAIRS. (2003)
- Roth, M., Frank, A.: A NLG-based application for walking directions. In: Proceedings of the 47th ACL and the 4th IJCNLP Conference. (2009) 37–40
- Boas, H.C., ed.: Multilingual FrameNets in Computational Lexicography. (2009)
- Borin, L., Dannélls, D., Forsberg, M., Toporowska Gronostaj, M., Kokkinakis, D.: The past meets the present in Swedish FrameNet++. In: Proceedings of the 14th EURALEX International Congress. (2010) 269–281
- Ranta, A., Enache, R., Détrez, G.: Controlled language for everyday use: The MOLTO Phrasebook. In: Proceedings of the 2nd Workshop on Controlled Natural Language. Volume 7175 of LNCS. (2010) 115–136
- Dannélls, D., Enache, R., Damova, M., Chechev, M.: Multilingual online generation from Semantic Web ontologies. In: Proceedings of the 21st International World Wide Web Conference, European Project Track. (2012) 239–242
- Davis, B., Enache, R., Grondelle, J.V., Pretorius, L.: Multilingual verbalisation of modular ontologies using GF and lemon. In: Controlled Natural Language. (2012)
- Coyne, B., Bauer, D., Rambow, O.: VigNet: Grounding Language in Graphics Using Frame Semantics. In: Proc. of RELMS, ACL (2011) 28–36
- Roth, M., Frank, A.: Computing EM-based Alignments of Routes and Route Directions as a Basis for Natural Language Generation. In Huang, C.R., Jurafsky, D., eds.: COLING, Tsinghua University Press (2010) 958–966
- Dannélls, D.: Discourse Generation from Formal Specifications Using the Grammatical Framework, GF. In: Special issue of the RCS, Springer (2010) 167–178
- Gruzitis, N., Barzdins, G.: Polysemy in controlled natural language texts. In: Revised papers of the Workshop on CNL. Volume 5972 of LNCS. (2010)