Creating Training Corpora for NLG Micro-Planning

Claire Gardent Anastasia Shimorina Shashi Narayan Laura Perez-Beltrachini CNRS, LORIA, UMR 7503 School of Informatics, University of Edinburgh Vandoeuvre-les-Nancy,` F-54500, France 10 Crichton Street, Edinburgh, EH8 9AB, UK claire.gardent,anastasia.shimorina @loria.fr shashi.narayan,lperez @ed.ac.uk { } { }

Abstract tion2, these corpora can be classified into three main types namely, (i) domain specific corpora, In this paper, we present a novel (ii) benchmarks constructed from “Expert” Lin- framework for semi-automatically cre- guistic Annotations and (iii) crowdsourced bench- ating linguistically challenging micro- marks.1 planning data-to-text corpora from ex- In this paper, we focus on how to create data- isting Knowledge Bases. Because our to-text corpora which can support the learning of method pairs data of varying size and micro-planners i.e., data-to-text generation sys- shape with texts ranging from simple tems that can handle the complex interactions clauses to short texts, a dataset created us- occurring between lexicalisation (mapping data ing this framework provides a challenging to words), aggregation (exploiting linguistic con- benchmark for microplanning. Another structs such as ellipsis and coordination to avoid feature of this framework is that it can be repetition), surface realisation (using the appropri- applied to any large scale knowledge base ate syntactic constructs to build sentences), sen- and can therefore be used to train and learn tence segmentation and referring expression gen- KB verbalisers. We apply our framework eration. to DBpedia data and compare the resulting We start by reviewing the main existing types of dataset with Wen et al.(2016)’s. We show NLG benchmarks and we argue for a crowdsourc- that while Wen et al.’s dataset is more than ing approach in which (i) data units are automati- twice larger than ours, it is less diverse cally built from an existing Knowledge Base (KB) both in terms of input and in terms of text. and (ii) text is crowdsourced from the data (Sec- We thus propose our corpus generation tion2). We then propose a generic framework for framework as a novel method for creat- semi-automatically creating training corpora for ing challenging data sets from which NLG NLG (Section3) from existing knowledge bases. models can be learned which are capable In Section4, we apply this framework to DBpedia of handling the complex interactions oc- data and we compare the resulting dataset with the curring during in micro-planning between dataset of Wen et al.(2016) using various metrics lexicalisation, aggregation, surface reali- to evaluate the linguistic and computational ade- sation, referring expression generation and quacy of both datasets. By applying these metrics, sentence segmentation. To encourage re- we show that while Wen et al.’s dataset is more searchers to take up this challenge, we re- than twice larger than ours, it is less diverse both in cently made available a dataset created us- terms of input and in terms of text. We also com- ing this framework in the context of the 1 WEBNLG shared task. We ignore here (Lebret et al., 2016)’s dataset which was created fully automatically from Wikipedia by associating infoboxes with text because this dataset fails to ensure an 1 Introduction adequate match between data and text. We manually ex- amined 50 input/output pairs randomly extracted from this To train Natural Language Generation (NLG) sys- dataset and did not find a single example where data and text tems, various input-text corpora have been devel- matched. As such, this dataset is ill-suited for training micro- planners. Moreover, since its texts contain both missing and oped which associate (numerical, formal, linguis- additional information, it cannot be used to train joint models tic) input with text. As discussed in detail in Sec- for content selection and micro-planning either.

179 Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics, pages 179–188 Vancouver, Canada, July 30 - August 4, 2017. c 2017 Association for Computational Linguistics

https://doi.org/10.18653/v1/P17-1017 pare the performance of a sequence-to-sequence are large enough for training systems that can gen- model (Vinyals et al., 2015) on both datasets to es- erate linguistically sophisticated text. timate the complexity of the learning task induced One main drawback of these benchmarks how- by each dataset. We show that the performance of ever is that their construction required massive this neural model is much lower on the new data manual annotation of text with complex linguis- set than on the existing ones. We thus propose our tic structures (parse trees for the SR task and Ab- corpus generation framework as a novel method stract Meaning Representation for the AMR cor- for creating challenging data sets from which NLG pus). Moreover because these structures are com- models can be learned which are capable of gen- plex, the annotation must be done by experts. It erating complex texts from KB data. cannot be delegated to the crowd. In short, the creation of such benchmark is costly both in terms 2 NLG Benchmarks of time and in terms of expertise. Another drawback is that, because the input rep- Domain specific benchmarks. Several domain resentation derived from a text is relatively close specific data-text corpora have been built by re- to its surface form2, the NLG task is mostly re- searchers to train and evaluate NLG systems. In stricted to surface realisation (mapping input to the sports domain, Chen and Mooney(2008) con- sentences). That is, these benchmarks give very structed a dataset mapping soccer games events to limited support for learning models that can han- text which consists of 1,539 data-text pairs and a dle the interactions between micro-planning sub- vocabulary of 214 words. For weather forecast tasks. generation, the dataset of Liang et al.(2009) in- cludes 29,528 data-text pairs with a vocabulary of Crowdsourced benchmarks. More recently, 345 words. For the air travel domain, Ratnaparkhi data-to-text benchmarks have also been created by (2000) created a dataset consisting of 5,426 data- associating data units with text using crowdsourc- text pairs with a richer vocabulary (927 words) ing. and in the biology domain, the KBGen shared task Wen et al.(2016) first created data by enumer- (Banik et al., 2013) made available 284 data-text ating all possible combinations of 14 dialog act pairs where the data was extracted from an exist- types (e.g., request, inform) and attribute-value ing knowledge base and the text was authored by pairs present in four small-size, hand-written on- biology experts. tologies about TVs, laptops, restaurants and ho- tels. They then use crowdsourcing to associate An important limitation of these datasets is that, each data unit with a text. The resulting dataset because they are domain specific, systems learned is both large and varied (4 domains) and was from them are restricted to generating domain spe- successfully exploited to train neural and imita- cific, often strongly stereotyped text (e.g., weather tion learning data-to-text generator (Wen et al., forecast or soccer game commentator reports). Ar- 2016; Lampouras and Vlachos, 2016). Similarly, guably, training corpora for NLG should support Novikova and Rieser(2016) described a frame- the learning of more generic systems capable of work for collecting data-text pairs using automatic handling a much wider range of linguistic interac- quality control measures and evaluating how the tions than is present in stereotyped texts. By na- type of the input representations (text vs pictures) ture however, domain specific corpora restrict the impacts the quality of crowdsourced text. lexical and often the syntactic coverage of the texts The crowdsourcing approach to creating input- to be produced and thereby indirectly limit the ex- text corpora has several advantages. pressivity of the generators trained on them. First, it is low cost in that the data is produced Benchmarks constructed from “expert” lin- automatically and the text is authored by a crowd- guistic annotations. NLG benchmarks have worker. This is in stark contrast with the previ- also been proposed where the input data is either ous approach where expert linguists are required derived from dependency parse trees (SR’11 task, to align text with data. Belz et al. 2011) or constructed through manual 2For instance, the input structures made available by the annotation (AMR Corpus, Banarescu et al. 2012). shallow track of the SR task contain all the lemmas present in the corresponding text. In this case, the generation task is Contrary to the domain-specific data sets just men- limited to determining (i) the linear ordering and (ii) the full tioned, these corpora have a wider coverage and form of the word in the input.

180 A mission B operator C Second, because the text is crowd-sourced from T1 the data (rather than the other way round), there is S1.1 A participated in mission B operated by C. S1.2 A participated in mission B which was an adequate match between text and data both se- operated by C. mantically (the text expresses the information con- tained in the data) and computationally (the data D is sufficiently different from the text to require the occupation A learning of complex generation operations such as birthPlace sentence segmentation, aggregation and referring E T2 expression generation). S2.1 A was born in E. She worked as an engineer. Third, by exploiting small hand-written ontolo- S2.2 A was born in E and worked as an engineer. gies to quickly construct meaningful artificial data, Figure 1: Input shape and linguistic structures (A the crowdsourcing approach allows for the easy = Susan Helms, B = STS 78, C = NASA, D = en- creation of a large dataset with data units of var- gineer, E = Charlotte, North Carolina). ious size and bearing on different domains. This, in turn, allows for better linguistic coverage and for NLG tasks of various complexity since typi- method combines (i) a content selection module cally, inputs of larger size increases the need for designed to extract varied, relevant and coherent complex microplanning operations. data units from DBPedia with (ii) a crowdsourc- ing process for associating data units with human 3 The WebNLG Framework for authored texts that correctly capture their mean- Creating Data-to-Text, Micro-Planning ing. Example1 shows a data/text unit created by Benchmarks our method using DBPedia as input KB.

While as just noted, the crowdsourcing approach (1) a. (John E Blaha birthDate 1942 08 26) presented by Wen et al.(2016) has several advan- (John E Blaha birthPlace San Antonio) (John E Blaha occupation Fighter pilot) tages, it also has a number of shortcomings. One important drawback is that it builds on arti- b. John E Blaha, born in San Antonio on 1942-08-26, ficial rather than “real” data i.e., data that would be worked as a fighter pilot extracted from an existing knowledge base. As a result, the training corpora built using this method Our method has the following features. cannot be used to train KB verbalisers i.e., gener- First, it can be used to create a data-to-text cor- ation systems that can verbalise KB fragments. pus from any knowledge base where entities are Another limitation concerns the shape of the in- categorised and there is a large number of entities put data. Wen et al.’s data can be viewed as trees of belonging to the same category. As noted above, depth one (a set of attributes-value pairs describing this means that the resulting corpus can be used to a single entity e.g., a restaurant or a laptop). As train KB verbalisers i.e., generators that are able to illustrated in Figure1 however, there is a strong verbalise fragments of existing knowledge bases. correlation between the shape of the input and the It could be used for instance, to verbalise frag- 3 4 syntactic structure of the corresponding sentence. ments of e.g., MusicBrainz , FOAF or Linked- GeoData.5 The path structure T1 where B is shared by two predicates (mission and operator) will favour the Second, as crowdworkers are required to enter use of a participial or a passive subject relative text that matches the data and a majority vote val- clause. In contrast, the branching structure T2 will idation process is used to eliminate mis-matched favour the use of a new clause with a pronomi- pairs, there is a direct match between text and nal subject or a coordinated VP. More generally, data. This allows for a clear focus on the non con- allowing for trees of deeper depth is necessary to tent selection part of generation known as micro- indirectly promote the introduction in the bench- planning. mark of a more varied set of syntactic constructs Third, because data of increasing size is to be learned by generators. matched with texts ranging from simple clauses to

To address these issues, we introduce a novel 3https://musicbrainz.org/ method for creating data-to-text corpora from 4http://www.foaf-project.org/ large knowledge bases such as DBPedia. Our 5http://linkedgeodata.org/

181 Figure 2: Extracting data units from DBPedia. short texts consisting of several sentences, the re- with typed literal values.6 sulting benchmark is appropriate for exercising the main subtasks of microplanning. For instance, in 3.2 Selecting Content Example (1) above, given the input shown in (1a), To create data units, we adapted the procedure generating (1b) involves lexicalising the occupa- outlined by Perez-Beltrachini et al.(2016) and tion property as the phrase worked as (lexicalisa- sketched in Figure2. This method can be sum- tion); using PP coordination (born in San Antonio marised as follows. on 1942-08-26) to avoid repeating the word born First, DBPedia category graphs are extracted (aggregation); and verbalising the three triples us- from DBPedia by retrieving up to 500 entity ing a single complex sentence including an appo- graphs for entities of the same category.7 For ex- sition, a PP coordination and a transitive verb con- ample, we build a category graph for the struction (sentence segmentation and surface real- category by collecting, graphs of depth five for 500 isation). entities of types astronaut. Next, category graphs are used to learn bi-gram 3.1 DBPedia models of DBPedia properties which specify the probability of two properties co-occuring together. To illustrate the functioning of our benchmark cre- Three types of bi-gram models are extracted from ation framework, we apply it to DBPedia. DBPe- category graphs using the SRILM toolkit (Stolcke, dia is a multilingual knowledge base that was built 2002): one model (S-Model) for bigrams occur- from various kinds of structured information con- ring in sibling triples (triples with a shared sub- tained in Wikipedia (Mendes et al., 2012). This ject); one model (C-Model) for bigrams occurring data is stored as RDF (Resource Description For- in chained triples (the object of one triple is the mat) triples of the form (subject, property, object) subject of the other); and one model (M-Model) where the subject is a URI (Uniform Resource which is a linear interpolation of the sibling and Identifier), the property is a binary relation and the chain model. The intuition is that these sib- the object is either a URI or a literal value such as a string, a date or a number. We use an English 6http://wiki.dbpedia.org/ version of the DBPedia knowledge base which en- dbpedia-dataset-version-2015-10 7An entity graph for some entity e is a graph obtained by compasses 6.2M entities, 739 classes, 1,099 prop- traversing the DBPedia graph starting in e and stopping at erties with reference values and 1,596 properties depth five.

182 ling and chain models capture different types of for each category being worked on, those prop- coherence, namely, topic-based coherence for the erties which have no obvious lexicalisations (e.g., S-Model and discourse-based coherence for the C- crew1up was replaced by commander). Model. Finally, the content selection task is formulated 2. Getting verbalisations for single triples. Next, we collected three verbalisations for data as an Integer Linear Programming (ILP) problem units of size one, i.e. single triples consisting to select, for a given entity of category C and its of a subject, a property and an object. For each entity graph Ge, subtrees of Ge with maximal bi- such input, crowdworkers were asked to produce gram probability and varying size (between 1 and a sentence verbalising its content. We used both 7 RDF triples). a priori automatic checks to prevent spamming Category A B M U S W and a posteriori manual checks to remove incor- #Inputs 663 1220 333 508 1137 1207 rect verbalisations. We also monitored crowd- #I. Patterns 546 369 300 432 184 277 #Properties 38 46 30 41 32 50 workers as they entered their input and banned #Entities 74 278 47 75 264 224 those who tried to circumvent our instructions and validators. The automatic checks comprise 12 Table 1: Data statistics from content selec- custom javascript validators implemented in the tion (A:Astronaut, B:Building, M:Monument, CrowdFlower platform to block contributor an- U:University, W:Written work, S:Sports team). swers which fail to meet requirements such as the minimal time a contributor should stay on page, We applied this content selection procedure to the minimal length of the text produced, the min- the DBPedia categories Astronaut (A), Building imal match of tokens between a triple and its ver- (B), Monument (M), University (U), Sports team balisation and various format restrictions used to (S) and Written work (W), using the three bi-gram detect invalid input. The exact match between a models (S-Model, C-Model, M-Model) and mak- triple and its verbalisation was also prohibited. In ing the number of triples required by the ILP con- addition, after data collection was completed, we straint to occur in the output solutions vary be- manually checked each data-text pair and elimi- tween 1 and 7. The results are shown in Table1. nated from the data set any pair where the text ei- An input is a set of triples produced by the content ther did not match the information conveyed by the selection module. The number of input (#Inputs) triple or was not a well-formed English sentence. is thus the number of distinct sets of triples pro- duced by this module. In contrast, input patterns 3. Getting verbalisations for input containing are inputs where subject and object have been ab- more than one triple. The verbalisations col- stracted over. That is, the number of input patterns lected for single triples were used to construct in- (#I. Patterns) is the number of distinct sets of prop- put with bigger size. Thus, for input with a number erties present in the set of inputs. The number of of triples more than one, the crowd was asked to properties (#Properties) is the number of distinct merge the sentences corresponding to each triple RDF properties occurring in the dataset. Similarly, (obtained in step 2) into a natural sounding text. the number of entities (#Entities) is the number In such a way, we diminish the risk of having of distinct RDF subjects and objects occurring in misinterpretations of the original semantics of a each given dataset. data unit. Contributors were also encouraged to change the order, and the wording of sentences, 3.3 Associating Content with Text while writing their texts. For each data unit, we We associate data with text using the Crowdflower collected three verbalisations. platform.8 We do this in four main steps as fol- 4. Verifying the quality of the collected texts. lows. The verbalisations obtained in Step 3 were veri- fied through crowdsourcing. Each verbalisation 1. Clarifying properties. One difficulty when collecting texts verbalising sets of DBPedia triples collected in Step 3 was displayed to CrowdFlower is that the meaning of DBPedia properties may contributors together with the corresponding set be unclear. We therefore first manually clarified of triples. Then the crowd was asked to assess its fluency, semantic adequacy, and grammaticality. 8http://www.crowdflower.com Those criteria were checked by asking the follow-

183 # Triples 1 2 3 4 5 6 7 # Tokens 4/30/10.48 11/45/22.97 7/37/16.96 17/60/36.38 14/53/29.61 29/80/49.14 24/73/42.95 # Sentences 1/2/1.00 1/4/1.23 1/3/1.02 1/5/2.05 1/4/1.64 1/6/2.85 1/5/2.42

Table 2: Text statistics from crowdsourcing for triple sets of varying sizes (min/max/avg). ing three questions: units that are relevant for a given ontological cat- egory and that are varied in terms of size, shape Does the text sound fluent and natural? and content. We now investigate the impact of Does the text contain all and only the information this difference on the two datasets (WEBNLG and from the data? RNNLG). To assess the degree to which both Is the text good English (no spelling or grammati- datasets support the generation of linguistically cal mistakes)? varied text requiring complex micro-planning op- erations, we examine a number of data and text We collected five answers per verbalisation. A related metrics. We also compare the results of verbalisation was considered bad, if it received an out-of-the-box sequence-to-sequence model as three negative answers in at least one criterion. Af- a way to estimate the complexity of the learning ter the verification step, the total corpus loss was task induced by each dataset. of 8.7%. An example of rejected verbalisation can be found in Example (2). The verbalisation was WEBNLGRNNLG Nb. Input 5068 22225 dropped due to the lack of fluency (awkward lexi- Nb. Data-Text Pairs 13339 30842 calisation of the property club). Nb. Domains 6 4 Nb. Attributes 172 108 (2) (AEK Athens F.C. manager Gus Poyet) Nb. Input Patterns 2108 2155 (Gus Poyet club Chelsea F.C.) Nb. Input / Nb Input Pattern 2.40 10.31 AEK Athens F.C. are managed by Gus Poyet, who is in Nb. Input Shapes 58 6 Chelsea F.C. Table2 shows some statistics about the texts Table 3: Comparing WEBNLG and RNNLG obtained using our crowdsourcing procedure for datasets. Attributes are properties in RDF triples triple sets of size one to seven. or slots in dialog acts.

4 Comparing Benchmarks 4.1 Data Comparison We now compare a dataset created using Terminology. The attributes in the RNNLG our dataset creation framework (henceforth dataset can be viewed as binary relations between WEBNLG) with the dataset of Wen et al.(2016) 9 the object talked about (a restaurant, a laptop, a (henceforth, RNNLG). Example3 shows a TV or a hotel) and a value. Similarly, in the sample data-text pair taken from the RNNLG WEBNLGdataset, DBpedia RDF properties relate dataset. a subject entity to an object which can be either (3) Dialog Moves recommend(name=caerus 33;type=television; an entity or a datatype value. In what follows, we screensizerange=medium;family=t5;hasusbport=true) refer to both as attributes. The caerus 33 is a medium television in the T5 family Table3 shows several statistics which indicate that’s USB-enabled. that, while the RNNLG dataset is larger than As should be clear from the discussion in Sec- WEBNLG,WEBNLG is much more diverse in tion2 and3, both datasets are similar in that, in terms of attributes, input patterns and input shapes. both cases, data is built from ontological infor- mation and text is crowdsourced from the data. Number of attributes. As illustrated in Exam- An important difference between the two datasets ple (4) below, different attributes can be lexi- is that, while the RNNLG data was constructed calised using different parts of speech. A dataset by enumerating possible combinations of dialog with a larger number of attributes is therefore more act types and attribute-value pairs, the WEBNLG likely to induce texts with greater syntactic variety. data is created using a sophisticated content se- (4) Verb: X title Y / X served as Y lection procedure geared at producing sets of data Relational noun: X nationality Y / X’s nationality is Y Preposition: X country Y / X is in Y 9https://github.com/shawnwun/RNNLG Adjective: X nationality USA / X is American

184 As shown in Table3,W EBNLG has a more facilitates learning, this also reduces linguistic diverse attribute set than RNNLG both in abso- coverage (less combinations of structures can be lute (172 attributes in WEBNLG against 108 in learned) and may induce over-fitting. Note that RNNLG) and in relative terms (RNNLG is a lit- because datasets are typically delexicalised when tle more than twice as large as WEBNLG). training NLG models (cf. e.g., Wen et al. 2015 and Lampouras and Vlachos 2016), at training time, Number of input patterns. Since attributes different instantiations of the same input pattern may give rise to lexicalisation with different parts reduce to identical input. of speech, the sets of attributes present in an input The two datasets markedly differ on this ratio (input pattern)10 indirectly determine the syntac- which is five times lower in WEBNLG. While tic realisation of the corresponding text. Hence in WEBNLG, the same pattern is instantiated in a higher number of input patterns will favour a average 2.40 times, it is instantiated 10.31 times higher number of syntactic realisations. This is ex- in average in RNNLG. From a learning perspec- emplified in Example (5) where two inputs with tive, this means that the RNNLG dataset facili- the same number of attributes give rise to texts tates learning but also makes it harder to assess with different syntactic forms. While in Exam- how well systems trained on it can generalise to ple (5a), the attribute set country, location, start- { handle unseen input. Date is realised by a passive (is located), an ap- } position (Australia) and a deverbal nominal (its Input shape. As mentioned in Section3, in the construction), in Example (5b), the attribute set RNNLG dataset, all inputs can be viewed as trees almaMater, birthPlace, selection induced a pas- { } of depth one while in the WEBNLG dataset, input sive (was born) and two VP coordinations (gradu- may have various shapes. As a result, RNNLG ated and joined). texts will be restricted to syntactic forms which (5) a. (‘108 St Georges Terrace location Perth’, ‘Perth permit expressing such multiple predications of country Australia’, ‘108 St Georges Terrace start- the same entity e.g., subject relative clause, VP Date 1981’) and sentence coordination etc. In contrast, the country, location, startDate 108 St. Georges Terrace is located in Perth, Aus- trees extracted by the WEBNLG content selection tralia. Its construction began in 1981. procedure may be of depth five and therefore allow passive, apposition, deverbal nominal for further syntactic constructs such as object rel- b. (‘ selection 1963’, ative clause and passive participles (cf. Figure1). ‘William Anders birthPlace British Hong Kong’, We can show this empirically as well that ‘William Anders almaMater ”AFIT, M.S. 1962”’) almaMater, birthPlace, selection WEBNLG is far more diverse than RNNLG in William Anders was born in British Hong Kong, terms of input shapes. The RNNLG dataset has graduated from AFIT in 1962, and joined NASA in 1963. only 6 distinct shapes and all of them are of depth passive, VP coordination, VP coordination 1, i.e., all (attribute, value) pairs in an input are siblings to each other. In contrast, the WEBNLG Again, despite the much larger size of the dataset has 58 distinct shapes, out of which only RNNLG dataset, the number of input patterns 7 shapes are with depth 1, all others have depth in both datasets is almost the same. That is, more than 1 and they cover 49.6% of all inputs. the relative variety in input patterns is higher in WEBNLG. 4.2 Text Comparison Number of input / Number of input patterns. Table4 gives some statistics about the texts con- The ratio between number of inputs and the num- tained in each dataset. ber of input patterns has an important impact both (6) ( birthDate “1932-03-15”) in terms of linguistic diversity and in terms of Alan Bean was born on March 15, 1932. learning complexity. A large ratio indicates a (7) (‘Alan Bean nationality United States’, ‘Alan Bean “repetitive dataset” where the same pattern is in- birthDate “1932-03-15”’, ‘Alan Bean almaMater stantiated a high number of times. While this “UT Austin, B.S. 1955”’, ‘Alan Bean birthPlace Wheeler, Texas’, ‘Alan Bean selection 1963’) 10Recall from section3 that input patterns are inputs where Alan Bean was an American astronaut, born on March subjects and objects have been remove thus, in essence, an 15, 1932 in Wheeler, Texas. He received a Bachelor of input pattern is the set of all the attributes occurring in a given Science degree at the University of Texas at Austin in input. 1955 and was chosen by NASA in 1963.

185 As illustrated by the contrast between Exam- sophisticated (higher proportion of unfrequent ples (6) and (7) above, text length (number of to- words) than RNNLG’s. They also show a propor- kens per text) and the number of sentences per text tionately larger vocabulary for WEBNLG (2,992 are strong indicators of the complexity of the gen- types for 290,479 tokens in WEBNLG against eration task. We use the Stanford Part-Of-Speech 3,524 types for 531,871 tokens in RNNLG). Tagger and Parser version 3.5.2 (dated 2015-04- 20, Manning et al. 2014) to tokenize and to per- 4.3 Neural Generation form sentence segmentation on text. As shown in Richer and more varied datasets are harder to learn Table4,W EBNLG’s texts are longer both in terms from. As a proof-of-concept study of the compar- of tokens and in terms of number of sentences per ative difficulty of the two datasets with respect to text. Another difference between the two datasets machine learning, we compare the performance of is that WEBNLG contains a higher number of text a sequence-to-sequence model for generation on per input thereby providing a better basis for learn- both datasets. ing paraphrases. We use the multi-layered sequence-to-sequence

WEBNLGRNNLG model with attention mechanism described in Nb. Text / Input 2.63 1.38 (Vinyals et al., 2015).12 The model was trained Text Length 24.36/23/4/80 18.37/19/1/76 with 3-layer LSTMs with 512 units each with a (avg/median/min/max) Nb. Sentence / Text 1.45/1/1/6 1.25/1/1/6 batch size of 64 and a learning rate of 0.5. (avg/median/min/max) To allow for a fair comparison, we use a simi- Nb. Tokens 290479 531871 Nb. Types 2992 3524 lar amount of data (13K data-text pairs) for both Lexical Sophistication 0.69 0.54 datasets. As RNNLG is bigger in size than CTTR 3.93 3.42 WEBNLG, we constructed a balanced sample of RNNLG which included equal number of in- Table 4: Text statistics from WEBNLG and RNNLG. stances per category (tv, laptop, etc). We use a 3:1:1 ratio for training, developement and test- The size and the content of the vocabulary is an- ing. The training was done in two delexicalisa- other important factor in ensuring the learning of tion modes: fully and name only. In case of fully wide coverage generators. While a large vocab- delexicalisation, all entities were replaced by their ulary makes the learning problem harder, it also generic terms, whereas in name only mode only allows for larger coverage. WEBNLG exhibits a subjects were modified in that way. For instance, higher corrected type-token ratio (CTTR), which the triple (FC Koln¨ manager Peter Stoger¨ ) was indicates greater lexical variety, and higher lexical delexicalised as (SportsTeam manager Manager) sophistication (LS). Lexical sophistication mea- in the first mode, and as (SportsTeam manager Pe- sures the proportion of relatively unusual or ad- ter Stoger¨ ) in the second mode. The delexicalisa- vanced word types in the text. In practice, LS tion in sentences was done using the exact match is the proportion of lexical word types (lemma) between entities and tokens. For training, we use which are not in the list of 2,000 most frequent all the available vocabulary. Input and output vo- words generated from the British National Cor- cabulary sizes are reported in Table5. pus11. Type-token ratio (TTR) is a measure of di- Table5 shows the perplexity results. In versity defined as the ratio of the number of word both modes, RNNLG yielded lower scores than types to the number of words in a text. To address WEBNLG. This is inline with the observations the fact that this ratio tends to decrease with the made above concerning the higher data diver- size of the corpus, corrected TTR can be used to sity, larger vocabulary and more complex texts of control for corpus size. It is defined as T/√2N, 12 T N We used the TensorFlow code available at where is the number of types and the number https://github.com/tensorflow/models/ of tokens. tree/master/tutorials/rnn/translate. Alter- Overall, the results shown in Table4 indicate natively, we could have used the implementation of Wen et al.(2016) which is optimised for generation. However that WEBNLG texts are both lexically more di- the code is geared toward dialog acts and modifying it to verse (higher corrected type/token ratio) and more handle RDF triples is non trivial. Since the comparison aims at examining the relative performance of the same 11We compute LS and CTTR using the Lexical Complexity neural network on the two datasets, we used the tensor flow Analyzer developed by Lu(2012). implementation instead.

186 WEBNLG. Similary, the BLEU score of the gen- We have recently released a first version of erated sentences (Papineni et al., 2002) is lower for the WebNLG dataset in the context of a shared WEBNLG suggesting again a dataset that is more task on micro-planning14. This new dataset complex and therefore more difficult to learn from. consists of 21,855 data/text pairs with a to- tal of 8,372 distinct data input. The input Delexicalisation WEBNLGRNNLG Mode describes entities belonging to 9 distinct DB- Fully 520, 2430 140, 1530 pedia categories namely, Astronaut, University, Vocab size Name only 1130, 2940 570, 1680 Monument, Building, ComicsCharacter, Food, Fully 27.41 17.42 Perplexity Name only 25.39 23.93 Airport, SportsTeam and WrittenWork. The Fully 0.19 0.26 WebNLG data is licensed under the follow- BLEU Name only 0.10 0.27 ing license: CC Attribution-Noncommercial- Share Alike 4.0 International and can be Table 5: Vocabulary sizes of input, output (number downloaded at http://talc1.loria.fr/ of tokens). Perplexity and BLEU scores. webnlg/stories/challenge.html. Recently, several sequence-to-sequence models 5 Conclusion have been proposed for generation. Our exper- iments suggest that these are not optimal when We presented a framework for building NLG data- it comes to generate linguistically complex texts to-text training corpora from existing knowledge from rich data. More generally, they indicate that bases. the data-to-text corpora built by our framework are One feature of our framework is that datasets challenging for such models. We hope that the created using this framework can be used for train- WEBNLG dataset which we have made available ing and testing KB verbalisers an in particular, for the WEBNLG shared task will drive the deep verbalisers for RDF knowledge bases. Following learning community to take up this new challenge the development of the semantic web, many large and work on the development of neural generators scale datasets are encoded in the RDF language that can handle the generation of KB verbalisers (e.g., MusicBrainz, FOAF, LinkedGeoData) and and of linguistically rich texts. official institutions13 increasingly publish their data in this format. In this context, our frame- Acknowledgments work is useful both for creating training data from RDF KB verbalisers and to increase the number of The research presented in this paper was par- datasets available for training and testing NLG. tially supported by the French National Research Another important feature of our framework is Agency within the framework of the WebNLG that it permits creating semantically and linguis- Project (ANR-14-CE24-0033). The third author is tically diverse datasets which should support the supported by the H2020 project SUMMA (under learning of lexically and syntactically, wide cov- grant agreement 688139). erage micro-planners. We applied our framework to DBpedia data and showed that although twice References smaller than the largest corpora currently available for training data-to-text microplanners, the result- Laura Banarescu, Claire Bonial, Shu Cai, Madalina ing dataset is more semantically and linguistically Georgescu, Kira Griffitt, Ulf Hermjakob, Kevin Knight, Philipp Koehn, Martha Palmer, and Nathan diverse. Despite the disparity in size, the num- Schneider. 2012. Abstract meaning representa- ber of attributes is comparable in the two datasets. tion (AMR) 1.0 specification. In Proceedings of The ratio between input and input patterns is five EMNLP. times lower in our dataset thereby making learning Eva Banik, Claire Gardent, and Eric Kow. 2013. The harder but also diminishing the risk of overfitting KBGen challenge. In Proceedings of ENLG. and providing for wider linguistic coverage. Con- versely, the ratio of text per input is twice higher Anja Belz, Michael White, Dominic Espinosa, Eric Kow, Deirdre Hogan, and Amanda Stent. 2011. The thereby providing better support for learning para- phrases. 14The test data for the WEBNLG challenge will be re- leased on August 18th, 2017 and preliminary results will 13See http://museum-api.pbworks.com for ex- be presented and discussed at INLG 2017, https:// amples. eventos.citius.usc.es/inlg2017/index.

187 first surface realisation shared task: Overview and Tsung-Hsien Wen, Milica Gasiˇ c,´ Nikola Mrksiˇ c,´ Pei- evaluation results. In Proceedings of ENLG. Hao Su, David Vandyke, and Steve Young. 2015. Semantically conditioned LSTM-based natural lan- David L Chen and Raymond J Mooney. 2008. Learn- guage generation for spoken dialogue systems. In ing to sportscast: A test of grounded language ac- Proceedings of EMNLP. quisition. In Proceedings of ICML.

Gerasimos Lampouras and Andreas Vlachos. 2016. Imitation learning for language generation from un- aligned data. In Proceedings of COLING.

Remi´ Lebret, David Grangier, and Michael Auli. 2016. Neural Text Generation from Structured Data with Application to the Biography Domain. In Proceed- ings of EMNLP.

Percy Liang, Michael I Jordan, and Dan Klein. 2009. Learning Semantic Correspondences with Less Su- pervision. In Proceedings of ACL-IJCNLP.

Xiaofei Lu. 2012. The relationship of lexical richness to the quality of ESL learners’ oral narratives. The Modern Language Journal 96(2):190–208.

Christopher D. Manning, Mihai Surdeanu, John Bauer, Jenny Finkel, Steven J. Bethard, and David Mc- Closky. 2014. The Stanford CoreNLP natural language processing toolkit. In Proceedings of ACL:System Demonstrations.

Pablo N Mendes, Max Jakob, and Christian Bizer. 2012. DBpedia: A Multilingual Cross-domain Knowledge Base. In Proceedings of LREC.

Jekaterina Novikova and Verena Rieser. 2016. The aNALoGuE challenge: Non aligned language gen- eration. In Proceedings of INLG.

Kishore Papineni, Salim Roukos, Todd Ward, and Wei jing Zhu. 2002. Bleu: A method for automatic eval- uation of machine translation. In Proceedings of ACL.

Laura Perez-Beltrachini, Rania Mohamed Sayed, and Claire Gardent. 2016. Building RDF content for Data-to-Text generation. In Proceedings of COL- ING.

Adwait Ratnaparkhi. 2000. Trainable methods for sur- face natural language generation. In Proceedings of NAACL.

Andreas Stolcke. 2002. SRILM – An extensible lan- guage modeling toolkit. In Proceedings of ICSLP.

Oriol Vinyals, Łukasz Kaiser, Terry Koo, Slav Petrov, Ilya Sutskever, and Geoffrey Hinton. 2015. Gram- mar as a foreign language. In Proceedings of NIPS.

Tsung-Hsien Wen, Milica Gasiˇ c,´ Nikola Mrksiˇ c,´ Lina M. Rojas-Barahona, Pei-Hao Su, David Vandyke, and Steve Young. 2016. Multi-domain neural network language generation for spoken di- alogue systems. In Proceedings of NAACL-HLT.

188